Open
Bug 1809505
Opened 2 years ago
Updated 1 year ago
Style containment not working well with counters on pseudo-elements
Categories
(Core :: Layout: Generated Content, Lists, and Counters, defect)
Core
Layout: Generated Content, Lists, and Counters
Tracking
()
NEW
People
(Reporter: Oriol, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
715 bytes,
text/html
|
Details |
Load attached testcase.
Expected:
[::before=0]
1. [::before=1][::after=1]
[::before=0] <-- Here
1. [::before=1][::after=1]
[::after=1]
2. [::before=2][::after=2]
[::after=2]
Actual:
[::before=0]
1. [::before=1][::after=1]
[::before=1] <-- Here
1. [::before=1][::after=1]
[::after=1]
2. [::before=2][::after=2]
[::after=2]
Also, layout is not stable. if then I run
var div = document.querySelector("div");
div.style.display = "none";
div.offsetLeft;
div.style.display = "";
it becomes
[::before=0]
1. [::before=1][::after=1]
[::before=2] <-- Here
1. [::before=1][::after=1]
[::after=1]
2. [::before=2][::after=2]
[::after=2]
Reporter | ||
Comment 1•2 years ago
|
||
I forgot about https://drafts.csswg.org/css-contain/#containment-style
the counter() and counters() value of the content property is not itself scoped, and can refer to counters established outside of the subtree.
So the initial result is actually good. I'm attaching a better testcase with counters()
.
[::before=0]
1. [::before=1][::after=1]
[::before=1]
1. [::before=1.1][::after=1.1]
[::after=1.1]
2. [::before=2][::after=2]
[::after=2]
But when I run the JS, it wrongly becomes
[::before=0]
1. [::before=1][::after=1]
[::before=2]
1. [::before=2.1][::after=2.1]
[::after=2.1]
2. [::before=2][::after=2]
[::after=2]
Attachment #9311606 -
Attachment is obsolete: true
Updated•2 years ago
|
Severity: S2 → S3
Comment 3•2 years ago
|
||
Martin, do you have cycles to take a look at this? No big deal if not but it seems it might not be too hard to address.
Flags: needinfo?(mrobinson)
Comment 5•1 year ago
|
||
Please accept my apologies for dropping the ball on this issue. I think that I may not have time to tackle it in the short term. :(
You need to log in
before you can comment on or make changes to this bug.
Description
•