Skip to content

Commit

Permalink
[css-text-3][css-text-4] Compute match-parent to start on the root fo…
Browse files Browse the repository at this point in the history
…r implementation simplicity. #6542
  • Loading branch information
fantasai committed Dec 28, 2022
1 parent 906319d commit 6266d62
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions css-text-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4901,11 +4901,17 @@ Text Alignment: the 'text-align' shorthand</h3>
except that an [=inherited value=] of
''text-align/start'' or ''text-align/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
''text-align/left'' or ''text-align/right''.
Computes to ''text-align/start''
when specified on the [=root element=].
<!-- ideally it would compute against the root writing mode
and inherit as `left` or `right` for consistency in descendants,
but since this is complicated due to propagation
and match-parent has basically no real use case on root,
we're doing this instead because it's easy -->

When specified on the 'text-align' shorthand,
sets both 'text-align-all' and 'text-align-last' to ''text-align/match-parent''.

Expand Down Expand Up @@ -7909,6 +7915,9 @@ Recent Changes</h3>
and should apply any appropriate spelling changes
just as for automatic hyphenation at the same point.</ins>
</blockquote>
* Define ''text-align/match-parent'' on the [=root element=] to compute to ''text-align/start''
instead of computing against the [=principal writing mode=].
(<a href="https://github.com/w3c/csswg-drafts/issues/6542">Issue 6542</a>)

In addition there have been some minor editorial fixes.

Expand Down
10 changes: 8 additions & 2 deletions css-text-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6380,11 +6380,17 @@ Text Alignment: the 'text-align' shorthand</h3>
except that an [=inherited value=] of
''text-align/start'' or ''text-align/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
''text-align/left'' or ''text-align/right''.
Computes to ''text-align/start''
when specified on the [=root element=].
<!-- ideally it would compute against the root writing mode
and inherit as `left` or `right` for consistency in descendants,
but since this is complicated due to propagation
and match-parent has basically no real use case on root,
we're doing this instead because it's easy -->

When specified on the 'text-align' shorthand,
sets both 'text-align-all' and 'text-align-last' to ''text-align/match-parent''.

Expand Down

0 comments on commit 6266d62

Please sign in to comment.