Wrong CSS warnings for pseudo elements viewed in RuleView's "pseudo-elements" panel
Categories
(DevTools :: Inspector: Rules, defect, P3)
Tracking
(Not tracked)
People
(Reporter: antonfedonyuk, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Steps to reproduce:
explore styles in inspector, see attached screenshot
Actual results:
property "vertical-align" mark as "unusable" for tags with "display: inline-block;", but it's not true - if you change "vertical-align" in inspector, then it's change in browser too.
Expected results:
vertical-align allow to "inline", "table-cell" and "inline-block"
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Inspector' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
Thanks for the report!
Can you share a test page to reproduce the problem?
Despite the suggestion in the tooltip, this warning is not supposed to show up for inline-block
elements. This was fixed in Bug 1554723.
For instance on data:text/html,<style>.one {display:inline-flex} .two {display:inline-block;vertical-align:sub;}</style><div class="one">one</div><div class="two">two</div>
I don't get the warning for the display: inline-block
element.
(In reply to Julian Descottes [:jdescottes] from comment #2)
Thanks for the report!
Can you share a test page to reproduce the problem?
Despite the suggestion in the tooltip, this warning is not supposed to show up for
inline-block
elements. This was fixed in Bug 1554723.For instance on
data:text/html,<style>.one {display:inline-flex} .two {display:inline-block;vertical-align:sub;}</style><div class="one">one</div><div class="two">two</div>
I don't get the warning for thedisplay: inline-block
element.
I use Firefox developer version 87.0b9 with enabled option "Enable source map" (dev tools)
You can check it in Bootstrap 5 dropdown carret(.nav-link.dropdown-toggle::after) https://getbootstrap.com/docs/5.0/components/navbar/#scrolling
it's happened when I'm enable option "enable debug tools browser chrome ..." (addition parameters - penultimate option)
Comment 7•4 years ago
|
||
Oh I see, it's when you select the parent element, but look at the rules of its pseudo element. I think it's because we always consider the style of the selected element to decide to show this warning.
If you select the ::after
pseudo element in the markup view, the Rule view will not show the warning.
Thanks for the added information!
Comment 8•4 years ago
|
||
STRs:
- open this page
- select the div
- check the "pseudo elements" section in the rule view
ER: No warning should be displayed for using vertical align on the pseudo element.
AR: A warning is displayed.
Updated•4 years ago
|
Updated•4 years ago
|
(In reply to Julian Descottes [:jdescottes] from comment #7)
If you select the
::after
pseudo element in the markup view, the Rule view will not show the warning.
check additional screen, I'm explore .dropdown-toggle::after
Comment 10•4 years ago
|
||
(In reply to Anton from comment #9)
(In reply to Julian Descottes [:jdescottes] from comment #7)
If you select the
::after
pseudo element in the markup view, the Rule view will not show the warning.check additional screen, I'm explore
.dropdown-toggle::after
Not exactly, in this screenshot the "selected element" is the <a> tag (notice the blue background). If you really click on ::after
in the tree (so that the blue background is really on the ::after
element), you will not see the warning.
Reporter | ||
Comment 11•4 years ago
|
||
never mind, my mistake - now i'm understand you
Updated•4 years ago
|
Comment 12•3 years ago
•
|
||
I just ran into this as well, with the grid-column
property. Here's a testcase to demonstrate.
STR with this testcase:
-
In DevTools inspector, select the first grid (
<div class="grid parent-of-pseudo"></div>
), and look at the rules view. -
Now expand the second grid and select its child
<div class="parent-of-pseudo">
and look at the rules view.
ACTUAL RESULTS:
In step 1, the Rules View shows a warning for the grid-column
declaration.
In step 2, the Rules View shows no warning for the grid-column
declaration.
This is the opposite of what should happen.
EXPECTED RESULTS:
In step 1, the Rules View should not show a warning for the grid-column
declaration.
In step 2, the Rules View should show a warning for the grid-column
declaration.
In both cases, if you use the inspector to focus the (innermost) ::before
pseudo-element itself, then we do provide the correct result (we correctly show or don't-show a warning in the rules panel). There is only an issue when you're focusing the parent (the element that matches the ::before
CSS selector); we warn depending on whether the declaration is applicable to the parent, which doesn't make sense in this case.
Updated•1 years ago
|
Description
•