Skip to content

Commit 81dbfe6

Browse files
committed
[css-text] Anchorify 'white space'. Clarify difference between document white space and CSS syntactic white space.
--HG-- extra : rebase_source : 64f701cc573065ae7d2f5e20ce15119cabcfa46f
1 parent 6b38a91 commit 81dbfe6

2 files changed

Lines changed: 64 additions & 41 deletions

File tree

css-text/Overview.bs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Languages and Typesetting</h4>
404404

405405
<p>Text transformation happens after <a href="#white-space-rules">white
406406
space processing</a>, which means that ''full-width'' only transforms
407-
U+0020 spaces to U+3000 within preserved white spaces.
407+
preserved U+0020 spaces to U+3000.
408408

409409
<p class="note">
410410
A future level of CSS may introduce the ability to create custom mapping
@@ -458,7 +458,7 @@ Languages and Typesetting</h4>
458458

459459
<p>This property specifies two things:
460460
<ul>
461-
<li>whether and how <a href="#white-space-processing">white space</a> inside the element is collapsed
461+
<li>whether and how <i>white space</i> inside the element is collapsed
462462
<li>whether lines may <i>wrap</i> at unforced <i>soft wrap opportunities</i>
463463
</ul>
464464

@@ -469,22 +469,22 @@ Languages and Typesetting</h4>
469469

470470
<dl dfn-for=white-space dfn-type=value>
471471
<dt><dfn>normal</dfn></dt>
472-
<dd>This value directs user agents to collapse sequences of white space
472+
<dd>This value directs user agents to collapse sequences of <i>white space</i>
473473
into a single character (or <a href="#line-break-transform">in some
474474
cases</a>, no character).
475475
Lines may wrap at allowed <i>soft wrap opportunities</i>,
476476
as determined by the line-breaking rules in effect,
477477
in order to minimize inline-axis overflow.
478478
<dt><dfn>pre</dfn></dt>
479-
<dd>This value prevents user agents from collapsing sequences of white space.
479+
<dd>This value prevents user agents from collapsing sequences of <i>white space</i>.
480480
<i>Segment breaks</i> such as line feeds and carriage returns are preserved as <i>forced line breaks</i>.
481481
Lines only break at <i>forced line breaks</i>;
482482
content that does not fit within the block container overflows it.
483483
<dt><dfn>nowrap</dfn>
484-
<dd>Like ''white-space/normal'', this value collapses white space;
484+
<dd>Like ''white-space/normal'', this value collapses <i>white space</i>;
485485
but like ''pre'', it does not allow wrapping.
486486
<dt><dfn>pre-wrap</dfn></dt>
487-
<dd>Like ''pre'', this value preserves white space;
487+
<dd>Like ''pre'', this value preserves <i>white space</i>;
488488
but like ''white-space/normal'', it allows wrapping.
489489
<dt><dfn>pre-line</dfn></dt>
490490
<dd>Like ''white-space/normal'', this value collapses consecutive spaces and allows wrapping,
@@ -542,12 +542,12 @@ Languages and Typesetting</h4>
542542
for details on how white space collapses. An informative summary of
543543
collapsing (''white-space/normal'' and ''nowrap'') is presented below:
544544
<ul>
545-
<li>A sequence of segment breaks and other white space between two
545+
<li>A sequence of segment breaks and other <i>white space</i> between two
546546
Chinese, Japanese, or Yi characters collapses into nothing.
547547
<li>A zero width space before or after a white space sequence
548-
containing a segment break causes the entire sequence of white space
548+
containing a segment break causes the entire sequence of <i>white space</i>
549549
to collapse into a zero width space.
550-
<li>Otherwise, consecutive white space collapses into a single space.
550+
<li>Otherwise, consecutive <i>white space</i> collapses into a single space.
551551
</ul>
552552

553553
<p>See <a href="#line-breaking">Line Breaking</a>
@@ -575,20 +575,21 @@ Languages and Typesetting</h4>
575575
<code>RECORD-START</code> and <code>RECORD-END</code> tokens.
576576
For CSS processing, each document language&ndash;defined segment break,
577577
CRLF sequence (U+000D U+000A), carriage return (U+000D), and line feed (U+000A)
578-
in the text is treated as a <dfn>segment break</dfn>,
578+
in the text is treated as a <dfn export>segment break</dfn>,
579579
which is then interpreted for rendering as specified by the 'white-space' property.
580580

581-
<p class="note">Note that the document parser may have not only normalized
582-
any segment breaks, but also collapsed other space characters or
581+
<p class="note">Note that the document parser may have
582+
not only normalized any <i>segment breaks</i>,
583+
but also collapsed other space characters or
583584
otherwise processed white space according to markup rules. Because CSS
584585
processing occurs <em>after</em> the parsing stage, it is not possible
585586
to restore these characters for styling. Therefore, some of the
586587
behavior specified below can be affected by these limitations and
587588
may be user agent dependent.</p>
588589

589590
<p class="note">Note that anonymous blocks consisting entirely of
590-
<i>collapsible</i> white space are removed from the rendering tree.
591-
Thus any such white space surrounding a block-level element is collapsed away.
591+
<i>collapsible</i> <i>white space</i> are removed from the rendering tree.
592+
Thus any such <i>white space</i> surrounding a block-level element is collapsed away.
592593
See [[CSS21]] section
593594
<a href="http://www.w3.org/TR/CSS21/visuren.html#anonymous">9.2.2.1</a></p>
594595

@@ -601,8 +602,16 @@ Languages and Typesetting</h4>
601602
<h3 id="white-space-rules">
602603
The White Space Processing Rules</h3>
603604

604-
<p>White space processing affects only spaces (U+0020), tabs (U+0009),
605-
and <a href="#segment-normalization">segment breaks</a>.
605+
<p>White space processing in CSS affects only
606+
the <dfn export title="white space|white space characters| document white space|document white space characters">document white space characters</dfn>:
607+
spaces (U+0020), tabs (U+0009), and <a href="#white-space-processing">segment breaks</a>.
608+
609+
<p class="note">
610+
Note that the set of characters considered <i>document white space</i> (part of the document content)
611+
and that considered syntactic white space (part of the CSS syntax)
612+
are not necessarily identical.
613+
However, since both include spaces (U+0020), tabs (U+0009), line feeds (U+000A), and carriage returns (U+000D)
614+
most authors won't notice any differences.
606615

607616
<h4 id="white-space-phase-1">Phase I: Collapsing and Transformation</h4>
608617

@@ -615,12 +624,12 @@ Languages and Typesetting</h4>
615624
<ul>
616625
<li id="collapse"><p>If 'white-space' is set to
617626
''white-space/normal'', ''nowrap'', or ''pre-line'',
618-
white space characters are considered <dfn>collapsible</dfn>
627+
white space characters are considered <dfn export title="collapsible white space|collapsible">collapsible</dfn>
619628
and are processed by performing the following steps:</p>
620629
<ol>
621630
<li>All spaces and tabs immediately preceding or following a segment
622631
break are removed.</li>
623-
<li>Segment breaks are transformed for
632+
<li><i>Segment breaks</i> are transformed for
624633
rendering according to the <a href="#line-break-transform">segment break transformation rules</a>.
625634
</li>
626635
<li>Every tab is converted to a space (U+0020).</li>

0 commit comments

Comments
 (0)