-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the Rendering section for Lists to use the built-in 'list-item… #4816
Conversation
Actually, it might be better skip the last paragraph that I added (about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you ensure that the result builds?
I noticed that you deleted the pull request template. Can you edit your OP to reinstate it? It contains important information for determining whether we'll be able to merge this, such as whether there are web platform tests for the normative changes, or multiple implementers lined up to implement it.
Actually, it might be better skip the last paragraph that I added (about
<ol reversed>
) and add that bit to CSS Lists instead since it affects the CSS used value, not the computed value.
It's unclear to me whether the CSS specifications want to take dependencies on HTML elements, and specific HTML element names, in this way, or whether they want to be agnostic to the "host language". So far from what I've seen of CSS they prefer being agnostic, but you would probably have more experience than I.
This relies on CSS introducing 'counter-reset: reversed(ident)', see w3c/csswg-drafts#4211 (comment)
ec9feb9
to
734f073
Compare
I've revamped this to address @domenic's comments, and to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work; thanks for this!
Could you say a bit more about the comparison with https://drafts.csswg.org/css-lists/#ua-stylesheet ? Specific things I wonder about:
ul { list-style-type: toggle(disc, circle, square); }
marker-side: match-parent;
onol, ul
text-align: match-parent;
onli
- The use of
attr()
andcalc()
instead of your algorithmic approach, and what the differences are.
is expected to use the following steps to treat the attributes as a <span data-x="presentational | ||
hints">presentational hint</span> for the <span>'counter-reset'</span> property:</p> | ||
|
||
<ol> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This algorithm is very nice and simple and clean. I worry a bit about whether it is in sync with the "ordinal value" definition. But, I can't think of any nice way to keep them in sync and make sure they reflect the same thing, because it's really comparing ordinal value to (this algorithm + CSS's automatic features like list-item incrementing).
Let me know if you have thoughts about ordinal value. Before, we spent effort defining ordinal value based on UA behavior to match the rendered output. Now that UA rendering is defined entirely in terms of CSS (and can, e.g., get out of sync with ordinal value via manually setting various CSS properties), it's not clear how to think of ordinal value's role. It gives a sense of what the semantics of the list are, but is it really OK for those semantics to drift visibly from the rendering? Which would we expect accessibility technology to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah ordinal value was indeed supposed to match browsers' rendering behavior, but now that mapping to CSS properties can do that, there's not so much of a need for ordinal value to do that. We could take the opportunity to completely decouple the semantic numbering from CSS. That CSS can be used to give a completely different visual compared to the semantics of the HTML is nothing new, and isn't an issue. On the contrary, having author CSS affect underlying semantics is against the spirit of CSS. I'll file an issue about ordinal value. (edit: #6473)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which would we expect accessibility technology to use?
ATs generally take CSS into account (e.g. don't expose display: none
, do expose generated content), but there are tricky cases (like <td style="display: block">
should still be exposed cells in a data table, while <div style="display: table">
should not be exposed as a data table). For counters, I think users would expect the numbers to match visual rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fantasai interesting, thanks! Even with speak-as
, though, the question is which number an AT should use -- the semantic number based on the HTML alone (or some combination of HTML+CSS), or the number the list item has per CSS counters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make it similar to the various bidi features, that have this language:
The following elements and attributes have requirements defined by the rendering section that, due to the requirements in this section, are requirements on all user agents (not just those that support the suggested default rendering)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This doesn't match what browsers do -- a nesting of e.g. https://html.spec.whatwg.org/multipage/rendering.html#lists
We could add these here, or in a follow-up. I haven't yet looked into what these do exactly.
So with this
The value would be parsed with CSS rules instead of HTML rules, which makes a difference for e.g. |
Awesome, that all makes sense. It'd be great to have tests for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will need tests, which should help inform implementation interest.
Also, @MatsPalmgren can you join https://github.com/mozilla-standards and publicize your membership therein?
This allows HTML to define the rendering for `<ol reversed>` in terms of a presentational hint for `counter-reset: reversed(list-item)` or `<ol reversed start=X>` to `counter-reset: reversed(list-item) X+1`. See whatwg/html#4816 Fixes w3c#4181 Fixes w3c#4211
This allows HTML to define the rendering for `<ol reversed>` in terms of a presentational hint for `counter-reset: reversed(list-item)` or `<ol reversed start=X>` to `counter-reset: reversed(list-item) X+1`. See whatwg/html#4816 Fixes w3c#4181 Fixes w3c#4211
I've filed browser bugs for this now, listed in OP. The spec change to CSS Lists needs review and CSS WG approval, and the tests for Also need clarify on implementer interest, which I think there is from Gecko and Chromium but I'm not the one to sign off on that. |
Yes there is Chromium interest. I think @emilio also indicated Gecko interest, and I believe in fact Gecko already implements |
w3c/csswg-drafts#6096 was merged, so I think this should be ready. @smfr can you comment regarding interest/opposition for WebKit? |
One week has passed. Should we merge? |
Do you have a proposed commit message? |
I'm not certain whether #4808 is fixed by this PR, though technically it's up to CSS to define the interaction between |
* HTML: Test rendering of ol, ul, menu, li, dir, dl, dt, dd See whatwg/html#4816
…, dir, dl, dt, dd, a=testonly Automatic update from web-platform-tests HTML: Test rendering of ol, ul, menu, li, dir, dl, dt, dd * HTML: Test rendering of ol, ul, menu, li, dir, dl, dt, dd See whatwg/html#4816 -- wpt-commits: bde70eda5074e031e4e57f4147bf9124f854ec20 wpt-pr: 28040
As requested by @domenic in w3c/csswg-drafts#4168
reversed()
) (@emilio @MatsPalmgren )(See WHATWG Working Mode: Changes for more details.)
/infrastructure.html ( diff )
/rendering.html ( diff )