:has in display:none doesn't behave as expected
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: coals-worker0q, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15
Steps to reproduce:
Using :has
in combination with other selectors seems to have no effect, unless some action is taken to cause the browser to 'redraw'.
I made 3 reproduced examples for the Mozilla team here: https://2a476f4e.spence.pages.dev/debug/
Actual results:
The conditions that should trigger the has selector don't initially take any effect. After, however, if anything is done to cause the page to be "redrawn", such as resizing the window, changing the zoom amount, or opening the dev console, then the CSS rules related to the has selector will be triggered.
Expected results:
The has selector should update the applicable CSS properties when conditions call for it do so.
Comment 1•8 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•8 months ago
|
Assignee | ||
Comment 2•8 months ago
|
||
Invalidation issue if the relevant element is display: none (if you remove display: none from the div container it works).
I'm going to bet this. David, do you have cycles to look?
Assignee | ||
Comment 4•8 months ago
|
||
Actually just confirmed that's the issue.
Assignee | ||
Updated•8 months ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/68ff26df3346 Don't ignore state changes in display: none subtrees if needed for :has(). r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44070 for changes under testing/web-platform/tests
Updated•8 months ago
|
Comment 8•8 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•