Open zcorpan opened 3 years ago
I think the plan you suggest of decoupling from CSS seems like a step in the right direction.
It might be good to also mention (perhaps as an additional example in the li section) that you can use CSS to make the rendering out of sync with the ordinal value, which is likely confusing for readers of your source and is best avoided.
From https://github.com/whatwg/html/pull/4816#discussion_r587928706 by @domenic
I replied:
Ordinal value is defined here:
https://html.spec.whatwg.org/multipage/grouping-content.html#ordinal-value
So currently, any element with computed value
display: list-item
has an a list owner and an ordinal value.The list owner is the nearest ancestor
ul
,ol
, ormenu
, except if it doesn't produce a CSS box, in which case the nearest ancestor element that does produce a CSS box is the list owner. (This doesn't seem to match WebKit/Chromium when styling theol
withdisplay: contents
. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/9064 )The ordinal value then checks if owner is an
ol
element, and if so look at thestart
andreversed
attributes. If the list item is anli
element, it looks at itsvalue
attribute. Then counts up or down as appropriate for all list items owned by owner.To decouple this from CSS, the minimum change is to remove the check of "CSS box", and only consider
li
elements (instead of depending on CSSdisplay
). Since "ordinal value" is only used for defining rendering for non-CSS user agents, I think having it rely on CSS doesn't really make sense.cc @whatwg/css