Skip to content

Commit eb29883

Browse files
committed
[css-ruby] Clarifications to white space collapsing section
--HG-- extra : rebase_source : 0ed7ac3e8db94fd86114f9a1a30e0f0c8b79613c
1 parent 390e7f8 commit eb29883

2 files changed

Lines changed: 59 additions & 42 deletions

File tree

css-ruby/Overview.html

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -727,29 +727,41 @@ <h3 id=autohide><span class=secno>2.4. </span> Autohiding Annotations</h3>
727727

728728
<h3 id=white-space><span class=secno>2.5. </span> White Space</h3>
729729

730-
<p class=issue>I'm unsure exactly where space should be trimmed. :/ But
731-
pretty sure we need to keep spaces between things, otherwise ruby only
732-
works for CJK.
733-
734-
<p><i>Collapsible</i> white space within a ruby structure is discarded at
735-
the beginning and end of a <a href="#ruby-container-box"><i>ruby
736-
container</i></a>, <a href="#ruby-annotation-container-box"><i>ruby
737-
annotation container</i></a>, or <a
738-
href="#ruby-base-container-box"><i>ruby base container</i></a>, and at the
739-
beginning/end of a <a href="#ruby-annotation-box"><i>ruby annotation
740-
box</i></a> or <a href="#ruby-base-box"><i>ruby base box</i></a> if white
741-
space is not its only contents. Between <a href="#ruby-segments"><i>ruby
742-
segments</i></a>, between <a href="#ruby-base-box"><i>ruby bases</i></a>,
743-
and between <a href="#ruby-annotation-box"><i>ruby annotations</i></a>,
744-
however, white space is not discarded. If such white space is
745-
<i>collapsible</i>, it will collapse following the standard <a
730+
<p><i>Collapsible</i> white space within a ruby structure is discarded
731+
732+
<ul>
733+
<li>at the beginning and end of a <a href="#ruby-container-box"><i>ruby
734+
container</i></a>, <a href="#ruby-annotation-container-box"><i>ruby
735+
annotation container</i></a>, or <a
736+
href="#ruby-base-container-box"><i>ruby base container</i></a>,
737+
738+
<li>at the beginning/end of a <a href="#ruby-annotation-box"><i>ruby
739+
annotation box</i></a> or <a href="#ruby-base-box"><i>ruby base
740+
box</i></a> if white space is not its only contents,
741+
742+
<li>between a <a href="#ruby-base-container-box"><i>ruby base
743+
container</i></a> and its following <a
744+
href="#ruby-annotation-container-box"><i>ruby annotation
745+
container</i></a>,
746+
747+
<li>between <a href="#ruby-annotation-container-box"><i>ruby annotation
748+
containers</i></a>.
749+
</ul>
750+
751+
<p>Between <a href="#ruby-segments"><i>ruby segments</i></a>, between <a
752+
href="#ruby-base-box"><i>ruby bases</i></a>, and between <a
753+
href="#ruby-annotation-box"><i>ruby annotations</i></a>, however, white
754+
space is not discarded.
755+
756+
<p>Where undiscarded white space is <i>collapsible</i>, it will collapse
757+
following the standard <a
746758
href="http://www.w3.org/TR/css3-text/#white-space-rules">white space
747759
processing rules</a>. <a href="#CSS3TEXT"
748-
rel=biblioentry>[CSS3TEXT]<!--{{!CSS3TEXT}}--></a> Between <a
749-
href="#ruby-segments"><i>ruby segments</i></a>, however, the contextual
750-
text for determining collapsing behavior is given by the <a
751-
href="#ruby-base-box"><i>ruby bases</i></a> on either side, not the text
752-
on either side of the white space in the source document.
760+
rel=biblioentry>[CSS3TEXT]<!--{{!CSS3TEXT}}--></a> For <i>collapsible</i>
761+
white space between <a href="#ruby-segments"><i>ruby segments</i></a>,
762+
however, the contextual text for determining collapsing behavior is given
763+
by the <a href="#ruby-base-box"><i>ruby bases</i></a> on either side, not
764+
the text on either side of the white space in the source document.
753765

754766
<div class=note>
755767
<p>Note that the white space processing rules cause a white space sequence
@@ -765,12 +777,14 @@ <h3 id=white-space><span class=secno>2.5. </span> White Space</h3>
765777
<!-- --> &lt;rt>とう&lt;/rt>&lt;rt>きょう&lt;/rt>
766778
<!-- -->&lt;/ruby></pre>
767779

768-
<p>However, this markup will:
780+
<p>However, white space that does not contain a <i>segment break</i> does
781+
not collapse completely away, so this markup will display with a space
782+
between the first and second ruby pairs:
769783

770784
<pre>
771785
<!-- -->&lt;ruby>
772786
<!-- --> &lt;rb>東&lt;/rb> &lt;rb>京&lt;/rb>
773-
<!-- --> &lt;rt>とう&lt;/rt> &lt;rt>きょう&lt;/rt>
787+
<!-- --> &lt;rt>とう&lt;/rt> &lt;rt>きょう&lt;/rt>
774788
<!-- -->&lt;/ruby></pre>
775789
</div>
776790

@@ -781,10 +795,12 @@ <h3 id=white-space><span class=secno>2.5. </span> White Space</h3>
781795
(if between <a href="#ruby-annotation-box"><i>ruby annotations</i></a>),
782796
or <a href="#ruby-container-box"><i>ruby container</i></a> (if between <a
783797
href="#ruby-segments"><i>ruby segments</i></a>). In the latter case, the
784-
text is considered part of the <i>base level</i>. This box does not take
785-
part in pairing. It merely ensures separation between adjacent
798+
text is considered part of the <i>base level</i>. Such anonynmous boxes do
799+
not take part in pairing. They merely ensure separation between adjacent
786800
bases/annotations.
787801

802+
<p class=issue>Specify how these anonymous white space boxes impact layout.
803+
788804
<div class=example>
789805
<p>These rules allow ruby to be used with space-separated scripts such as
790806
Latin. For example,
@@ -804,8 +820,6 @@ <h3 id=white-space><span class=secno>2.5. </span> White Space</h3>
804820
<!-- -->&lt;/ruby></pre>
805821
</div>
806822

807-
<p class=issue>Specify how this impacts layout, or not.
808-
809823
<h3 id=ruby-layout><span class=secno>2.6. </span> Ruby layout</h3>
810824

811825
<p>When a ruby structure is laid out, its base level is laid out on the

css-ruby/Overview.src.html

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -426,18 +426,20 @@ <h3 id="autohide">
426426
<h3 id="white-space">
427427
White Space</h3>
428428

429-
<p class="issue">I'm unsure exactly where space should be trimmed. :/
430-
But pretty sure we need to keep spaces between things,
431-
otherwise ruby only works for CJK.
432-
433429
<p><i>Collapsible</i> white space within a ruby structure is discarded
434-
at the beginning and end of a <i>ruby container</i>, <i>ruby annotation container</i>, or <i>ruby base container</i>,
435-
and 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.
436-
Between <i>ruby segments</i>, between <i>ruby bases</i>, and between <i>ruby annotations</i>, however,
430+
<ul>
431+
<li>at the beginning and end of a <i>ruby container</i>, <i>ruby annotation container</i>, or <i>ruby base container</i>,
432+
<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,
433+
<li>between a <i>ruby base container</i> and its following <i>ruby annotation container</i>,
434+
<li>between <i>ruby annotation containers</i>.
435+
</ul>
436+
437+
<p>Between <i>ruby segments</i>, between <i>ruby bases</i>, and between <i>ruby annotations</i>, however,
437438
white space is not discarded.
438-
If such white space is <i>collapsible</i>, it will collapse
439+
440+
<p>Where undiscarded white space is <i>collapsible</i>, it will collapse
439441
following the standard <a href="http://www.w3.org/TR/css3-text/#white-space-rules">white space processing rules</a>. [[!CSS3TEXT]]
440-
Between <i>ruby segments</i>, however,
442+
For <i>collapsible</i> white space between <i>ruby segments</i>, however,
441443
the contextual text for determining collapsing behavior is given by the <i>ruby bases</i> on either side,
442444
not the text on either side of the white space in the source document.
443445

@@ -452,11 +454,12 @@ <h3 id="white-space">
452454
<!-- --> &lt;rb>東&lt;/rb>&lt;rb>京&lt;/rb>
453455
<!-- --> &lt;rt>とう&lt;/rt>&lt;rt>きょう&lt;/rt>
454456
<!-- -->&lt;/ruby></pre>
455-
<p>However, this markup will:
457+
<p>However, white space that does not contain a <i>segment break</i> does not collapse completely away,
458+
so this markup will display with a space between the first and second ruby pairs:
456459
<pre>
457460
<!-- -->&lt;ruby>
458461
<!-- --> &lt;rb>東&lt;/rb> &lt;rb>京&lt;/rb>
459-
<!-- --> &lt;rt>とう&lt;/rt> &lt;rt>きょう&lt;/rt>
462+
<!-- --> &lt;rt>とう&lt;/rt> &lt;rt>きょう&lt;/rt>
460463
<!-- -->&lt;/ruby></pre>
461464
</div>
462465

@@ -465,8 +468,10 @@ <h3 id="white-space">
465468
<i>ruby annotation container</i> (if between <i>ruby annotations</i>),
466469
or <i>ruby container</i> (if between <i>ruby segments</i>).
467470
In the latter case, the text is considered part of the <i>base level</i>.
468-
This box does not take part in pairing.
469-
It merely ensures separation between adjacent bases/annotations.
471+
Such anonynmous boxes do not take part in pairing.
472+
They merely ensure separation between adjacent bases/annotations.
473+
474+
<p class="issue">Specify how these anonymous white space boxes impact layout.
470475

471476
<div class="example">
472477
<p>These rules allow ruby to be used with space-separated scripts such as Latin.
@@ -484,8 +489,6 @@ <h3 id="white-space">
484489
<!-- -->&lt;/ruby></pre>
485490
</div>
486491

487-
<p class="issue">Specify how this impacts layout, or not.
488-
489492
<h3 id="ruby-layout">
490493
Ruby layout</h3>
491494

0 commit comments

Comments
 (0)