Skip to content

DevTools: Allow modification of attributes - #32888

Merged
mrobinson merged 4 commits into
servo:mainfrom
eerii:devtools-attributes
Aug 5, 2024
Merged

mrobinson merged 4 commits into
servo:mainfrom
eerii:devtools-attributes

Conversation

@eerii

@eerii eerii commented Jul 30, 2024

Copy link
Copy Markdown
Member

This PR fixes the handling of attributes in the inspector. Now it is possible to add, remove and modify attributes of HTML nodes. There were two issues with it:

  • Servo crashed when updating the values (Crash when queuing a mutation record #32885). This was because it was not properly entering a realm before making DOM modifications.
  • The messages have changed. Now after receiving a modifyAttributes message, the node has to inform the walker that there have been mutations on the DOM. The walker then sends newMutations (which is part of the event messages that are not directly responding to another message, see browsing_context for more examples), which then triggers the DevTools client to ask for getMutations. Here we send a list of all of the changes to the attributes that we made.

@eerii
eerii requested a review from gterzian as a code owner July 30, 2024 11:26

@mrobinson mrobinson 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.

Looks good to me, just a small nit:

Comment thread components/devtools/actors/inspector.rs Resolved
@eerii
eerii force-pushed the devtools-attributes branch 2 times, most recently from 4a717b0 to cfb0dec Compare July 31, 2024 15:51
eerii and others added 3 commits July 31, 2024 18:05
@eerii
eerii force-pushed the devtools-attributes branch from cfb0dec to d122574 Compare July 31, 2024 16:05
@eerii

eerii commented Jul 31, 2024

Copy link
Copy Markdown
Member Author

Sorry about that, for some reason that error wasn't showing in my local build until now.

@eerii eerii mentioned this pull request Jul 31, 2024
22 of 26 tasks
@mrobinson
mrobinson added this pull request to the merge queue Aug 5, 2024
Merged via the queue into servo:main with commit babc844 Aug 5, 2024
@eerii
eerii deleted the devtools-attributes branch August 5, 2024 11:55
Gae24 pushed a commit to Gae24/servo that referenced this pull request Aug 7, 2024
* feat: allow modification of attributes

Signed-off-by: eri <[email protected]>

* fix: tidiness

Signed-off-by: eri <[email protected]>

* feat: clean walker name generation

Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: eri <[email protected]>

* fix: missed out parameter

Signed-off-by: eri <[email protected]>

---------

Signed-off-by: eri <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
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.

Crash when queuing a mutation record

2 participants