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

NEW
Unassigned

Status

DevTools
Inspector
P2
normal
a year ago
11 days ago

People

(Reporter: 684sigma, Unassigned)

Tracking

({regression})

53 Branch
regression

Firefox Tracking Flags

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

Details

(Reporter)

Description

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 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
(Reporter)

Updated

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

Comment 1

a year ago
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=1a3194836cb4c3da6ba3a9742a2d25cf26669b55&tochange=90b691bf09f5cc4fe7d0c6445fcf5afa2c34eeee
Blocks: 1154645
Status: UNCONFIRMED → NEW
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:
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).
status-firefox55: affected → wontfix
status-firefox56: --- → wontfix
status-firefox57: --- → fix-optional

Updated

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