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



a year ago
11 days ago


(Reporter: 684sigma, Unassigned)



53 Branch

Firefox Tracking Flags

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




a year ago
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
2. Right-click on word "Demonstration", click "Inspect element"

Result: Inspector opens, but no node selected
Expected: The node should be selected


a year ago
Has STR: --- → yes
Keywords: regression

Comment 1

a year ago
Regression window:
Blocks: 1154645
Has Regression Range: --- → yes
status-firefox52: --- → unaffected
status-firefox53: --- → affected
status-firefox54: --- → affected
status-firefox55: --- → affected
status-firefox-esr52: --- → unaffected
Ever confirmed: true
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.
status-firefox53: affected → wontfix
status-firefox54: affected → fix-optional
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:

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:
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:
> 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).
status-firefox55: affected → wontfix
status-firefox56: --- → wontfix
status-firefox57: --- → fix-optional


11 days ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.