-
Notifications
You must be signed in to change notification settings - Fork 682
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
[css-lists] How does the list-item counter affect display? #4168
Comments
Well, we have: "list-style-type on the originating element defines a marker string " " So, if the UA sheet contains Perhaps the spec should say upfront that all examples assumes an UA sheet similar to the one in the appendix? It'd be rather tedious to list complete markup+style for each example, and it would make them less informative since the reader might not know which rules are necessary for the example to work in a web browser and might start adding lot's of redundant styles. (It looks like most examples assumes existing (UA) style on ol/ul/li elements, fwiw.) |
Right, if there were a normative statement that UAs had such a rule, then the OP's example would make sense. The fact that there is no such statement is why I find the example confusing. I don't think it would be that tedious to list such a rule for the 1 example where it is necessary. (I believe there are only 2 examples in the spec that use the list-item counter, one of which already has such a rule.) I think it would be more informative, since adding such a rule would be necessary in a web browser, not redundant. (Unless the browser introduces UA styles based on no normative spec, I suppose, but I don't think we should be writing spec examples catering to such situations.) |
Actually, there are many more. Also, there are other UA style assumptions: example 3, 4, 6 and 10 are missing Making the examples complete in the sense that they work with an empty UA sheet might be good for implementors, but I think it makes the examples less informative for authors since it's less clear which declarations they need to include for the example to work and which are simply copies from the UA sheet. It would be unfortunate if the spec mislead authors to include li { display: list-item; } /* in UA sheet */
ol { counter-reset: list-item; list-style-type: decimal; } /* in UA sheet */
li::marker { content: "(" counter(list-item, lower-roman) ")"; }
... other non-UA sheet rules needed for the example ... |
I think we're talking past each other. I'm not talking about making the examples complete with an empty UA stylesheet. I'm talking about making the examples complete with the UA stylesheet. That seems important for authors. I agree it's of dubious value to duplicate the relevant UA stylesheet rules in every example in the spec; we should not need to spell out that But, given that there is no UA stylesheet rule that li's render using the list-item counter, it seems like the two examples in the spec (16 and 17) which relate to the behavior of the list-item counter should probably make that counter render. Otherwise they're just confusing. (Especially since example 17 does include such a rule; we're just discussing whether to make example 16 consistent with that.) An example such as example 3 works fine with the UA stylesheet rules that exist today, so it doesn't need any additions. Note: perhaps the confusion is that when I say "UA stylesheet", I mean the one normatively specified to apply to UAs (in the HTML spec), whereas you might be referring to the non-normative example UA stylesheet appendix? I think the one that applies to UAs is more relevant when we're talking about usefulness to authors (and implementers!), than the example appendix one. |
It renders because the other CSS properties implies a generated marker that is using the This also implies that a <style>::marker{color:red}</style><li>Hi makes the bullet red. The
Well, the one in the css-lists spec is a lot closer to the actual UA sheet we have in Gecko than the "normative" rules in the HTML spec (which lacks (I implemented HTML list numbering using a built-in |
Thank you! That was what I was missing. So there is a normative requirement in the spec, it's just in the list-style-type property section, not in the list-item section. I know I could have clicked on the 'list-item' definition to see that, but may I suggest adding an explicit note explaining this connection? E.g. in the list-item counter section, something like
Right. I'm aware that Gecko implemented a UA stylesheet based on no normative spec. I'd hoped that as @dbaron asked, we'd see an update to the normative UA stylesheet at some point---at least in pull request form---but that hasn't materialized yet. As such I hesitate to take such unspecified, not-even-proposed UA stylesheets into account. |
@MatsPalmgren So I see that |
@tabatkins It's intentional. We initially implemented the |
Ah yes, apologies, I remember that resolution. I've done some wording tweaks to make all this clearer. @domenic, I also added the note you requested. |
Fwiw, the CSSWG resolutions on redefining HTML list numbering to integrate with CSS counters predate the HTML spec by quite a few years: https://www.w3.org/TR/2002/WD-css3-lists-20021107/#declaring Gecko's implementation is fulfilling a longstanding intention, and they have been coordinating with the CSSWG to work out missing details on how exactly to make it work.
You don't need to. As @MatsPalmgren points out, That said, yes, the HTML spec should be updated to hook into css-lists-3 for list numbering, as it currently doesn't define the rendering of list numbers for CSS UAs at all. (I'm guessing this is what the red-boxed note at the end of 14.3.8 Lists is about?) Thus, every browser's
We've done one better, and revised the section overall to be a little clearer. :) There's now a cross-reference to the |
Good catch! The sentence that currently reads
was meant to read "user agents"; that was missed when we introduced the definition of "ordinal value". That said, it sounds like perhaps that will be unnecessary soon, with proposals such as whatwg/html#4816, or the work you mentioned you and Tab intend to submit. (Assuming they gain the requisite multi-implementer interest.)
Yep, my OP request is definitely fulfilled; thank you for your work! |
https://drafts.csswg.org/css-lists-3/#list-item-counter
I can't find a normative requirement to support this rendering. The normative requirements I can find are all about the value of the list-item counter (although I think there are contradictions; see #4167). There is nothing in the spec that says that the list-item counter is to be used in rendering.
Perhaps the example is missing a
ol.evens::marker { content: counters(list-item,'.') '.'; }
, similar to the following Example 17?The text was updated successfully, but these errors were encountered: