Re: [csswg-drafts] [css-content] Quote character choice must depend on surrounding language, not language of the quotation (#5478)

The CSS Working Group just discussed `[css-content] Quote character choice must depend on surrounding language, not language of the quotation`, and agreed to the following:

* `RESOLVED: adopt a quotes value that, if the parent's quotes computed value is auto, computes the correct quotes for the parent's language, and if the parent's quotes computed value is not auto, inherits that value`
* `RESOLVED: drop existing match-parent value`

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> florian: The internationalization people have told us what they want<br>
&lt;dbaron> s/five other ways/five other ways, whether computed style from font relative units or layout/<br>
&lt;emeyer> …A quote should inject at the start and end the quotation marks of the parent's language, not the element's language<br>
&lt;emeyer> …But if you nest them, the innermost should use the quote of the outermost quotation style<br>
&lt;emeyer> …In the general default case, you have to lock in the quote style and carry it down the ancestor chain<br>
&lt;emeyer> …We think we've come up with some approaches, but they could be performantly painful<br>
&lt;emeyer> The old-fashioned way was to supply a bunch of pairs of strings<br>
&lt;emeyer> 1. The spec has an auto value which computes to itself and represents the quotation system implied by the language of the parent element<br>
&lt;emeyer> fantasai: So if you have English text with a French quote, you use English quotation marks, even though the q elem,ent and its generated content are in French<br>
&lt;emeyer> …But if the French quote has a quote in French or English or whatever, you still want to use the English style quotes because you're in an English paragraph<br>
&lt;florian> q { quotes: auto; }<br>
&lt;florian> q::before,<br>
&lt;florian> q::after,<br>
&lt;florian> q * { quotes: match-parent; }<br>
&lt;emeyer> florian: So to achieve that, there's a match-parent value that computes to itself and means, "use the same quotation system as my parent"<br>
&lt;kizu> +q<br>
&lt;emeyer> …This does put a `q *` selector in UA stylesheets<br>
&lt;emeyer> …If you think this doesn't solve as stated, say so; if you think it's fine to put it in UA stylesheets, say so<br>
&lt;astearns> ack kizu<br>
&lt;emeyer> kizu: If we had a content pseudo-element, we might use this for quotes?<br>
&lt;emeyer> fantasai: No, that wouldn't work, because inheritance is before box construction<br>
&lt;emeyer> florian: 2. Uses different keywords not specced yet, but let's call one 'parent-language'<br>
&lt;emeyer> …This is like 'auto', but it computes to the set of strings the language needed, and inherits as those strings<br>
&lt;florian> q { quotes: parent-language; }<br>
&lt;florian> q q { quotes: inherit; }<br>
&lt;emeyer> s/but/except/<br>
&lt;emeyer> …If you're a quote element, you lock on your parent, unless you're nested, in which case you inherit the strings<br>
&lt;emeyer> …I don't know which UAs would prefer, I suspect the latter<br>
&lt;emeyer> …If neither works, what do we do??<br>
&lt;emeyer> dbaron: If both are bad, we could solve it by having a value that uses the parent language only if the parent has the initial value, and otherwise inherits from the parent<br>
&lt;emeyer> florian: Say again?<br>
&lt;emeyer> dbaron: 'parent-language-or-auto', uses the logical value 'auto' would use, otherwise inherits<br>
&lt;kbabbitt> q+<br>
&lt;emeyer> florian: It computes to itself and stays as is?<br>
&lt;emeyer> dbaron: All I need auto for is it's the initial value of the property<br>
&lt;emeyer> …So on the outer element it would look at the parent to get the language<br>
&lt;emeyer> (crosstalk)<br>
&lt;emeyer> …Then if you have a nested q element, you look at the parent, it isn't auto, so you just inherit it<br>
&lt;emeyer> florian: I agree that would also work<br>
&lt;emeyer> …One thing to not forget and I don't think you did, the place where the actual quotes are injected, they're the before and after, but that should still work with what you described<br>
&lt;emeyer> …Great, now we have three solutions; which is most implementable?<br>
&lt;astearns> ack kbabbitt<br>
&lt;emeyer> kbabbitt: I vote against putting a universal selector in a UA stylesheet, as it will likely trigger a lot of style invalidation<br>
&lt;emeyer> dbaron: I would defer to Rune or Anne for their thought on option 2<br>
&lt;dbaron> s/or Anne/or Ian/<br>
&lt;emeyer> florian: internationalization is reluctant about option 2, since you have to remember to put a bunch of non-obvious things in stylesheets<br>
&lt;emeyer> …I think David's thing is closer to what they want<br>
&lt;emeyer> dbaron: That's true, the downside is it's more magical and more weird<br>
&lt;emeyer> …We'd need a name<br>
&lt;emeyer> fantasai: match-parent?<br>
&lt;emeyer> dbaron: noooooooooo<br>
&lt;emeyer> florian: It doesn't quite work because it has to do different things<br>
&lt;emeyer> fantasai: Another one is to call one value normal and one auto?<br>
&lt;emeyer> dbaron: We could name for what it isn't for instead of what it does<br>
&lt;TabAtkins> for-q<br>
&lt;emeyer> florian: Bikeshedding aside, between option 2 and 3, which is better?<br>
&lt;TabAtkins> [me yelling at the dude who just sideswiped me] "FOR-Q"<br>
&lt;emeyer> futhark: I'm a little confused about the options, but avoiding the universal is good<br>
&lt;fantasai> 1. q { quotes: auto; }<br>
&lt;fantasai> q * { quotes: match-parent; }<br>
&lt;fantasai> 2. q { quotes: parent-language; }<br>
&lt;fantasai> q q { quotes: inherit; }<br>
&lt;emeyer> dbaron: Option 2 had a `q q` selector<br>
&lt;fantasai> 3. q { quotes: magic; }<br>
&lt;emeyer> …option 3 has only `q` because all the nmagic is in the value<br>
&lt;emeyer> futhark: I think I prefer that<br>
&lt;ChrisL> q {quotes: anon }<br>
&lt;emeyer> florian: All the magic happens at compute time, which is a different concern<br>
&lt;emeyer> futhark: Does it have to walk up the tree?<br>
&lt;emeyer> dbaron: It involves lookiong at the parent and maybe pulling stuff down<br>
&lt;emeyer> futhark: That sounds the best option<br>
&lt;emeyer> florian: So we can go back to bikeshedding optoin 3<br>
&lt;emeyer> jfkthame: Can we just not change the value of auto?<br>
&lt;emeyer> florian: ??<br>
&lt;emeyer> iank_: That would change the existing quotes property?<br>
&lt;emeyer> florian: The value now is only strings, there is no auto<br>
&lt;astearns> s/??/we could use auto, but then we need an initial value - maybe normal?/<br>
&lt;emeyer> fantasai: But everyone's shipping auto<br>
&lt;emeyer> florian: What does it do?<br>
&lt;emeyer> fantasai: [missed]<br>
&lt;emeyer> florian: So auto does something and has to be kept and we need a new name<br>
&lt;emeyer> fantasai: capture?<br>
&lt;emeyer> florian: Maybe<br>
&lt;emeyer> astearns: I prefer going back to the issue while resolving on behavior<br>
&lt;dbaron> quotes: outer-language ?<br>
&lt;fantasai> It wouldn't be outer language if you nested three languages though<br>
&lt;dbaron> Proposed resolution: adopt a quotes value that, if the parent's quotes computed value is auto, computes the correct quotes for the parent's language, and if the parent's quotes computed value is not auto, inherits that value.<br>
&lt;bkardell_> I'm good with that<br>
&lt;emilio> q+<br>
&lt;emeyer> emilio: Doesn't this require you to walk arbitrary ancestors?<br>
&lt;emeyer> florian: You only have to look at the parent<br>
&lt;emeyer> emilio: This would only apply to the quote element?<br>
&lt;emeyer> fantasai: You could put it on any element<br>
&lt;emeyer> dbaron: This will mostly work for style computation and inheritance<br>
&lt;emeyer> …The special inheriatnce rules here will only require looking up one step for each element<br>
&lt;emeyer> emilio: But it would expose ?? data for the language<br>
&lt;emeyer> dbaron: Yes<br>
&lt;fantasai> s/??/CLDR/<br>
&lt;emeyer> emilio: Okay, I think it might be fine<br>
&lt;emeyer> dbaron: I guess that might be a substantive change in that you need to do CLDR seek at computation time rather than layout time<br>
&lt;emeyer> emilio: I don't think that's a hard lookup to do, but I don't know how much we can expose that data<br>
&lt;emeyer> dbaron: I think you can get it with text data<br>
&lt;dbaron> s/text data/text measurement/<br>
&lt;emeyer> fantasai: CLDR doesn't vary by locale, it's ???<br>
&lt;emeyer> florian: It exposes information about the page, not the environment<br>
&lt;dbaron> s/???/something baked into the browser/<br>
&lt;emeyer> emilio: As long as that's the case, it's okay<br>
&lt;emeyer> RESOLVED: adopt a quotes value that, if the parent's quotes computed value is auto, computes the correct quotes for the parent's language, and if the parent's quotes computed value is not auto, inherits that value<br>
&lt;emeyer> florian: I think we should drop match-parent, which doesn't do what we want<br>
&lt;emeyer> astearns: Concerns?<br>
&lt;fantasai> PROPOSED: Drop existing match-parent value<br>
&lt;emeyer> dbaron: How widely implemented is it?<br>
&lt;emeyer> florian: I don't think it is<br>
&lt;emeyer> astearns: Objections?<br>
&lt;emeyer> RESOLVED: drop existing match-parent value<br>
&lt;emeyer> florian: Now, what does auto do?  I think there are two different behaviors<br>
&lt;emeyer> …Unless we have an obvious answer, it should be a separate issue<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5478#issuecomment-2163354212 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 12 June 2024 15:40:25 UTC