Skip to content

Commit 43dad92

Browse files
committed
[css-text-4] Add the text-group-align property
This is the first step towards solving w3c#1975 r=fantasai
1 parent c71588e commit 43dad92

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

css-text-4/Overview.bs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,67 @@ Character-based Alignment in a Table Column</h3>
932932
and to the without-alignment-character intrinsic widths
933933
of the other spanned columns.</p>
934934

935+
<h3 id="text-group-align-property">
936+
Aligning a block of text within its container: the 'text-group-align' property</h3>
937+
938+
<pre class="propdef">
939+
Name: text-group-align
940+
Value: none | start | end | left | right | center
941+
Initial: none
942+
Applies to: <a>block containers</a>
943+
Inherited: no
944+
Percentages: N/A
945+
Computed value: as specified
946+
</pre>
947+
948+
This property aligns the contents of the line boxes as a group while maintaining their text alignment.
949+
950+
<dfn lt="group alignment | group-align | group-aligned">Group alignment</dfn> is performed by finding the line box with the shortest remaining space
951+
and adding that amount of space as padding to one or both sides of the line box,
952+
reducing the amount of space available for its contents;
953+
<a href="#text-align-property">text alignment</a> is then applied to its contents within the remaining space.
954+
All descendant [=in-flow=] line boxes within the same [=block formatting context=] are considered
955+
both when searching for the shortest remaining space
956+
and when adding the padding;
957+
the contents of descendants that establish [=independent formatting contexts=] are skipped.
958+
959+
Issue: A variant of this property is inherited,
960+
and applies on each block container individually,
961+
only affecting the line boxes that are direct children of that block.
962+
This is less useful, but probably easier to implement.
963+
964+
Issue: Somehow also moving the floats that originate in the same block container
965+
by the same amount
966+
would make things line up more nicely,
967+
which would be especially valuable in CJK layout.
968+
Exactly how that works, and how it interacts with intruding floats
969+
from ancestor elements is left as an exercise for the reader.
970+
971+
Values have the following meanings:
972+
973+
<dl dfn-for=text-group-align dfn-type=value>
974+
<dt><dfn>none</dfn>
975+
<dd>Text alignment happens normally: [=group alignment=] is not performed.
976+
977+
<dt><dfn>start</dfn>
978+
<dd>Inline-level content is [=group-aligned=] to the [=inline start=] side,
979+
by padding the [=inline end=] side of each line box.
980+
<dt><dfn>end</dfn>
981+
<dd>Inline-level content is [=group-aligned=] to the [=inline end=] side,
982+
by padding the [=inline start=] side of each line box.
983+
<dt><dfn>left</dfn>
984+
<dd>Inline-level content is [=group-aligned=] to the [=line-left=] side,
985+
by padding the [=line-right=] side of each line box.
986+
<dt><dfn>right</dfn>
987+
<dd>Inline-level content is [=group-aligned=] to the [=line-right=] side,
988+
by padding the [=line-left=] side of each line box.
989+
<dt><dfn>center</dfn>
990+
<dd>Inline-level content is [=group-aligned=] to the center,
991+
by padding both sides of each line box,
992+
half the spacing to each side.
993+
</dl>
994+
995+
935996

936997

937998
<h2 id="spacing">

0 commit comments

Comments
 (0)