CSS pseudo class :has in combination with HTMLTemplateElement
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: pascalav, Assigned: dshin)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Steps to reproduce:
You can simulate the bug(?) with JSFiddle click by click.
Both examples show the error in the Firefox browser under Kubuntu (Snap version 121.0.1-1). Once with document.createElement('template') and once with the template tag in the body. The result is the same.
https://jsfiddle.net/o5fuztr0/1/
or
https://jsfiddle.net/o5fuztr0/
User-Agent: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0"
Actual results:
If you use the CSS pseudo class :has in combination with templates, the CSS property is not updated when the template is inserted into the DOM.
Expected results:
The stored CSS properties should be displayed. In the example here the background color. However, this applies to all properties. Also display: none etc.
Updated•8 months ago
|
Updated•8 months ago
|
Assignee | ||
Comment 1•8 months ago
|
||
Thanks for filing!
Minimum reproducible case for the root cause attached.
Root cause is here where in a multiple append scenario, we skip invalidation if the first node is not an element.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 2•8 months ago
|
||
Comment 5•8 months ago
|
||
bugherder |
Updated•8 months ago
|
Comment 8•7 months ago
|
||
Reproducible on a 2024-01-15 Nightly build on macOS 12.
Verified as fixed on Firefox 123.0 and Firefox Nightly 124.0a1 on Windows 10, Ubuntu 22, macOS 12.
Description
•