Closed Bug 688558 Opened 8 years ago Closed 8 years ago

Context Menu for Inspect Element can Create 2 Highlighters

Categories

(DevTools :: General, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 9

People

(Reporter: rcampbell, Assigned: rcampbell)

References

Details

(Whiteboard: [minotaur][has-patch])

Attachments

(1 file)

During some integration testing, I found that one of my patches made it possible to create two Highlighter instances using the new Context Menu's Inspect Element item landed in bug 587134.

I wrote a test and some simple guard code in openInspectorUI() that my patch from bug 650794 breaks.
Attachment #561816 - Flags: review?(mihai.sucan)
Whiteboard: [minotaur][has-patch][needs-review]
Comment on attachment 561816 [details] [diff] [review]
[in-fx-team] re-entrant context menu test

We seem to inconsistently use isTreePanelOpen, or null checks of treeLoaded or highlighter for "is the inspector open". It would be nice to have a canonical way to check that and use it consistently.
Gavin, I think checking for the existence of InspectorUI.highlighter is going to be pretty reliable. It gets initialized at the end of everything else and should only be present when the Inspector/Highlighter is actually up and running. That's what I'm looking for in my updated patch for bug 650794.

I could create a getter in InspectorUI that verifies the existence of the highlighter and that it's inited properly. Prior to bug 650794, we also rely on the tree panel being properly initialized and that starts to get a little confusing.
I could morph this bug into "create a canonical getter in InspectorUI to determine if the Inspector is Up and Running". Want?
Comment on attachment 561816 [details] [diff] [review]
[in-fx-team] re-entrant context menu test

Review of attachment 561816 [details] [diff] [review]:
-----------------------------------------------------------------

Patch looks fine, but I agree with Gavin about isTreePanelOpen.

In our megapatch we do have isPanelOpen (IIRC), which is the canonical way to check if the Inspector is open or not. So we can use that. It would be nice if this fix would be on top of the megapatch?
Attachment #561816 - Flags: review?(mihai.sucan) → review+
no, isPanelOpen or isTreePanelOpen are only useful for checking states of... panels! We want to know if the InspectorUI itself is up. I can create a method to do that.
Comment on attachment 561816 [details] [diff] [review]
[in-fx-team] re-entrant context menu test

https://hg.mozilla.org/integration/fx-team/rev/7e53a3cf73b5
Attachment #561816 - Attachment description: re-entrant context menu test → [in-fx-team] re-entrant context menu test
Whiteboard: [minotaur][has-patch][needs-review] → [minotaur][has-patch][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/7e53a3cf73b5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 9
Backed out because of various new mochitest-browser-chrome leaks. Unfortunately, this landed with a bunch of other interweaved patches. I only felt comfortable ruling out f297a626dd13 and 7d5311c92e04.
Assignee: nobody → rcampbell
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
relanded:

https://hg.mozilla.org/integration/fx-team/rev/4afe9d03a4d4
Status: REOPENED → NEW
Target Milestone: Firefox 9 → ---
https://hg.mozilla.org/mozilla-central/rev/4afe9d03a4d4
Status: NEW → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Whiteboard: [minotaur][has-patch][fixed-in-fx-team] → [minotaur][has-patch]
Target Milestone: --- → Firefox 9
Verified Fixed using Build identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0a1) Gecko/20111020 Firefox/10.0a1.
Status: RESOLVED → VERIFIED
Duplicate of this bug: 682297
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.