W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

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

From: L. David Baron via GitHub <sysbot+gh@w3.org>
Date: Thu, 07 Nov 2019 21:24:38 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-519521303-1573161876-sysbot+gh@w3.org>
dbaron has just created a new issue for https://github.com/w3c/csswg-drafts:

== Should vertical-align:middle behave differently when the dominant baseline is not alphabetic ==
In both [the definition in CSS 2.1](https://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align) and [the definition in css-inline](https://drafts.csswg.org/css-inline-3/#valdef-alignment-baseline-middle) `vertical-align: middle` is defined as:
> Align the vertical midpoint of the box with the baseline of the parent box plus half the x-height of the parent.

Nothing in the [Inline-level alignment section](https://drafts.csswg.org/css-writing-modes-3/#inline-alignment) of css-writing-modes appears to modify this definition.

Yet, as far as I can tell, this definition really makes sense primarily when the dominant baseline is alphabetic.  If you're starting from an alphabetic baseline, adding half the x-height gives a position that could reasonably described as the "middle".  If you're starting from a central baseline... I don't think it does.

In https://github.com/web-platform-tests/wpt/commit/07210df69af0daa9f07cd2109093b97ae917397e @hshiozawa added tests to web-platform-tests that test this behavior for vertical text with a central baseline.  Based on https://wpt.fyi/results/css/css-writing-modes it seems that these tests pass in Chrome (but no other engines).  [Mozilla bug 1220353](https://bugzilla.mozilla.org/show_bug.cgi?id=1220353) covers making them pass in Gecko.

We could try to implement this to pass these tests... but I'm hesitant to do so given that I don't see how the behavior makes sense.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4495 using your GitHub account
Received on Thursday, 7 November 2019 21:24:40 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC