Skip to content

Commit 5f3dc4b

Browse files
committed
[css-text] Change the definition of pre-wrap
Based on a resolution from the 2015 New York face to face, this makes sure that white spaces that fall at the end of the line are preserved and allowed to wrap.
1 parent 09aeff6 commit 5f3dc4b

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

css-text/Overview.bs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,13 @@ Languages and Typesetting</h4>
648648
invisible, but retains its <a>soft wrap opportunity</a>, if any.)</li>
649649
</ol>
650650
</li>
651-
<li><p>If 'white-space' is set to ''pre-wrap'', any sequence of
652-
spaces is treated as a sequence of non-breaking spaces. However,
653-
a <a>soft wrap opportunity</a> exists at the end of the sequence.</p></li>
651+
<li><p>If 'white-space' is set to ''pre-wrap'',
652+
any sequence of spaces is preserved.
653+
This is achieved by treating it as a sequence of non-breaking spaces,
654+
except that a <a>soft wrap opportunity</a> exists
655+
between each of the spaces of this preserved sequence,
656+
as well as at the beginning
657+
and at the end of the sequence.</p></li>
654658
</ul>
655659

656660
<p>Then, the entire block is rendered. Inlines are laid out, taking bidi
@@ -735,9 +739,6 @@ Languages and Typesetting</h4>
735739
from the block's starting content edge.
736740
The tab size is given by the 'tab-size' property.
737741
<li>A sequence of <a>collapsible</a> spaces at the end of a line is removed.
738-
<li>If spaces or tabs at the end of a line are non-collapsible but
739-
have 'white-space' set to ''pre-wrap'' the UA may visually
740-
collapse their character advance widths.
741742
</ol>
742743

743744
<p>White space that was not removed or collapsed during the white space

css-text/Overview.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,13 @@ <h4 class="heading settled" data-level="4.1.1" id="white-space-phase-1"><span cl
12711271

12721272

12731273
<li>
1274-
<p>If <a class="property" data-link-type="propdesc" href="#propdef-white-space">white-space</a> is set to <a class="css" data-link-type="maybe" href="#valdef-white-space-pre-wrap">pre-wrap</a>, any sequence of
1275-
spaces is treated as a sequence of non-breaking spaces. However,
1276-
a <a data-link-type="dfn" href="#soft-wrap-opportunity">soft wrap opportunity</a> exists at the end of the sequence.</p>
1274+
<p>If <a class="property" data-link-type="propdesc" href="#propdef-white-space">white-space</a> is set to <a class="css" data-link-type="maybe" href="#valdef-white-space-pre-wrap">pre-wrap</a>,
1275+
any sequence of spaces is preserved.
1276+
This is achieved by treating it as a sequence of non-breaking spaces,
1277+
except that a <a data-link-type="dfn" href="#soft-wrap-opportunity">soft wrap opportunity</a> exists
1278+
between each of the spaces of this preserved sequence,
1279+
as well as at the beginning
1280+
and at the end of the sequence.</p>
12771281

12781282

12791283
</ul>
@@ -1402,10 +1406,6 @@ <h4 class="heading settled" data-level="4.1.3" id="white-space-phase-2"><span cl
14021406
The tab size is given by the <a class="property" data-link-type="propdesc" href="#propdef-tab-size">tab-size</a> property.
14031407

14041408
<li>A sequence of <a data-link-type="dfn" href="#collapsible-white-space">collapsible</a> spaces at the end of a line is removed.
1405-
1406-
<li>If spaces or tabs at the end of a line are non-collapsible but
1407-
have <a class="property" data-link-type="propdesc" href="#propdef-white-space">white-space</a> set to <a class="css" data-link-type="maybe" href="#valdef-white-space-pre-wrap">pre-wrap</a> the UA may visually
1408-
collapse their character advance widths.
14091409

14101410
</ol>
14111411

0 commit comments

Comments
 (0)