NEW224811
Implement CSS Lists counter-reset: reversed(list-item) and <ol>/<ol reversed> default style per spec
https://bugs.webkit.org/show_bug.cgi?id=224811
Summary Implement CSS Lists counter-reset: reversed(list-item) and <ol>/<ol reversed>...
Simon Pieters (:zcorpan)
Reported 2021-04-20 06:27:20 PDT
The CSS Lists spec, with the reversed() proposal, is able to "explain" rendering of <ol> and <ol reversed> counters through presentational hints. See these spec changes: https://github.com/whatwg/html/pull/4816 https://github.com/w3c/csswg-drafts/pull/6096 and wpt tests: https://github.com/web-platform-tests/wpt/pull/28040 https://github.com/web-platform-tests/wpt/pull/28453
Attachments
Radar WebKit Bug Importer
Comment 1 2021-04-27 06:28:13 PDT
Karl Dubost
Comment 3 2026-05-19 02:18:28 PDT
Chrome ships it. Firefox ships it. https://drafts.csswg.org/css-lists/#valdef-counter-reset-reversed-counter-name 1. Parsing: Source/WebCore/css/parser/CSSPropertyParserConsumer+Lists.cpp needs a reversed(<counter-name>) function branch alongside the bare ident path. 2. Data model: CounterDirectives (Source/WebCore/rendering/style/CounterDirectives.h) is currently just std::optional<int> resetValue/incrementValue/setValue. It needs a flag for "this reset is reversed" so resolution knows to count downward. 3. Style serialization: StyleCounterReset (Source/WebCore/style/values/lists/StyleCounterReset.{h,cpp}) and computed style getters need to round-trip the reversed() notation. 4. Counter resolution: RenderCounter.cpp needs to compute the implicit start (= count of incremented descendants when the value is omitted) and decrement instead of increment. 5. UA sheet: html.css for ol[reversed] should use counter-reset: reversed(list-item) <start> and counter-increment: list-item -1, replacing the current behavior.
Note You need to log in before you can comment on or make changes to this bug.