Skip to content

devtools: Rework debugger value structure - #43587

Merged
eerii merged 3 commits into
servo:mainfrom
eerii:webidl-rework
Mar 26, 2026
Merged

eerii merged 3 commits into
servo:mainfrom
eerii:webidl-rework

Conversation

@eerii

@eerii eerii commented Mar 23, 2026

Copy link
Copy Markdown
Member

The WebIDLs for values were duplicated in PropertyDescriptor and EvalResultValue, with duplicated handlers across the code.

General cleanup of how debugger values are passed from debugger.js and how the conversion from JS and to JSON happens.

There shouldn't be a behaviour change.

Testing: Existing devtools tests and manual testing
Part of: #36027

The WebIDLs for values were duplicated in PropertyDescriptor and
EvalResultValue, with duplicated handlers across the code.

General cleanup of how debugger values are passed from debugger.js and
how the conversion from JS and to JSON happens.

There shouldn't be a behaviour change.

Co-authored-by: atbrakhi <[email protected]>
Signed-off-by: eri <[email protected]>
@eerii
eerii requested a review from gterzian as a code owner March 23, 2026 23:35
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 23, 2026
@eerii

eerii commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

Apologies for the long diff. There are quite a few connected things that needed to change together.

@atbrakhi and I spent some time brainstorming different ways of handling the values. Improving how this is handled is quite important, since the entire inspecting objects / properties is already getting too complex, and this was blocking new patches for more advanced features.

The main issue is ownProperties, since it contains a list of property descriptors. Our WebIDL implementation doesn't allow dictionaries with sequences of said dictionary. Even though in theory it shouldn't be an infinite recursion, our codegen.py is not prepared for that, so it doesn't build. As an alternative we split the preview outside of the property descriptor. That way there is no self reference and no recursion.

As a bonus, we got rid of one of the two very similar functions in debugger.js, and now object.rs deals directly with processed DebuggerValues, no need to parse the type again.

It's a bit late now, but I may come back tomorrow to do a general style review pass, since I don't like how nested some things ended up.

@atbrakhi
atbrakhi requested a review from jdm March 24, 2026 11:47
Comment thread components/devtools/actors/console.rs Resolved
Comment thread resources/debugger.js Resolved
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 26, 2026
Co-authored-by: atbrakhi <[email protected]>
Signed-off-by: eri <[email protected]>
@eerii

eerii commented Mar 26, 2026

Copy link
Copy Markdown
Member Author

Thanks for reviewing! :)

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice cleanup!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 26, 2026
@atbrakhi
atbrakhi added this pull request to the merge queue Mar 26, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 26, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Mar 26, 2026
@eerii
eerii added this pull request to the merge queue Mar 26, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Mar 26, 2026
Merged via the queue into servo:main with commit 2ee93de Mar 26, 2026
36 checks passed
@eerii
eerii deleted the webidl-rework branch March 26, 2026 21:40
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 26, 2026
@eerii eerii mentioned this pull request Apr 16, 2026
24 of 37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants