Skip to content

Commit 9b6006c

Browse files
committed
[css-ruby] split out some details of inter-character layout, make containers unstyleable for now
1 parent c02d695 commit 9b6006c

2 files changed

Lines changed: 92 additions & 20 deletions

File tree

css-ruby/Overview.html

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,18 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2>
213213

214214
<li><a href="#ruby-layout"><span class=secno>2.6. </span> Ruby
215215
layout</a>
216+
<ul class=toc>
217+
<li><a href="#inter-character-layout"><span class=secno>2.6.1. </span>
218+
Inter-character ruby layout</a>
219+
</ul>
220+
221+
<li><a href="#box-style"><span class=secno>2.7. </span> Styling Ruby
222+
Boxes </a>
216223

217-
<li><a href="#line-breaking"><span class=secno>2.7. </span> Ruby box and
224+
<li><a href="#line-breaking"><span class=secno>2.8. </span> Ruby box and
218225
line breaking</a>
219226

220-
<li><a href="#line-height"><span class=secno>2.8. </span> Ruby box and
227+
<li><a href="#line-height"><span class=secno>2.9. </span> Ruby box and
221228
line stacking</a>
222229
</ul>
223230

@@ -788,8 +795,8 @@ <h3 id=ruby-layout><span class=secno>2.6. </span> Ruby layout</h3>
788795

789796
<p>When a ruby structure is laid out, its base level is laid out on the
790797
line, aligned according to its ‘<code
791-
class=property>vertical-align</code>’ property exactly as if it were a
792-
regular sequence of <i>inline</i> boxes. Each <a
798+
class=property>vertical-align</code>’ property exactly as if its
799+
<i>bases</i> were a regular sequence of <i>inline</i> boxes. Each <a
793800
href="#ruby-base-container-box"><i>ruby base container</i></a> is sized
794801
and positioned to contain exactly the full height of its <a
795802
href="#ruby-base-box"><i>ruby bases</i></a>.
@@ -808,23 +815,57 @@ <h3 id=ruby-layout><span class=secno>2.6. </span> Ruby layout</h3>
808815
href="#ruby-annotation-box"><i>ruby annotations</i></a>.
809816

810817
<p>A ruby container (or fragment thereof) measures as wide as the content
811-
of its widest level. (In the case of ‘<code
812-
class=css>inter-character</code>’ annotations, they are spliced in and
813-
measured as part of the base level.) Similarly, <a
814-
href="#ruby-base-box"><i>ruby base boxes</i></a> and <a
815-
href="#ruby-annotation-box"><i>ruby annotation boxes</i></a> within a ruby
816-
“column” have the measure of the widest content in that “column”.
817-
In the case of spanning <i>annotations</i> (whether actually spanning or
818-
pretending to span per ‘<code class=property>ruby-collapse</code>’),
819-
the measures of the <a href="#ruby-annotation-box"><i>ruby annotation
820-
box</i></a> and the sum of its associated <a href="#ruby-base-box"><i>ruby
821-
base boxes</i></a> must match.
818+
of its widest level. Similarly, <a href="#ruby-base-box"><i>ruby base
819+
boxes</i></a> and <a href="#ruby-annotation-box"><i>ruby annotation
820+
boxes</i></a> within a ruby “column” have the measure of the widest
821+
content in that “column”. In the case of spanning <i>annotations</i>
822+
(whether actually spanning or pretending to span per ‘<code
823+
class=property>ruby-collapse</code>’), the measures of the <a
824+
href="#ruby-annotation-box"><i>ruby annotation box</i></a> and the sum of
825+
its associated <a href="#ruby-base-box"><i>ruby base boxes</i></a> must
826+
match.
822827

823828
<p>How the extra space is distributed when ruby content is narrower than
824829
the measure of its box is specified by the ‘<a href="#ruby-align"><code
825830
class=property>ruby-align</code></a>’ property.
826831

827-
<h3 id=line-breaking><span class=secno>2.7. </span> Ruby box and line
832+
<h4 id=inter-character-layout><span class=secno>2.6.1. </span>
833+
Inter-character ruby layout</h4>
834+
835+
<p>Inter-character annotations have special layout. When ‘<a
836+
href="#ruby-position"><code class=property>ruby-position</code></a>
837+
indicates ‘<code class=css>inter-character</code>’ annotations, the
838+
affected <i>annotation boxes</i> are spliced into and measured as part of
839+
the layout of the base level. The <a
840+
href="#ruby-base-container-box"><i>ruby base container</i></a> must be
841+
sized to include both the <i>base boxes</i> as well as the ‘<code
842+
class=css>inter-character</code><i>annotation boxes</i> The affected
843+
<a href="#ruby-annotation-container-box"><i>ruby annotation
844+
container</i></a> is similarly sized so that its content box coincides
845+
with that of the <a href="#ruby-base-container-box"><i>ruby base
846+
container</i></a>.
847+
848+
<p>For the purpose of laying out other levels of annotations, an ‘<code
849+
class=css>inter-character</code>’ annotation effectively becomes part of
850+
its base. <span class=issue>Or should it become a quasi-base between two
851+
bases?</span> A spanning ‘<code class=css>inter-character</code>
852+
annotation is placed after all the bases that it spans.
853+
854+
<h3 id=box-style><span class=secno>2.7. </span> Styling Ruby Boxes</h3>
855+
856+
<p>In most respects, ruby boxes can be styled similar to inline boxes.
857+
However, the UA is not required to support any of the box properties
858+
(borders, margins, padding), any of the background properties or outline
859+
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.
864+
865+
<p class=issue> Alternatively... use margins to control offsets? Or could
866+
line-height be adequate? Its centering behavior can be awkward.
867+
868+
<h3 id=line-breaking><span class=secno>2.8. </span> Ruby box and line
828869
breaking</h3>
829870

830871
<p>When there is not enough space for an entire <a
@@ -886,7 +927,7 @@ <h3 id=line-breaking><span class=secno>2.7. </span> Ruby box and line
886927
breaking opportunity
887928
</div>
888929

889-
<h3 id=line-height><span class=secno>2.8. </span> Ruby box and line
930+
<h3 id=line-height><span class=secno>2.9. </span> Ruby box and line
890931
stacking</h3>
891932

892933
<p>The ‘<code class=property>line-height</code>’ property controls

css-ruby/Overview.src.html

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ <h3 id="ruby-layout">
491491
<p>When a ruby structure is laid out,
492492
its base level is laid out on the line,
493493
aligned according to its 'vertical-align' property
494-
exactly as if it were a regular sequence of <i>inline</i> boxes.
494+
exactly as if its <i>bases</i> were a regular sequence of <i>inline</i> boxes.
495495
Each <i>ruby base container</i> is sized and positioned
496496
to contain exactly the full height of its <i>ruby bases</i>.
497497

@@ -506,8 +506,6 @@ <h3 id="ruby-layout">
506506

507507
<p>A ruby container (or fragment thereof)
508508
measures as wide as the content of its widest level.
509-
(In the case of ''inter-character'' annotations,
510-
they are spliced in and measured as part of the base level.)
511509
Similarly, <i>ruby base boxes</i> and <i>ruby annotation boxes</i>
512510
within a ruby “column” have the measure of the widest content in that “column”.
513511
In the case of spanning <i>annotations</i>
@@ -519,6 +517,39 @@ <h3 id="ruby-layout">
519517
when ruby content is narrower than the measure of its box
520518
is specified by the 'ruby-align' property.
521519

520+
<h4 id="inter-character-layout">
521+
Inter-character ruby layout</h4>
522+
523+
<p>Inter-character annotations have special layout.
524+
When 'ruby-position' indicates ''inter-character'' annotations, the affected <i>annotation boxes</i>
525+
are spliced into and measured as part of the layout of the base level.
526+
The <i>ruby base container</i> must be sized to include both the <i>base boxes</i>
527+
as well as the ''inter-character'' <i>annotation boxes</i>
528+
The affected <i>ruby annotation container</i> is similarly sized
529+
so that its content box coincides with that of the <i>ruby base container</i>.
530+
531+
<p>For the purpose of laying out other levels of annotations,
532+
an ''inter-character'' annotation effectively becomes part of its base.
533+
<span class="issue">Or should it become a quasi-base between two bases?</span>
534+
A spanning ''inter-character'' annotation is placed after
535+
all the bases that it spans.
536+
537+
<h3 id="box-style">
538+
Styling Ruby Boxes</h4>
539+
540+
<p>In most respects, ruby boxes can be styled similar to inline boxes.
541+
However, the UA is not required to support
542+
any of the box properties (borders, margins, padding),
543+
any of the background properties or outline properties,
544+
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>.
546+
The UA may implement these boxes simply as abstractions for inheritance
547+
and control over the layout of their contents.
548+
549+
<p class="issue">
550+
Alternatively... use margins to control offsets?
551+
Or could line-height be adequate? Its centering behavior can be awkward.
552+
522553
<h3 id="line-breaking">
523554
Ruby box and line breaking</h3>
524555

0 commit comments

Comments
 (0)