Counter is not reset when using a registered custom property
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: kizmarh, Unassigned)
Details
Attachments
(1 file)
1.63 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
Steps to reproduce:
- Open https://codepen.io/kizu/pen/emOEPXp?editors=1100 or the attached .html
- Look at the first 2 lines after the
test1
andtest2
lines.
Actual results:
These lines show 0
Expected results:
These lines should be the same as the other two lines below them.
Some notes:
- The
test3
, I think, is a different issue, and I'll open a separate bug about it. - As seen from the test cases, using a non-registered property works fine, as well as calling the custom property inside a
calc()
- Interestingly, after doing one of the things from point 2 (
calc()
or using a non-registered custom property), when doing the same thing with the registered one — it then works. See the last line in each test.
Comment 1•2 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.
Comment 2•1 month ago
|
||
The severity field is not set for this bug.
:jwatt, could you have a look please?
For more information, please visit BugBot documentation.
Comment 3•26 days ago
|
||
I think what you're seeing is that the effective value ends up being fractional, and counter-reset
doesn't deal with that (e.g., counter-reset: test 10.5
is invalid), right?
I can also see 0
in other browsers at some zoom levels, which would support this diagnostic. If so I think the code is not wrong, you just need a round()
somewhere, or making the property an <integer>
.
Reporter | ||
Comment 4•26 days ago
|
||
Ah, hmm. Yes, this looks like it, and the fractional value is there because of https://bugzilla.mozilla.org/show_bug.cgi?id=1939353, I guess.
And then because counter-reset
is not reset on the last item due to the fractional value, it takes the value of that counter from the previous sibling that did reset it, so that's why it seems to “work” accidentally (but does not).
I think it should be safe to mark this as a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1939353 then,
Description
•