Skip to content

[css-lists] Omitted start value of reversed list isn't calculated right #6233

@Loirooriol

Description

@Loirooriol

From https://drafts.csswg.org/css-lists/#instantiating-counters,

When a counter is instantiated without an initial value, the user agent must dynamically calculate the initial value at layout-time to be the number of elements and pseudo-elements that instantiate the same counter in the same scope, plus 1.

Imagine a simple

<ol reversed>
  <li>foo</li>
  <li>bar</li>
  <li>baz</li>
</ol>

There is a singe element instantiating list-item: the <ol>. The <li> don't instantiate it since they only use counter-increment

The counter-increment and counter-set properties manipulate the value of existing counters. They only instantiate new counters if there is no counter of the given name on the element yet.

But precisely, what we want to count is the number of <li>. Or maybe the (negated?) sum of their counter-increments if they have been set to a value different than 1 (-1?). Something like that, not the number of instantiations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions