[webkit-reviews] review granted: [Bug 135995] Web Inspector: Inspect Element doesn't always highlight the correct element when inspector is closed before inspecting : [Attachment 236682] [PATCH] Attempted fix.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 15 17:07:43 PDT 2014


Joseph Pecoraro <joepeck at webkit.org> has granted Jono Wells
<jonowells at apple.com>'s request for review:
Bug 135995: Web Inspector: Inspect Element doesn't always highlight the correct
element when inspector is closed before inspecting
https://bugs.webkit.org/show_bug.cgi?id=135995

Attachment 236682: [PATCH] Attempted fix.
https://bugs.webkit.org/attachment.cgi?id=236682&action=review

------- Additional Comments from Joseph Pecoraro <joepeck at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=236682&action=review


> Source/WebInspectorUI/ChangeLog:11
> +	   Change so if an element is inspected, restoreSelectedNodeIsAllowed
is set to false
> +	   and kept in that state until the main resource changes or is
refreshed. This way an
> +	   attempt by a frame on a page to restore a node will not change the
highlighted
> +	   element unexpectedly.

There is a lot of ambiguity in this ChangeLog comment!

How about something like: (emphasis mine and can be removed)

    Change so if an element is inspected *via the Inspect Element context
menu*, selected node restoration is disallowed
    until the main resource *in the main frame* changes. This way an attempt by
a *sub-frame* will not change the
    highlighted element in the Main Frame's DOM tree unexpectedly.

> Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js:272
> +    _mainResourceDidChange: function(event) {
> +	   if (event.target.isMainFrame())
> +	       this._restoreSelectedNodeIsAllowed = true;
> +    },

Style: Opening brace should be on its own line
Style: This function should be down at the bottom of this file in the Private
section.


More information about the webkit-reviews mailing list