W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2021

[csswg-drafts] [css-text] text-align: match-parent on the root element with direction: rtl doesn't match browsers (#6542)

From: Simon Pieters via GitHub <sysbot+gh@w3.org>
Date: Wed, 25 Aug 2021 13:45:18 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-979169223-1629899116-sysbot+gh@w3.org>
zcorpan has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text] text-align: match-parent on the root element with direction: rtl doesn't match browsers ==
See this test: https://github.com/web-platform-tests/wpt/pull/30175

If I understand correctly, a used value of 'direction: rtl' on the root element is propagated to the ICB per https://drafts.csswg.org/css-writing-modes-3/#icb

Then, https://drafts.csswg.org/css-text/#valdef-text-align-match-parent says

> match-parent
> This value behaves the same as inherit (computes to its parent’s computed value) except that an inherited value of start or end is interpreted against the parent’s (or the initial containing block’s, if there is no parent) direction value and results in a computed value of either left or right. When specified on the text-align shorthand, sets both text-align-all and text-align-last to match-parent.

The initial value of text-align is 'start', so I guess the inherited value for the root element has to be 'start'. Therefore, it looks at the 'direction' of the ICB, which is propagated from the root element, and is thus 'rtl'. Therefore text-align should compute to 'right'.

Here are the results of the test:

Firefox Nightly | Safari TP | Chrome Canary
----|-----|-----
expected "right" but got "start" | expected "right" but got "left" | expected "right" but got "left"

Is my reading of the spec correct?

Should the spec be changed to side with either Firefox or Safari/Chrome?

Also, the spec only says that the computed value is "either left or right", which doesn't say which value to use. I assume a mapping where direction: ltr -> left and direction: rtl -> right, but the spec should say so explicitly.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6542 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 25 August 2021 13:45:21 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:26 UTC