@@ -418,7 +418,7 @@ Characters and Letters</h3>
418
418
419
419
<pre class="propdef">
420
420
Name : white-space
421
- Value : normal | pre | nowrap | pre-wrap | pre-line
421
+ Value : normal | pre | nowrap | pre-wrap | break-spaces | pre-line
422
422
Initial : normal
423
423
Applies to : <a>inline boxes</a>
424
424
Inherited : yes
@@ -456,6 +456,20 @@ Characters and Letters</h3>
456
456
<dt> <dfn>pre-wrap</dfn> </dt>
457
457
<dd> Like ''pre'' , this value preserves <a>white space</a> ;
458
458
but like ''white-space/normal'' , it allows wrapping.
459
+ <dt> <dfn>break-spaces</dfn> </dt>
460
+ <dd> The behavior is identical to that of ''white-space/pre-wrap'' ,
461
+ except that:
462
+ * Any sequence of <a>preserved</a> white space always takes up space,
463
+ including at the end of the line.
464
+ * A line breaking opportunity exists after every <a>preserved</a> <a>white space</a> character,
465
+ including between white space characters.
466
+
467
+ As preserved spaces take up space and do not hang,
468
+ they affect the box's intrinsic sizes ([=min-content size=] and [=max-content size=] ).
469
+
470
+ <p class="note"> This value does not guarantee that there will never be any overflow due to spaces:
471
+ for example, if the line length is so short that even a single space does not fit,
472
+ overflow is unavoidable.</p>
459
473
<dt> <dfn>pre-line</dfn> </dt>
460
474
<dd> Like ''white-space/normal'' , this value collapses consecutive spaces and allows wrapping,
461
475
but preserves <a>segment breaks</a> in the source as <a>forced line breaks</a> .
@@ -473,6 +487,7 @@ Characters and Letters</h3>
473
487
<th> New Lines</th>
474
488
<th> Spaces and Tabs</th>
475
489
<th> Text Wrapping</th>
490
+ <th> End-of-line spaces</th>
476
491
</tr>
477
492
</thead>
478
493
<tbody>
@@ -481,30 +496,42 @@ Characters and Letters</h3>
481
496
<td> Collapse</td>
482
497
<td> Collapse</td>
483
498
<td> Wrap</td>
499
+ <td> Remove</td>
484
500
</tr>
485
501
<tr>
486
502
<th> ''pre'' </th>
487
503
<td> Preserve</td>
488
504
<td> Preserve</td>
489
505
<td> No wrap</td>
506
+ <td> Preserve</td>
490
507
</tr>
491
508
<tr>
492
509
<th> ''nowrap'' </th>
493
510
<td> Collapse</td>
494
511
<td> Collapse</td>
495
512
<td> No wrap</td>
513
+ <td> Remove</td>
496
514
</tr>
497
515
<tr>
498
516
<th> ''pre-wrap'' </th>
499
517
<td> Preserve</td>
500
518
<td> Preserve</td>
501
519
<td> Wrap</td>
520
+ <td> Collapse or hang</td>
521
+ </tr>
522
+ <tr>
523
+ <th> ''break-spaces'' </th>
524
+ <td> Preserve</td>
525
+ <td> Preserve</td>
526
+ <td> Wrap</td>
527
+ <td> Wrap</td>
502
528
</tr>
503
529
<tr>
504
530
<th> ''pre-line'' </th>
505
531
<td> Preserve</td>
506
532
<td> Collapse</td>
507
533
<td> Wrap</td>
534
+ <td> Remove</td>
508
535
</tbody>
509
536
</table>
510
537
@@ -623,7 +650,7 @@ Characters and Letters</h3>
623
650
invisible, but retains its <a>soft wrap opportunity</a> , if any.)</li>
624
651
</ol>
625
652
</li>
626
- <li><p> If 'white-space' is set to ''pre'' or ''pre-wrap'' ,
653
+ <li><p> If 'white-space' is set to ''pre'' , ''pre-wrap'' , or ''break-spaces''
627
654
any sequence of spaces is treated as a sequence of non-breaking spaces.
628
655
However, a <a>soft wrap opportunity</a> exists at the end of the sequence.
629
656
@@ -669,7 +696,7 @@ Characters and Letters</h3>
669
696
<h4 id="line-break-transform">
670
697
Segment Break Transformation Rules</h4>
671
698
672
- <p> When 'white-space' is ''pre'' , ''pre-wrap'' , or ''pre-line'' ,
699
+ <p> When 'white-space' is ''pre'' , ''pre-wrap'' , ''break-spaces'' , or ''pre-line'' ,
673
700
<a>segment breaks</a> are not <a>collapsible</a>
674
701
and are instead transformed into a preserved line feed (U+000A).
675
702
@@ -730,19 +757,18 @@ Characters and Letters</h3>
730
757
(ignoring any intervening <a>inline box</a> boundaries)
731
758
is removed.
732
759
<li> If spaces or tabs at the end of a line are non-collapsible
733
- but have 'white-space' set to ''pre-wrap'' :
734
- <ul>
735
- <li> If 'overflow-wrap' does not specify ''overflow-wrap/break-spaces''
760
+ <ul>
761
+ <li> If 'white-space' is set to ''pre-wrap'' ,
736
762
the UA must either <a>hang</a> the <a>white space</a>
737
763
or visually collapse the character advance widths
738
764
of any overflowing spaces
739
765
such that they don't take up space in the line.
740
766
741
767
Note: Hanging the white space rather than collapsing it
742
768
allows users to see the space when selecting or editing text.
743
- <li> Otherwise
744
- (i.e. 'overflow-wrap' property specifies ''overflow-wrap/break-spaces'' ),
769
+ <li> If 'white-space' is set to ''break-spaces'' ,
745
770
hanging or collapsing the advance width of spaces at the end of the line is not allowed.
771
+ </ul>
746
772
747
773
</ol>
748
774
@@ -1215,7 +1241,7 @@ Line Breaking Details</h3>
1215
1241
1216
1242
<pre class="propdef">
1217
1243
Name : overflow-wrap, word-wrap
1218
- Value : normal | break-word || break-spaces
1244
+ Value : normal | break-word
1219
1245
Initial : normal
1220
1246
Applies to : <a>inline boxes</a>
1221
1247
Inherited : yes
@@ -1247,20 +1273,6 @@ Line Breaking Details</h3>
1247
1273
Shaping characters are still shaped as if the word were not
1248
1274
broken, and grapheme clusters must stay together as one unit.
1249
1275
No hyphenation character is inserted at the break point.
1250
- <dt> <dfn>break-spaces</dfn> </dt>
1251
- <dd> Line breaks are handled as usual,
1252
- except that:
1253
- * Any sequence of <a>preserved</a> white space always takes up space,
1254
- including at the end of the line.
1255
- * A line breaking opportunity exists after every <a>preserved</a> <a>white space</a> character,
1256
- including between white space characters.
1257
-
1258
- As preserved spaces take up space and do not hang,
1259
- they affect the box's intrinsic sizes ([=min-content size=] and [=max-content size=] ).
1260
-
1261
- <p class="note"> This value does not guarantee that there will never be any overflow due to spaces:
1262
- for example, if the line length is so short that even a single space does not fit,
1263
- overflow is unavoidable.</p>
1264
1276
1265
1277
</dl>
1266
1278
0 commit comments