:is(:host) doesn't work, but it probably should.
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox121 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio, Mentored)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Blink (at least, haven't checked WebKit) also has this bug, fwiw. See attached test-case.
This prevents nesting from working with :host
rules, because the &
is expanded to :is(<parent-selector>)
.
To fix this, we should probably change this code to not look at whether we're a featureless host selector, but at whether :host
might match at all, and insert those into host_rules
too, alongside with putting it in the normal rules.
It's a bit tricky, and then we somehow need to prevent stuff like :is(#foo, :host(#bar))
from matching a host with id foo
...
Assignee | ||
Comment 1•10 months ago
|
||
WebKit also fails this test-case.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 2•8 months ago
|
||
Tests needed, but this should work per spec, see
https://github.com/w3c/csswg-drafts/issues/9509.
Tweak a bit the selector flags set up so that checking for :host
selectors during CascadeData rebuilds is cheap.
Tests needed for:
- Basic cases.
- Nesting.
- Ancestor selector.
- Ancestor selector with nesting.
So WIP for now.
Updated•8 months ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3b13b5585380 Make :is(:host) work. r=zrhoffman
Comment 4•8 months ago
|
||
Backed out for causing multiple failures e.g. parser crashes
- backout: https://hg.mozilla.org/integration/autoland/rev/f08bd867bf21d333c48d2a66c4e5c27021508277
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&revision=3b13b5585380e95b76444f10d65a42d3543bbd1a
- failure log:
*gmake[4]: *** [/builds/worker/checkouts/gecko/config/makefiles/rust.mk:527: force-cargo-test-run] Error 101
*PROCESS-CRASH | is_part() lied somehow? [@ selectors::parser::Selector<Impl>::parts] | /css/css-nesting/pseudo-part-crash.html
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42822 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Updated•8 months ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b16994e8df5 Make :is(:host) work. r=zrhoffman
Assignee | ||
Updated•8 months ago
|
Comment 8•8 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•