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

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>
  </div>
</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
right-aligned.

Aharon

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