Skip to content

Commit 9de1bf2

Browse files
committed
[css-ruby] Clean up white space collapsing section to mesh with recent changes to box-fixup. Pass I
1 parent 14be9db commit 9de1bf2

2 files changed

Lines changed: 57 additions & 68 deletions

File tree

css-ruby/Overview.html

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>CSS Ruby Layout Module Level 1</h1>
5656
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
57-
<span class=dt-updated><span class=value-title title=20140707>7 July 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140711>11 July 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl>
5959
<dt>This version:
6060
<dd><a class=u-url href=http://dev.w3.org/csswg/css-ruby-1/>http://dev.w3.org/csswg/css-ruby-1/</a>
@@ -713,33 +713,52 @@ <h3 class="heading settled heading" data-level=2.4 id=autohide><span class=secno
713713
<h3 class="heading settled heading" data-level=2.5 id=white-space><span class=secno>2.5 </span><span class=content>
714714
White Space Collapsing</span><a class=self-link href=#white-space></a></h3>
715715

716-
<p><i data-link-type=dfn title="collapsible white space">Collapsible white space</i> within a ruby structure is discarded
716+
<p>White space within a ruby structure is <a href=#anon-gen-discard-space>discarded</a>
717717
<ul>
718718
<li>at the beginning and end of a <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>, <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>, or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>,
719-
<li>at the beginning/end of a <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation box">ruby annotation box</a> or <a data-link-type=dfn href=#ruby-base-box title="ruby base box">ruby base box</a> if white space is not its only contents,
720719
<li>between a <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a> and its following <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>,
721720
<li>between <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation containers">ruby annotation containers</a>.
722721
</ul>
723722

724723
<p>Between <a data-link-type=dfn href=#ruby-segments title="ruby segments">ruby segments</a>, between <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a>, and between <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a>, however,
725-
white space is not discarded.
724+
white space is not discarded,
725+
and is maintained for rendering
726+
as <a data-link-type=dfn href=#inter-base-white-space title="inter-base white space">inter-base</a>,
727+
<a data-link-type=dfn href=#inter-annotation-white-space title="inter-annotation white space">inter-annotation</a>,
728+
or <a data-link-type=dfn href=#inter-segment-white-space title="inter-segment white space">inter-segment white space</a>.
729+
(See <a href=#box-fixup>Anonymous Ruby Box Generation</a>, above.)
730+
731+
<div class=example>
732+
<p>These rules allow ruby to be used with space-separated scripts such as Latin.
733+
For example,
734+
<pre>&lt;ruby&gt;
735+
&lt;rb&gt;W&lt;/rb&gt;&lt;rb&gt;W&lt;/rb&gt;&lt;rb&gt;W&lt;/rb&gt;
736+
&lt;rt&gt;World&lt;/rt&gt; &lt;rt&gt;Wide&lt;/rt&gt; &lt;rt&gt;Web&lt;/rt&gt;
737+
&lt;/ruby&gt;</pre>
738+
<p>They also ensure that annotated white space is preserved. For example,
739+
<pre>&lt;ruby&gt;
740+
&lt;rb&gt;Aerith&lt;/rb&gt;&lt;rb&gt; &lt;/rb&gt;&lt;rb&gt;Gainsboro&lt;/rb&gt;
741+
&lt;rt&gt;エアリス&lt;/rt&gt;&lt;rt&gt;・&lt;/rt&gt;&lt;rt&gt;ゲインズブール&lt;/rt&gt;
742+
&lt;/ruby&gt;</pre>
743+
</div>
726744

727745
<p>Where undiscarded white space is <i data-link-type=dfn title=collapsible>collapsible</i>, it will collapse
728746
following the standard <a href=http://www.w3.org/TR/css3-text/#white-space-rules>white space processing rules</a>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3text title=biblio-css3text>[CSS3TEXT]</a>
729-
For <i data-link-type=dfn title=collapsible>collapsible</i> white space between <a data-link-type=dfn href=#ruby-segments title="ruby segments">ruby segments</a>, however,
747+
For <i data-link-type=dfn title="collapsible white space">collapsible white space</i> between <a data-link-type=dfn href=#ruby-segments title="ruby segments">ruby segments</a> (<a data-link-type=dfn href=#inter-segment-white-space title="inter-segment white space">inter-segment white space</a>), however,
730748
the contextual text for determining collapsing behavior is given by the <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a> on either side,
731-
not the text on either side of the white space in the source document.
749+
not the text on either side of the white space in source document order.
732750

733751
<div class=note>
734752
<p>Note that the white space processing rules
735753
cause a white space sequence containing a <i data-link-type=dfn title="segment break">segment break</i> (such as a line feed)
736-
to <a href=http://www.w3.org/TR/css3-text/#line-break-transform>collapse to nothing</a> between CJK characters.
737-
This means that CJK ruby can safely use white space for indentation of the ruby markup.
754+
to <a href=http://www.w3.org/TR/css3-text/#line-break-transform>collapse to nothing</a> between Han and Kana characters.
755+
This means that Chinese and Japanese ruby can safely use white space for indentation of the ruby markup.
738756
For example, the following markup will display without any spaces:
739757
<pre>&lt;ruby&gt;
740758
&lt;rb&gt;東&lt;/rb&gt;&lt;rb&gt;京&lt;/rb&gt;
741759
&lt;rt&gt;とう&lt;/rt&gt;&lt;rt&gt;きょう&lt;/rt&gt;
742760
&lt;/ruby&gt;</pre>
761+
<p class=issue id=issue-6f614186><a class=self-link href=#issue-6f614186></a>This example actually doesn’t trigger the rule in question. Come up with one that does.
743762
<p>However, white space that does not contain a <i data-link-type=dfn title="segment break">segment break</i> does not collapse completely away,
744763
so this markup will display with a space between the first and second ruby pairs:
745764
<pre>&lt;ruby&gt;
@@ -748,30 +767,6 @@ <h3 class="heading settled heading" data-level=2.5 id=white-space><span class=se
748767
&lt;/ruby&gt;</pre>
749768
</div>
750769

751-
<p>Any preserved white space is then wrapped in an anonymous box belonging to
752-
the <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a> (if between <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a>),
753-
<a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a> (if between <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a>),
754-
or <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a> (if between <a data-link-type=dfn href=#ruby-segments title="ruby segments">ruby segments</a>).
755-
In the latter case, the text is considered part of the <a data-link-type=dfn href=#base-level title="base level">base level</a>.
756-
Such anonymous boxes do not take part in pairing.
757-
They merely ensure separation between adjacent bases/annotations.
758-
759-
<p class=issue id=issue-1851041e><a class=self-link href=#issue-1851041e></a>Specify how these anonymous white space boxes impact layout.
760-
761-
<div class=example>
762-
<p>These rules allow ruby to be used with space-separated scripts such as Latin.
763-
For example,
764-
<pre>&lt;ruby&gt;
765-
&lt;rb&gt;W&lt;/rb&gt;&lt;rb&gt;W&lt;/rb&gt;&lt;rb&gt;W&lt;/rb&gt;
766-
&lt;rt&gt;World&lt;/rt&gt; &lt;rt&gt;Wide&lt;/rt&gt; &lt;rt&gt;Web&lt;/rt&gt;
767-
&lt;/ruby&gt;</pre>
768-
<p>They also ensure that annotated white space is preserved. For example,
769-
<pre>&lt;ruby&gt;
770-
&lt;rb&gt;Aerith&lt;/rb&gt;&lt;rb&gt; &lt;/rb&gt;&lt;rb&gt;Gainsboro&lt;/rb&gt;
771-
&lt;rt&gt;エアリス&lt;/rt&gt;&lt;rt&gt;・&lt;/rt&gt;&lt;rt&gt;ゲインズブール&lt;/rt&gt;
772-
&lt;/ruby&gt;</pre>
773-
</div>
774-
775770
<h2 class="heading settled heading" data-level=3 id=ruby-layout><span class=secno>3 </span><span class=content>
776771
Ruby Layout</span><a class=self-link href=#ruby-layout></a></h2>
777772

@@ -1729,9 +1724,8 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
17291724
or needs to be handled specially.
17301725
Waiting until layout is better-defined to find out...
17311726

1732-
<a href=#issue-9b177ca3></a></div><div class=issue>Specify how these anonymous white space boxes impact layout.
1733-
1734-
<a href=#issue-1851041e></a></div><div class=issue>Or should it become a quasi-base between two bases?<a href=#issue-029133da></a></div>
1727+
<a href=#issue-9b177ca3></a></div><div class=issue>This example actually doesn’t trigger the rule in question. Come up with one that does.
1728+
<a href=#issue-6f614186></a></div><div class=issue>Or should it become a quasi-base between two bases?<a href=#issue-029133da></a></div>
17351729
A spanning <div class=issue>
17361730
Insert scanned example so people don’t think this is just the ramblings of an insane spec-writer.
17371731

css-ruby/Overview.src.html

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -561,66 +561,61 @@ <h3 id="autohide">
561561
<h3 id="white-space">
562562
White Space Collapsing</h3>
563563

564-
<p><i>Collapsible white space</i> within a ruby structure is discarded
564+
<p>White space within a ruby structure is <a href="#anon-gen-discard-space">discarded</a>
565565
<ul>
566566
<li>at the beginning and end of a <i>ruby container</i>, <i>ruby annotation container</i>, or <i>ruby base container</i>,
567-
<li>at the beginning/end of a <i>ruby annotation box</i> or <i>ruby base box</i> if white space is not its only contents,
568567
<li>between a <i>ruby base container</i> and its following <i>ruby annotation container</i>,
569568
<li>between <i>ruby annotation containers</i>.
570569
</ul>
571570

572571
<p>Between <i>ruby segments</i>, between <i>ruby bases</i>, and between <i>ruby annotations</i>, however,
573-
white space is not discarded.
572+
white space is not discarded,
573+
and is maintained for rendering
574+
as <i title="inter-base white space">inter-base</i>,
575+
<i title="inter-annotation white space">inter-annotation</i>,
576+
or <i>inter-segment white space</i>.
577+
(See <a href="#box-fixup">Anonymous Ruby Box Generation</a>, above.)
578+
579+
<div class="example">
580+
<p>These rules allow ruby to be used with space-separated scripts such as Latin.
581+
For example,
582+
<pre>
583+
<!-- -->&lt;ruby>
584+
<!-- --> &lt;rb>W&lt;/rb>&lt;rb>W&lt;/rb>&lt;rb>W&lt;/rb>
585+
<!-- --> &lt;rt>World&lt;/rt> &lt;rt>Wide&lt;/rt> &lt;rt>Web&lt;/rt>
586+
<!-- -->&lt;/ruby></pre>
587+
<p>They also ensure that annotated white space is preserved. For example,
588+
<pre>
589+
<!-- -->&lt;ruby>
590+
<!-- --> &lt;rb>Aerith&lt;/rb>&lt;rb> &lt;/rb>&lt;rb>Gainsboro&lt;/rb>
591+
<!-- --> &lt;rt>エアリス&lt;/rt>&lt;rt>・&lt;/rt>&lt;rt>ゲインズブール&lt;/rt>
592+
<!-- -->&lt;/ruby></pre>
593+
</div>
574594

575595
<p>Where undiscarded white space is <i>collapsible</i>, it will collapse
576596
following the standard <a href="http://www.w3.org/TR/css3-text/#white-space-rules">white space processing rules</a>. [[!CSS3TEXT]]
577-
For <i>collapsible</i> white space between <i>ruby segments</i>, however,
597+
For <i>collapsible white space</i> between <i>ruby segments</i> (<i>inter-segment white space</i>), however,
578598
the contextual text for determining collapsing behavior is given by the <i>ruby bases</i> on either side,
579-
not the text on either side of the white space in the source document.
599+
not the text on either side of the white space in source document order.
580600

581601
<div class="note">
582602
<p>Note that the white space processing rules
583603
cause a white space sequence containing a <i>segment break</i> (such as a line feed)
584-
to <a href="http://www.w3.org/TR/css3-text/#line-break-transform">collapse to nothing</a> between CJK characters.
585-
This means that CJK ruby can safely use white space for indentation of the ruby markup.
604+
to <a href="http://www.w3.org/TR/css3-text/#line-break-transform">collapse to nothing</a> between Han and Kana characters.
605+
This means that Chinese and Japanese ruby can safely use white space for indentation of the ruby markup.
586606
For example, the following markup will display without any spaces:
587607
<pre>
588608
<!-- -->&lt;ruby>
589609
<!-- --> &lt;rb>東&lt;/rb>&lt;rb>京&lt;/rb>
590610
<!-- --> &lt;rt>とう&lt;/rt>&lt;rt>きょう&lt;/rt>
591611
<!-- -->&lt;/ruby></pre>
612+
<p class="issue">This example actually doesn't trigger the rule in question. Come up with one that does.
592613
<p>However, white space that does not contain a <i>segment break</i> does not collapse completely away,
593614
so this markup will display with a space between the first and second ruby pairs:
594615
<pre>
595616
<!-- -->&lt;ruby>
596617
<!-- --> &lt;rb>東&lt;/rb> &lt;rb>京&lt;/rb>
597618
<!-- --> &lt;rt>とう&lt;/rt> &lt;rt>きょう&lt;/rt>
598-
<!-- -->&lt;/ruby></pre>
599-
</div>
600-
601-
<p>Any preserved white space is then wrapped in an anonymous box belonging to
602-
the <i>ruby base container</i> (if between <i>ruby bases</i>),
603-
<i>ruby annotation container</i> (if between <i>ruby annotations</i>),
604-
or <i>ruby container</i> (if between <i>ruby segments</i>).
605-
In the latter case, the text is considered part of the <i>base level</i>.
606-
Such anonymous boxes do not take part in pairing.
607-
They merely ensure separation between adjacent bases/annotations.
608-
609-
<p class="issue">Specify how these anonymous white space boxes impact layout.
610-
611-
<div class="example">
612-
<p>These rules allow ruby to be used with space-separated scripts such as Latin.
613-
For example,
614-
<pre>
615-
<!-- -->&lt;ruby>
616-
<!-- --> &lt;rb>W&lt;/rb>&lt;rb>W&lt;/rb>&lt;rb>W&lt;/rb>
617-
<!-- --> &lt;rt>World&lt;/rt> &lt;rt>Wide&lt;/rt> &lt;rt>Web&lt;/rt>
618-
<!-- -->&lt;/ruby></pre>
619-
<p>They also ensure that annotated white space is preserved. For example,
620-
<pre>
621-
<!-- -->&lt;ruby>
622-
<!-- --> &lt;rb>Aerith&lt;/rb>&lt;rb> &lt;/rb>&lt;rb>Gainsboro&lt;/rb>
623-
<!-- --> &lt;rt>エアリス&lt;/rt>&lt;rt>・&lt;/rt>&lt;rt>ゲインズブール&lt;/rt>
624619
<!-- -->&lt;/ruby></pre>
625620
</div>
626621

0 commit comments

Comments
 (0)