3232
3333 < h1 > CSS Text Level 3</ h1 >
3434
35- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 13 January
35+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 14 January
3636 2012</ h2 >
3737
3838 < dl >
3939 < dt > This version:
4040
41- < dd > < a href ="http://dev.w3.org/csswg/css3-text/ "> $Date: 2012/01/12
42- 23:36:47 $ (CVS $Revision$)</ a > <!--
43- <dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120113 /">http://www.w3.org/TR/2012/WD-css3-text-20120113 /</a></dd>
41+ < dd > < a href ="http://dev.w3.org/csswg/css3-text/ "> $Date: 2012/01/13
42+ 02:00:08 $ (CVS $Revision$)</ a > <!--
43+ <dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120114 /">http://www.w3.org/TR/2012/WD-css3-text-20120114 /</a></dd>
4444 -->
4545
4646
@@ -226,10 +226,7 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2>
226226 Example of bidirectionality with white space collapsing</ a >
227227
228228 < li > < a href ="#line-break-transform "> < span class =secno > 3.3.2. </ span >
229- Line Feed Transformation Rules</ a >
230-
231- < li > < a href ="#white-space-summary "> < span class =secno > 3.3.3. </ span >
232- Informative Summary of White Space Collapsing Effects</ a >
229+ Line Break Transformation Rules</ a >
233230 </ ul >
234231
235232 < li > < a href ="#white-space "> < span class =secno > 3.4. </ span > White Space
@@ -670,21 +667,18 @@ <h2 id=white-space-processing><span class=secno>3. </span> White Space
670667 segments (lines) for ease of editing or adding white space characters such
671668 as tabs and spaces to indent the source code. CSS white space processing
672669 allows the author to control interpretation of such formatting: to
673- preserve or collapse it away when rendering the document.
674-
675- < p id =segment-normalization > In the document source, segments can be
676- delimited by carriage returns (U+000D), linefeeds (U+000A) or a
677- combination (U+000D U+000A), or by some other mechanism, such as the SGML
678- RECORD-START and RECORD-END tokens. If no segmentation rules are specified
679- for the document language, each line feed (U+000A), carriage return
680- (U+000D) and CRLF sequence (U+000D U+000A) in the text is considered a
681- segment break. (This default rule also applies to generated content.) In
682- CSS, each such segment break is treated as a single line feed character
683- (U+000A).
684-
685- < p > White space processing in CSS interprets white space characters only for
670+ preserve or collapse it away when rendering the document. Note that white
671+ space processing in CSS interprets white space characters only for
686672 rendering: it has no effect on the underlying document data.
687673
674+ < p id =segment-normalization > CSS does not define document segmentation
675+ rules. Segments could be separated by a particular newline seqence (such
676+ as a line feed or CRLF pair), or delimited by some other mechanism, such
677+ as the SGML RECORD-START and RECORD-END tokens. For CSS processing, each
678+ document-defined segment break, CRLF sequence (U+000D U+000A), carriage
679+ return (U+000D), and line feed (U+000A) in the text is treated as a
680+ segment break, which is then interpreted for rendering as defined below.
681+
688682 < p class =note > Note that the document parser may have not only normalized
689683 segment breaks, but also collapsed other space characters or otherwise
690684 processed white space according to markup rules. Because CSS processing
@@ -762,17 +756,32 @@ <h3 id=white-space-collapsing><span class=secno>3.1. </span> White Space
762756 class =css > preserve</ code > ’</ dfn >
763757
764758 < dd > This value prevents user agents from collapsing sequences of white
765- space. Line feeds are preserved as forced line breaks.
759+ space. Segment breaks such as line feeds and carriage returns are
760+ preserved as forced line breaks.
766761
767762 < dt > < dfn id =preserve-breaks
768763 title ="white-space:preserve-breaks "> ‘< code
769764 class =css > preserve-breaks</ code > ’</ dfn >
770765
771- < dd > This value collapses white space as for ‘< code
772- class =css > collapse</ code > ’, but preserves line feeds as forced line
773- breaks.
766+ < dd > This value collapses consecutive spaces, but renders segment breaks as
767+ forced line breaks.
774768 </ dl >
775769
770+ < p > See < a href ="#white-space-processing "> White Space Processing Rules</ a >
771+ for details on how white space collapses. An informative summary of
772+ ‘< code class =css > collapse</ code > ’ is presented below:
773+
774+ < ul >
775+ < li > A sequence of segment breaks and other white space between two
776+ Chinese, Japanese, or Yi characters collapses into nothing.
777+
778+ < li > A zero width space before or after a white space sequence containing a
779+ segment break causes the entire sequence of white space to collapse into
780+ a zero width space.
781+
782+ < li > Otherwise, consecutive white space collapses into a single space.
783+ </ ul >
784+
776785 < h3 id =tab-size > < span class =secno > 3.2. </ span > Tab Character Size: the
777786 ‘< a href ="#tab-size0 "> < code
778787 class =property > tab-size</ code > </ a > ’ property</ h3 >
@@ -828,8 +837,7 @@ <h3 id=white-space-rules><span class=secno>3.3. </span> The White Space
828837 Processing Rules</ h3 >
829838
830839 < p > White space processing affects only spaces (U+0020), tabs (U+0009), and
831- (< a href ="#segment-normalization "> post-normalization</ a > ) line feeds
832- (U+00A0).
840+ < a href ="#segment-normalization "> segment breaks</ a > .
833841
834842 < p > For each inline (including anonymous inlines) within an inline
835843 formatting context, white space characters are handled as follows,
@@ -845,21 +853,20 @@ <h3 id=white-space-rules><span class=secno>3.3. </span> The White Space
845853 performing the following steps:</ p >
846854
847855 < ol >
848- < li > All spaces and tabs immediately preceding or following a line feed
849- character are removed.
856+ < li > All spaces and tabs immediately preceding or following a segment
857+ break are removed.
850858
851- < li > If ‘< a href ="#text-space-collapse "> < code
852- class =property > text-space-collapse</ code > </ a > ’ is not
853- ‘< code class =css > preserve-breaks</ code > ’, line feed
854- characters are transformed for rendering according to the < a
855- href ="#line-break-transform "> line feed transformation rules</ a > .
859+ < li > Segment breaks are transformed for rendering according to the < a
860+ href ="#line-break-transform "> line break transformation rules</ a > .
856861
857862 < li > Every tab is converted to a space (U+0020).
858863
859864 < li > Any space immediately following another collapsible space
860- —even one outside the boundary of the inline—is removed.
861- However, if removing this space would eliminate a line breaking
862- opportunity in the text, that opportunity is still considered to exist.
865+ —even one outside the boundary of the inline containing the
866+ space, provided they are within the same inline formatting
867+ context—is removed. However, if removing this space would
868+ eliminate a line breaking opportunity in the text, that opportunity is
869+ still considered to exist.
863870 </ ol >
864871
865872 < li >
@@ -946,48 +953,40 @@ <h4 id=egbidiwscollapse><span class=secno>3.3.1. </span> Example of
946953 on implicit bidirectionality instead of explicit embedding levels.</ p >
947954 </ div >
948955
949- < h4 id =line-break-transform > < span class =secno > 3.3.2. </ span > Line Feed
956+ < h4 id =line-break-transform > < span class =secno > 3.3.2. </ span > Line Break
950957 Transformation Rules</ h4 >
951958
952- < p > When line feeds are < a href ="#collapse "> collapsible</ a > , they are either
953- transformed into a space (U+0020) or removed depending on the context
954- before and after the line break.
959+ < p > When ‘< a href ="#text-space-collapse "> < code
960+ class =property > text-space-collapse</ code > </ a > ’ is ‘< code
961+ class =css > preserve-breaks</ code > ’, segment breaks are not < a
962+ href ="#collapsible "> < i > collapsible</ i > </ a > and are transformed into a
963+ preserved line feed (U+000A).
964+
965+ < p > When segment breaks are < a href ="#collapsible "> < i > collapsible</ i > </ a > ,
966+ they are either transformed into a space (U+0020) or removed depending on
967+ the context before and after the break.
955968
956969 < p class =note > Note that the white space processing rules have already
957- removed any tabs and spaces after the line feed before these checks take
958- place.
970+ removed any tabs and spaces after the segment break before these checks
971+ take place.
959972
960973 < ul >
961- < li > If the character immediately before or immediately after the line feed
962- is the zero width space character (U+200B), then the line feed is
963- removed.
974+ < li > If the character immediately before or immediately after the segment
975+ break is the zero- width space character (U+200B), then the break is
976+ removed, leaving behind the zero-width space .
964977
965978 < li > Otherwise, if the East Asian Width property < a href ="#UAX11 "
966979 rel =biblioentry > [UAX11]<!--{{!UAX11}}--> </ a > of both the character before
967980 and after the line feed is F, W, or H (not A), and neither side is
968- Hangul, then the line feed is removed.
981+ Hangul, then the segment break is removed.
969982
970- < li > Otherwise, the line feed is converted to a space (U+0020).
983+ < li > Otherwise, the segment break is converted to a space (U+0020).
971984 </ ul >
972985
973986 < p class =issue > Comments on how well this would work in practice would be
974987 very much appreciated, particularly from people who work with Thai and
975988 similar scripts.
976989
977- < h4 id =white-space-summary > < span class =secno > 3.3.3. </ span > Informative
978- Summary of White Space Collapsing Effects</ h4 >
979-
980- < ul >
981- < li > Consecutive white space collapses into a single space.
982-
983- < li > A sequence of newlines and other white space between two Chinese,
984- Japanese, or Yi characters collapses into nothing.
985-
986- < li > A zero width space before or after a white space sequence containing a
987- newline causes the entire sequence of white space to collapse into a zero
988- width space.
989- </ ul >
990-
991990 < h3 id =white-space > < span class =secno > 3.4. </ span > White Space and Text
992991 Wrapping Shorthand: the ‘< a href ="#white-space0 "> < code
993992 class =property > white-space</ code > </ a > ’ property</ h3 >
0 commit comments