[webkit-reviews] review granted: [Bug 238226] Web Inspector: Elements tab: selection variable not displayed after losing focus : [Attachment 455442] Patch v1.2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 22 15:58:35 PDT 2022


Devin Rousso <drousso at apple.com> has granted Patrick Angle <pangle at apple.com>'s
request for review:
Bug 238226: Web Inspector: Elements tab: selection variable not displayed after
losing focus
https://bugs.webkit.org/show_bug.cgi?id=238226

Attachment 455442: Patch v1.2

https://bugs.webkit.org/attachment.cgi?id=455442&action=review




--- Comment #8 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 455442
  --> https://bugs.webkit.org/attachment.cgi?id=455442
Patch v1.2

View in context: https://bugs.webkit.org/attachment.cgi?id=455442&action=review

r=me, nice!

... but I did get a bit curious ��

I think the backtrace for this bug is when `WI.DOMTreeOutline.prototype.update`
is called by `WI.DOMTreeOutline.prototype.setVisible`.

Looking at `WI.DOMTreeOutline.prototype.setVisible`, I think there may be some
other (possibly previously undiscovered) bugs in that we call `this.update()`
_last_, which seems to completely wipe out the entire tree, meaning that
- `this._updateModifiedNodes()` is kinda pointless since we recreate all the
`WI.DOMTreeElement`
- `this._revealAndSelectNode(this._selectedDOMNode, omitFocus)` might not end
up doing anything since the `WI.DOMTreeElement` that we might reveal and select
(assuming `this._selectedDOMNode` is set) is then immediately removed by
`this.update()`
We might need to move the `this.update()` down below (and maybe get rid of
`this._updateModifiedNodes()`), or do some other restructuring of things.  Not
really sure.

Either way, I think what you've done here is probably fine :)

> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:195
> +		   inspectedNodeTreeElement.reveal();

NIT: I wonder if we should also do this inside
`WI.DOMTreeOutline.prototype._handleInspectedNodeChanged` ��


More information about the webkit-reviews mailing list