[InactiveCSS] hints on pseudo-element rules displayed in their binding elements' rules are incorrect
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(Not tracked)
People
(Reporter: untainsyd, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
I have been doing web-page and i have tried to align custom <li> dots/bullets for my unordered list and i used "display: inline-block;" and "vertical-align: middle;" for mine task.
Actual results:
Firefox Dev. Tools CSS-hints noticed for me that:
"vertical-align has no effect on this element since it’s not an inline or table-cell element.
Try adding display:inline or display:table-cell. Learn more"
Expected results:
This hints wouldn't have appeared because "vertical-align: middle" works in this case.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 4•4 years ago
|
||
Changing the description to reflect what the problem here actually is.
Some STRs:
- Open the test case: attachment 9100855 [details]
- Open the inspector
- Select the
<div>
- In the Rules panel, expand the "pseudo elements" section to reveal the
div::before
rule
==> Notice that thevertical-align
property is marked as inactive, this is WRONG - Now open the
div
and select the::before
pseudo-element in the DOM tree
==> Notice that the same rule in the Rules panel has thevertical-align
property marked as active. This is CORRECT.
The problem is the following:
- When we explicitely select pseudo-element in the DOM tree, everything goes well, because the DOM node and computed style information we pass to the InactiveCSS helper are the right ones.
- When we only select the parent
div
element in the DOM tree, but still show the corresponding pseudo-elements rules in the Rules panel, we pass thediv
and its computed style to the InactiveCSS helper. So we evaluate the inactivity state of the pseudo-element by looking at the div's styles, which is wrong.
Comment 5•4 years ago
|
||
The inactive-property-helper can sometimes be called for properties inside rules
that match pseudo-elements, even though the node being passed is not the pseudo-
element itself.
This happens because the Rules view has a feature whereby selecting, say, a <div>
will show its rules, but also any pseudo-element rules that may be applied that
result in the creation of a pseudo-element inside of it.
So if you have div::before { content: "" } in CSS, then selecting that div will
also show this rule in the Rules view.
This patch adds a check for this case, and when it happens, walks the DOM to
find the right pseudo-element, and then gets its style.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Description
•