Re: [csswg-drafts] Should vertical-align:middle behave differently when the dominant baseline is not alphabetic? (#4495)

The CSS Working Group just discussed `vertical align:middle in vertical text`, and agreed to the following:

* `RESOLVED: "vertical-align: middle" always uses halfway between alphabetic baseline and x-height, except in modes where the x-height is meaningless (vertical writing modes with upright text orientation)`
* `RESOLVED: In such "meaningless" cases, "middle" means the same as "central".`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: vertical align:middle in vertical text<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/4495<br>
&lt;TabAtkins> fantasai: Afaict from dbaron's description, issue is that v-a:middle has you find the point between the alphabetic baseline and the x-height, and call that "the middle", then use that for alignment<br>
&lt;TabAtkins> fantasai: Apparently there's some impls that, in vertical modes, instead of doing that in a sideways fashion, take the central baseline.<br>
&lt;TabAtkins> dbaron: I think Gecko does vertical-align:middle based on, not a font-derived central baseline, but a synthesized central baseline.<br>
&lt;TabAtkins> fantasai: So I think we should clarify the spec to say you're using the alphabetic baseline even in vertical text.<br>
&lt;TabAtkins> fantasai: *Not* the central or hanging or whatever the dominatn baseline is.<br>
&lt;TabAtkins> fantasai: So you'll always find the same point.<br>
&lt;TabAtkins> fantasai: But when text-orientation is upright, the x-height doesn't have a meaning in the transverse axis, so maybe use central then.<br>
&lt;TabAtkins> jfkthame: What about when text orientation is mixed?<br>
&lt;TabAtkins> fantasai: Then you're rotating the text, you can still get a meaningful x-height and align there.<br>
&lt;TabAtkins> jfkthame: I disagree, this is mostly useful for CJK text and we should be centering.<br>
&lt;TabAtkins> fantasai: Then just use the central baseline explicitly.<br>
&lt;TabAtkins> fantasai: If that's what you want to change to, tho, we can do that.<br>
&lt;TabAtkins> fantasai: So we have severa ldistinctions we make in vertical text.s<br>
&lt;TabAtkins> fantasai: First is whether you're in horizontal or vertical typesetting.<br>
&lt;TabAtkins> s/typesetting/typographic mode/<br>
&lt;TabAtkins> fantasai: Horizontal mode is trigger by w-m: sideways-rl<br>
&lt;TabAtkins> fantasai: In that case we should ensure the conventions are a rotation from horizontal text<br>
&lt;TabAtkins> fantasai: Within the vertical typographic modes (vertical-rl/lr modes), we have three text-orientation values.<br>
&lt;TabAtkins> fantasai: uprgiht, sideways, mixed<br>
&lt;TabAtkins> fantasai: If we want this "Middle" alignment to be avaible for a paragraph in vertical typographic mode, we need to define it the same was as in horiz mode, at the very least when t-o is sideways<br>
&lt;TabAtkins> fantasai: But when t-o is upright, that definition is nonsensical. It'll have to be the central baselie.<br>
&lt;TabAtkins> fantasai: For mixed, it's a question of do we want to match upright or sideways.<br>
&lt;TabAtkins> fantasai: Since "middle" is this weird thing tailored to latin text, I say we should match it to how latin text works, which is the alphabetic/x-height thing.<br>
&lt;TabAtkins> fantasai: If someone wants to use actually centrally-baselined stuff, they should say v-a:central;<br>
&lt;TabAtkins> fantasai: Open to other opinions tho<br>
&lt;TabAtkins> heycam: Kinda feel like I agree with jfkthame, where mixed is for primarily vertical with little bits of rotated horizontal text. So I think you want to align based on majority text.<br>
&lt;TabAtkins> fantasai: This isn't a default keyword, you ahve to specifically request middle<br>
&lt;TabAtkins> heycam: I see what you're saying, there's no other way to get that before.<br>
&lt;TabAtkins> fantasai: So yeah, you'll get the correct (central-aligned) behavior by default. You have to explicitly say "middle" to get this behavior; I agree it's usually weird.<br>
&lt;TabAtkins> dbaron: What I'm concerned about is that we don't add half the x-height to anything but the alphabetic baseline.<br>
&lt;TabAtkins> dbaron: I think fantasai makes sense; this is something you'd use for a small image you want to line up with the text.<br>
&lt;TabAtkins> dbaron: Since there's already a "central" value, and if there *is* an alphabetic baseline around to use, I think we should do fantasai's proposal.<br>
&lt;TabAtkins> dbaron: The name is unfortnate, but we're stuck with it.<br>
&lt;TabAtkins> jfkthame: 'central' keyword is new, right?<br>
&lt;TabAtkins> fantasai: Yeah, we added it for CJK specifically here.<br>
&lt;TabAtkins> dbaron: We don't implement it yet, I didn't realize it was there. But its existence influences my opinion here.<br>
&lt;TabAtkins> jfkthame: So we're going to have to tell people to stop using middle for their cJK?<br>
&lt;TabAtkins> dbaron: It doesn't really work there anyway, it's only good for bicameral scripts.<br>
&lt;TabAtkins> astearns: So proposed resolution is to make the middle spot always be what middle uses, as long as the alphabetic baseline and x-height are in the relevant axis.<br>
&lt;fantasai> middle should have been called x-middle<br>
&lt;TabAtkins> RESOLVED: "vertical-align: middle" always uses halfway between alphabetic baseline and x-height, except in modes where the x-height is meaningless (vertical writing modes with upright text orientation)<br>
&lt;dbaron> The followup question is whether the alphabetic | ideographic | central values are stable enough to implement.<br>
&lt;TabAtkins> RESOLVED: In such "meaningless" cases, "middle" means the same as "central".<br>
</details>


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

Received on Friday, 24 January 2020 16:00:11 UTC