New issue
Advanced search Search tips

Issue 796961 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Special list-item counter starts from an incorrect number for ::before and ::after

Reported by kizm...@gmail.com, Dec 21 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 YaBrowser/17.10.0.2052 Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
1. Go to https://codepen.io/kizu/pen/QaKjmJ
2. Look at the custom counters

Or

1. Create an ordered list, optionally with a `start` attribute.
2. Add custom styles for the list items by using `counter(list-item)`.

What is the expected behavior?
This counter should start from either the `1` or from the number set by `start` attribute.

What went wrong?
The number the counters start from are wrong by one.

However, when the `value` attribute is used, the value is correct.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.100  Channel: n/a
OS Version: OS X 10.13.1
Flash Version: 

Edge browser renders everything in a correct way.

There is a hacky fix/workaround for this issue:

    ol.fix:not(*:root) > li:first-child:not([value]) {
      counter-increment: list-item 0;
    }
 

Comment 1 by lgrey@chromium.org, Dec 21 2017

Components: Blink>CSS
Status: Available (was: Unconfirmed)
Not a recent regression.

Comment 3 by shend@chromium.org, Jan 2 2018

Components: -Blink>CSS Blink>Layout
Redirecting to Layout as most of the counters logic is there (especially the numbering logic).
Just wanted to mention that this was fixed in webkit, and already landed in Safari: https://bugs.webkit.org/show_bug.cgi?id=181084, so probably the fix could be ported.

Sign in to add a comment