-
Notifications
You must be signed in to change notification settings - Fork 669
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-counter-style] overriding symbolic counter styles. #3584
Comments
(I basically find it a bit silly that I need to pay hash lookups in parts of Gecko to paint a square :)) |
A more concrete proposal: Can we prevent from overriding It's not a huge deal if not I guess, but it's somewhat unfortunate. |
The reason is that, theoretically, once you implement @counter-style you can just move all your built-in counter styles to being defined by the UA style sheet. We include the minimum amount of magic names to allow us to do reasonable fallback, and otherwise assume that this is exactly what happens, so all the other styles can be overridden. That said, I don't care and don't think it's important; if you want more disallowed names I'm okay with that. |
The argument for those four counter styles to be non-overridable is that, browsers have special rendering code for them, so not needing to go through the counter style resolution may simplify / accelerate some handling for certain implementation strategies. |
Like I said, I'm fine with that. The current list is just a minimal list (tho... I forget why I added |
For reference, |
Agenda+ to see if we still want to make the list of simple symbolic styles that Emilio lists (circle, square, disclosure-open, and disclosure-closed) non-overridable. As I said in earlier comments, I'm fine with doing more non-overridable values, if UAs want it. |
If we resolve for this proposal, #6201 becomes a non issue; the special formatting for The disclosures I'm less sure on; first because we don't have the legacy issues we do with the other three, but mainly because the special handling that comes with |
@faceless2 While this simplifies #6201, I don't think it becomes a non-issue, because even if you can't override symbolic counters, I guess you can extend them like |
Hmm, good point. I agree the question to resolve is - if a "special" counter like disc, circle, square is extended, does it remain special? If we try and propagate this "specialness" through inheritance, I can see it getting quite complex. @counter-style my-circle { system: extends circle; suffix: ":" } /* circle or \25E6? */
@counter-style my-circle2 { system: extends circle; symbols: \25E6 } /* circle or \25E6? */
@counter-style my-circle3 { system: extends square; symbols: \25E6 } /* circle or \25E6? */
@counter-style tmp { system: extends disc; symbols: A }
@counter-style my-circle5 { system: extends tmp; symbols: \25E6 } /* circle or \25E6? */ I guess there are probably three options:
I can see an argument for 1 or 2, but not 3 myself - it starts to get weird and complex for what is, ultimately, something we're only doing for compatibility. |
Yeah, I think we should just do the simplest thing there. At least 2, but I'd be fine with 1. |
2 implies that part of the marker may be normal text (like prefix and suffix), and part may be special (symbol). This seems unnecessarily tricky to implement. I prefer 1, which is what Chromium and Firefox currently do. Anyways, this discussion seems more suited for #6201. |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-counter-style] overriding symbolic counter styles.<dael> github: https://github.com//issues/3584 <dael> TabAtkins: IN current spec I went conserivitive with locking down styles so could not be overwritten. <dael> TabAtkins: After prodding I added a few things in addition to decimal. Disc. Emilio is asking for others not to be overwritable. rendered specially by browsers so requires a bit more work. <dael> TabAtkins: I'm happy with this. You can make your own and give it your own name. Need sign off <dael> astearns: Yes, there is the out of making your own. Do you think there is a compat problem where we will remove people's overrides? <dael> TabAtkins: I strongly doubt. If you're doing a counter style named square that is not squares you're bringing it on yourself <dael> astearns: Your special squares is the thing. Going back to normal boring squares is not that terrible <dael> astearns: Any concerns with the change? <dael> astearns: Prop: Make app predefined symbolic counter styles not overwritable <dael> TabAtkins: All predefined symbolics <dael> s/app/all <dael> astearns: Obj? <dael> Resolved: Make all predefined symbolic counter styles not overwritable <dael> TabAtkins: What if you extend these? <dael> TabAtkins: Two major options <dael> TabAtkins: First is that whenever you extend a predefined counter style the thing you are extending is the spec version, not what browsers do. Means you might get slightly different glyph <dael> TabAtkins: Still approx the same <dael> TabAtkins: Other is doing more subtle thing where certain descriptors cause revert to version in spec. That still has complicaitons <dael> TabAtkins: Prop: if you extend a predefined symbolic you are extending the version defined in spec not as rendered in browsers <dael> fantasai: Not sure on this one <dael> fantasai: Reasonable you might want to extend with some such as speak-as without effecting rendering <dael> TabAtkins: Symbolics with speak-as best you can do it make them read decimal of counter. Doing that one something that doesn't render a number doesn't sound good <dael> TabAtkins: Decimal is fine. Predefined symbolics where in spec you can render in other ways <dael> fantasai: So this is just circle, disc type ones? <dael> TabAtkins: Yeah <dael> oriol: This is how FF and Chromium render so it is fine <dael> astearns: Prop: When you extend a predefined symbolic you are extending the version defined in the spec <dael> astearns: Obj? <dael> RESOLVED: When you extend a predefined symbolic you are extending the version defined in the spec |
Oops it seems only one resolution is recorded by the bot. |
Official minutes at https://lists.w3.org/Archives/Public/www-style/2021Jun/0005.html |
…able, and specify that extending them uses the spec version, not the UA exception. #3584
This CL follows from a recent spec revision that made all predefined symbolic counter styles non-overridable: w3c/csswg-drafts#3584 (comment) Bug: 1218770 Change-Id: Id28e0e0c74dfc5659552d709078562f9621ccccf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3032917 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#902526}
This CL follows from a recent spec revision that made all predefined symbolic counter styles non-overridable: w3c/csswg-drafts#3584 (comment) Bug: 1218770 Change-Id: Id28e0e0c74dfc5659552d709078562f9621ccccf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3032917 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#902526} NOKEYCHECK=True GitOrigin-RevId: 168f047097f2620fca65e608233871dce554dc23
Counter styles allows to override built-in counter styles (except for
none
/disc
/decimal
). Is there any use-case to justify doing this? Can we at least disallow overriding the list-style types?/cc @upsuper @tabatkins
The text was updated successfully, but these errors were encountered: