RESOLVED FIXED 203159
Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203159
Summary Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
Devin Rousso
Reported 2019-10-18 10:43:01 PDT
This includes: - double-clicking on tags/attributes/text - context menu actions - Log Element - $0
Attachments
Patch (23.30 KB, patch)
2019-10-18 11:54 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2019-10-18 11:54:00 PDT
EWS Watchlist
Comment 2 2019-10-18 11:54:53 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Blaze Burg
Comment 3 2019-10-18 13:34:16 PDT
Comment on attachment 381320 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381320&action=review r=me with a question > Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js:94 > + this.dispatchEventToListeners(WI.StyleDetailsPanel.Event.NodeChanged); I don't understand why this change is in the patch. Is it related?
Devin Rousso
Comment 4 2019-10-18 14:11:36 PDT
Comment on attachment 381320 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381320&action=review >> Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js:94 >> + this.dispatchEventToListeners(WI.StyleDetailsPanel.Event.NodeChanged); > > I don't understand why this change is in the patch. Is it related? Previously, we would show the add button even if the selected node was inside a UserAgent shadow root. This isn't a good idea because a lot of times the `WI.DOMNode.prototype.appropriateSelectorFor` is just `.div`, and the newly added rule wouldn't even apply to the UserAgent shadow tree anyways, so we'd basically be creating a rule that doesn't do anything. This part of the patch is to make it so that the add button isn't even shown when the selected node is inside a UserAgent shadow tree. This particular line of code was moved because the old position (in `WI.StyleDetailsPanel.prototype.refresh`) wouldn't fire "quick" enough. It would fire _after_ the `WI.DOMNodeStyles` have refreshed, which involves three "concurrent" protocol commands (which are pretty hefty in size), which meant that the add button would sometimes be briefly visible and flash away. By this point we already know the `WI.DOMNode`, so we can determine whether the selected node is inside a UserAgent shadow tree and can act on that. Also, nobody was actually listening for `WI.StyleDetailsPanel.Event.Refreshed`, so it was fine to "replace".
WebKit Commit Bot
Comment 5 2019-10-18 15:54:16 PDT
Comment on attachment 381320 [details] Patch Clearing flags on attachment: 381320 Committed r251306: <https://trac.webkit.org/changeset/251306>
WebKit Commit Bot
Comment 6 2019-10-18 15:54:18 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2019-10-18 15:55:16 PDT
Joseph Pecoraro
Comment 8 2019-10-18 15:59:14 PDT
Comment on attachment 381320 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381320&action=review > Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:102 > + Nit: Bad newline.
Note You need to log in before you can comment on or make changes to this bug.