1.1 --- a/css-ruby/Overview.src.html Wed Jun 19 00:18:35 2013 +0900 1.2 +++ b/css-ruby/Overview.src.html Wed Jun 19 00:31:59 2013 +0900 1.3 @@ -238,29 +238,138 @@ 1.4 1.5 <dl> 1.6 <dt>''ruby'' 1.7 - <dd>Specifies that an element generates a <dfn>ruby container box</dfn>. 1.8 + <dd>Specifies that an element generates a <dfn title="ruby container | ruby container box">ruby container box</dfn>. 1.9 (Corresponds to HTML/XHTML <code><ruby></code> elements.) 1.10 <dt>''ruby-base'' 1.11 - <dd>Specifies that an element generates a <dfn>ruby base box</dfn>. 1.12 + <dd>Specifies that an element generates a <dfn title="ruby base box | ruby base">ruby base box</dfn>. 1.13 (Corresponds to HTML/XHTML <code><rb></code> elements.) 1.14 <dt>''ruby-text'' 1.15 - <dd>Specifies that an element generates a <dfn>ruby annotation box</dfn>. 1.16 + <dd>Specifies that an element generates a <dfn title="ruby annotation box | ruby annotation">ruby annotation box</dfn>. 1.17 (Corresponds to HTML/XHTML <code><rt></code> elements.) 1.18 <dt>''ruby-base-container'' 1.19 - <dd>Specifies that an element generates a <dfn>ruby base container box</dfn>. 1.20 + <dd>Specifies that an element generates a <dfn title="ruby base container box | ruby base container">ruby base container box</dfn>. 1.21 (Corresponds to XHTML <code><rbc></code> elements; always implied in HTML.) 1.22 <dt>''ruby-text-container'' 1.23 - <dd>Specifies that an element generates a <dfn>ruby annotation container box</dfn>. 1.24 + <dd>Specifies that an element generates a <dfn title="ruby annotation container box | ruby annotation container">ruby annotation container box</dfn>. 1.25 (Corresponds to HTML/XHTML <code><ruby></code> elements.) 1.26 </dl> 1.27 1.28 +<h3 id="box-fixup"> 1.29 +Anonymous Ruby Box Generation</h3> 1.30 + 1.31 <p>The CSS model does not require that the document language 1.32 include elements that correspond to each of these components. 1.33 - Missing parts of the structure are implied through the anonymous box generation rules. 1.34 + Missing parts of the structure are implied through the anonymous box generation rules 1.35 + <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to those used to normalize tables</a>. [[!CSS21]] 1.36 1.37 - <p class="issue">The spec needs to address anonymous box generation rules (and to make them compatible with HTML5 ruby markup). 1.38 - <p class="issue">How should box generation rules deal with ruby elements that contain block-level boxes? 1.39 - Turn them into inline blocks? Treat them as 'display: none'? Force them to float? Something else? 1.40 + <ol> 1.41 + <li>Any in-flow block-level boxes directly contained by a 1.42 + <i>ruby container</i>, 1.43 + <i>ruby base container</i>, 1.44 + <i>ruby annotation container</i>, 1.45 + <i>ruby base box</i>, 1.46 + or <i>ruby annotation box</i> 1.47 + are forced to be inline-level boxes, 1.48 + and their 'display' value computed accordingly. 1.49 + For example, 1.50 + the 'display' property of an in-flow element with ''display: block'' 1.51 + parented by an element with ''display: ruby-text'' 1.52 + computes to ''inline-block''. 1.53 + This computation occurs after any intermediary anonymous-box fixup 1.54 + (such as that required by internal table elements). 1.55 + 1.56 + <li>Any consecutive sequence of <i>ruby bases</i> not parented by a <i>ruby base container</i> 1.57 + is wrapped in an anonymous <i>ruby base container</i>. 1.58 + Similarly, any consecutive sequence of <i>ruby annotations</i> not parented by a <i>ruby annotation container</i> 1.59 + is wrapped in an anonymous <i>ruby annotation container</i>. 1.60 + 1.61 + <li>Within each <i>ruby base container</i>, 1.62 + each sequence of inline-level boxes is wrapped in an anonymous <i>ruby base box</i>. 1.63 + Similarly, within each <i>ruby annotation container</i>, 1.64 + each sequence of inline-level boxes is wrapped in an anonymous <i>ruby annotation box</i>. 1.65 + 1.66 + <li>A sequence of <i>ruby base containers</i> and/or <i>ruby annotation containers</i> 1.67 + not parented by a <i>ruby container</i> 1.68 + is wrapped in an anonymous <i>ruby container</i>. 1.69 + </ol> 1.70 + 1.71 + <p>At this point, all ruby layout structures are properly parented, 1.72 + and the UA can start to associate bases with their annotations. 1.73 + 1.74 + <p class="note"> 1.75 + Note that the UA is not required to create any of these anonymous boxes in its internal structures, 1.76 + as long as pairing and layout behaves as if they existed. 1.77 + 1.78 +<h3 id="pairing"> 1.79 +Ruby Pairing and Annotation Levels</h3> 1.80 + 1.81 + <p>Within a ruby structure, 1.82 + each <i>ruby bases</i> are associated with <i>ruby annotations</i> 1.83 + and vice versa. 1.84 + A <i>ruby base</i> can be associated with at most one <i>ruby annotation</i> per annotation level. 1.85 + If there are multiple annotation levels, it can therefore be associated with multiple <i>ruby annotations</i>. 1.86 + A <i>ruby annotation</i> is associated with one or more <i>ruby bases</i>; 1.87 + annotations can span multiple bases. 1.88 + 1.89 + <p><dfn>Annotation pairing</dfn> is the process of associating 1.90 + <i>ruby annotations</i> with <i>ruby bases</i>. 1.91 + 1.92 + <ol> 1.93 + <li> 1.94 + <p>First, the ruby structure is divided into <i>ruby segments</i>, 1.95 + each consisting of a single <i>ruby base container</i> 1.96 + followed by one or more <i>ruby annotation containers</i>. 1.97 + If the first child of a <i>ruby container</i> is a <i>ruby annotation container</i>, 1.98 + an anonymous, empty <i>ruby base container</i> is assumed to exist before it. 1.99 + Similarly, if the <i>ruby container</i> contains consecutive <i>ruby base containers</i>, 1.100 + anonymous, empty <i>ruby annotation containers</i> are assumed to exist between them. 1.101 + The <i>ruby base container</i> in each segment is thus associated 1.102 + with each of the <i>ruby annotation containers</i> in that segment. 1.103 + 1.104 + <p>Each <i>ruby annotation containers</i> in a <i>ruby segment</i> 1.105 + represents one <dfn title="annotation level | level">level</dfn> of annotation: 1.106 + the first one represents the first level of annotation, 1.107 + the second one represents the second level of annotation, 1.108 + and so on. 1.109 + 1.110 + <li>Within each <i>ruby segment</i>, 1.111 + each <i>ruby base box</i> in the <i>ruby base container</i> 1.112 + is paired with one <i>ruby annotation box</i> 1.113 + from each <i>ruby annotation container</i> in its <i>ruby segment</i>. 1.114 + If there are not enough <i>ruby annotations</i> in a <i>ruby annotation container</i>, 1.115 + the last one is associated with any excess <i>ruby bases</i>. 1.116 + (If there are not any in the <i>ruby annotation container</i>, an anonymous empty one is assumed to exist.) 1.117 + If there are not enough <i>ruby bases</i>, 1.118 + any remaining <i>ruby annotations</i> are assumed to be associated 1.119 + with empty, anonymous bases inserted at the end of the <i>ruby base container</i>. 1.120 + </ol> 1.121 + 1.122 + <p>A this point, ruby “columns” are defined, 1.123 + each represented by a single <i>ruby base</i> 1.124 + and associated with one <i>ruby annotation</i> (possibly an empty, anonymous one) 1.125 + from each <i>annotation level</i>. 1.126 + 1.127 +<h4 id="nested-pairing"> 1.128 +Nested Ruby</h4> 1.129 + 1.130 + <p>When <i>ruby containers</i> are nested, 1.131 + pairing begins with the deepest <i>ruby container</i>, 1.132 + then expands out, 1.133 + treating each <i>ruby container</i> nested within another <i>ruby container</i> 1.134 + as a <i>ruby base</i>, 1.135 + and associating each <i>ruby annotation</i> 1.136 + associated with the nested <i>ruby container</i> 1.137 + as being associated with (spanning) all of its <i>ruby bases</i>. 1.138 + 1.139 + <p>Using nested <i>ruby containers</i> thus allows the representation 1.140 + of complex spanning relationships. 1.141 + 1.142 + <p class="issue">This shouldn't belong in Level 1. But HTML5 allows it, so we have to handle it. Yay HTML5. 1.143 + 1.144 +<h3 id="box-model"> 1.145 +Generating Ruby Structure</h3> 1.146 + 1.147 + <p> 1.148 1.149 <h3 id="box-model"> 1.150 Ruby box model</h3>