Skip to content

Commit dbd77ff

Browse files
committed
Add consume-before and consume-after to white-space-collapsing, clarify that white space processing happens within a single inline formatting context
1 parent 1f0dc09 commit dbd77ff

2 files changed

Lines changed: 48 additions & 12 deletions

File tree

css3-text/Overview.html

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@
8383

8484
<h1>CSS Text Level 3</h1>
8585

86-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 7 March 2011</h2>
86+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 9 March 2011</h2>
8787

8888
<dl>
8989
<dt>This version:
9090

9191
<dd><a href="http://dev.w3.org/csswg/css3-text/Overview.html">$Date:
92-
2011/03/03 09:12:56 $ (CVS $Revision$)</a> <!--
93-
<dd><a href="http://www.w3.org/TR/2011/WD-css3-text-20110307/">http://www.w3.org/TR/2011/WD-css3-text-20110307/</a></dd>
92+
2011/03/07 17:16:19 $ (CVS $Revision$)</a> <!--
93+
<dd><a href="http://www.w3.org/TR/2011/WD-css3-text-20110309/">http://www.w3.org/TR/2011/WD-css3-text-20110309/</a></dd>
9494
-->
9595

9696

@@ -788,7 +788,8 @@ <h3 id=white-space-collapsing><span class=secno>4.1. </span> White Space
788788
<tr>
789789
<th>Value:
790790

791-
<td>collapse | discard | [ [preserve | preserve-breaks] && trim-inner ]
791+
<td>collapse | discard | [ [preserve | preserve-breaks] && [ trim-inner
792+
|| consume-before || consume-after ]
792793

793794
<tr>
794795
<th>Initial:
@@ -866,6 +867,18 @@ <h3 id=white-space-collapsing><span class=secno>4.1. </span> White Space
866867
non-white-space character in the block as well as to discard all white
867868
space at the end of a block starting with the first line feed after the
868869
last non-white-space character in the block.
870+
871+
<dt><dfn id=consume-before
872+
title="white-space-collapsing:consume-before"><code>consume-before</code></dfn>
873+
874+
<dd>This value directs the UA to collapse all collapsible whitespace
875+
immediately before the start of the element.
876+
877+
<dt><dfn id=consume-after
878+
title="white-space-collapsing:consume-after"><code>consume-after</code></dfn>
879+
880+
<dd>This value directs the UA to collapse all collapsible whitespace
881+
immediately after the end of the element.
869882
</dl>
870883

871884
<h3 id=tab-size><span class=secno>4.2. </span> Tab Character Size: the
@@ -922,9 +935,9 @@ <h3 id=tab-size><span class=secno>4.2. </span> Tab Character Size: the
922935
<h3 id=white-space-rules><span class=secno>4.3. </span> The White Space
923936
Processing Rules</h3>
924937

925-
<p>For each inline (including anonymous inlines), white space characters
926-
are handled as follows, ignoring bidi formatting characters as if they
927-
were not there:
938+
<p>For each inline (including anonymous inlines) within an inline
939+
formatting context, white space characters are handled as follows,
940+
ignoring bidi formatting characters as if they were not there:
928941

929942
<ul>
930943
<li id=collapse>
@@ -953,6 +966,12 @@ <h3 id=white-space-rules><span class=secno>4.3. </span> The White Space
953966
(U+0020)&mdash;even a space before the inline&mdash;is removed.
954967
However, if removing this space would eliminate a line breaking
955968
opportunity in the text, that opportunity is still considered to exist.
969+
970+
<li>A collapsible space before the start of an element with &lsquo;<code
971+
class=css>consume-before</code>&rsquo; is removed.
972+
973+
<li>A collapsible space after the end of an element with &lsquo;<code
974+
class=css>consume-after</code>&rsquo; is removed.
956975
</ol>
957976

958977
<li>
@@ -6240,7 +6259,8 @@ <h2 class=no-num id=appendix-b-property-index> Appendix B: Property index</h2>
62406259
<td><a class=property
62416260
href="#white-space-collapsing0">white-space-collapsing</a>
62426261

6243-
<td>collapse | discard | [ [preserve | preserve-breaks] && trim-inner ]
6262+
<td>collapse | discard | [ [preserve | preserve-breaks] && [ trim-inner
6263+
|| consume-before || consume-after ]
62446264

62456265
<td>collapse
62466266

@@ -6743,6 +6763,12 @@ <h2 class=no-num id=index>Index</h2>
67436763
<li>white-space-collapsing:collapse, <a href="#collapse0"
67446764
title="white-space-collapsing:collapse"><strong>4.1.</strong></a>
67456765

6766+
<li>white-space-collapsing:consume-after, <a href="#consume-after"
6767+
title="white-space-collapsing:consume-after"><strong>4.1.</strong></a>
6768+
6769+
<li>white-space-collapsing:consume-before, <a href="#consume-before"
6770+
title="white-space-collapsing:consume-before"><strong>4.1.</strong></a>
6771+
67466772
<li>white-space-collapsing:discard, <a href="#discard"
67476773
title="white-space-collapsing:discard"><strong>4.1.</strong></a>
67486774

css3-text/Overview.src.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ <h3 id="white-space-collapsing">
459459
</tr>
460460
<tr>
461461
<th>Value:</th>
462-
<td>collapse | discard | [ [preserve | preserve-breaks] && trim-inner ]</td>
462+
<td>collapse | discard | [ [preserve | preserve-breaks] && [ trim-inner || consume-before || consume-after ]</td>
463463
</tr>
464464
<tr>
465465
<th>Initial:</th>
@@ -516,6 +516,12 @@ <h3 id="white-space-collapsing">
516516
non-white-space character in the block as well as to discard all white
517517
space at the end of a block starting with the first line feed after
518518
the last non-white-space character in the block.</dd>
519+
<dt><dfn title="white-space-collapsing:consume-before"><code>consume-before</code></dfn></dt>
520+
<dd>This value directs the UA to collapse all collapsible whitespace
521+
immediately before the start of the element.
522+
<dt><dfn title="white-space-collapsing:consume-after"><code>consume-after</code></dfn></dt>
523+
<dd>This value directs the UA to collapse all collapsible whitespace
524+
immediately after the end of the element.
519525
</dl>
520526

521527
<h3 id="tab-size">
@@ -565,9 +571,9 @@ <h3 id="tab-size">
565571
<h3 id="white-space-rules">
566572
The White Space Processing Rules</h3>
567573

568-
<p>For each inline (including anonymous inlines), white space
569-
characters are handled as follows, ignoring bidi formatting
570-
characters as if they were not there:</p>
574+
<p>For each inline (including anonymous inlines) within an inline
575+
formatting context, white space characters are handled as follows,
576+
ignoring bidi formatting characters as if they were not there:</p>
571577

572578
<ul>
573579
<li id="collapse"><p>If <span class="property">'white-space-collapsing'</span>
@@ -588,6 +594,10 @@ <h3 id="white-space-rules">
588594
However, if removing this space would eliminate a line breaking
589595
opportunity in the text, that opportunity is still considered
590596
to exist.</li>
597+
<li>A collapsible space before the start of an element with
598+
''consume-before'' is removed.
599+
<li>A collapsible space after the end of an element with
600+
''consume-after'' is removed.
591601
</ol>
592602
</li>
593603
<li><p>If <span class="property">'white-space-collapsing'</span> is set to

0 commit comments

Comments
 (0)