W3C home > Mailing lists > Public > www-style@w3.org > November 2012

[css-text] clarification may be needed for text-align:match-parent

From: Aharon (Vladimir) Lanin <aharon@google.com>
Date: Tue, 27 Nov 2012 11:43:18 +0200
Message-ID: <CA+FsOYaMRThdx54KoDH7c=sr+YkeSqcHT_DVNPxkcL9P_xrL5w@mail.gmail.com>
To: W3C style mailing list <www-style@w3.org>
http://dev.w3.org/csswg/css3-text/#text-align currently defines
text-align:match-parent as follows:

This value behaves the same as ‘inherit’ except that an inherited ‘start’
> or ‘end’ keyword is calculated against its parent's ‘direction’ value and
> results in a computed value of either ‘left’ or ‘right’.

There is also a note on text-align's computed value generally:

Computed value: specified value, except for ‘match-parent’ (see prose)

Simon Montagu and I think that the definition above may need to be
clarified to the effect that the text-align value inherited *from* an
element with text-align:match-parent is its computed text-align value, and
thus is never 'match-parent' (or 'start' or 'end'). Here is an example
where this is crucial:

<div id="div1" style="text-align:start" dir="ltr>
  <div id="div2" style="text-align:match-parent" dir="rtl>
    <div id="div3"></div>

The intent behind match-parent is that both div2 and div3 be left-aligned.
The definition as it currently stands makes that quite clear for div2, but
is quite unclear re div3, where it can be misinterpreted to mean that
text-align inherits 'match-parent', goes up the tree to find the 'start'
and then references off the parent, div2, which is RTL, and thus winds up

Received on Tuesday, 27 November 2012 09:44:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:06 UTC