[css-ruby] First draft of anonymous box generation rules...

Wed, 19 Jun 2013 00:31:59 +0900

author
fantasai <fantasai.cvs@inkedblade.net>
date
Wed, 19 Jun 2013 00:31:59 +0900
changeset 8504
4f0f1fccb087
parent 8503
2763a62e9a48
child 8505
abcea110767d

[css-ruby] First draft of anonymous box generation rules...

css-ruby/Overview.html file | annotate | diff | comparison | revisions
css-ruby/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/css-ruby/Overview.html	Wed Jun 19 00:18:35 2013 +0900
     1.2 +++ b/css-ruby/Overview.html	Wed Jun 19 00:31:59 2013 +0900
     1.3 @@ -186,13 +186,26 @@
     1.4       <li><a href="#ruby-display"><span class=secno>2.1. </span> Ruby-specific
     1.5        ‘<code class=property>display</code>’ property values</a>
     1.6  
     1.7 -     <li><a href="#box-model"><span class=secno>2.2. </span> Ruby box
     1.8 +     <li><a href="#box-fixup"><span class=secno>2.2. </span> Anonymous Ruby
     1.9 +      Box Generation</a>
    1.10 +
    1.11 +     <li><a href="#pairing"><span class=secno>2.3. </span> Ruby Pairing and
    1.12 +      Annotation Levels</a>
    1.13 +      <ul class=toc>
    1.14 +       <li><a href="#nested-pairing"><span class=secno>2.3.1. </span> Nested
    1.15 +        Ruby</a>
    1.16 +      </ul>
    1.17 +
    1.18 +     <li><a href="#box-model"><span class=secno>2.4. </span> Generating Ruby
    1.19 +      Structure</a>
    1.20 +
    1.21 +     <li><a href="#box-model"><span class=secno>2.5. </span> Ruby box
    1.22        model</a>
    1.23  
    1.24 -     <li><a href="#ruby-line-height"><span class=secno>2.3. </span> Ruby box
    1.25 +     <li><a href="#ruby-line-height"><span class=secno>2.6. </span> Ruby box
    1.26        and line stacking</a>
    1.27  
    1.28 -     <li><a href="#ruby-line-breaking"><span class=secno>2.4. </span> Ruby
    1.29 +     <li><a href="#ruby-line-breaking"><span class=secno>2.7. </span> Ruby
    1.30        box and line breaking</a>
    1.31      </ul>
    1.32  
    1.33 @@ -392,14 +405,14 @@
    1.34       more levels of <dfn id=ruby-annotation>ruby annotation</dfn> elements
    1.35       representing the annotations. The structure of ruby is similar to that
    1.36       of a table: there are “rows” (the base text level, each annotation
    1.37 -     level) and “columns” (each <a href="#ruby-base"><i>ruby base</i></a>
    1.38 -     and its corresponding <a href="#ruby-annotation"><i>ruby
    1.39 -     annotations</i></a>).
    1.40 +     level) and “columns” (each <a href="#ruby-base-box"><i>ruby
    1.41 +     base</i></a> and its corresponding <a
    1.42 +     href="#ruby-annotation-box"><i>ruby annotations</i></a>).
    1.43  
    1.44      <p>Consecutive bases and annotations are grouped together into <dfn
    1.45       id=ruby-segments>ruby segments</dfn>. Within a <i>ruby segment</i>, a <a
    1.46 -     href="#ruby-annotation"><i>ruby annotation</i></a> may span multiple <a
    1.47 -     href="#ruby-base"><i>ruby bases<i>. </i></i></a>
    1.48 +     href="#ruby-annotation-box"><i>ruby annotation</i></a> may span multiple
    1.49 +     <a href="#ruby-base-box"><i>ruby bases<i>. </i></i></a>
    1.50  
    1.51      <p class=note>In HTML, a single <code>&lt;ruby&gt;</code> element may
    1.52       contain multiple <a href="#ruby-segments"><i>ruby segments</i></a>. (In
    1.53 @@ -434,48 +447,199 @@
    1.54      <dl>
    1.55       <dt>‘<a href="#ruby"><code class=css>ruby</code></a>’
    1.56  
    1.57 +     <dd>Specifies that an element generates a <dfn id=ruby-container-box
    1.58 +      title="ruby container | ruby container box">ruby container box</dfn>.
    1.59 +      (Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
    1.60 +
    1.61 +     <dt>‘<code class=css>ruby-base</code>’
    1.62 +
    1.63 +     <dd>Specifies that an element generates a <dfn id=ruby-base-box
    1.64 +      title="ruby base box | ruby base">ruby base box</dfn>. (Corresponds to
    1.65 +      HTML/XHTML <code>&lt;rb&gt;</code> elements.)
    1.66 +
    1.67 +     <dt>‘<code class=css>ruby-text</code>’
    1.68 +
    1.69 +     <dd>Specifies that an element generates a <dfn id=ruby-annotation-box
    1.70 +      title="ruby annotation box | ruby annotation">ruby annotation
    1.71 +      box</dfn>. (Corresponds to HTML/XHTML <code>&lt;rt&gt;</code>
    1.72 +      elements.)
    1.73 +
    1.74 +     <dt>‘<code class=css>ruby-base-container</code>’
    1.75 +
    1.76       <dd>Specifies that an element generates a <dfn
    1.77 -      id=ruby-container-box>ruby container box</dfn>. (Corresponds to
    1.78 -      HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
    1.79 -
    1.80 -     <dt>‘<code class=css>ruby-base</code>’
    1.81 -
    1.82 -     <dd>Specifies that an element generates a <dfn id=ruby-base-box>ruby
    1.83 -      base box</dfn>. (Corresponds to HTML/XHTML <code>&lt;rb&gt;</code>
    1.84 -      elements.)
    1.85 -
    1.86 -     <dt>‘<code class=css>ruby-text</code>’
    1.87 +      id=ruby-base-container-box
    1.88 +      title="ruby base container box | ruby base container">ruby base
    1.89 +      container box</dfn>. (Corresponds to XHTML <code>&lt;rbc&gt;</code>
    1.90 +      elements; always implied in HTML.)
    1.91 +
    1.92 +     <dt>‘<code class=css>ruby-text-container</code>’
    1.93  
    1.94       <dd>Specifies that an element generates a <dfn
    1.95 -      id=ruby-annotation-box>ruby annotation box</dfn>. (Corresponds to
    1.96 -      HTML/XHTML <code>&lt;rt&gt;</code> elements.)
    1.97 -
    1.98 -     <dt>‘<code class=css>ruby-base-container</code>’
    1.99 -
   1.100 -     <dd>Specifies that an element generates a <dfn
   1.101 -      id=ruby-base-container-box>ruby base container box</dfn>. (Corresponds
   1.102 -      to XHTML <code>&lt;rbc&gt;</code> elements; always implied in HTML.)
   1.103 -
   1.104 -     <dt>‘<code class=css>ruby-text-container</code>’
   1.105 -
   1.106 -     <dd>Specifies that an element generates a <dfn
   1.107 -      id=ruby-annotation-container-box>ruby annotation container box</dfn>.
   1.108 -      (Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
   1.109 +      id=ruby-annotation-container-box
   1.110 +      title="ruby annotation container box | ruby annotation container">ruby
   1.111 +      annotation container box</dfn>. (Corresponds to HTML/XHTML
   1.112 +      <code>&lt;ruby&gt;</code> elements.)
   1.113      </dl>
   1.114  
   1.115 +    <h3 id=box-fixup><span class=secno>2.2. </span> Anonymous Ruby Box
   1.116 +     Generation</h3>
   1.117 +
   1.118      <p>The CSS model does not require that the document language include
   1.119       elements that correspond to each of these components. Missing parts of
   1.120 -     the structure are implied through the anonymous box generation rules.
   1.121 -
   1.122 -    <p class=issue>The spec needs to address anonymous box generation rules
   1.123 -     (and to make them compatible with HTML5 ruby markup).
   1.124 -
   1.125 -    <p class=issue>How should box generation rules deal with ruby elements
   1.126 -     that contain block-level boxes? Turn them into inline blocks? Treat them
   1.127 -     as ‘<code class=css>display: none</code>’? Force them to float?
   1.128 -     Something else?
   1.129 -
   1.130 -    <h3 id=box-model><span class=secno>2.2. </span> Ruby box model</h3>
   1.131 +     the structure are implied through the anonymous box generation rules <a
   1.132 +     href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to
   1.133 +     those used to normalize tables</a>. <a href="#CSS21"
   1.134 +     rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
   1.135 +
   1.136 +    <ol>
   1.137 +     <li>Any in-flow block-level boxes directly contained by a <a
   1.138 +      href="#ruby-container-box"><i>ruby container</i></a>, <a
   1.139 +      href="#ruby-base-container-box"><i>ruby base container</i></a>, <a
   1.140 +      href="#ruby-annotation-container-box"><i>ruby annotation
   1.141 +      container</i></a>, <a href="#ruby-base-box"><i>ruby base box</i></a>,
   1.142 +      or <a href="#ruby-annotation-box"><i>ruby annotation box</i></a> are
   1.143 +      forced to be inline-level boxes, and their ‘<code
   1.144 +      class=property>display</code>’ value computed accordingly. For
   1.145 +      example, the ‘<code class=property>display</code>’ property of an
   1.146 +      in-flow element with ‘<code class=css>display: block</code>’
   1.147 +      parented by an element with ‘<code class=css>display:
   1.148 +      ruby-text</code>’ computes to ‘<code
   1.149 +      class=css>inline-block</code>’. This computation occurs after any
   1.150 +      intermediary anonymous-box fixup (such as that required by internal
   1.151 +      table elements).
   1.152 +
   1.153 +     <li>Any consecutive sequence of <a href="#ruby-base-box"><i>ruby
   1.154 +      bases</i></a> not parented by a <a
   1.155 +      href="#ruby-base-container-box"><i>ruby base container</i></a> is
   1.156 +      wrapped in an anonymous <a href="#ruby-base-container-box"><i>ruby base
   1.157 +      container</i></a>. Similarly, any consecutive sequence of <a
   1.158 +      href="#ruby-annotation-box"><i>ruby annotations</i></a> not parented by
   1.159 +      a <a href="#ruby-annotation-container-box"><i>ruby annotation
   1.160 +      container</i></a> is wrapped in an anonymous <a
   1.161 +      href="#ruby-annotation-container-box"><i>ruby annotation
   1.162 +      container</i></a>.
   1.163 +
   1.164 +     <li>Within each <a href="#ruby-base-container-box"><i>ruby base
   1.165 +      container</i></a>, each sequence of inline-level boxes is wrapped in an
   1.166 +      anonymous <a href="#ruby-base-box"><i>ruby base box</i></a>. Similarly,
   1.167 +      within each <a href="#ruby-annotation-container-box"><i>ruby annotation
   1.168 +      container</i></a>, each sequence of inline-level boxes is wrapped in an
   1.169 +      anonymous <a href="#ruby-annotation-box"><i>ruby annotation
   1.170 +      box</i></a>.
   1.171 +
   1.172 +     <li>A sequence of <a href="#ruby-base-container-box"><i>ruby base
   1.173 +      containers</i></a> and/or <a
   1.174 +      href="#ruby-annotation-container-box"><i>ruby annotation
   1.175 +      containers</i></a> not parented by a <a
   1.176 +      href="#ruby-container-box"><i>ruby container</i></a> is wrapped in an
   1.177 +      anonymous <a href="#ruby-container-box"><i>ruby container</i></a>.
   1.178 +    </ol>
   1.179 +
   1.180 +    <p>At this point, all ruby layout structures are properly parented, and
   1.181 +     the UA can start to associate bases with their annotations.
   1.182 +
   1.183 +    <p class=note> Note that the UA is not required to create any of these
   1.184 +     anonymous boxes in its internal structures, as long as pairing and
   1.185 +     layout behaves as if they existed.
   1.186 +
   1.187 +    <h3 id=pairing><span class=secno>2.3. </span> Ruby Pairing and Annotation
   1.188 +     Levels</h3>
   1.189 +
   1.190 +    <p>Within a ruby structure, each <a href="#ruby-base-box"><i>ruby
   1.191 +     bases</i></a> are associated with <a href="#ruby-annotation-box"><i>ruby
   1.192 +     annotations</i></a> and vice versa. A <a href="#ruby-base-box"><i>ruby
   1.193 +     base</i></a> can be associated with at most one <a
   1.194 +     href="#ruby-annotation-box"><i>ruby annotation</i></a> per annotation
   1.195 +     level. If there are multiple annotation levels, it can therefore be
   1.196 +     associated with multiple <a href="#ruby-annotation-box"><i>ruby
   1.197 +     annotations</i></a>. A <a href="#ruby-annotation-box"><i>ruby
   1.198 +     annotation</i></a> is associated with one or more <a
   1.199 +     href="#ruby-base-box"><i>ruby bases</i></a>; annotations can span
   1.200 +     multiple bases.
   1.201 +
   1.202 +    <p><dfn id=annotation-pairing>Annotation pairing</dfn> is the process of
   1.203 +     associating <a href="#ruby-annotation-box"><i>ruby annotations</i></a>
   1.204 +     with <a href="#ruby-base-box"><i>ruby bases</i></a>.
   1.205 +
   1.206 +    <ol>
   1.207 +     <li>
   1.208 +      <p>First, the ruby structure is divided into <a
   1.209 +       href="#ruby-segments"><i>ruby segments</i></a>, each consisting of a
   1.210 +       single <a href="#ruby-base-container-box"><i>ruby base
   1.211 +       container</i></a> followed by one or more <a
   1.212 +       href="#ruby-annotation-container-box"><i>ruby annotation
   1.213 +       containers</i></a>. If the first child of a <a
   1.214 +       href="#ruby-container-box"><i>ruby container</i></a> is a <a
   1.215 +       href="#ruby-annotation-container-box"><i>ruby annotation
   1.216 +       container</i></a>, an anonymous, empty <a
   1.217 +       href="#ruby-base-container-box"><i>ruby base container</i></a> is
   1.218 +       assumed to exist before it. Similarly, if the <a
   1.219 +       href="#ruby-container-box"><i>ruby container</i></a> contains
   1.220 +       consecutive <a href="#ruby-base-container-box"><i>ruby base
   1.221 +       containers</i></a>, anonymous, empty <a
   1.222 +       href="#ruby-annotation-container-box"><i>ruby annotation
   1.223 +       containers</i></a> are assumed to exist between them. The <a
   1.224 +       href="#ruby-base-container-box"><i>ruby base container</i></a> in each
   1.225 +       segment is thus associated with each of the <a
   1.226 +       href="#ruby-annotation-container-box"><i>ruby annotation
   1.227 +       containers</i></a> in that segment.
   1.228 +
   1.229 +      <p>Each <a href="#ruby-annotation-container-box"><i>ruby annotation
   1.230 +       containers</i></a> in a <i>ruby segment</i> represents one <dfn
   1.231 +       id=level title="annotation level | level">level</dfn> of annotation:
   1.232 +       the first one represents the first level of annotation, the second one
   1.233 +       represents the second level of annotation, and so on.
   1.234 +
   1.235 +     <li>Within each <i>ruby segment</i>, each <a
   1.236 +      href="#ruby-base-box"><i>ruby base box</i></a> in the <a
   1.237 +      href="#ruby-base-container-box"><i>ruby base container</i></a> is
   1.238 +      paired with one <a href="#ruby-annotation-box"><i>ruby annotation
   1.239 +      box</i></a> from each <a href="#ruby-annotation-container-box"><i>ruby
   1.240 +      annotation container</i></a> in its <i>ruby segment</i>. If there are
   1.241 +      not enough <a href="#ruby-annotation-box"><i>ruby annotations</i></a>
   1.242 +      in a <a href="#ruby-annotation-container-box"><i>ruby annotation
   1.243 +      container</i></a>, the last one is associated with any excess <a
   1.244 +      href="#ruby-base-box"><i>ruby bases</i></a>. (If there are not any in
   1.245 +      the <a href="#ruby-annotation-container-box"><i>ruby annotation
   1.246 +      container</i></a>, an anonymous empty one is assumed to exist.) If
   1.247 +      there are not enough <a href="#ruby-base-box"><i>ruby bases</i></a>,
   1.248 +      any remaining <a href="#ruby-annotation-box"><i>ruby
   1.249 +      annotations</i></a> are assumed to be associated with empty, anonymous
   1.250 +      bases inserted at the end of the <a
   1.251 +      href="#ruby-base-container-box"><i>ruby base container</i></a>.
   1.252 +    </ol>
   1.253 +
   1.254 +    <p>A this point, ruby “columns” are defined, each represented by a
   1.255 +     single <a href="#ruby-base-box"><i>ruby base</i></a> and associated with
   1.256 +     one <a href="#ruby-annotation-box"><i>ruby annotation</i></a> (possibly
   1.257 +     an empty, anonymous one) from each <a href="#level"><i>annotation
   1.258 +     level</i></a>.
   1.259 +
   1.260 +    <h4 id=nested-pairing><span class=secno>2.3.1. </span> Nested Ruby</h4>
   1.261 +
   1.262 +    <p>When <a href="#ruby-container-box"><i>ruby containers</i></a> are
   1.263 +     nested, pairing begins with the deepest <a
   1.264 +     href="#ruby-container-box"><i>ruby container</i></a>, then expands out,
   1.265 +     treating each <a href="#ruby-container-box"><i>ruby container</i></a>
   1.266 +     nested within another <a href="#ruby-container-box"><i>ruby
   1.267 +     container</i></a> as a <a href="#ruby-base-box"><i>ruby base</i></a>,
   1.268 +     and associating each <a href="#ruby-annotation-box"><i>ruby
   1.269 +     annotation</i></a> associated with the nested <a
   1.270 +     href="#ruby-container-box"><i>ruby container</i></a> as being associated
   1.271 +     with (spanning) all of its <a href="#ruby-base-box"><i>ruby
   1.272 +     bases</i></a>.
   1.273 +
   1.274 +    <p>Using nested <a href="#ruby-container-box"><i>ruby containers</i></a>
   1.275 +     thus allows the representation of complex spanning relationships.
   1.276 +
   1.277 +    <p class=issue>This shouldn't belong in Level 1. But HTML5 allows it, so
   1.278 +     we have to handle it. Yay HTML5.
   1.279 +
   1.280 +    <h3 id=box-model><span class=secno>2.4. </span> Generating Ruby Structure</h3>
   1.281 +
   1.282 +    <p>
   1.283 +
   1.284 +    <h3 id=box-model><span class=secno>2.5. </span> Ruby box model</h3>
   1.285  
   1.286      <p>In the following description, the elements specified by Ruby
   1.287       Annotation <a href="#RUBY" rel=biblioentry>[RUBY]<!--{{RUBY}}--></a> are
   1.288 @@ -640,7 +804,7 @@
   1.289       a styling rule for these elements that avoids rendering them such as 
   1.290       <samp>rp {display: none}</samp>.
   1.291  
   1.292 -    <h3 id=ruby-line-height><span class=secno>2.3. </span> Ruby box and line
   1.293 +    <h3 id=ruby-line-height><span class=secno>2.6. </span> Ruby box and line
   1.294       stacking</h3>
   1.295  
   1.296      <p>The interaction of the ruby box and line stacking is controlled by the
   1.297 @@ -658,7 +822,7 @@
   1.298  
   1.299      <p>In the following figure, each line box is shown with leading space
   1.300       distributed before and after the two text segments (‘<code
   1.301 -     class=css>Previous line</code>’ and ‘<a href="#ruby-base"><code
   1.302 +     class=css>Previous line</code>’ and ‘<a href="#ruby-base-box"><code
   1.303       class=css>Ruby base</code></a>’); the dotted lines show the line box
   1.304       for each line. The ‘<code class=property>line-stacking-ruby</code>’
   1.305       property is set to ‘<code class=property>exclude-ruby</code>’. The
   1.306 @@ -696,7 +860,7 @@
   1.307       than the computed line-height of the largest ruby element within the
   1.308       block.
   1.309  
   1.310 -    <h3 id=ruby-line-breaking><span class=secno>2.4. </span> Ruby box and
   1.311 +    <h3 id=ruby-line-breaking><span class=secno>2.7. </span> Ruby box and
   1.312       line breaking</h3>
   1.313  
   1.314      <p>When a ruby falls at the end of a line where there is not sufficient
   1.315 @@ -1516,7 +1680,7 @@
   1.316       not possible with CSS to express rules that will automatically and
   1.317       correctly add parentheses to unparenthesized ruby annotations in HTML.
   1.318       (This is because HTML ruby allows implying the <a
   1.319 -     href="#ruby-base"><i>ruby base</i></a> from raw text, without a
   1.320 +     href="#ruby-base-box"><i>ruby base</i></a> from raw text, without a
   1.321       corresponding element.) However, these rules will handle cases where
   1.322       either <code>&lt;rb&gt;</code> or <code>&lt;rtc&gt;</code> is used
   1.323       rigorously.
   1.324 @@ -1827,9 +1991,18 @@
   1.325      <h2 class=no-num id=index> Index</h2>
   1.326      <!--begin-index-->
   1.327      <ul class=indexlist>
   1.328 +     <li>annotation level, <a href="#level"
   1.329 +      title="section 2.3."><strong>2.3.</strong></a>
   1.330 +
   1.331 +     <li>Annotation pairing, <a href="#annotation-pairing"
   1.332 +      title="section 2.3."><strong>2.3.</strong></a>
   1.333 +
   1.334       <li>authoring tool, <a href="#authoring-tool"
   1.335        title="section 6.2."><strong>6.2.</strong></a>
   1.336  
   1.337 +     <li>level, <a href="#level"
   1.338 +      title="section 2.3."><strong>2.3.</strong></a>
   1.339 +
   1.340       <li>renderer, <a href="#renderer"
   1.341        title="section 6.2."><strong>6.2.</strong></a>
   1.342  
   1.343 @@ -1854,24 +2027,36 @@
   1.344        title="section 3.3."><strong>3.3.</strong></a>
   1.345  
   1.346       <li>ruby annotation, <a href="#ruby-annotation"
   1.347 -      title="section 2."><strong>2.</strong></a>
   1.348 +      title="section 2."><strong>2.</strong></a>, <a
   1.349 +      href="#ruby-annotation-box"
   1.350 +      title="section 2.1."><strong>2.1.</strong></a>
   1.351  
   1.352       <li>ruby annotation box, <a href="#ruby-annotation-box"
   1.353        title="section 2.1."><strong>2.1.</strong></a>
   1.354  
   1.355 +     <li>ruby annotation container, <a href="#ruby-annotation-container-box"
   1.356 +      title="section 2.1."><strong>2.1.</strong></a>
   1.357 +
   1.358       <li>ruby annotation container box, <a
   1.359        href="#ruby-annotation-container-box"
   1.360        title="section 2.1."><strong>2.1.</strong></a>
   1.361  
   1.362       <li>ruby base, <a href="#ruby-base"
   1.363 -      title="section 2."><strong>2.</strong></a>
   1.364 +      title="section 2."><strong>2.</strong></a>, <a href="#ruby-base-box"
   1.365 +      title="section 2.1."><strong>2.1.</strong></a>
   1.366  
   1.367       <li>ruby base box, <a href="#ruby-base-box"
   1.368        title="section 2.1."><strong>2.1.</strong></a>
   1.369  
   1.370 +     <li>ruby base container, <a href="#ruby-base-container-box"
   1.371 +      title="section 2.1."><strong>2.1.</strong></a>
   1.372 +
   1.373       <li>ruby base container box, <a href="#ruby-base-container-box"
   1.374        title="section 2.1."><strong>2.1.</strong></a>
   1.375  
   1.376 +     <li>ruby container, <a href="#ruby-container-box"
   1.377 +      title="section 2.1."><strong>2.1.</strong></a>
   1.378 +
   1.379       <li>ruby container box, <a href="#ruby-container-box"
   1.380        title="section 2.1."><strong>2.1.</strong></a>
   1.381  
     2.1 --- a/css-ruby/Overview.src.html	Wed Jun 19 00:18:35 2013 +0900
     2.2 +++ b/css-ruby/Overview.src.html	Wed Jun 19 00:31:59 2013 +0900
     2.3 @@ -238,29 +238,138 @@
     2.4  
     2.5  	<dl>
     2.6  		<dt>''ruby''
     2.7 -			<dd>Specifies that an element generates a <dfn>ruby container box</dfn>.
     2.8 +			<dd>Specifies that an element generates a <dfn title="ruby container | ruby container box">ruby container box</dfn>.
     2.9  			(Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
    2.10  		<dt>''ruby-base''
    2.11 -			<dd>Specifies that an element generates a <dfn>ruby base box</dfn>.
    2.12 +			<dd>Specifies that an element generates a <dfn title="ruby base box | ruby base">ruby base box</dfn>.
    2.13  			(Corresponds to HTML/XHTML <code>&lt;rb&gt;</code> elements.)
    2.14  		<dt>''ruby-text''
    2.15 -			<dd>Specifies that an element generates a <dfn>ruby annotation box</dfn>.
    2.16 +			<dd>Specifies that an element generates a <dfn title="ruby annotation box | ruby annotation">ruby annotation box</dfn>.
    2.17  			(Corresponds to HTML/XHTML <code>&lt;rt&gt;</code> elements.)
    2.18  		<dt>''ruby-base-container''
    2.19 -			<dd>Specifies that an element generates a <dfn>ruby base container box</dfn>.
    2.20 +			<dd>Specifies that an element generates a <dfn title="ruby base container box | ruby base container">ruby base container box</dfn>.
    2.21  			(Corresponds to XHTML <code>&lt;rbc&gt;</code> elements; always implied in HTML.)
    2.22  		<dt>''ruby-text-container''
    2.23 -			<dd>Specifies that an element generates a <dfn>ruby annotation container box</dfn>.
    2.24 +			<dd>Specifies that an element generates a <dfn title="ruby annotation container box | ruby annotation container">ruby annotation container box</dfn>.
    2.25  			(Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
    2.26  	</dl>
    2.27  
    2.28 +<h3 id="box-fixup">
    2.29 +Anonymous Ruby Box Generation</h3>
    2.30 +
    2.31  	<p>The CSS model does not require that the document language
    2.32  	include elements that correspond to each of these components.
    2.33 -	Missing parts of the structure are implied through the anonymous box generation rules.
    2.34 +	Missing parts of the structure are implied through the anonymous box generation rules
    2.35 +	<a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to those used to normalize tables</a>. [[!CSS21]]
    2.36  
    2.37 -	<p class="issue">The spec needs to address anonymous box generation rules (and to make them compatible with HTML5 ruby markup).
    2.38 -	<p class="issue">How should box generation rules deal with ruby elements that contain block-level boxes?
    2.39 -	Turn them into inline blocks? Treat them as 'display: none'? Force them to float? Something else?
    2.40 +	<ol>
    2.41 +		<li>Any in-flow block-level boxes directly contained by a
    2.42 +		<i>ruby container</i>,
    2.43 +		<i>ruby base container</i>,
    2.44 +		<i>ruby annotation container</i>,
    2.45 +		<i>ruby base box</i>,
    2.46 +		or <i>ruby annotation box</i>
    2.47 +		are forced to be inline-level boxes,
    2.48 +		and their 'display' value computed accordingly.
    2.49 +		For example,
    2.50 +		the 'display' property of an in-flow element with ''display: block''
    2.51 +		parented by an element with ''display: ruby-text''
    2.52 +		computes to ''inline-block''.
    2.53 +		This computation occurs after any intermediary anonymous-box fixup
    2.54 +		(such as that required by internal table elements).
    2.55 +
    2.56 +		<li>Any consecutive sequence of <i>ruby bases</i> not parented by a <i>ruby base container</i>
    2.57 +		is wrapped in an anonymous <i>ruby base container</i>.
    2.58 +		Similarly, any consecutive sequence of <i>ruby annotations</i> not parented by a <i>ruby annotation container</i>
    2.59 +		is wrapped in an anonymous <i>ruby annotation container</i>.
    2.60 +
    2.61 +		<li>Within each <i>ruby base container</i>,
    2.62 +		each sequence of inline-level boxes is wrapped in an anonymous <i>ruby base box</i>.
    2.63 +		Similarly, within each <i>ruby annotation container</i>,
    2.64 +		each sequence of inline-level boxes is wrapped in an anonymous <i>ruby annotation box</i>.
    2.65 +
    2.66 +		<li>A sequence of <i>ruby base containers</i> and/or <i>ruby annotation containers</i>
    2.67 +		not parented by a <i>ruby container</i>
    2.68 +		is wrapped in an anonymous <i>ruby container</i>.
    2.69 +	</ol>
    2.70 +
    2.71 +	<p>At this point, all ruby layout structures are properly parented,
    2.72 +	and the UA can start to associate bases with their annotations.
    2.73 +
    2.74 +	<p class="note">
    2.75 +	Note that the UA is not required to create any of these anonymous boxes in its internal structures,
    2.76 +	as long as pairing and layout behaves as if they existed.
    2.77 +
    2.78 +<h3 id="pairing">
    2.79 +Ruby Pairing and Annotation Levels</h3>
    2.80 +
    2.81 +	<p>Within a ruby structure,
    2.82 +	each <i>ruby bases</i> are associated with <i>ruby annotations</i>
    2.83 +	and vice versa.
    2.84 +	A <i>ruby base</i> can be associated with at most one <i>ruby annotation</i> per annotation level.
    2.85 +	If there are multiple annotation levels, it can therefore be associated with multiple <i>ruby annotations</i>.
    2.86 +	A <i>ruby annotation</i> is associated with one or more <i>ruby bases</i>;
    2.87 +	annotations can span multiple bases.
    2.88 +
    2.89 +	<p><dfn>Annotation pairing</dfn> is the process of associating
    2.90 +	<i>ruby annotations</i> with <i>ruby bases</i>.
    2.91 +
    2.92 +	<ol>
    2.93 +		<li>
    2.94 +		<p>First, the ruby structure is divided into <i>ruby segments</i>,
    2.95 +		each consisting of a single <i>ruby base container</i>
    2.96 +		followed by one or more <i>ruby annotation containers</i>.
    2.97 +		If the first child of a <i>ruby container</i> is a <i>ruby annotation container</i>,
    2.98 +		an anonymous, empty <i>ruby base container</i> is assumed to exist before it.
    2.99 +		Similarly, if the <i>ruby container</i> contains consecutive <i>ruby base containers</i>,
   2.100 +		anonymous, empty <i>ruby annotation containers</i> are assumed to exist between them.
   2.101 +		The <i>ruby base container</i> in each segment is thus associated
   2.102 +		with each of the <i>ruby annotation containers</i> in that segment.
   2.103 +
   2.104 +		<p>Each <i>ruby annotation containers</i> in a <i>ruby segment</i>
   2.105 +		represents one <dfn title="annotation level | level">level</dfn> of annotation:
   2.106 +		the first one represents the first level of annotation,
   2.107 +		the second one represents the second level of annotation,
   2.108 +		and so on.
   2.109 +
   2.110 +		<li>Within each <i>ruby segment</i>,
   2.111 +		each <i>ruby base box</i> in the <i>ruby base container</i>
   2.112 +		is paired with one <i>ruby annotation box</i>
   2.113 +		from each <i>ruby annotation container</i> in its <i>ruby segment</i>.
   2.114 +		If there are not enough <i>ruby annotations</i> in a <i>ruby annotation container</i>,
   2.115 +		the last one is associated with any excess <i>ruby bases</i>.
   2.116 +		(If there are not any in the <i>ruby annotation container</i>, an anonymous empty one is assumed to exist.)
   2.117 +		If there are not enough <i>ruby bases</i>,
   2.118 +		any remaining <i>ruby annotations</i> are assumed to be associated
   2.119 +		with empty, anonymous bases inserted at the end of the <i>ruby base container</i>.
   2.120 +	</ol>
   2.121 +
   2.122 +	<p>A this point, ruby “columns” are defined,
   2.123 +	each represented by a single <i>ruby base</i>
   2.124 +	and associated with one <i>ruby annotation</i> (possibly an empty, anonymous one)
   2.125 +	from each <i>annotation level</i>.
   2.126 +
   2.127 +<h4 id="nested-pairing">
   2.128 +Nested Ruby</h4>
   2.129 +
   2.130 +	<p>When <i>ruby containers</i> are nested,
   2.131 +	pairing begins with the deepest <i>ruby container</i>,
   2.132 +	then expands out,
   2.133 +	treating each <i>ruby container</i> nested within another <i>ruby container</i>
   2.134 +	as a <i>ruby base</i>,
   2.135 +	and associating each <i>ruby annotation</i>
   2.136 +	associated with the nested <i>ruby container</i>
   2.137 +	as being associated with (spanning) all of its <i>ruby bases</i>.
   2.138 +
   2.139 +	<p>Using nested <i>ruby containers</i> thus allows the representation
   2.140 +	of complex spanning relationships.
   2.141 +
   2.142 +	<p class="issue">This shouldn't belong in Level 1. But HTML5 allows it, so we have to handle it. Yay HTML5.
   2.143 +
   2.144 +<h3 id="box-model">
   2.145 +Generating Ruby Structure</h3>
   2.146 +
   2.147 +	<p>
   2.148  
   2.149  <h3 id="box-model">
   2.150  Ruby box model</h3>

mercurial