Re: [csswg-drafts] [css-lists-3] Need a way to return the max value of a counter within a scope. (#3667)

Note that the min/max value of a counter might be somewhere in the middle of the list.  So which functions we choose to implement really depends on what the use cases are.  E.g.
```html
<ol>
  <li>
  <li value=9>
  <li style="counter-increment: list-item -1">
</ol>
```

Here, I would say that `counter-final()` / `counter-last()` is 8, while `counter-max()` is 9, and `counter-length()` is 3.

We also need to define what these functions should return for `reversed()` counters, e.g.
```html
<ol reversed>
  <li>
  <li value=9>
  <li style="counter-increment: list-item 3">
</ol>
```
which results in the numbering: 10, 9, 12. Here, `counter-final()` is 10, `counter-last()` /  `counter-max()` is 12.

I don't think I see much use for `counter-max()` given that it can be any item.

`counter-length()` seems reasonable to implement, given that there's a use case ("step 1 of 3" etc), but then the question is which elements to count. Counting every element which has a `counter-set` or non-zero valued `counter-increment` for the counter seems reasonable. So `counter-length()` would be 3 for my examples above.



-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3667#issuecomment-956908751 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 1 November 2021 23:43:42 UTC