Skip to content

Commit 06e22ba

Browse files
committed
[css-text] Make text-align shorthand of text-align-last.
1 parent 1cfa98e commit 06e22ba

2 files changed

Lines changed: 181 additions & 117 deletions

File tree

css-text/Overview.bs

Lines changed: 74 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Editor: Koji Ishii, Invited Expert, kojiishi@gluesoft.co.jp
1717
Abstract: This CSS3 module defines properties for text manipulation and specifies their processing model. It covers line breaking, justification and alignment, white space handling, and text transformation.
1818
At Risk: the ''full-width'' value of 'text-transform'
1919
At Risk: the <length> values of the 'tab-size' property
20-
At Risk: the ''start end'' value of 'text-align'
2120
At Risk: the 'text-justify' property
2221
At Risk: the percentage values of 'word-spacing'
2322
At Risk: the 'hanging-punctuation' property
@@ -1214,24 +1213,8 @@ Canonical order: N/A
12141213

12151214
<p>Alignment and justification controls how inline content is distributed within a line box.
12161215

1217-
<div class="issue">
1218-
<p>There's a proposal for 'text-align' to become a shorthand for 'text-align-last' and ''text-align-all''.
1219-
This has the advantage that 'text-align-last' can be set in a single declaration with 'text-align',
1220-
e.g. ''text-align: justify-all'' (justify align all lines) or ''text-align: justify center'' (justify all lines except center last line).
1221-
It has the disadvantage of creating the ''text-align-all'' property.
1222-
There are also some cascading considerations:
1223-
if 'text-align-last' is part of the shorthand, then any declaration of 'text-align' will reset it;
1224-
it's unclear if this is an advantage or a disadvantage.
1225-
1226-
<p>The CSSWG has no strong opinion on this issue, and solicits feedback from others.
1227-
We unfortunately can't <em>drop</em> 'text-align-last' in favor of an expanded value set in 'text-align'
1228-
because of existing content and implementations.
1229-
However, because authors have a pattern of typing 'text-align-last' after 'text-align',
1230-
we can change their interaction without breaking content.
1231-
</div>
1232-
12331216
<h3 id="text-align-property">
1234-
Text Alignment: the 'text-align' property</h3>
1217+
Text Alignment: the 'text-align' shorthand</h3>
12351218

12361219
<table class="propdef">
12371220
<tr>
@@ -1241,7 +1224,7 @@ Canonical order: N/A
12411224
<tr>
12421225
<th><a href="#values">Value</a>:
12431226
<td>start | end | left | right | center |
1244-
justify | match-parent | start end
1227+
justify | match-parent | justify-all
12451228
</td>
12461229
</tr>
12471230
<tr>
@@ -1276,7 +1259,8 @@ Canonical order: N/A
12761259
<td>N/A
12771260
</table>
12781261

1279-
<p>This property describes how the inline-level content of a block
1262+
<p>This shorthand property sets the 'text-align-all' and 'text-align-last' properties
1263+
and describes how the inline-level content of a block
12801264
is aligned along the inline axis
12811265
if the content does not completely fill the line box.
12821266
Values have the following meanings:</p>
@@ -1305,19 +1289,21 @@ Canonical order: N/A
13051289
<dt><dfn>justify</dfn></dt>
13061290
<dd>Text is justified according to the method specified by the 'text-justify' property,
13071291
in order to exactly fill the line box.
1292+
Unless otherwise specified by 'text-align-last',
1293+
the last line before a forced break or the end of the block is ''start''-aligned.
1294+
<dt><dfn>justify-all</dfn></dt>
1295+
<dd>Same as ''justify'', except 'text-align-last' is also set to ''justify'',
1296+
forcing the last line to justify as well.
13081297
<dt><dfn>match-parent</dfn></dt>
13091298
<dd>This value behaves the same as ''inherit''
13101299
(computes to its parent's computed value)
13111300
except that an inherited ''start'' or ''end'' keyword
13121301
is interpreted against its parent's 'direction' value
13131302
and results in a computed value of either 'left' or 'right'.
1314-
<dt><dfn>start end</dfn>
1315-
<dd>Specifies ''start'' alignment of the first line and any line
1316-
immediately after a <i>forced line break</i>;
1317-
and ''end'' alignment of any remaining lines.
1318-
<p class="issue">This value will be removed at the end of the LC period unless someone comes up with a more understandable keyword to replace it with.
13191303
</dl>
13201304

1305+
<p>All values except ''justify-all'' reset 'text-align-last' to ''text-align-last/auto''.
1306+
13211307
<p>A block of text is a stack of
13221308
<a href="http://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
13231309
This property specifies how the inline-level boxes within each line box
@@ -1342,6 +1328,49 @@ Canonical order: N/A
13421328
<p>See <a href="#bidi-linebox">Bidirectionality and line boxes</a>
13431329
for details on how to determine the <i>start</i> and <i>end</i> edges of a line box.
13441330

1331+
<h3 id="text-align-all-property">
1332+
Default Text Alignment: the 'text-align-all' property</h3>
1333+
1334+
<table class="propdef">
1335+
<tr>
1336+
<th>Name:
1337+
<td><dfn>text-align-all</dfn>
1338+
<tr>
1339+
<th><a href="#values">Value</a>:
1340+
<td>start | end | left | right | center |
1341+
justify | match-parent
1342+
<tr>
1343+
<th>Initial:
1344+
<td>start
1345+
<tr>
1346+
<th>Applies to:
1347+
<td>block containers
1348+
<tr>
1349+
<th>Inherited:
1350+
<td>yes
1351+
<tr>
1352+
<th>Percentages:
1353+
<td>N/A
1354+
<tr>
1355+
<th>Media:
1356+
<td>visual
1357+
<tr>
1358+
<th>Computed&#160;value:
1359+
<td>specified value
1360+
<tr>
1361+
<th>Animatable:
1362+
<td>no
1363+
<tr>
1364+
<th>Canonical order:
1365+
<td>N/A
1366+
</table>
1367+
1368+
<p>This longhand of the 'text-align' shorthand
1369+
specifies the inline alignment of all lines of inline content in the block container,
1370+
except for last lines overridden by a non-''text-align-last/auto'' value of 'text-align-last'.
1371+
See 'text-align' for a full description of values.
1372+
Authors should use the 'text-align' shorthand instead.
1373+
13451374
<h3 id="text-align-last-property">
13461375
Last Line Alignment: the 'text-align-last' property</h3>
13471376

@@ -1388,18 +1417,17 @@ Canonical order: N/A
13881417
</table>
13891418

13901419
<p>This property describes how the last line of a block or a line
1391-
right before a <i>forced line break</i> is aligned
1392-
when 'text-align' is ''justify''.
1420+
right before a <i>forced line break</i> is aligned.
13931421
If a line is also the first line of the block
13941422
or the first line after a <i>forced line break</i>,
1395-
then, unless 'text-align' assigns an explicit first line alignment (via ''start end''),
1396-
'text-align-last' takes precedence over 'text-align'.
1423+
'text-align-last' takes precedence over 'text-align-all'.
13971424

1398-
<p>If <dfn dfn-for=text-align-last dfn-type=value>auto</dfn> is specified, content on the affected line is aligned
1399-
per 'text-align' unless 'text-align' is set to ''justify''. In
1400-
this case, content is justified if 'text-justify' is ''distribute''
1425+
<p>If <dfn dfn-for=text-align-last dfn-type=value>auto</dfn> is specified,
1426+
content on the affected line is aligned per 'text-align'
1427+
unless 'text-align' is set to ''justify''.
1428+
In this case, content is justified if 'text-justify' is ''distribute''
14011429
and start-aligned otherwise.
1402-
All other values have the same meanings as in 'text-align'.</p>
1430+
All other values have the same meanings as in 'text-align'.
14031431

14041432
<h3 id="text-justify-property">
14051433
Justification Method: the 'text-justify' property</h3>
@@ -2331,13 +2359,23 @@ Acknowledgements</h2>
23312359

23322360
<h2 class="no-num" id="changes">
23332361
Changes</h2>
2362+
23342363
<h3 class="no-num" id="recent-changes">
2335-
Changes from the <a href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">November
2364+
Changes from the <a href="http://www.w3.org/TR/2013/WD-css-text-3-20131010/">October
2365+
2013 CSS3 Text <abbr title="Last Call Working Draft">LCWD</abbr></a></h3>
2366+
2367+
<ul>
2368+
<li>Made 'text-align' a shorthand of 'text-align-last' and the new 'text-align-all' property.
2369+
<li>Removed dependence of 'text-align-last' on ''text-align: justify'',
2370+
since the problem it solves is now solved by the shorthanding relationship.
2371+
</ul>
2372+
2373+
<h3 class="no-num" id="changes-2013">
2374+
Changes from the <a href="http://www.w3.org/TR/2013/WD-css-text-3-20131010/">November
23362375
2012 CSS3 Text <abbr title="Working Draft">WD</abbr></a></h3>
23372376

23382377
<p>Major changes include:
23392378
<ul>
2340-
<li>Changed 'text-align-last' to depend on ''text-align: justify''.
23412379
<li>Removed ''inter-ideograph'', ''inter-cluster'', and ''kashida'' values of 'text-justify'.
23422380
<li>Changed ''text-justify: inter-word'' to prohibit justification between letters.
23432381
<li>Dropped minimum and maximum values in 'letter-spacing' and 'word-spacing'.
@@ -2356,7 +2394,7 @@ Changes</h2>
23562394

23572395
<p>Significant details updated:
23582396
<ul>
2359-
<li>Clarified ''start end'' and ''match-parent'' value of 'text-align'.
2397+
<li>Clarified ''match-parent'' value of 'text-align'.
23602398
<li>Clarified ''text-justify::none'' value of 'text-justify'.
23612399
<li>Clarified <a href="#expanding-text">expanding and compressing text</a> for 'text-justify'.
23622400
<li>Clarified the behavior of 'letter-spacing'.

0 commit comments

Comments
 (0)