Pseudo-element properties are not marked as overwritten in the rules inspector
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox-esr60 wontfix, firefox66 wontfix, firefox67 wontfix, firefox68 wontfix, firefox69 verified)
People
(Reporter: cfogel, Assigned: rcaliman)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [dt-q])
Attachments
(3 files)
Affected versions
- 67.0b13, 68.0a1 (2019-04-23), 66.0.3, 57.0b9, 52.9.esr
Affected platforms
- Windows10, Ubuntu 18.04
Steps to reproduce
- Launch Firefox, DevTools inspector;
- Access https://www.w3schools.com/css/tryit.asp?filename=trycss_firstline
- Right Click and inspect on the Red text row from the example;
- In the rules tab add multiple color properties
Expected result
- the previous color(s) become dashed and are no longer marked as active
Actual result
- no disable indicator for overwritten properties
Regression range
- will provide one asap;
- 31.0.a1 is not affected by this issue;
Additional notes
- attached screenshot with the issue;
- not limited to the color property, any other from the tested ones have the same behavior for;
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Additional context:
The issue manifests when the pseudo-element is not selected. ::first-line
doesn't have a correspondent node in the markup view to be selected, but ::before
and ::after
do. If selecting the pseudo-element directly, not its parent element, the overwritten properties show as expected.
To test, run this in the address bar of a new tab:
data:text/html,<style>div::before { color:red; color:black; content: "TEST" }</style><div>
Open DevTools and inspect the <div>
, then Inspect the ::before
pseudo-element for the <div>
. Notice the different styling on the pseudo-element's declarations in the Rules view.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
•
|
||
The issue manifests when the pseudo-element itself is not selected.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3435dd7ad71fe9003bdeee18fd38d815e033beef&tochange=dc4d7f68030e9edd22ad0bb0bd2244d047dd767d
Suspect: 7275ea886739 Nicolas Chevobbe — Bug 1253869 - Don't assume that rule in the Rules view match the selected node when checking for overidden properties. r=gl
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Sorry, Nicolas, could you look at this one?
Comment 6•5 years ago
|
||
That's quite an old patch regression :D I may have a look but can't promise anything.
Since it's a P1, feel free to have a look Inspector people :)
Assignee | ||
Comment 7•5 years ago
|
||
I'll take a look at it. I have a bit more exposure to this part of the code.
The P1 priority signifies the intent that we should fix this during this cycle, not that an urgent fix is required. It's on my radar now.
Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
We're very close to 68 going to beta, and this is an old regression, let's mark it as fix-optional for 68 then. It would be very nice to fix it sooner rather than later as this is a case where the rule-view is showing incorrect information, so fails at doing its job.
Assignee | ||
Comment 9•5 years ago
|
||
This patch adjust the method which marks CSS declaration as overridden to also consider pseudo-elements when they're not directly selected (i.e. their host element is selected).
For style rules on regular elements, there's a condition to only consider rules that match the selected element. This is done so that unmatched rules (you may get one after renaming a selector in the Rules view) don't influence the remaining matching rules. For pseudo-elements, this strict check caused pseudo-element rules to not show overridden declarations if they weren't directly selected in the markup view. For some types of pseudo-elements, it is impossible to ever select their nodes in the markup view because they don't exist, for example ::first-line, ::selection, ::first-letter, etc.
Also introduced an optimization to not call the logic to mark declarations as overridden for non-existent pseudo-elements. The previous code ran a minimum of 17 times, once for every entry in cssProperties.pseudoElements
array which includes the full dictionary of pseudo-elements supported by Firefox.
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Pushed by rcaliman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2901438abf7c Ensure pseudo-element declarations are marked as overridden when host element is selected. r=pbro
Comment 13•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Is this something we should consider for Beta uplift or can this ride the trains?
Assignee | ||
Comment 15•5 years ago
|
||
I believe this can safely ride the trains. It touches some sensitive code and it would be beneficial to let it go in slowly and notice any potential new bugs.
Updated•5 years ago
|
Reporter | ||
Comment 16•5 years ago
|
||
Fix confirmed with 69.0a1 (2019-07-01) on Windows 10, macOS 10.11, Ubuntu 16.04.
Updated•2 years ago
|
Description
•