- From: Elika Etemad via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 14 Jan 2012 00:51:27 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-text In directory hutz:/tmp/cvs-serv24666 Modified Files: Overview.html Overview.src.html Log Message: Rewrite white space chapter using a unified concept of 'segment break'. Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-text/Overview.html,v retrieving revision 1.210 retrieving revision 1.211 diff -u -d -r1.210 -r1.211 --- Overview.html 13 Jan 2012 02:00:08 -0000 1.210 +++ Overview.html 14 Jan 2012 00:51:25 -0000 1.211 @@ -32,15 +32,15 @@ <h1>CSS Text Level 3</h1> - <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 13 January + <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 14 January 2012</h2> <dl> <dt>This version: - <dd><a href="http://dev.w3.org/csswg/css3-text/">$Date: 2012/01/12 - 23:36:47 $ (CVS $Revision$)</a> <!-- - <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> + <dd><a href="http://dev.w3.org/csswg/css3-text/">$Date: 2012/01/13 + 02:00:08 $ (CVS $Revision$)</a> <!-- + <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> --> @@ -226,10 +226,7 @@ Example of bidirectionality with white space collapsing</a> <li><a href="#line-break-transform"><span class=secno>3.3.2. </span> - Line Feed Transformation Rules</a> - - <li><a href="#white-space-summary"><span class=secno>3.3.3. </span> - Informative Summary of White Space Collapsing Effects</a> + Line Break Transformation Rules</a> </ul> <li><a href="#white-space"><span class=secno>3.4. </span> White Space @@ -670,21 +667,18 @@ segments (lines) for ease of editing or adding white space characters such as tabs and spaces to indent the source code. CSS white space processing allows the author to control interpretation of such formatting: to - preserve or collapse it away when rendering the document. - - <p id=segment-normalization> In the document source, segments can be - delimited by carriage returns (U+000D), linefeeds (U+000A) or a - combination (U+000D U+000A), or by some other mechanism, such as the SGML - RECORD-START and RECORD-END tokens. If no segmentation rules are specified - for the document language, each line feed (U+000A), carriage return - (U+000D) and CRLF sequence (U+000D U+000A) in the text is considered a - segment break. (This default rule also applies to generated content.) In - CSS, each such segment break is treated as a single line feed character - (U+000A). - - <p>White space processing in CSS interprets white space characters only for + preserve or collapse it away when rendering the document. Note that white + space processing in CSS interprets white space characters only for rendering: it has no effect on the underlying document data. + <p id=segment-normalization> CSS does not define document segmentation + rules. Segments could be separated by a particular newline seqence (such + as a line feed or CRLF pair), or delimited by some other mechanism, such + as the SGML RECORD-START and RECORD-END tokens. For CSS processing, each + document-defined segment break, CRLF sequence (U+000D U+000A), carriage + return (U+000D), and line feed (U+000A) in the text is treated as a + segment break, which is then interpreted for rendering as defined below. + <p class=note>Note that the document parser may have not only normalized segment breaks, but also collapsed other space characters or otherwise processed white space according to markup rules. Because CSS processing @@ -762,17 +756,32 @@ class=css>preserve</code>’</dfn> <dd>This value prevents user agents from collapsing sequences of white - space. Line feeds are preserved as forced line breaks. + space. Segment breaks such as line feeds and carriage returns are + preserved as forced line breaks. <dt><dfn id=preserve-breaks title="white-space:preserve-breaks">‘<code class=css>preserve-breaks</code>’</dfn> - <dd>This value collapses white space as for ‘<code - class=css>collapse</code>’, but preserves line feeds as forced line - breaks. + <dd>This value collapses consecutive spaces, but renders segment breaks as + forced line breaks. </dl> + <p>See <a href="#white-space-processing">White Space Processing Rules</a> + for details on how white space collapses. An informative summary of + ‘<code class=css>collapse</code>’ is presented below: + + <ul> + <li>A sequence of segment breaks and other white space between two + Chinese, Japanese, or Yi characters collapses into nothing. + + <li>A zero width space before or after a white space sequence containing a + segment break causes the entire sequence of white space to collapse into + a zero width space. + + <li>Otherwise, consecutive white space collapses into a single space. + </ul> + <h3 id=tab-size><span class=secno>3.2. </span> Tab Character Size: the ‘<a href="#tab-size0"><code class=property>tab-size</code></a>’ property</h3> @@ -828,8 +837,7 @@ Processing Rules</h3> <p>White space processing affects only spaces (U+0020), tabs (U+0009), and - (<a href="#segment-normalization">post-normalization</a>) line feeds - (U+00A0). + <a href="#segment-normalization">segment breaks</a>. <p>For each inline (including anonymous inlines) within an inline formatting context, white space characters are handled as follows, @@ -845,21 +853,20 @@ performing the following steps:</p> <ol> - <li>All spaces and tabs immediately preceding or following a line feed - character are removed. + <li>All spaces and tabs immediately preceding or following a segment + break are removed. - <li>If ‘<a href="#text-space-collapse"><code - class=property>text-space-collapse</code></a>’ is not - ‘<code class=css>preserve-breaks</code>’, line feed - characters are transformed for rendering according to the <a - href="#line-break-transform">line feed transformation rules</a>. + <li>Segment breaks are transformed for rendering according to the <a + href="#line-break-transform">line break transformation rules</a>. <li>Every tab is converted to a space (U+0020). <li>Any space immediately following another collapsible space - —even one outside the boundary of the inline—is removed. - However, if removing this space would eliminate a line breaking - opportunity in the text, that opportunity is still considered to exist. + —even one outside the boundary of the inline containing the + space, provided they are within the same inline formatting + context—is removed. However, if removing this space would + eliminate a line breaking opportunity in the text, that opportunity is + still considered to exist. </ol> <li> @@ -946,48 +953,40 @@ on implicit bidirectionality instead of explicit embedding levels.</p> </div> - <h4 id=line-break-transform><span class=secno>3.3.2. </span> Line Feed + <h4 id=line-break-transform><span class=secno>3.3.2. </span> Line Break Transformation Rules</h4> - <p>When line feeds are <a href="#collapse">collapsible</a>, they are either - transformed into a space (U+0020) or removed depending on the context - before and after the line break. + <p>When ‘<a href="#text-space-collapse"><code + class=property>text-space-collapse</code></a>’ is ‘<code + class=css>preserve-breaks</code>’, segment breaks are not <a + href="#collapsible"><i>collapsible</i></a> and are transformed into a + preserved line feed (U+000A). + + <p>When segment breaks are <a href="#collapsible"><i>collapsible</i></a>, + they are either transformed into a space (U+0020) or removed depending on + the context before and after the break. <p class=note>Note that the white space processing rules have already - removed any tabs and spaces after the line feed before these checks take - place. + removed any tabs and spaces after the segment break before these checks + take place. <ul> - <li>If the character immediately before or immediately after the line feed - is the zero width space character (U+200B), then the line feed is - removed. + <li>If the character immediately before or immediately after the segment + break is the zero-width space character (U+200B), then the break is + removed, leaving behind the zero-width space. <li>Otherwise, if the East Asian Width property <a href="#UAX11" rel=biblioentry>[UAX11]<!--{{!UAX11}}--></a> of both the character before and after the line feed is F, W, or H (not A), and neither side is - Hangul, then the line feed is removed. + Hangul, then the segment break is removed. - <li>Otherwise, the line feed is converted to a space (U+0020). + <li>Otherwise, the segment break is converted to a space (U+0020). </ul> <p class=issue>Comments on how well this would work in practice would be very much appreciated, particularly from people who work with Thai and similar scripts. - <h4 id=white-space-summary><span class=secno>3.3.3. </span> Informative - Summary of White Space Collapsing Effects</h4> - - <ul> - <li>Consecutive white space collapses into a single space. - - <li>A sequence of newlines and other white space between two Chinese, - Japanese, or Yi characters collapses into nothing. - - <li>A zero width space before or after a white space sequence containing a - newline causes the entire sequence of white space to collapse into a zero - width space. - </ul> - <h3 id=white-space><span class=secno>3.4. </span> White Space and Text Wrapping Shorthand: the ‘<a href="#white-space0"><code class=property>white-space</code></a>’ property</h3> Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-text/Overview.src.html,v retrieving revision 1.309 retrieving revision 1.310 diff -u -d -r1.309 -r1.310 --- Overview.src.html 13 Jan 2012 02:00:08 -0000 1.309 +++ Overview.src.html 14 Jan 2012 00:51:25 -0000 1.310 @@ -353,24 +353,19 @@ white space characters such as tabs and spaces to indent the source code. CSS white space processing allows the author to control interpretation of such formatting: to preserve or - collapse it away when rendering the document. + collapse it away when rendering the document. Note that white + space processing in CSS interprets white space characters only + for rendering: it has no effect on the underlying document data. <p id="segment-normalization"> - In the document source, segments can be delimited by carriage - returns (U+000D), linefeeds (U+000A) or a combination (U+000D U+000A), - or by some other mechanism, such as the SGML RECORD-START - and RECORD-END tokens. - - If no segmentation rules are specified for the document language, - each line feed (U+000A), carriage return (U+000D) and CRLF sequence - (U+000D U+000A) in the text is considered a segment break. (This - default rule also applies to generated content.) - - In CSS, each such segment break is treated as a single line feed - character (U+000A). - - <p>White space processing in CSS interprets white space characters - only for rendering: it has no effect on the underlying document data. + CSS does not define document segmentation rules. Segments could be + separated by a particular newline seqence (such as a line feed or + CRLF pair), or delimited by some other mechanism, such as the SGML + RECORD-START and RECORD-END tokens. + For CSS processing, each document-defined segment break, CRLF sequence + (U+000D U+000A), carriage return (U+000D), and line feed (U+000A) + in the text is treated as a segment break, which is then interpreted + for rendering as defined below. <p class="note">Note that the document parser may have not only normalized segment breaks, but also collapsed other space characters or @@ -437,12 +432,26 @@ cases</a>, no character).</dd> <dt><dfn title="white-space:preserve">''preserve''</dfn></dt> <dd>This value prevents user agents from collapsing sequences - of white space. Line feeds are preserved as forced line breaks.</dd> + of white space. Segment breaks such as line feeds and carriage returns + are preserved as forced line breaks.</dd> <dt><dfn title="white-space:preserve-breaks">''preserve-breaks''</dfn></dt> - <dd>This value collapses white space as for ''collapse'', but preserves - line feeds as forced line breaks.</dd> + <dd>This value collapses consecutive spaces, but renders segment + breaks as forced line breaks.</dd> </dl> + <p>See <a href="#white-space-processing">White Space Processing Rules</a> + for details on how white space collapses. An informative summary of + ''collapse'' is presented below: + <ul> + <li>A sequence of segment breaks and other white space between two + Chinese, Japanese, or Yi characters collapses into nothing. + <li>A zero width space before or after a white space sequence + containing a segment break causes the entire sequence of white space + to collapse into a zero width space. + <li>Otherwise, consecutive white space collapses into a single space. + </ul> + + <h3 id="tab-size"> Tab Character Size: the 'tab-size' property</h3> @@ -491,8 +500,7 @@ The White Space Processing Rules</h3> <p>White space processing affects only spaces (U+0020), tabs (U+0009), - and (<a href="#segment-normalization">post-normalization</a>) - line feeds (U+00A0). + and <a href="#segment-normalization">segment breaks</a>. <p>For each inline (including anonymous inlines) within an inline formatting context, white space characters are handled as follows, @@ -504,17 +512,17 @@ are considered <dfn>collapsible</dfn> and are processed by performing the following steps:</p> <ol> - <li>All spaces and tabs immediately preceding or following a line - feed character are removed.</li> - <li>If 'text-space-collapse' is not - ''preserve-breaks'', line feed characters are transformed for + <li>All spaces and tabs immediately preceding or following a segment + break are removed.</li> + <li>Segment breaks are transformed for rendering according to the <a href="#line-break-transform">line - feed transformation rules</a>. + break transformation rules</a>. </li> <li>Every tab is converted to a space (U+0020).</li> <li>Any space immediately following another collapsible space - —even one outside the boundary of the inline—is - removed. + —even one outside the boundary of the inline containing + the space, provided they are within the same inline formatting + context—is removed. However, if removing this space would eliminate a line breaking opportunity in the text, that opportunity is still considered to exist.</li> @@ -587,43 +595,34 @@ </div> <h4 id="line-break-transform"> - Line Feed Transformation Rules</h4> + Line Break Transformation Rules</h4> - <p>When line feeds are <a href="#collapse">collapsible</a>, they are + <p>When 'text-space-collapse' is ''preserve-breaks'', segment breaks are + not <i>collapsible</i> and are transformed into a preserved line feed + (U+000A). + + <p>When segment breaks are <i>collapsible</i>, they are either transformed into a space (U+0020) or removed depending on the - context before and after the line break.</p> + context before and after the break.</p> <p class="note">Note that the white space processing rules have already - removed any tabs and spaces after the line feed before these checks + removed any tabs and spaces after the segment break before these checks take place.</p> <ul> - <li>If the character immediately before or immediately after the line - feed is the zero width space character (U+200B), then the line feed - is removed. + <li>If the character immediately before or immediately after the segment + break is the zero-width space character (U+200B), then the break + is removed, leaving behind the zero-width space. <li>Otherwise, if the East Asian Width property [[!UAX11]] of both the character before and after the line feed is F, W, or H (not A), - and neither side is Hangul, - then the line feed is removed. - <li>Otherwise, the line feed is converted to a space (U+0020). + and neither side is Hangul, then the segment break is removed. + <li>Otherwise, the segment break is converted to a space (U+0020). </ul> <p class="issue">Comments on how well this would work in practice would be very much appreciated, particularly from people who work with Thai and similar scripts.</p> - <h4 id="white-space-summary"> - Informative Summary of White Space Collapsing Effects</h4> - - <ul> - <li>Consecutive white space collapses into a single space. - <li>A sequence of newlines and other white space between two - Chinese, Japanese, or Yi characters collapses into nothing. - <li>A zero width space before or after a white space sequence - containing a newline causes the entire sequence of white space - to collapse into a zero width space. - </ul> - <h3 id="white-space"> White Space and Text Wrapping Shorthand: the 'white-space' property</h3>
Received on Saturday, 14 January 2012 00:51:34 UTC