Open Bug 1699811 Opened 4 years ago Updated 1 years ago

Wrong CSS warnings for pseudo elements viewed in RuleView's "pseudo-elements" panel

Categories

(DevTools :: Inspector: Rules, defect, P3)

Firefox 87
defect

Tracking

(Not tracked)

People

(Reporter: antonfedonyuk, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached image scr.png

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"

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.

Component: Untriaged → Inspector
Product: Firefox → DevTools

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.

Flags: needinfo?(antonfedonyuk)

(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 the display: 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

Flags: needinfo?(antonfedonyuk)
Attached image additional screen

display that's problem in Bootstrap5

it's happened when I'm enable option "enable debug tools browser chrome ..." (addition parameters - penultimate option)

And in adaptive mode too

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!

Status: UNCONFIRMED → NEW
Ever confirmed: true

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.

Summary: Dev tools, inspector: vertical-align allow for inline-block too → Wrong CSS warnings for pseudo elements viewed in RuleView's "pseudo-elements" panel
Component: Inspector → Inspector: Rules

(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

(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.

never mind, my mistake - now i'm understand you

Severity: -- → S3
Priority: -- → P3

I just ran into this as well, with the grid-column property. Here's a testcase to demonstrate.

STR with this testcase:

  1. In DevTools inspector, select the first grid (<div class="grid parent-of-pseudo"></div>), and look at the rules view.

  2. 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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: