Skip to content

Commit eb64ff3

Browse files
committed
[css-text-4] add preserve-auto and preserve-trim, explain the shorthand
1 parent 55bc11c commit eb64ff3

1 file changed

Lines changed: 67 additions & 1 deletion

File tree

css-text-4/Overview.bs

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ White Space Collapsing: the 'text-space-collapse' property</h3>
3636

3737
<pre class="propdef">
3838
Name: text-space-collapse
39-
Value: collapse | discard | preserve | preserve-breaks | preserve-spaces
39+
Value: collapse | discard | preserve | preserve-auto | preserve-trim | preserve-breaks | preserve-spaces
4040
Initial: collapse
4141
Applies to: all elements
4242
Inherited: yes
@@ -65,6 +65,26 @@ White Space Collapsing: the 'text-space-collapse' property</h3>
6565
from collapsing sequences of white space.
6666
<a>Segment breaks</a> are preserved as forced line breaks.
6767

68+
<dt><dfn>preserve-auto</dfn>
69+
<dd>
70+
This value preserves white space and <a>segment breaks</a> as for ''preserve''.
71+
However, the UA <em>may</em> visually collapse
72+
the advance widths of preserved white space
73+
that occur at the end of a line.
74+
75+
If 'text-wrap' is ''text-wrap/normal'' or ''text-wrap/balance'',
76+
whether or not there are soft wrap opportunities
77+
in preserved sequences of white space,
78+
and if yes where and under what condition,
79+
is UA defined.
80+
81+
<dt><dfn>preserve-trim</dfn>
82+
<dd>
83+
This value preserves white space and <a>segment breaks</a> as for ''preserve''.
84+
However, the UA <em>must</em> visually collapse to 0
85+
the advance widths of all preserved white space
86+
that occur at the end of a line.
87+
6888
<dt><dfn>preserve-breaks</dfn>
6989
<dd>
7090
This value collapses white space as for ''collapse'', but preserves
@@ -450,6 +470,52 @@ Shorthand for White Space and Wrapping: the 'white-space' property</h2>
450470
Note: This shorthand combines both inheritable and non-inheritable properties.
451471
If this is a problem, please inform the CSSWG.
452472

473+
The following table gives the mapping of the values of the shorthand to its longhands.
474+
475+
<table class="data">
476+
<colgroup class="header"></colgroup>
477+
<colgroup span=3></colgroup>
478+
<thead>
479+
<tr>
480+
<th>'white-space'
481+
<th>'text-space-collapse'
482+
<th>'text-wrap'
483+
<th>'text-space-trim'
484+
</thead>
485+
<tbody>
486+
<tr>
487+
<th>''white-space/normal''
488+
<td>''text-space-collapse/collapse''
489+
<td>''text-wrap/normal''
490+
<td>''text-space-trim/none''
491+
<tr>
492+
<th>''pre''
493+
<td>''text-space-collapse/preserve''
494+
<td>''text-wrap/nowrap''
495+
<td>''text-space-trim/none''
496+
<tr>
497+
<th>''nowrap''
498+
<td>''text-space-collapse/collapse''
499+
<td>''text-wrap/nowrap''
500+
<td>''text-space-trim/none''
501+
<tr>
502+
<th>''pre-wrap''
503+
<td>''text-space-collapse/preserve''
504+
<td>''text-wrap/normal''
505+
<td>''text-space-trim/none''
506+
<tr>
507+
<th>''pre-wrap-auto''
508+
<td>''text-space-collapse/preserve-auto''
509+
<td>''text-wrap/normal''
510+
<td>''text-space-trim/none''
511+
<tr>
512+
<th>''pre-line''
513+
<td>''text-space-collapse/preserve-breaks''
514+
<td>''text-wrap/normal''
515+
<td>''text-space-trim/none''
516+
</tbody>
517+
</table>
518+
453519
Issue: Add details from level 3
454520

455521
<h2 id="hyphenation">

0 commit comments

Comments
 (0)