Re: [csswg-drafts] [css-lists] automatic start value of reversed list is affected by 'counter-increment: <counter> 0' nodes (#6738)

Another possibility would be changing the normal order and say that, for reversed lists, counter increments are applied *after* using the values. Specifically, when the counter is inherited by a following element in tree order which is not a descendant, I guess. Then we would just initialize to the negated sum of increments:

```html
<ol reversed><!-- 5 -->
  <li style="counter-increment: list-item -2"><!-- 5 --></li>
  <li style="counter-increment: list-item -3"><!-- 3 --></li>
</ol>
<ol reversed><!-- 5 -->
  <li style="counter-increment: list-item 0"><!-- 5 --></li>
  <li style="counter-increment: list-item -2"><!-- 5 --></li>
  <li style="counter-increment: list-item -3"><!-- 3 --></li>
</ol>
<ol reversed><!-- 5 -->
  <li style="counter-increment: list-item -2"><!-- 5 --></li>
  <li style="counter-increment: list-item -3"><!-- 3 --></li>
  <li style="counter-increment: list-item 0"><!-- 0 --></li>
</ol>
<ol reversed><!-- 5 -->
  <li style="counter-increment: list-item 0"><!-- 5 --></li>
  <li style="counter-increment: list-item -2"><!-- 5 --></li>
  <li style="counter-increment: list-item -3"><!-- 3 --></li>
  <li style="counter-increment: list-item 0"><!-- 0 --></li>
</ol>
```

The UA style would have

```css
ol[reversed] {
  counter-reset: reversed(list-item);
}
ol[reversed][start] {
  counter-reset: reversed(list-item) calc(attr(start integer));
}
```

Looks nice, but that would change the model quite a bit, which probably is not a good idea for implementations.

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


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

Received on Monday, 18 October 2021 19:06:36 UTC