Closed
Bug 2013327
Opened 4 months ago
Closed 4 months ago
[computed panel] wrong matched selector order when rule applying on parent element is important
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(firefox149 fixed)
RESOLVED
FIXED
149 Branch
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
Details
Attachments
(3 files)
Steps to reproduce
- Open attached test case
- Open the inspector
- Select the
<h1>::afternode in the markup view - Select the computed panel
- Expand the
colorproperty to see matched selectors
Expected results
I'm seeing 2 matched selectors in this order:
h1::after > redh1 > blue
Actual results
The selectors are not in the right order:
h1> blue`h1::after > red
| Assignee | ||
Comment 1•4 months ago
|
||
| Assignee | ||
Comment 2•4 months ago
|
||
Note that this is not restricted to pseudo element, we have the same issue if an inherited rule has an important priority while the rule applying on the element does not (but it should still win)
Summary: [computed panel] wrong matched selector order when pseudo element is selected and binding element rule declaration is important → [computed panel] wrong matched selector order when rule applying on parent element is important
| Assignee | ||
Comment 3•4 months ago
|
||
The distance property indicates if the selector applies to the element or to an ancestor (in such case, it is
negative and reflect how many level there is between the ancestor and the viewed element).
We need to use this when comparing those selectors, as an inherited declaration, even if important, can't
override a direct declaration.
A test case is added in browser_computed_matched-selectors-order.
Updated•4 months ago
|
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/66677c72a60d
https://hg.mozilla.org/integration/autoland/rev/00b1fc551b60
[devtools] Consider selector distance in CssSelectorInfo#compareTo. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
status-firefox149:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
Updated•3 months ago
|
QA Whiteboard: [qa-triage-done-c150/b149]
You need to log in
before you can comment on or make changes to this bug.
Description
•