Skip to content

Commit 592317f

Browse files
committed
[css-ruby] Some fixup in the line breaking section
1 parent 006084f commit 592317f

2 files changed

Lines changed: 97 additions & 44 deletions

File tree

css-ruby/Overview.html

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<meta content="CSS Ruby Module Level 1" name=dcterms.title>
2222
<meta content=text name=dcterms.type>
23-
<meta content=2013-07-09 name=dcterms.date>
23+
<meta content=2013-07-11 name=dcterms.date>
2424
<meta content="Elika J. Etemad" name=dcterms.creator>
2525
<meta content="Koji Ishii" name=dcterms.creator>
2626
<meta content="Richard Ishida" name=dcterms.creator>
@@ -41,8 +41,8 @@
4141
<h1 class=p-name>CSS Ruby Module Level 1</h1>
4242

4343
<h2 class="no-num no-toc" id=longstatus-date->Editor's Draft <time
44-
class=dt-updated datetime=20130709> 9 July 2013</time>
45-
<!-- for HTML4 doctype: <span class="value-title" title="20130709"> 9 July 2013</span></span> --></h2>
44+
class=dt-updated datetime=20130711>11 July 2013</time>
45+
<!-- for HTML4 doctype: <span class="value-title" title="20130711">11 July 2013</span></span> --></h2>
4646

4747
<dl>
4848
<dt>This version:
@@ -221,8 +221,15 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2>
221221
<li><a href="#box-style"><span class=secno>2.7. </span> Styling Ruby
222222
Boxes </a>
223223

224-
<li><a href="#line-breaking"><span class=secno>2.8. </span> Ruby box and
224+
<li><a href="#line-breaks"><span class=secno>2.8. </span> Ruby box and
225225
line breaking</a>
226+
<ul class=toc>
227+
<li><a href="#break-between"><span class=secno>2.8.1. </span> Breaking
228+
between bases</a>
229+
230+
<li><a href="#break-within"><span class=secno>2.8.2. </span> Breaking
231+
within bases</a>
232+
</ul>
226233

227234
<li><a href="#line-height"><span class=secno>2.9. </span> Ruby box and
228235
line stacking</a>
@@ -857,29 +864,51 @@ <h3 id=box-style><span class=secno>2.7. </span> Styling Ruby Boxes</h3>
857864
However, the UA is not required to support any of the box properties
858865
(borders, margins, padding), any of the background properties or outline
859866
properties, or any other property that illustrates the bounds of the box
860-
on <a href="#ruby-base-container-box"><i>ruby base container boxes</i></a>
861-
or <a href="#ruby-annotation-container-box"><i>ruby annotation container
862-
boxes</i></a>. The UA may implement these boxes simply as abstractions for
863-
inheritance and control over the layout of their contents.
867+
on <a href="#ruby-base-container-box"><i>ruby base container
868+
boxes</i></a>, <a href="#ruby-annotation-container-box"><i>ruby annotation
869+
container boxes</i></a>, or <a href="#nested-pairing">ruby-internal
870+
<i>ruby container boxes</i></a>. The UA may implement these boxes simply
871+
as abstractions for inheritance and control over the layout of their
872+
contents.
864873

865874
<p class=issue> Alternatively... use margins to control offsets? Or could
866875
line-height be adequate? Its centering behavior can be awkward.
867876

868-
<h3 id=line-breaking><span class=secno>2.8. </span> Ruby box and line
877+
<h3 id=line-breaks><span class=secno>2.8. </span> Ruby box and line
869878
breaking</h3>
870879

871880
<p>When there is not enough space for an entire <a
872881
href="#ruby-container-box"><i>ruby container</i></a> to fit on the line,
873-
the ruby may be broken wherever all levels allow a break. In typical
874-
cases, line breaks are forbidden within each <a
875-
href="#ruby-base-box"><i>ruby base</i></a> and <a
876-
href="#ruby-annotation-box"><i>ruby annotation</i></a>, so the <a
882+
the ruby may be broken wherever the base level allows a break. Ruby most
883+
often breaks between base-annotation sets, but if the line-breaking rules
884+
allow it, can also break within a <a href="#ruby-base-box"><i>ruby
885+
base</i></a> (and, in parallel, its associated <i>annotation boxes</i>).
886+
887+
<p>Whenever ruby breaks across lines, <a
888+
href="#ruby-annotation-box"><i>ruby annotations</i></a> must stay with
889+
their respective <i>bases</i>. The line <em>must not</em> break between a
890+
<a href="#ruby-base-box"><i>ruby base</i></a> and its <i>annotations</i>,
891+
even in the case of ‘<code class=css>inter-character</code>
892+
<i>annotations</i>.
893+
894+
<div class=figure> <img
895+
alt="Diagram showing the line breaking opportunity in a &#34;Bopomofo&#34; ruby"
896+
src="images/r-break-b.gif">
897+
<p class=caption><code class=css>inter-character</code>’ ruby line
898+
breaking opportunity
899+
</div>
900+
901+
<h4 id=break-between><span class=secno>2.8.1. </span> Breaking between
902+
bases</h4>
903+
904+
<p>In typical cases, <a href="#ruby-base-box"><i>ruby base boxes</i></a>
905+
and <a href="#ruby-annotation-box"><i>ruby annotation boxes</i></a> are
906+
styled to forbid internal line wrapping and do not contain forced breaks.
907+
(See <a href="#default-stylesheet">Appendix A</a>.) In such cases the <a
877908
href="#ruby-container-box"><i>ruby container</i></a> can only break
878909
between adjacent <a href="#ruby-base-box"><i>ruby bases</i></a>, and only
879910
if no <a href="#ruby-annotation-box"><i>ruby annotations</i></a> span
880-
those <a href="#ruby-base-box"><i>ruby bases</i></a>. Whenever ruby breaks
881-
across lines, <a href="#ruby-annotation-box"><i>ruby annotations</i></a>
882-
<em>must stay with their respective bases. </em>
911+
those <a href="#ruby-base-box"><i>ruby bases</i></a>.
883912

884913
<div class=figure>
885914
<p><img
@@ -892,40 +921,43 @@ <h3 id=line-breaking><span class=secno>2.8. </span> Ruby box and line
892921
<p>Whether ruby can break between two adjacent <a
893922
href="#ruby-base-box"><i>ruby bases</i></a> is controlled by normal
894923
line-breaking rules for the affected text, exactly as if the <a
895-
href="#ruby-base-box"><i>ruby bases</i></a> were regular <i>inline</i>
896-
boxes.
924+
href="#ruby-base-box"><i>ruby bases</i></a> were adjacent <i>inline</i>
925+
boxes. (The annotations are ignored when determining soft wrap
926+
opportunities for the base level.)
897927

898928
<div class=example>
899929
<p>For example, if two adjacent ruby bases are “蝴” and “蝶”,
900930
the line may break between them, because lines are normally allowed to
901931
break between two Han characters. However, if ‘<code
902932
class=property>word-break</code>’ is ‘<code
903933
class=css>keep-all</code>’, that line break is forbidden.
934+
935+
<pre>&lt;ruby>蝴&lt;rt>hú&lt;/rt>蝶&lt;rt>dié&lt;/rt></pre>
904936
</div>
905937

906938
<p>Inter-base white space is significant for evaluating line break
907939
opportunities between <a href="#ruby-base-box"><i>ruby bases</i></a>. As
908940
with white space between inlines, it collapses when the line breaks there.
941+
Similarly, annotation white space is also trimmed at a line break.
909942

910943
<div class=example>
911944
<p>For example, given the following markup:
912945

913946
<pre>&lt;ruby>&lt;rb>one&lt;/rb> &lt;rb>two&lt;/rb> &lt;rt>1&lt;/rt> &lt;rt>2&lt;/rt>&lt;/ruby></pre>
914947

915948
<p>Due to the space, the line may break between “one” and “two“.
916-
If the line breaks there, that space disappears, in accordance with
917-
standard CSS white space processing rules. [[CSS3-TEXT]]
949+
If the line breaks there, that space—and the space between “1” and
950+
“2”—disappears, in accordance with standard CSS white space
951+
processing rules. <a href="#CSS3TEXT"
952+
rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a>
918953
</div>
919954

920-
<p>The line <em>must not</em> break between a <a
921-
href="#ruby-base-box"><i>ruby base</i></a> and its annotations.
955+
<h4 id=break-within><span class=secno>2.8.2. </span> Breaking within bases</h4>
922956

923-
<div class=figure> <img
924-
alt="Diagram showing the line breaking opportunity in a &#34;Bopomofo&#34; ruby"
925-
src="images/r-break-b.gif">
926-
<p class=caption><code class=css>inter-character</code>’ ruby line
927-
breaking opportunity
928-
</div>
957+
<p class=issue>Fill in this section...
958+
959+
<p>There are no line breaking opportunities within ‘<code
960+
class=css>inter-character</code><i>annotations</i>.
929961

930962
<h3 id=line-height><span class=secno>2.9. </span> Ruby box and line
931963
stacking</h3>

css-ruby/Overview.src.html

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -542,24 +542,43 @@ <h3 id="box-style">
542542
any of the box properties (borders, margins, padding),
543543
any of the background properties or outline properties,
544544
or any other property that illustrates the bounds of the box
545-
on <i>ruby base container boxes</i> or <i>ruby annotation container boxes</i>.
545+
on <i>ruby base container boxes</i>, <i>ruby annotation container boxes</i>,
546+
or <a href="#nested-pairing">ruby-internal <i>ruby container boxes</i></a>.
546547
The UA may implement these boxes simply as abstractions for inheritance
547548
and control over the layout of their contents.
548549

549550
<p class="issue">
550551
Alternatively... use margins to control offsets?
551552
Or could line-height be adequate? Its centering behavior can be awkward.
552553

553-
<h3 id="line-breaking">
554+
<h3 id="line-breaks">
554555
Ruby box and line breaking</h3>
555556

556557
<p>When there is not enough space for an entire <i>ruby container</i> to fit on the line,
557-
the ruby may be broken wherever all levels allow a break.
558-
In typical cases, line breaks are forbidden within each <i>ruby base</i> and <i>ruby annotation</i>,
559-
so the <i>ruby container</i> can only break between adjacent <i>ruby bases</i>,
558+
the ruby may be broken wherever the base level allows a break.
559+
Ruby most often breaks between base-annotation sets,
560+
but if the line-breaking rules allow it, can also break within a <i>ruby base</i>
561+
(and, in parallel, its associated <i>annotation boxes</i>).
562+
563+
<p>Whenever ruby breaks across lines, <i>ruby annotations</i> must stay
564+
with their respective <i>bases</i>.
565+
The line <em>must not</em> break between a <i>ruby base</i> and its <i>annotations</i>,
566+
even in the case of ''inter-character'' <i>annotations</i>.
567+
568+
<div class="figure">
569+
<img src="images/r-break-b.gif"
570+
alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'>
571+
<p class="caption">''inter-character'' ruby line breaking opportunity
572+
</div>
573+
574+
<h4 id="break-between">
575+
Breaking between bases</h4>
576+
577+
<p>In typical cases, <i>ruby base boxes</i> and <i>ruby annotation boxes</i>
578+
are styled to forbid internal line wrapping and do not contain forced breaks.
579+
(See <a href="#default-stylesheet">Appendix A</a>.)
580+
In such cases the <i>ruby container</i> can only break between adjacent <i>ruby bases</i>,
560581
and only if no <i>ruby annotations</i> span those <i>ruby bases</i>.
561-
Whenever ruby breaks across lines, <i>ruby annotations</i>
562-
<em>must</i> stay with their respective bases.
563582

564583
<div class="figure">
565584
<p><img src="images/r-break-a.gif"
@@ -569,33 +588,35 @@ <h3 id="line-breaking">
569588

570589
<p>Whether ruby can break between two adjacent <i>ruby bases</i>
571590
is controlled by normal line-breaking rules for the affected text,
572-
exactly as if the <i>ruby bases</i> were regular <i>inline</i> boxes.
591+
exactly as if the <i>ruby bases</i> were adjacent <i>inline</i> boxes.
592+
(The annotations are ignored when determining soft wrap opportunities for the base level.)
573593

574594
<div class="example">
575595
<p>For example, if two adjacent ruby bases are “蝴” and “蝶”,
576596
the line may break between them,
577597
because lines are normally allowed to break between two Han characters.
578598
However, if 'word-break' is ''keep-all'', that line break is forbidden.
599+
<pre>&lt;ruby>蝴&lt;rt>hú&lt;/rt>蝶&lt;rt>dié&lt;/rt></pre>
579600
</div>
580601

581602
<p>Inter-base white space is significant for evaluating line break opportunities between <i>ruby bases</i>.
582603
As with white space between inlines, it collapses when the line breaks there.
604+
Similarly, annotation white space is also trimmed at a line break.
583605

584606
<div class="example">
585607
<p>For example, given the following markup:
586608
<pre>&lt;ruby>&lt;rb>one&lt;/rb> &lt;rb>two&lt;/rb> &lt;rt>1&lt;/rt> &lt;rt>2&lt;/rt>&lt;/ruby></pre>
587609
<p>Due to the space, the line may break between “one” and “two“.
588-
If the line breaks there, that space disappears,
589-
in accordance with standard CSS white space processing rules. [[CSS3-TEXT]]
610+
If the line breaks there, that space&mdash;and the space between “1” and “2”&mdash;disappears,
611+
in accordance with standard CSS white space processing rules. [[CSS3TEXT]]
590612
</div>
591613

592-
<p>The line <em>must not</em> break between a <i>ruby base</i> and its annotations.
614+
<h4 id="break-within">
615+
Breaking within bases</h4>
593616

594-
<div class="figure">
595-
<img src="images/r-break-b.gif"
596-
alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'>
597-
<p class="caption">''inter-character'' ruby line breaking opportunity
598-
</div>
617+
<p class="issue">Fill in this section...
618+
619+
<p>There are no line breaking opportunities within ''inter-character'' <i>annotations</i>.
599620

600621
<h3 id="line-height">
601622
Ruby box and line stacking</h3>

0 commit comments

Comments
 (0)