Closed
Bug 356485
Opened 18 years ago
Closed 18 years ago
CSS2 counter / counter-increment not working correctly
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 288946
People
(Reporter: interghost, Assigned: dbaron)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060910 SeaMonkey/1.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060910 SeaMonkey/1.0.5
The counter-increment operation occurs only once and not when it should.
Reproducible: Always
Steps to Reproduce:
Open the following in Seamonkey:
<html>
<style type=text/css>
span:before
{
content: counter(test)": ";
counter-increment: test;
}
</style>
<body>
<span>first</span><br>
<span>second</span><br>
<span>third</span>
</body>
</html>
Actual Results:
1: first
1: second
1: third
Expected Results:
0: first (counter-increment after the content line, so 0: first, not 1: first)
1: second
2: third
Reporter | ||
Updated•18 years ago
|
Version: unspecified → 1.8 Branch
Reporter | ||
Comment 1•18 years ago
|
||
> Expected Results:
> 0: first (counter-increment after the content line, so 0: first, not 1: first)
> 1: second
> 2: third
>
After some more reading and testing I found that the increment goes prior to render, and that I'm missing a counter-reset. After adding a counter-reset everything is ok, but it should also work without it...the specs (http://www.w3.org/TR/CSS21/syndata.html#counter) say:
"Counters that are not in the scope of any 'counter-reset', are assumed to have been reset to 0 by a 'counter-reset' on the root element."
So expected result would be:
1: first
2: second
3: third
Reporter | ||
Comment 2•18 years ago
|
||
> "Counters that are not in the scope of any 'counter-reset', are assumed to have
> been reset to 0 by a 'counter-reset' on the root element."
OK the above can be interpreted in several ways, my interpretation is:
1st span occurs, counter is not in the scope of any 'counter-reset' => reset to 0 by a 'counter-reset' on the root element, incremented by 1
2nd span occurs, counter now is in the scope of a root element 'counter-reset' => only increment by 1
3rd ...
is my interpretation wrong?
Updated•18 years ago
|
Assignee: general → dbaron
Component: General → Style System (CSS)
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Assignee | ||
Comment 3•18 years ago
|
||
That sentence was supposed to have been removed a few drafts ago when the sections on counters were rewritten and will be removed in the next public draft.
You need a counter-reset; without it, the counters are all separate.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
Assignee | ||
Updated•17 years ago
|
Resolution: INVALID → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•