Open Bug 1350185 Opened 9 years ago Updated 3 years ago

Inspector doesn't select the node when opened from context menu (sometimes)

Categories

(DevTools :: Inspector, defect, P2)

53 Branch
defect

Tracking

(firefox52 unaffected, firefox-esr52 unaffected, firefox53 wontfix, firefox54 fix-optional, firefox56 wontfix, firefox57 fix-optional)

Tracking Status
firefox52 --- unaffected
firefox-esr52 --- unaffected
firefox53 --- wontfix
firefox54 --- fix-optional
firefox56 --- wontfix
firefox57 --- fix-optional

People

(Reporter: 684sigma, Unassigned)

References

Details

(Keywords: regression)

I have a problem with Firefox Beta 53. It also happens in Nightly 55. Doesn't happen in Beta 52. Sometimes when I inspect elements using context menu, inspector doesn't select the node. It happens unpredictably, however, I noticed one specific scenario when it happens 1. Open https://codemirror.net/demo/folding.html 2. Right-click on word "Demonstration", click "Inspect element" Result: Inspector opens, but no node selected Expected: The node should be selected
Has STR: --- → yes
Keywords: regression
Too late for a fix for 53, as we are heading into the last week of the beta 53 cycle and no one is assigned.
Interesting, definitely seem related to bug 1154645. When right-clicking, we get the following message in the browser console: unsafe/forbidden CPOW usage css-logic.js:395:34 Alex: mind taking a look at what could cause this?
Flags: needinfo?(poirot.alex)
Priority: -- → P2
That's related to page CSS behavior and this code: http://searchfox.org/mozilla-central/source/toolkit/modules/css-selector.js#79-103 When right clicking on codemirror element, .CodeMirror-focused class is set on the editor <div>, then we craft a selector based on that: .CodeMirror-focused > div:nth-child(6) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(5) > div:nth-child(2) > pre:nth-child(2) It then fails as the inspector takes the focus and codemirror <div> losses its .CodeMirror-focused class. I'm wondering if we should remove this code: http://searchfox.org/mozilla-central/source/toolkit/modules/css-selector.js#79-103 And ignore class name completely, or only use tag-name:nth-child(x) selectors which sounds like the most stateless ones.
Flags: needinfo?(poirot.alex)
(In reply to Alexandre Poirot [:ochameau] from comment #4) > I'm wondering if we should remove this code: > http://searchfox.org/mozilla-central/source/toolkit/modules/css-selector. > js#79-103 > And ignore class name completely, or only use tag-name:nth-child(x) > selectors which sounds like the most stateless ones. For the purpose of selecting an element with the context-menu, yes, I think that would be fine. But we should keep this code around for other use cases (for instance, you can right-click on nodes in the inspector and copy their CSS selectors from there. For this use case, we do want to keep classes).
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.