Thu, 15 Aug 2013 16:26:55 -0700
[css-ruby] Check in some commented-out notes on bidi reordering, to review and write up properly later.
1 <!--
3 Issues:
4 bidi
5 box layout/sizing
6 clean up inter-character vs. parallel layout requirements
8 Redo all examples with consistent font. (M+ 2p?)
10 -->
12 <!DOCTYPE html>
13 <html lang="en">
14 <head>
15 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
16 <title>CSS Ruby Module Level 1</title>
17 <link rel=contents href="#contents">
18 <link rel=index href="#index">
19 <link rel="stylesheet" type="text/css" href="../default.css">
20 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
21 <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
22 </head>
24 <body class="h-entry">
26 <div class="head">
27 <!--logo-->
29 <h1 class="p-name">CSS Ruby Module Level 1</h1>
31 <h2 class="no-num no-toc">[LONGSTATUS] <time class="dt-updated" datetime="[CDATE]">[DATE]</time> <!-- for HTML4 doctype: <span class="value-title" title="[CDATE]">[DATE]</span></span> --> </h2>
32 <dl>
33 <dt>This version:
34 <dd><a class="u-url" href="[VERSION]">[VERSION]</a>
36 <dt>Latest version:
37 <dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/css3-ruby/</a>
39 <dt>Editor's draft:
40 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
41 (<a href="https://dvcs.w3.org/hg/csswg/log/tip/[SHORTNAME]/Overview.src.html">change log</a>)
43 <dt>Previous version:
44 <dd><a href="http://www.w3.org/TR/2011/WD-css3-ruby-20110630/">
45 http://www.w3.org/TR/2011/WD-css3-ruby-20110630/</a>
47 <dt>Issue Tracking:</dt>
48 <dd><a rel="issues" href="http://www.w3.org/Style/CSS/Tracker/products/FIXME">http://www.w3.org/Style/CSS/Tracker/products/FIXME</a>
50 <dt>Feedback:</dt>
51 <dd><a href="mailto:www-style@w3.org?subject=%5BSHORTNAME%5D%20feedback"
52 >www-style@w3.org</a>
53 with subject line “<kbd>[[SHORTNAME]]
54 <var>… message topic …</var></kbd>”
55 (<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/"
56 >archives</a>)
58 <dt>Editors:
59 <dd class="p-author h-card vcard">
60 <a class="p-name fn u-url url" rel="author"
61 href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>,
62 <a class="p-org org h-org" href="http://www.mozilla.org/">Mozilla</a>
63 <dd class="p-author h-card vcard">
64 <a class="p-name fn u-url url" rel="author"
65 href="mailto:koji.a.ishii@mail.rakuten.com">Koji Ishii</a>,
66 <span class="p-org org">Rakuten, Inc.</span>
67 <dd class="p-author h-card vcard">
68 <a class="p-name fn u-url url" rel="author"
69 href="mailto:ishida@w3.org">Richard Ishida</a>,
70 <span class="p-org org">W3C</span>
72 <dt>Former editors:
73 <dd>Michel Suignard, Microsoft
74 <dd>Marcin Sawicki, Microsoft
75 </dl>
77 <!--copyright-->
79 <hr title="Separator for header">
80 </div>
82 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
84 <p>
85 <span class="p-summary">
86 “Ruby” are short runs of text alongside the base text,
87 typically used in East Asian documents to indicate pronunciation
88 or to provide a short annotation.
89 This module describes the rendering model and formatting controls
90 related to displaying ruby annotations in CSS.
91 </span>
93 <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing
94 the rendering of structured documents (such as HTML and XML) on screen, on
95 paper, in speech, etc.
97 <h2 class="no-num no-toc" id="status">Status of this document</h2>
99 <!--status-->
101 <p>The following features are at risk: …
103 <h2 class="no-num no-toc" id="contents">
104 Table of Contents</h2>
106 <!--toc-->
108 <h2 id="intro">
109 Introduction</h2>
111 <p><em>This section is not normative.</em>
113 <h3 id="placement">
114 Module interactions</h3>
116 <p>This module extends the inline box model of CSS Level 2 [[!CSS21]]
117 to support ruby.
119 <p>None of the properties in this module apply to the <code>::first-line</code> or
120 <code>::first-letter</code> pseudo-elements.
122 <h3 id="values">
123 Values</h3>
125 <p>This specification follows the
126 <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
127 definition conventions</a> from [[!CSS21]]. Value types not defined in
128 this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
129 Other CSS modules may expand the definitions of these value types: for
130 example [[CSS3VAL]], when combined with this module, expands the
131 definition of the <var><length></var> value type as used in this specification.</p>
133 <p>In addition to the property-specific values listed in their definitions,
134 all properties defined in this specification also accept the
135 <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
136 keyword as their property value. For readability it has not been repeated
137 explicitly.
139 <h3 id="conventions">
140 Document conventions</h3>
142 <p>Many typographical conventions in East Asian typography depend
143 on whether the character rendered is wide (CJK) or narrow (non-CJK).
144 There are a number of illustrations in this document
145 for which the following legend is used:
147 <dl>
148 <dt><img alt="Symbolic wide-cell glyph representation" width="39" height="39" src="images/fullwidth.gif">
149 <dd>Wide-cell glyph (e.g. Han) that is the <var>n</var>th character in the text run.
150 They are typically sized to 50% when used as annotations.
151 <dt><img alt="Symbolic narrow-cell glyph representation" width="19" height="39" src="images/halfwidth.gif">
152 <dd>Narrow-cell glyph (e.g. Roman) which is the <var>n</var>th glyph in the text run.
153 </dl>
155 <p>The orientation which the above symbols assume in the diagrams
156 corresponds to the orientation that the glyphs they represent
157 are intended to assume when rendered by the user agent.
158 Spacing between these characters in the diagrams is incidental,
159 unless intentionally changed to make a point.
161 <h3 id="ruby-def">
162 What is ruby?</h3>
164 <p><dfn>Ruby</dfn> is the commonly-used name for a run of text
165 that appears alongside another run of text (referred to as the “base”)
166 and serves as an annotation or a pronunciation guide associated with that run of text.
168 <p>The following figures show two examples of Ruby,
169 a simple case and one with more complicated structure.
171 <div class="example">
172 <p>In this first example, a single annotation is used to annotate the base text.
173 <div class="figure">
174 <p><img src="images/licence.png"
175 alt="Example of ruby applied on top of a Japanese expression">
176 <p class="caption">Example of ruby used in Japanese (simple case)
177 </div>
178 <p>In Japanese typography, this case is sometimes called
179 <i lang="ja">taigo</i> ruby or group-ruby (per-word ruby),
180 because the annotation as a whole is associated
181 with multi-character word (as a whole).
182 </div>
184 <div class="example">
185 <p>In this second example,
186 two levels of annotations are attached to a base sequence:
187 the hiragana characters on top refer to the pronunciation of each of the base kanji characters,
188 while the words “Keio” and “University” on the bottom are annotations describing the English translation.
189 <div class="figure">
190 <p><img src="images/ruby-univ.gif"
191 alt="Example showing complex ruby with annotation text over and under the base characters">
192 <p class="caption">Complex ruby with annotation text over and under the base characters
193 </div>
194 <p>
195 <p>Notice that to allow correct association between the hiragana characters and
196 their corresponding Kanji base characters,
197 the spacing between these Kanji characters is adjusted.
198 (This happens around the fourth Kanji character in the figure above.)
199 To avoid variable spacing between the Kanji characters in the example above
200 the hiragana annotations can be styled as a <i>collapsed annotation</i>,
201 which will look more like the group-ruby example earlier.
202 However because the base-annotation pairings are recorded in the ruby structure,
203 if the text breaks across lines, the annotation characters will stay
204 correctly paired with their respective base characters.
205 </div>
207 <p><i>Ruby</i> formatting as used in Japanese is described in JIS X-4051 [[JIS4051]] (in Japanese)
208 and in Requirements for Japanese Text Layout [[JLREQ]] (in English and Japanese)].
209 In HTML, ruby structure and markup to represent it is described
210 in the Ruby Markup Extension specification.
211 This module describes the CSS rendering model
212 and formatting controls relevant to ruby layout of such markup.
214 <h2 id="ruby-model">
215 Ruby Formatting Model</h2>
217 <p>The CSS ruby model is based on
218 the <a href="http://darobin.github.io/html-ruby/">HTML Ruby Markup Extension</a>
219 and <a href="http://www.w3.org/TR/ruby/">XHTML Ruby Annotation Recommendation</a> [[RUBY]].
220 In this model, a ruby structure consists of
221 one or more <dfn>ruby base</dfn> elements representing the base (annotated) text,
222 associated with one or more levels of <dfn>ruby annotation</dfn> elements representing the annotations.
223 The structure of ruby is similar to that of a table:
224 there are “rows” (the base text level, each annotation level)
225 and “columns” (each <i>ruby base</i> and its corresponding <i>ruby annotations</i>).
227 <p>Consecutive bases and annotations are grouped together into <dfn>ruby segments</dfn>.
228 Within a <i>ruby segment</i>, a <i>ruby annotation</i> may span multiple <i>ruby bases<i>.
230 <p class="note">In HTML, a single <code><ruby></code> element may contain multiple <i>ruby segments</i>.
231 (In the XHTML Ruby model, a single <code><ruby></code> element can only contain one <i>ruby segment</i>.)
233 <h3 id="ruby-display">
234 Ruby-specific 'display' property values</h3>
236 <p>For document languages (such as XML applications) that do not have pre-defined ruby elements,
237 authors must map document language elements to ruby elements;
238 this is done with the 'display' property.
240 <table class="propdef">
241 <tr>
242 <th>Name:
243 <td>display
244 <tr>
245 <th><a href="#values">New Values</a>:
246 <td>ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container
247 </table>
249 <p>The following new 'display' values assign ruby layout roles to an arbitrary element:
251 <dl>
252 <dt>''ruby''
253 <dd>Specifies that an element generates a <dfn title="ruby container | ruby container box">ruby container box</dfn>.
254 (Corresponds to HTML/XHTML <code><ruby></code> elements.)
255 <dt>''ruby-base''
256 <dd>Specifies that an element generates a <dfn title="ruby base box | ruby base">ruby base box</dfn>.
257 (Corresponds to HTML/XHTML <code><rb></code> elements.)
258 <dt>''ruby-text''
259 <dd>Specifies that an element generates a <dfn title="ruby annotation box | ruby annotation">ruby annotation box</dfn>.
260 (Corresponds to HTML/XHTML <code><rt></code> elements.)
261 <dt>''ruby-base-container''
262 <dd>Specifies that an element generates a <dfn title="ruby base container box | ruby base container">ruby base container box</dfn>.
263 (Corresponds to XHTML <code><rbc></code> elements; always implied in HTML.)
264 <dt>''ruby-text-container''
265 <dd>Specifies that an element generates a <dfn title="ruby annotation container box | ruby annotation container">ruby annotation container box</dfn>.
266 (Corresponds to HTML/XHTML <code><ruby></code> elements.)
267 </dl>
269 <h3 id="box-fixup">
270 Anonymous Ruby Box Generation</h3>
272 <p>The CSS model does not require that the document language
273 include elements that correspond to each of these components.
274 Missing parts of the structure are implied through the anonymous box generation rules
275 <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to those used to normalize tables</a>. [[!CSS21]]
277 <ol>
278 <li>Any in-flow block-level boxes directly contained by a
279 <i>ruby container</i>,
280 <i>ruby base container</i>,
281 <i>ruby annotation container</i>,
282 <i>ruby base box</i>,
283 or <i>ruby annotation box</i>
284 are forced to be inline-level boxes,
285 and their 'display' value computed accordingly.
286 For example,
287 the 'display' property of an in-flow element with ''display: block''
288 parented by an element with ''display: ruby-text''
289 computes to ''inline-block''.
290 This computation occurs after any intermediary anonymous-box fixup
291 (such as that required by internal table elements).
293 <li>Any consecutive sequence of <i>ruby bases</i> not parented by a <i>ruby base container</i>
294 is wrapped in an anonymous <i>ruby base container</i>.
295 Similarly, any consecutive sequence of <i>ruby annotations</i> not parented by a <i>ruby annotation container</i>
296 is wrapped in an anonymous <i>ruby annotation container</i>.
298 <li>Within each <i>ruby base container</i>,
299 each sequence of inline-level boxes is wrapped in an anonymous <i>ruby base box</i>.
300 Similarly, within each <i>ruby annotation container</i>,
301 each sequence of inline-level boxes is wrapped in an anonymous <i>ruby annotation box</i>.
303 <li>A sequence of <i>ruby base containers</i> and/or <i>ruby annotation containers</i>
304 not parented by a <i>ruby container</i>
305 is wrapped in an anonymous <i>ruby container</i>.
306 </ol>
308 <p>At this point, all ruby layout structures are properly parented,
309 and the UA can start to associate bases with their annotations.
311 <p class="note">
312 Note that the UA is not required to create any of these anonymous boxes in its internal structures,
313 as long as pairing and layout behaves as if they existed.
315 <h3 id="pairing">
316 Ruby Pairing and Annotation Levels</h3>
318 <p>Within a ruby structure,
319 each <i>ruby base</i> is associated with <i>ruby annotations</i>
320 and vice versa.
321 A <i>ruby base</i> can be associated with at most one <i>ruby annotation</i> per annotation level.
322 If there are multiple annotation levels, it can therefore be associated with multiple <i>ruby annotations</i>.
323 A <i>ruby annotation</i> is associated with one or more <i>ruby bases</i>;
324 annotations can span multiple bases.
326 <p><dfn>Annotation pairing</dfn> is the process of associating
327 <i>ruby annotations</i> with <i>ruby bases</i>.
329 <ol>
330 <li>
331 <p>First, the ruby structure is divided into <i>ruby segments</i>,
332 each consisting of a single <i>ruby base container</i>
333 followed by one or more <i>ruby annotation containers</i>.
334 If the first child of a <i>ruby container</i> is a <i>ruby annotation container</i>,
335 an anonymous, empty <i>ruby base container</i> is assumed to exist before it.
336 Similarly, if the <i>ruby container</i> contains consecutive <i>ruby base containers</i>,
337 anonymous, empty <i>ruby annotation containers</i> are assumed to exist between them.
338 The <i>ruby base container</i> in each segment is thus associated
339 with each of the <i>ruby annotation containers</i> in that segment.
341 <p>Each <i>ruby annotation containers</i> in a <i>ruby segment</i>
342 represents one <dfn title="annotation level | level">level</dfn> of annotation:
343 the first one represents the first level of annotation,
344 the second one represents the second level of annotation,
345 and so on.
347 <li>Within each <i>ruby segment</i>,
348 each <i>ruby base box</i> in the <i>ruby base container</i>
349 is paired with one <i>ruby annotation box</i>
350 from each <i>ruby annotation container</i> in its <i>ruby segment</i>.
351 If there are not enough <i>ruby annotations</i> in a <i>ruby annotation container</i>,
352 the last one is associated with any excess <i>ruby bases</i>.
353 (If there are not any in the <i>ruby annotation container</i>, an anonymous empty one is assumed to exist.)
354 If there are not enough <i>ruby bases</i>,
355 any remaining <i>ruby annotations</i> are assumed to be associated
356 with empty, anonymous bases inserted at the end of the <i>ruby base container</i>.
358 <p>If an implementation supports ruby markup with explicit spanning
359 (e.g. XHTML Complex Ruby Annotations),
360 it must adjust the pairing rules to pair spanning annotations to multiple bases
361 appropriately.
362 </ol>
364 <p>A this point, ruby “columns” are defined,
365 each represented by a single <i>ruby base</i>
366 and associated with one <i>ruby annotation</i> (possibly an empty, anonymous one)
367 from each <i>annotation level</i>.
369 <h4 id="nested-pairing">
370 Nested Ruby</h4>
372 <p>When <i>ruby containers</i> are nested,
373 pairing begins with the deepest <i>ruby container</i>,
374 then expands out,
375 treating each <i>ruby container</i> nested within another <i>ruby container</i>
376 as a <i>ruby base</i>,
377 and associating each <i>ruby annotation</i>
378 associated with the nested <i>ruby container</i>
379 as being associated with (spanning) all of its <i>ruby bases</i>.
381 <p>Using nested <i>ruby containers</i> thus allows the representation
382 of complex spanning relationships.
384 <p class="issue">This shouldn't belong in Level 1. But HTML5 allows it, so we have to handle it. Yay HTML5.
386 <h3 id="autohide">
387 Autohiding Annotations</h3>
389 <p>If a <i>ruby annotation</i> has the exact same content as its base,
390 it is <dfn title="hidden ruby annotation | hidden annotation">hidden</dfn>.
391 Hiding a <i>ruby annotation</i> does not affect annotation pairing
392 or the block-axis positioning of boxes in other <i>levels</i>.
393 However the <i>hidden annotation</i> is not visible,
394 and it has no impact on layout
395 other than to separate adjacent sequences of <i>ruby annotation boxes</i> within its level,
396 as if they belonged to separate segments
397 and the <i>hidden annotation</i>’s base were not a <i>ruby base</i> but an intervening inline.
399 <div class="example">
400 <p>This is to allow correct inlined display of annotations
401 for Japanese words that are a mix of kanji and hirangana.
402 For example, the word <i>振り仮名</i> should be inlined as
403 <p class="figure">振り仮名(ふりがな)
404 <p>and therefore marked up as
405 <pre>
406 <!-- --><ruby>
407 <!-- --> <rb>振</rb><rb>り</rb><rb>仮</rb><rb>名</rb>
408 <!-- --> <rp>(</rp><rt>ふ</rt><rt>り</rt><rt>が</rt><rt>な</rt><rp>)</rp>
409 <!-- --><ruby></pre>
410 <p>However, when displayed as ruby, the “り” should be hidden
411 <div class="figure">
412 <p><img src="images/furigana-separate.png"
413 alt="Hiragana annotations for 振り仮名 appear, each above its base character.">
414 <p class="caption">Hiragana ruby for 振り仮名
415 </div>
416 </div>
418 <p class="note">
419 Future levels of CSS Ruby may add controls for this,
420 however in this level it is always forced.
422 <p>The content comparison for this auto-hiding behavior
423 takes place prior to white space collapsing.
424 <span class="issue">Is this easier? Or after collapsing is easier? We should do whatever is easier, as it really doesn't matter much which way to go.
426 <h3 id="white-space">
427 White Space</h3>
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.
433 <p><i>Collapsible</i> white space within a ruby structure is discarded
434 at the beginning and end of a <i>ruby 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,
437 white space is not discarded.
438 If such white space is <i>collapsible</i>, it will collapse
439 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,
441 the contextual text for determining collapsing behavior is given by the <i>ruby bases</i> on either side,
442 not the text on either side of the white space in the source document.
444 <div class="note">
445 <p>Note that the white space processing rules
446 cause a white space sequence containing a <i>segment break</i> (such as a line feed)
447 to <a href="http://www.w3.org/TR/css3-text/#line-break-transform">collapse to nothing</a> between CJK characters.
448 This means that CJK ruby can safely use white space for indentation of the ruby markup.
449 For example, the following markup will display without any spaces:
450 <pre>
451 <!-- --><ruby>
452 <!-- --> <rb>東</rb><rb>京</rb>
453 <!-- --> <rt>とう</rt><rt>きょう</rt>
454 <!-- --></ruby></pre>
455 <p>However, this markup will:
456 <pre>
457 <!-- --><ruby>
458 <!-- --> <rb>東</rb> <rb>京</rb>
459 <!-- --> <rt>とう</rt> <rt>きょう</rt>
460 <!-- --></ruby></pre>
461 </div>
463 <p>Any preserved white space is then wrapped in an anonymous box belonging to
464 the <i>ruby base container</i> (if between <i>ruby bases</i>),
465 <i>ruby annotation container</i> (if between <i>ruby annotations</i>),
466 or <i>ruby container</i> (if between <i>ruby segments</i>).
467 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 <div class="example">
472 <p>These rules allow ruby to be used with space-separated scripts such as Latin.
473 For example,
474 <pre>
475 <!-- --><ruby>
476 <!-- --> <rb>W</rb><rb>W</rb><rb>W</rb>
477 <!-- --> <rt>World</rt> <rt>Wide</rt> <rt>Web</rt>
478 <!-- --></ruby></pre>
479 <p>They also ensure that annotated white space is preserved. For example,
480 <pre>
481 <!-- --><ruby>
482 <!-- --> <rb>Aerith</rb><rb> </rb><rb>Gainsboro</rb>
483 <!-- --> <rt>エアリス</rt><rt>・</rt><rt>ゲインズブール</rt>
484 <!-- --></ruby></pre>
485 </div>
487 <p class="issue">Specify how this impacts layout, or not.
489 <h3 id="ruby-layout">
490 Ruby layout</h3>
492 <p>When a ruby structure is laid out,
493 its base level is laid out on the line,
494 aligned according to its 'vertical-align' property
495 exactly as if its <i>bases</i> were a regular sequence of <i>inline</i> boxes.
496 Each <i>ruby base container</i> is sized and positioned
497 to contain exactly the full height of its <i>ruby bases</i>.
499 <p><i>Ruby annotations</i> associated with the base level
500 are then positioned with respect to their <i>ruby base boxes</i>
501 according to the applicable 'ruby-position' values.
502 <i>Ruby annotations</i> within a level (within a single <i>ruby container</i>)
503 are aligned to each other as if they were inline boxes
504 participating in the same inline formatting context.
505 Each <i>ruby annotation container</i> is sized and positioned
506 to contain exactly the full height of its <i>ruby annotations</i>.
508 <p>A ruby container (or fragment thereof)
509 measures as wide as the content of its widest level.
510 Similarly, <i>ruby base boxes</i> and <i>ruby annotation boxes</i>
511 within a ruby “column” have the measure of the widest content in that “column”.
512 In the case of spanning <i>annotations</i>
513 (whether actually spanning or pretending to span per 'ruby-collapse'),
514 the measures of the <i>ruby annotation box</i> and
515 the sum of its associated <i>ruby base boxes</i> must match.
517 <p>How the extra space is distributed
518 when ruby content is narrower than the measure of its box
519 is specified by the 'ruby-align' property.
521 <h4 id="inter-character-layout">
522 Inter-character ruby layout</h4>
524 <p>Inter-character annotations have special layout.
525 When 'ruby-position' indicates ''inter-character'' annotations, the affected <i>annotation boxes</i>
526 are spliced into and measured as part of the layout of the base level.
527 The <i>ruby base container</i> must be sized to include both the <i>base boxes</i>
528 as well as the ''inter-character'' <i>annotation boxes</i>
529 The affected <i>ruby annotation container</i> is similarly sized
530 so that its content box coincides with that of the <i>ruby base container</i>.
532 <p>For the purpose of laying out other levels of annotations,
533 an ''inter-character'' annotation effectively becomes part of its base.
534 <span class="issue">Or should it become a quasi-base between two bases?</span>
535 A spanning ''inter-character'' annotation is placed after
536 all the bases that it spans.
538 <h3 id="box-style">
539 Styling Ruby Boxes</h4>
541 <p>In most respects, ruby boxes can be styled similar to inline boxes.
542 However, the UA is not required to support
543 any of the box properties (borders, margins, padding),
544 any of the background properties or outline properties,
545 or any other property that illustrates the bounds of the box
546 on <i>ruby base container boxes</i>, <i>ruby annotation container boxes</i>,
547 or <a href="#nested-pairing">ruby-internal <i>ruby container boxes</i></a>.
548 The UA may implement these boxes simply as abstractions for inheritance
549 and control over the layout of their contents.
551 <p class="issue">
552 Alternatively... use margins to control offsets?
553 Or could line-height be adequate? Its centering behavior can be awkward.
555 <h3 id="line-breaks">
556 Ruby box and line breaking</h3>
558 <p>When there is not enough space for an entire <i>ruby container</i> to fit on the line,
559 the ruby may be broken wherever the base level allows a break.
560 Ruby most often breaks between base-annotation sets,
561 but if the line-breaking rules allow it, can also break within a <i>ruby base</i>
562 (and, in parallel, its associated <i>annotation boxes</i>).
564 <p>Whenever ruby breaks across lines, <i>ruby annotations</i> must stay
565 with their respective <i>bases</i>.
566 The line <em>must not</em> break between a <i>ruby base</i> and its <i>annotations</i>,
567 even in the case of ''inter-character'' <i>annotations</i>.
569 <div class="figure">
570 <img src="images/r-break-b.gif"
571 alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'>
572 <p class="caption">''inter-character'' ruby line breaking opportunity
573 </div>
575 <h4 id="break-between">
576 Breaking between bases</h4>
578 <p>In typical cases, <i>ruby base boxes</i> and <i>ruby annotation boxes</i>
579 are styled to forbid internal line wrapping and do not contain forced breaks.
580 (See <a href="#default-stylesheet">Appendix A</a>.)
581 In such cases the <i>ruby container</i> can only break between adjacent <i>ruby bases</i>,
582 and only if no <i>ruby annotations</i> span those <i>ruby bases</i>.
584 <div class="figure">
585 <p><img src="images/r-break-a.gif"
586 alt="Diagram showing the line breaking opportunity in a complex ruby">
587 <p class="caption">Ruby line breaking opportunity
588 </div>
590 <p>Whether ruby can break between two adjacent <i>ruby bases</i>
591 is controlled by normal line-breaking rules for the affected text,
592 exactly as if the <i>ruby bases</i> were adjacent <i>inline</i> boxes.
593 (The annotations are ignored when determining soft wrap opportunities for the base level.)
595 <div class="example">
596 <p>For example, if two adjacent ruby bases are “蝴” and “蝶”,
597 the line may break between them,
598 because lines are normally allowed to break between two Han characters.
599 However, if 'word-break' is ''keep-all'', that line break is forbidden.
600 <pre><ruby>蝴<rt>hú</rt>蝶<rt>dié</rt></pre>
601 </div>
603 <p>Inter-base white space is significant for evaluating line break opportunities between <i>ruby bases</i>.
604 As with white space between inlines, it collapses when the line breaks there.
605 Similarly, annotation white space is also trimmed at a line break.
607 <div class="example">
608 <p>For example, given the following markup:
609 <pre><ruby><rb>one</rb> <rb>two</rb> <rt>1</rt> <rt>2</rt></ruby></pre>
610 <p>Due to the space, the line may break between “one” and “two“.
611 If the line breaks there, that space—and the space between “1” and “2”—disappears,
612 in accordance with standard CSS white space processing rules. [[CSS3TEXT]]
613 </div>
615 <h4 id="break-within">
616 Breaking within bases</h4>
618 <p>For longer base texts, it is sometimes appropriate to allow breaking within a base-annotation pair.
619 For example, if an English sentence is annotated with its Japanese translation,
620 allowing the text to wrap allows for reasonable line breaking behavior in the paragraph.
622 <p class="issue">
623 Insert scanned example so people don't think this is just the ramblings of an insane spec-writer.
625 <p>Line-breaking within a <i>ruby base</i> is only allowed if the 'white-space' property
626 of the <i>ruby base</i> and all its parallel <i>annotations</i> allow it,
627 and there exists a <i>soft wrap opportunity</i> <em>within</em> (i.e. not at the start or end)
628 the content of each base/annotation box.
629 Since there is no structural correspondance between fragments of content
630 within <i>ruby bases</i> and <i>annotations</i>,
631 the UA may break at any set of opportunities;
632 but it is recommended that the UA attempt to proportionally balance
633 the amount of content inside each fragment.
635 <p>There are no line breaking opportunities within ''inter-character'' <i>annotations</i>.
637 <p>Ruby alignment takes place within each fragment, after line-breaking.
639 <h3 id="ruby-bidi">
640 Bidi Reordering</h3>
642 <p class="issue">The easiest thing would be to treat each <i>ruby base</i> as an embedding of its 'direction'.
643 But this means that implicit bidi reordering is scoped to within a single base.
645 <!--
647 <p>The Unicode bidirectional algorithm orders logically-stored text for visual presentation
648 when characters from scripts of opposing directionalities are mixed
649 within a single paragraph.
650 (See [[CSS3-WRITING-MODES]] for a more in-depth discussion of bidirectional text in CSS.)
651 Bidi reordering of ruby-annotation pairs is controlled by the ordering of the base text, as follows:
653 <h4 id="bidi-B">Proposal A</h4>
655 <p class="note">This proposal is simpler, but will require more frequent tagging of mixed-directionality content.
657 <p>To avoid the interference of the <i>annotations</i> in the ordering of base text,
658 all annotations are ignored for the purpose of resolving neutral characters in the base level.
660 <p>To preserve the correspondance of <i>ruby annotations</i>
661 to their respective <i>ruby bases</i>,
662 a few restrictions are imposed:
663 <ul>
664 <li>The contents of a <i>ruby base</i> or <i>ruby annotation</i> must remain contiguous.
665 To this end, the contents of each <i>ruby base</i> and <i>ruby annotation</i> are treated as if within a <i>bidi isolation</i>.
666 <li>For the purpose of ordering <i>ruby bases</i> within a <i>ruby container</i>,
667 each <i>ruby base</i> is treated as a strong character of its specified 'direction'.
668 (<i>Ruby annotations</i> are positioned with respect to their <i>bases</i>,
669 so are affected by reordering, but do not themselves participate in reordering.)
670 <li>All <i>bases</i> spanned by a single <i>annotation</i> must remain contiguous.
671 To this end, the embedding level of all bases spanned by a spanning <i>annotation</i>
672 is increased by two prior to reordering.
673 </ul>
675 <h4 id="bidi-B">Proposal B</h4>
677 <p class="note">This preserves some aspects of implicit bidi.
678 For example, annotating each half of "first-second" would not cause the word to reverse itself to "second-first" within an opposite-order paragraph.
680 <p>To avoid the interference of the <i>annotations</i> in the ordering of the base text,
681 all annotations are ignored for the purpose of resolving neutral characters in the base text;
682 and the base text is resolved exactly as if each <i>ruby base</i> were
683 just a normal <i>inline box</i> embedded in the <i>ruby container</i>'s inline formatting context.
685 <p>Furthermore, to preserve the correspondance of <i>ruby annotations</i>
686 to their respective <i>ruby bases</i>,
687 a few restrictions are imposed:
688 <ul>
689 <li>The contents of a <i>ruby base</i> must remain contiguous.
690 <li>All <i>bases</i> spanned by a single <i>annotation</i> must remain contiguous.
691 </ul>
692 <p>To this end, the text of <i>ruby base</i> boxes that are not <i>bidi-isolated</i>
693 must have its embedding level increased by two;
694 and if an <i>annotation</i> spans more than one <i>ruby base</i>,
695 the spanned text's embedding level
696 (or the embedding level assigned to the isolation, if the <i>ruby base</i> is <i>bidi-isolated</i>)
697 is further increased by two.
699 -->
701 <h3 id="line-height">
702 Ruby box and line stacking</h3>
704 <p>The 'line-height' property controls spacing between lines in CSS.
705 When inline content on line is shorter than the 'line-height',
706 half-leading is added on either side of the content,
707 as specificed in <a href="http://www.w3.org/TR/CSS21/visudet.html#line-height">CSS2.1§10.8</a>. [[!CSS21]]
709 <p>In order to ensure consistent spacing of lines,
710 documents with ruby typically ensure that the 'line-height' is large enough
711 to accommodate ruby between lines of text.
712 Therefore, ordinarily, <i>ruby annotation containers</i> and <i>ruby annotation boxes</i>
713 do not contribute to the measured height of a line's inline contents;
714 any alignment (see 'vertical-align') and line-height calculations
715 are performed using only the <i>ruby base container</i>,
716 exactly as if it were a normal inline.
718 <p>However, if the 'line-height' specified on the <i>ruby container</i>
719 is less than the distance between
720 the top of the top <i>ruby annotation container</i>
721 and the bottom of the bottom <i>ruby annotation container</i>,
722 then additional leading is added
723 on the appropriate side of the <i>ruby base container</i>
724 such that if a block consisted of three lines
725 each containing ruby identical to this,
726 none of the <i>ruby containers</i> would overlap.
728 <p class="note">Note that this does not ensure that the <i>ruby annotations</i> remain within the line box.
729 It merely ensures that <em>if all lines had equal spacing</em>
730 and equivalent amounts and positioning of <i>ruby annotations</i>,
731 there would be enough room to avoid overlap.
733 <p>Authors should ensure appropriate 'line-height' and 'padding' to accommodate ruby,
734 and be particularly careful at the beginning or end of a block
735 and when a line contains inline-level content
736 (such as images, inline blocks, or elements shifted with 'vertical-align')
737 taller than the paragraph's default font size.
739 <div class="figure">
740 <p><img src="images/rlh-a.gif"
741 alt="The content of each line sits in the middle of its line height;
742 the additional space on each side is called half-leading.
743 Ruby fits between lines if it is smaller than twice the half-leading,
744 but this means that it occupies space belonging to the half-leading of the previous line.">
745 <p class="caption">Ruby annotations will often overflow the line;
746 authors should ensure content over/under a ruby-annotated line
747 is adequately spaced to leave room for the ruby.
748 </div>
750 <p class="note">More control over how ruby affects alignment and line layout
751 will be part of the CSS Line Layout Module Level 3.
752 Note, it is currently in the process of being rewritten;
753 the current drafts should not be relied upon.
755 <h2 id="ruby-props">
756 Ruby Properties</h2>
758 <p>The following properties are introduced to control ruby positioning and alignment.
760 <h3 id="rubypos">
761 Ruby positioning: the 'ruby-position' property</h3>
763 <table class="propdef">
764 <tr>
765 <th>Name:
766 <td><dfn>ruby-position</dfn>
767 <tr>
768 <th><a href="#values">Value</a>:
769 <td>[ over | under | inter-character ] && [ right | left ]
770 <tr>
771 <th>Initial:
772 <td>over right
773 <tr>
774 <th>Applies to:
775 <td>ruby annotation containers
776 <tr>
777 <th>Inherited:
778 <td>yes
779 <tr>
780 <th>Percentages:
781 <td>N/A
782 <tr>
783 <th>Media:
784 <td>visual
785 <tr>
786 <th>Computed value:
787 <td>specified value
788 <tr>
789 <th>Animatable:
790 <td>no
791 <tr>
792 <th>Canonical order:
793 <td><abbr title="follows order of property value definition">per grammar</abbr>
794 </table>
796 <p>This property controls position of the ruby text with respect to its base.
797 Values have the following meanings:
799 <p class="issue"><span class="issuehead">Issue-107: </span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=ruby-position%3A+undesirable+default+value+%27before%27+for+complex+ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=www-style&resultsperpage=20&sortby=date">this thread</a> and <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=Styling+of+complex+Ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=public-i18n-core&resultsperpage=20&sortby=date">this one</a>.</p>
800 <dl>
801 <dt><dfn title="ruby-position:over">''over''</dfn>
802 <dd>The ruby text appears <i>over</i> the base in horizontal text.
804 <div class="figure">
805 <p><img src="images/shinkansen-top.gif"
806 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base">
807 <p class="caption">Ruby over Japanese base text in horizontal layout
808 </div>
809 </dd>
811 <dt><dfn title="ruby-position:right">''right''</dfn>
812 <dd>The ruby text appears on the right side of the base in vertical text.
813 <div class="figure">
814 <p><img src="images/shinkansen-right.gif" width="33"
815 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base">
816 <p class="caption">Ruby to the right of Japanese base text in vertical layout
817 </div>
818 </dd>
820 <dt><dfn title="ruby-position:under">''under''</dfn>
821 <dd>The ruby text appears under the base in horizontal text.
822 This is a relatively rare setting used in ideographic East Asian writing systems,
823 most easily found in educational text.
825 <div class="figure">
826 <p><img src="images/shinkansen-bottom.gif"
827 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base">
828 <p class="caption">Ruby under Japanese base text in horizontal layout
829 </div>
830 </dd>
832 <dt><dfn title="ruby-position:left">''left''</dfn>
833 <dd>The ruby text appears on the left side of the base in vertical text.
835 <div class="figure">
836 <p><img src="images/shinkansen-left.gif"
837 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base">
838 <p class="caption">Ruby to the left of Japanese base text in vertical layout
839 </div>
840 </dd>
842 <dt><dfn title="ruby-position:inter-character">''inter-character''</dfn></dt>
843 <dd>
844 <p>The ruby text appears on the right of the base in horizontal text.
845 This value forces the 'writing-mode' of the <i>ruby annotation</i> to be vertical.
847 <p>This value is provided for the special case of traditional Chinese
848 as used especially in Taiwan:
849 ruby (made of <a href="#g-bopomofo">bopomofo</a> glyphs) in that context
850 appears vertically along the right side of the base glyph,
851 even when the layout of the base characters is horizontal:
853 <div class="figure">
854 <p><img src="images/bopomofo.gif"
855 alt="Example of Taiwanese-style ruby">
856 <p class="caption">“Bopomofo” ruby in traditional Chinese
857 (ruby text shown in blue for clarity) in horizontal layout
858 </div>
859 <p class="note">
860 Note that the user agent is responsible for ensuring the correct relative alignment and positioning of the glyphs,
861 including those corresponding to the tone marks, when displaying.
862 Tone marks are spacing characters that occur (in memory) at the end of the ruby text for each base character.
863 They are usually displayed in a separate column to the right of the bopomofo characters,
864 and the height of the tone mark depends on the number of characters in the syllable.
865 One tone mark, however, is placed above the bopomofo, not to the right of it.
866 <!-- See Taiwanese requirements doc for EPUB at http://epub-revision.googlecode.com/files/EGLS_TW_eng.ppt -->
867 </dd>
868 </dl>
870 <p>If multiple <i>ruby annotation containers</i> have the same 'ruby-position',
871 they stack along the block axis,
872 with lower levels of annotation closer to the base text.
874 <h3 id="collapsed-ruby">
875 Collapsed Ruby Annotations: the 'ruby-merge' property</h3>
877 <table class="propdef">
878 <tr>
879 <th>Name:
880 <td><dfn>ruby-merge</dfn>
881 <tr>
882 <th><a href="#values">Value</a>:
883 <td>separate | collapse | auto
884 <tr>
885 <th>Initial:
886 <td>separate
887 <tr>
888 <th>Applies to:
889 <td>ruby annotation containers
890 <tr>
891 <th>Inherited:
892 <td>yes
893 <tr>
894 <th>Percentages:
895 <td>N/A
896 <tr>
897 <th>Media:
898 <td>visual
899 <tr>
900 <th>Computed value:
901 <td>specified value
902 <tr>
903 <th>Animatable:
904 <td>no
905 <tr>
906 <th>Canonical order:
907 <td><abbr title="follows order of property value definition">per grammar</abbr>
908 </table>
910 <p>
911 This property controls how ruby annotation boxes should be rendered
912 when there are more than one in a ruby container box.
914 <p>Possible values:</p>
915 <dl>
916 <dt><dfn title="ruby-merge:separate">''separate''</dfn>
917 <dd>
918 <p>
919 Each ruby annotation box is rendered in the same column(s) as its corresponding base box(es).
920 This style is called “mono ruby” in [[JLREQ]].
922 <div class="example">
923 <p>For example, the following two markups render the same:
924 <pre><ruby>無<rt>む</ruby><ruby>常<rt>じょう</ruby></pre>
925 <p>and:
926 <pre><ruby style="ruby-merge:separate"><rb>無<rb>常<rt>む<rt>じょう</ruby></pre>
927 </div>
928 </dd>
930 <dt><dfn title="ruby-merge:collapse">''collapse''</dfn>
931 <dd>
932 <p>
933 All <i>ruby annotation boxes</i> within the same <i>ruby segment</i> on the same line are concatenated,
934 and laid out as if their contents belonged to a single <i>ruby annotation box</i>
935 spanning all their associated <i>ruby base boxes.
936 This style renders similar to “group ruby” in [[JLREQ]],
937 except that <i>ruby annotations</i> are kept together with their respective <i>ruby bases</i> when breaking lines.
938 </p>
940 <div class="example">
941 <p>The following two markups render the same both characters fit on one line:
942 <pre><ruby>無常<rt>むじょう</ruby></pre>
943 <p>and:
944 <pre><ruby style="ruby-merge:collapse"><rb>無<rb>常<rt>む<rt>じょう</ruby></pre>
945 <p>However, the second one renders the same as ''ruby-position: separate''
946 when the two bases are split across lines.
947 </div>
948 </dd>
950 <dt><dfn title="ruby-merge:auto">''auto''</dfn></dt>
951 <dd>
952 <p>
953 The user agent may use any algorithm to determine how each ruby annotation box
954 is rendered to its corresponding base box.
955 <div class="example">
956 <p>
957 One possible algorithm is described as Jukugo-ruby in [[JLREQ]].
958 <p>
959 Another, more simplified algorithm of Jukugo-ruby is
960 to render as Mono-ruby if all ruby annotation boxes fit within
961 advances of their corresponding base boxes,
962 and render as Group-ruby otherwise.
963 </p>
964 </div>
965 </dd>
966 </dl>
968 <h3 id="rubyalign">
969 Ruby Text Distribution: the 'ruby-align' property</h3>
971 <table class="propdef">
972 <tr>
973 <th>Name:
974 <td><dfn>ruby-align</dfn>
975 <tr>
976 <th><a href="#values">Value</a>:
977 <td>auto | start | center |
978 distribute-letter | distribute-space
979 <tr>
980 <th>Initial:
981 <td>auto
982 <tr>
983 <th>Applies to:
984 <td>ruby bases, ruby annotations, ruby base containers, ruby annotation containers
985 <tr>
986 <th>Inherited:
987 <td>yes
988 <tr>
989 <th>Percentages:
990 <td>N/A
991 <tr>
992 <th>Media:
993 <td>visual
994 <tr>
995 <th>Computed value:
996 <td>specified value (except for initial and inherit)
997 </table>
999 <p>This property specifies how text is distributed within the various ruby boxes
1000 when their text contents exactly fill their respective boxes.
1002 <p>Values have the following meanings:
1003 <p class="issue"><span class="issuehead">Issue: </span> Tony Graham has <a href="http://www.w3.org/Style/XSL/Group/FO/wiki/Ruby#Treat_CSS3_.22ruby-align.22_As_Shorthand.3F">suggested </a>that distribute-letter and distribute-space be values of a ruby-group-distribution property, and line-edge be moved to a ruby-alignment-edge property, and that the rest be gathered under a ruby-alignment property. And that ruby-align become a shorthand.</p>
1004 <dl>
1005 <dt><dfn title="ruby-align:auto">''auto''</dfn></dt>
1006 <dd>
1007 <p>The user agent determines how the ruby contents are aligned.
1008 This is the initial value.
1009 The behavior recommended by [[JLREQ]] is for wide-cell ruby to be aligned in the 'distribute-space' mode:
1010 <div class="figure">
1011 <p><img width="145" height="91"
1012 alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base"
1013 src="images/ra-ds.gif" /><img width="145" height="91"
1014 alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base"
1015 src="images/ra-ds-rb.gif" /></p>
1016 <p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is
1017 'distribute-space' justified</p>
1018 </div>
1020 <p>The recommended behavior for narrow-cell glyph ruby is to be
1021 aligned in the 'center' mode.</p>
1022 <div class="figure">
1023 <p><img
1024 alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
1025 width="145" height="91"
1026 src="images/ra-c-h.gif" /><img
1027 alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
1028 width="145" height="91"
1029 src="images/ra-c-rb-h.gif" /></p>
1030 <p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment
1031 is centered</p>
1032 </div>
1033 </dd>
1035 <dt><dfn title="ruby-align:start">''start''</dfn></dt>
1036 <dd>The ruby annotation content is aligned with the start edge of the base.
1037 <div class="figure">
1038 <p><img
1039 alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base"
1040 width="145" height="91" src="images/ra-l.gif" /><img
1041 width="145" height="91"
1042 alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base"
1043 src="images/ra-l-rb.gif" /></p>
1044 <p><b>Figure 4.2.3</b>: Start ruby alignment</p>
1045 </div>
1046 </dd>
1048 <dt><dfn title="ruby-align:center">''center''</dfn></dt>
1049 <dd>The ruby text content is centered within the width of the base. If the
1050 length of the base is smaller than the length of the ruby text, then the
1051 base is centered within the width of the ruby text.
1053 <div class="figure">
1054 <p><img width="145" height="91"
1055 alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base"
1056 src="images/ra-c.gif" /><img width="145" height="91"
1057 alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base"
1058 src="images/ra-c-rb.gif" /></p>
1059 <p><b>Figure 4.2.4</b>: Center ruby alignment</p>
1060 </div>
1061 </dd>
1063 <!--
1064 <dt><strong>right</strong></dt>
1065 <dd>The ruby text content is aligned with the end edge of the base.
1066 <p class="issue"><span class="issuehead">Issue: </span> The i18n WG feels that end and right should not be synonymous, and proposed to drop right (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a>.</p>
1067 <div class="figure">
1068 <p><img class="example" width="145" height="91"
1069 alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base"
1070 src="images/ra-r.gif" /><img class="example" width="145" height="91"
1071 alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base"
1072 src="images/ra-r-rb.gif" /></p>
1073 <p><b>Figure 4.2.5</b>: End ruby alignment</p>
1074 </div>
1075 </dd>
1076 -->
1078 <dt><dfn title="ruby-align:distribute-letter">''distribute-letter''</dfn></dt>
1079 <dd>If the width of the ruby text is smaller than that of the base, then
1080 the ruby text contents are evenly distributed across the width of the
1081 base, with the first and last ruby text glyphs lining up with the
1082 corresponding first and last base glyphs. If the width of the ruby text
1083 is at least the width of the base, then the letters of the base are
1084 evenly distributed across the width of the ruby text.
1086 <div class="figure">
1087 <p><img width="145" height="91"
1088 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base"
1089 src="images/ra-dl.gif" /><img width="145" height="91"
1090 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base"
1091 src="images/ra-dl-rb.gif" /></p>
1092 <p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p>
1093 </div>
1094 </dd>
1096 <dt><dfn title="ruby-align:distribute-space">''distribute-space''</dfn></dt>
1097 <dd>If the width of the ruby text is smaller than that of the base, then
1098 the ruby text contents are evenly distributed across the width of the
1099 base, with a certain amount of white space preceding the first and
1100 following the last character in the ruby text. That amount of white
1101 space is normally equal to half the amount of inter-character space of
1102 the ruby text. If the width of the ruby text is at least the width of
1103 the base, then the same type of space distribution applies to the base.
1104 In other words, if the base is shorter than the ruby text, the base is
1105 distribute-space aligned. This type of alignment
1106 is described by [[JLREQ]].
1108 <div class="figure">
1109 <p><img width="145" height="91"
1110 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base"
1111 src="images/ra-ds.gif" /><img width="145" height="91"
1112 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base"
1113 src="images/ra-ds-rb.gif" /></p>
1114 <p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p>
1115 </div>
1116 </dd>
1118 <!--
1119 <dt><strong>line-edge</strong></dt>
1120 <dd>If the ruby text is not adjacent to a line edge, it is aligned as in
1121 'auto'. If it is adjacent to a line edge, then it is still aligned as in
1122 auto, but the side of the ruby text that touches the end of the line is
1123 lined up with the corresponding edge of the base. This type of alignment
1124 is described by [[JLREQ]]. This type of alignment is
1125 relevant only to the scenario where the ruby text is longer than the
1126 ruby base. In the other scenarios, this is just 'auto'.
1127 <div class="figure">
1128 <p><img class="example" width="146" height="109"
1129 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base"
1130 src="images/ra-le-l.gif" /><img class="example" width="146"
1131 height="110"
1132 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base"
1133 src="images/ra-le-r.gif" /></p>
1134 <p><b>Figure 4.2.8</b>: Line edge ruby alignment</p>
1135 </div>
1136 </dd>
1137 -->
1138 </dl>
1140 <p>For a complex ruby with spanning elements, one additional consideration is
1141 required. If the spanning element spans multiple 'rows' (other rbc or rtc
1142 elements), and the ruby alignment requires space distribution among the
1143 'spanned' elements, a ratio must be determined among the 'columns' of spanned
1144 elements. This ratio is computed by taking into consideration the widest
1145 element within each column.</p>
1147 <h2 id="edge-effects">
1148 Edge Effects</h2>
1150 <h3 id="ruby-overhang">
1151 Overhanging Ruby</h3>
1153 <p>
1154 When <i>ruby annotation box</i> is longer than its corresponding <i>ruby base box</i>,
1155 the <i>ruby annotation box</i> may partially overhang adjacent boxes.
1156 </p>
1157 <p>
1158 This level of the specification does not define
1159 how much the overhang may be allowed, and under what conditions.
1160 </p>
1162 <p>If the ruby text is not allowed to overhang,
1163 then the ruby behaves like a traditional inline box,
1164 i.e. only its own contents are rendered within its boundaries
1165 and adjacent elements do not cross the box boundary:
1167 <div class="figure">
1168 <p><img src="images/ro-n.gif"
1169 alt="Diagram showing the ruby boxes interacting with adjacent text">
1170 <p class="caption">Simple ruby whose text is not allowed to overhang adjacent text
1171 </div>
1173 <p>However, if <i>ruby annotation</i> content is allowed to overhang adjacent elements
1174 and it happens to be wider than its base,
1175 then the adjacent content is partially rendered within the area of the <i>ruby container box</i>,
1176 while the <i>ruby annotation</i> may partially overlap the upper blank parts of the adjacent content:
1178 <div class="figure">
1179 <p><img src="images/ro-a.gif"
1180 alt="Diagram showing the ruby boxes interacting with adjacent text">
1181 <p class="caption">Simple ruby whose text is allowed to overhang adjacent text
1182 </div>
1184 <p>The <i>ruby annotations</i> related to a <i>ruby base</i>
1185 must never overhang another <i>ruby base</i>.
1187 <p>The alignment of the contents of the base or the ruby text
1188 is not affected by overhanging behavior.
1189 The alignment is achieved the same way regardless of the overhang behavior setting
1190 and it is computed before the space available for overlap is determined.
1191 It is controlled by the 'ruby-align' property.
1193 <p class="issue">
1194 I suspect overhanging interacts with alignment in some cases;
1195 might need to look into this later.
1197 <p>This entire logic applies the same way in vertical ideographic layout,
1198 only the dimension in which it works in such a layout is vertical,
1199 instead of horizontal.
1201 <div class="example">
1202 <p>
1203 The user agent may use [[JIS4051]] recommendation of
1204 using one ruby text character length as the maximum overhang length.
1205 Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [[JLREQ]].
1206 </p>
1207 </div>
1209 <h3 id="line-edge">
1210 Line-edge Alignment</h3>
1212 <p>
1213 When a <i>ruby annotation box</i> that is longer than its <i>ruby base</i>
1214 is at the start or end edge of a line,
1215 the user agent <em>may</em> force the side of the <i>ruby annotation</i> that touches the edge of the line
1216 to align to the corresponding edge of the base.
1217 This type of alignment is described by [[JLREQ]].
1218 </p>
1219 <p>
1220 This level of the specification does not provide a mechanism to control this behavior.
1221 </p>
1222 <div class="figure">
1223 <p><img src="images/ra-le-l.gif"
1224 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base">
1225 <img src="images/ra-le-r.gif"
1226 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base">
1227 <p class="caption">Line-edge alignment
1228 </div>
1230 <!--
1231 <h3 id="rubyover">
1232 Ruby overhanging: the 'ruby-overhang' property</h3>
1234 <table class="propdef">
1235 <tr>
1236 <th>Name:
1237 <td><dfn>ruby-overhang</dfn>
1238 <tr>
1239 <th>Value:
1240 <td>auto | start | end | none
1241 <tr>
1242 <th>Initial:
1243 <td>none
1244 <tr>
1245 <th>Applies to:
1246 <td>the parent of elements with display: ruby-text
1247 <tr>
1248 <th>Inherited:
1249 <td>yes
1250 <tr>
1251 <th>Percentages:
1252 <td>N/A
1253 <tr>
1254 <th>Media:
1255 <td>visual
1256 <tr>
1257 <th>Computed value:
1258 <td>specified value (except for initial and inherit)
1259 </table>
1261 <p>This property determines whether, and on which side, ruby text is allowed
1262 to partially overhang any adjacent text in addition to its own base, when the
1263 ruby text is wider than the ruby base. Note that ruby text is never allowed to
1264 overhang glyphs belonging to another ruby base. <span class="issue"><span class="issuehead">Issue: </span> This rule must be broken if we are to allow support for jukugo ruby.</span> Also the user agent is free to assume
1265 a maximum amount by which ruby text may overhang adjacent text. The user agent may use
1266 the [[JIS4051]] recommendation of using one ruby text character
1267 length as the maximum overhang length. Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [[JLREQ]].</p>
1269 <p>Possible values:</p>
1270 <dl>
1271 <dt><strong>auto</strong></dt>
1272 <dd>The ruby text can overhang text adjacent to the base on either side. [[JLREQ]] and [[JIS4051]] specify the categories of characters that
1273 ruby text can overhang. The user agent is free to follow those recommendations or specify its own classes of
1274 characters to overhang. This is the initial value.
1275 <div class="figure">
1276 <p><img class="example" width="177" height="91"
1277 alt="Diagram of glyph layout in overhanging ruby" src="images/ro-a.gif" /></p>
1278 <p><b>Figure 4.3.1</b>: Ruby overhanging adjacent text</p>
1279 </div>
1280 </dd>
1281 <dt><strong>start</strong></dt>
1282 <dd>The ruby text can only overhang the text that precedes it. That means, for
1283 example, that ruby cannot overhang text that is to the right of it in
1284 horizontal LTR layout, and it cannot overhang text that is below it in
1285 vertical-ideographic layout.
1286 <div class="figure">
1287 <p><img class="example" width="199" height="91"
1288 alt="Diagram of glyph layout when ruby overhangs the preceding glyphs only"
1289 src="images/ro-s.gif" /></p>
1290 <p><b>Figure 4.3.2</b>: Ruby overhanging preceding text only</p>
1291 </div>
1292 </dd>
1293 <dt><strong>end</strong></dt>
1294 <dd>The ruby text can only overhang the text that follows it. That means, for
1295 example, that ruby cannot overhang text that is to the left of it in
1296 horizontal LTR layout, and it cannot overhang text that is above it in
1297 vertical-ideographic layout.
1298 <div class="figure">
1299 <p><img class="example" width="198" height="91"
1300 alt="Diagram of glyph layout when ruby overhangs the following characters only"
1301 src="images/ro-e.gif" /></p>
1302 <p><b>Figure 4.3.3</b>: Ruby overhanging following text only</p>
1303 </div>
1304 </dd>
1305 <dt><strong>none</strong></dt>
1306 <dd>The ruby text cannot overhang any text adjacent to its base, only its
1307 own base.
1309 <div class="figure">
1310 <p><img class="example" width="220" height="91"
1311 alt="Diagram of glyph layout in non-overhanging ruby"
1312 src="images/ro-n.gif" /></p>
1313 <p><b>Figure 4.3.4</b>: Ruby not allowed to overhang adjacent text</p>
1314 </div>
1315 </dd>
1316 </dl>
1318 <h3 id="rubyspan">
1319 Ruby annotation spanning: the 'ruby-span' property</h3>
1321 <table class="propdef">
1322 <tr>
1323 <th>Name:
1324 <td><dfn>ruby-span</dfn>
1325 <tr>
1326 <th>Value:
1327 <td>attr(x) | none
1328 <tr>
1329 <th>Initial:
1330 <td>none
1331 <tr>
1332 <th>Applies to:
1333 <td>elements with display: ruby-text
1334 <tr>
1335 <th>Inherited:
1336 <td>no
1337 <tr>
1338 <th>Percentages:
1339 <td>N/A
1340 <tr>
1341 <th>Media:
1342 <td>visual
1343 <tr>
1344 <th>Computed value:
1345 <td><number>
1346 </table>
1348 <p>This property controls the spanning behavior of annotation elements. </p>
1350 <p class="note"><span class="note-label">Note:</span> A XHTML user agent may also use the <samp>rbspan</samp>
1351 attribute to get the same effect.</p>
1353 <p>Possible values:</p>
1355 <dl>
1356 <dt><strong>attr(x)</strong></dt>
1357 <dd>The value of attribute 'x' as a string value. The string value is
1358 evaluated as a <number> to determine the number of ruby base elements to be
1359 spanned by the annotation element. If the <number> is '0', it is replaced by
1360 '1'.The <number> is the computed value. </dd>
1361 <dt>none</dt>
1362 <dd>No spanning. The computed value is '1'.</dd>
1363 </dl>
1365 <p>The following example shows an XML example using the 'display' property
1366 values associated with the 'ruby structure and the 'ruby-span' property</p>
1367 <pre class="xml">myruby { display: ruby; }
1368 myrbc { display: ruby-base-container; }
1369 myrb { display: ruby-base; }
1370 myrtc.before { display: ruby-text-container; ruby-position: before}
1371 myrtc.after { display: ruby-text-container; ruby-position: after}
1372 myrt { display: ruby-text; ruby-span: attr(rbspan); }
1373 ...
1374 <myruby>
1375 <myrbc>
1376 <myrb>10</myrb>
1377 <myrb>31</myrb>
1378 <myrb>2002</myrb>
1379 </myrbc>
1380 <myrtc class="before">
1381 <myrt>Month</myrt>
1382 <myrt>Day</myrt>
1383 <myrt>Year</myrt>
1384 </myrtc>
1385 <myrtc class="after">
1386 <myrt rbspan="3">Expiration Date</myrt>
1387 </myrtc>
1388 </myruby></pre>
1389 -->
1391 <h2 id="default-stylesheet" class="no-num">
1392 Appendix A: Default Style Sheet</h2>
1394 <p><em>This section is informative.</em>
1396 <h3 id="default-ua-ruby" class="no-num">
1397 <span class="secno">A.1</span> Supporting Ruby Layout</h3>
1399 <p>The following represents a default UA style sheet
1400 for rendering HTML and XHTML ruby markup as ruby layout:
1402 <pre>
1403 <!-- -->ruby { display: ruby; }
1404 <!-- -->rb { display: ruby-base; white-space: nowrap; }
1405 <!-- -->rt { display: ruby-text; white-space: nowrap; font-size: 50%; }
1406 <!-- -->rbc { display: ruby-base-container; }
1407 <!-- -->rtc { display: ruby-text-container; }
1408 <!-- -->ruby, rb, rt, rbc, rtc { unicode-bidi: isolate; }</pre>
1410 <p>Additional rules for UAs supporting the relevant features of [[CSS3-TEXT-DECOR]] and [[CSS3-FONTS]]:
1411 <pre>rt { font-variant-east-asian: ruby; text-emphasis: none; }</pre>
1413 <p class="note">Authors should not use the above rules;
1414 a UA that supports ruby layout should provide these by default.
1416 <h3 id="default-inline" class="no-num">
1417 <span class="secno">A.2</span> Inlining Ruby Annotations</h3>
1419 <p>The following represents a sample style sheet
1420 for rendering HTML and XHTML ruby markup as inline annotations:
1422 <pre>ruby, rb, rt, rbc, rtc, rp {
1423 <!-- --> display: inline; white-space: inherit;
1424 <!-- --> font-variant-east-asian: inherit; text-emphasis: inherit; }</pre>
1426 <h3 id="default-parens" class="no-num">
1427 <span class="secno">A.3</span> Generating Parentheses</h3>
1429 <p>Unfortunately, because Selectors cannot match against text nodes,
1430 it's not possible with CSS to express rules that will automatically and correctly
1431 add parentheses to unparenthesized ruby annotations in HTML.
1432 (This is because HTML ruby allows implying the <i>ruby base</i> from raw text, without a corresponding element.)
1433 However, these rules will handle cases where either <code><rb></code>
1434 or <code><rtc></code> is used rigorously.
1436 <pre>
1437 <!-- -->/* Parens around <rtc> */
1438 <!-- -->rtc::before { content: "("; }
1439 <!-- -->rtc::after { content: ")"; }
1441 <!-- -->/* Parens before first <rt> not inside <rtc> */
1442 <!-- -->rb + rt::before,
1443 <!-- -->rtc + rt::before { content: "("; }
1445 <!-- -->/* Parens after <rt> not inside <rtc> */
1446 <!-- -->rb ~ rt:last-child::after,
1447 <!-- -->rt + rb::before { content: ")"; }
1448 <!-- -->rt + rtc::before { content: ")("; }</pre>
1450 <h2 id="glossary">
1451 Glossary</h2>
1452 <dl>
1453 <dt><a id="g-bopomofo"><strong><span
1454 lang="zh">Bopomofo</span></strong></a></dt>
1455 <dd>37 characters and 4 tone markings used as phonetics in Chinese,
1456 especially standard Mandarin.</dd>
1457 <dt><a id="g-hanja"><strong><span
1458 lang="ko">Hanja</span></strong></a></dt>
1459 <dd>Subset of the Korean writing system that utilizes ideographic
1460 characters borrowed or adapted from the Chinese writing system. Also see
1461 <a href="#g-kanji"><span lang="ja">Kanji</span></a>.</dd>
1462 <dt><a id="g-hiragana"><strong><span
1463 lang="ja">Hiragana</span></strong></a></dt>
1464 <dd>Japanese syllabic script, or character of that script. Rounded and
1465 cursive in appearance. Subset of the Japanese writing system, used together
1466 with kanji and katakana. In recent times, mostly used to write Japanese
1467 words when kanji are not available or appropriate, and word endings and
1468 particles. Also see <a
1469 href="#g-katakana"><span lang="ja">Katakana</span></a>.</dd>
1470 <dt><a id="g-ideogram"><strong>Ideograph</strong></a></dt>
1471 <dd>A character that is used to represent an idea, word, or word component,
1472 in contrast to a character from an alphabetic or syllabic script. The most
1473 well-known ideographic script is used (with some variation) in East Asia
1474 (China, Japan, Korea,...).</dd>
1475 <dt><a id="g-kana"><strong><span lang="ja">Kana</span></strong></a></dt>
1476 <dd>Collective term for hiragana and katakana.</dd>
1477 <dt><a id="g-kanji"><strong>Kanji</strong></a></dt>
1478 <dd>Japanese term for ideographs; ideographs used in Japanese. Subset of the
1479 Japanese writing system, used together with hiragana and katakana. Also see <a
1480 href="#g-hanja"><span lang="ko">Hanja</span></a>.</dd>
1481 <dt><a id="g-katakana"><strong><span
1482 lang="ja">Katakana</span></strong></a></dt>
1483 <dd>Japanese syllabic script, or character of that script. Angular in
1484 appearance. Subset of the Japanese writing system, used together with
1485 kanji and hiragana. In recent times, mainly used to write foreign words. Also see <a
1486 href="#g-hiragana"><span lang="ja">Hiragana</span></a>.</dd>
1487 <dt><a id="g-monoruby" name="g-monoruby"><strong>Mono-ruby</strong></a></dt>
1488 <dd>In Japanese typography: Ruby associated with a single character of
1489 the base text.</dd>
1490 <dt><a id="g-ruby"><strong>Ruby</strong></a></dt>
1491 <dd>A run of text that appears in the vicinity of another run of text and
1492 serves as an annotation or a pronunciation guide for that text.</dd>
1493 </dl>
1495 <h2 id="conformance">
1496 Conformance</h2>
1498 <h3 id="conventions">
1499 Document conventions</h3>
1501 <p>Conformance requirements are expressed with a combination of
1502 descriptive assertions and RFC 2119 terminology. The key words “MUST”,
1503 “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
1504 “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
1505 document are to be interpreted as described in RFC 2119.
1506 However, for readability, these words do not appear in all uppercase
1507 letters in this specification.
1509 <p>All of the text of this specification is normative except sections
1510 explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p>
1512 <p>Examples in this specification are introduced with the words “for example”
1513 or are set apart from the normative text with <code>class="example"</code>,
1514 like this:
1516 <div class="example">
1517 <p>This is an example of an informative example.</p>
1518 </div>
1520 <p>Informative notes begin with the word “Note” and are set apart from the
1521 normative text with <code>class="note"</code>, like this:
1523 <p class="note">Note, this is an informative note.</p>
1525 <h3 id="conformance-classes">
1526 Conformance classes</h3>
1528 <p>Conformance to CSS Ruby Module
1529 is defined for three conformance classes:
1530 <dl>
1531 <dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
1532 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
1533 style sheet</a>.
1534 <dt><dfn>renderer</dfn></dt>
1535 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
1536 that interprets the semantics of a style sheet and renders
1537 documents that use them.
1538 <dt><dfn id="authoring-tool">authoring tool</dfn></dt>
1539 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
1540 that writes a style sheet.
1541 </dl>
1543 <p>A style sheet is conformant to CSS Ruby Module
1544 if all of its statements that use syntax defined in this module are valid
1545 according to the generic CSS grammar and the individual grammars of each
1546 feature defined in this module.
1548 <p>A renderer is conformant to CSS Ruby Module
1549 if, in addition to interpreting the style sheet as defined by the
1550 appropriate specifications, it supports all the features defined
1551 by CSS Ruby Module by parsing them correctly
1552 and rendering the document accordingly. However, the inability of a
1553 UA to correctly render a document due to limitations of the device
1554 does not make the UA non-conformant. (For example, a UA is not
1555 required to render color on a monochrome monitor.)
1557 <p>An authoring tool is conformant to CSS Ruby Module
1558 if it writes style sheets that are syntactically correct according to the
1559 generic CSS grammar and the individual grammars of each feature in
1560 this module, and meet all other conformance requirements of style sheets
1561 as described in this module.
1563 <h3 id="partial">
1564 Partial implementations</h3>
1566 <p>So that authors can exploit the forward-compatible parsing rules to
1567 assign fallback values, CSS renderers <strong>must</strong>
1568 treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
1569 as appropriate</a>) any at-rules, properties, property values, keywords,
1570 and other syntactic constructs for which they have no usable level of
1571 support. In particular, user agents <strong>must not</strong> selectively
1572 ignore unsupported component values and honor supported values in a single
1573 multi-value property declaration: if any value is considered invalid
1574 (as unsupported values must be), CSS requires that the entire declaration
1575 be ignored.</p>
1577 <h3 id="experimental">
1578 Experimental implementations</h3>
1580 <p>To avoid clashes with future CSS features, the CSS2.1 specification
1581 reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
1582 syntax</a> for proprietary and experimental extensions to CSS.
1584 <p>Prior to a specification reaching the Candidate Recommendation stage
1585 in the W3C process, all implementations of a CSS feature are considered
1586 experimental. The CSS Working Group recommends that implementations
1587 use a vendor-prefixed syntax for such features, including those in
1588 W3C Working Drafts. This avoids incompatibilities with future changes
1589 in the draft.
1590 </p>
1592 <h3 id="testing">
1593 Non-experimental implementations</h3>
1595 <p>Once a specification reaches the Candidate Recommendation stage,
1596 non-experimental implementations are possible, and implementors should
1597 release an unprefixed implementation of any CR-level feature they
1598 can demonstrate to be correctly implemented according to spec.
1600 <p>To establish and maintain the interoperability of CSS across
1601 implementations, the CSS Working Group requests that non-experimental
1602 CSS renderers submit an implementation report (and, if necessary, the
1603 testcases used for that implementation report) to the W3C before
1604 releasing an unprefixed implementation of any CSS features. Testcases
1605 submitted to W3C are subject to review and correction by the CSS
1606 Working Group.
1608 <p>Further information on submitting testcases and implementation reports
1609 can be found from on the CSS Working Group's website at
1610 <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
1611 Questions should be directed to the
1612 <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
1613 mailing list.
1615 <h2 class=no-num id="acknowledgments">
1616 Acknowledgments</h2>
1618 <p>This specification would not have been possible without the help from:</p>
1620 <p>Stephen Deach, Martin Dürst, Hideki Hiura(<span lang="ja">樋浦 秀樹</span>), Masayasu Ishikawa(<span lang="ja">石川
1621 雅康</span>), Chris
1622 Pratley, Takao Suzuki(<span lang="ja">鈴木 孝雄</span>), Frank Yung-Fong Tang, Chris Thrasher, Masafumi Yabe<span lang="ja">家辺
1623 勝文</span>), Steve Zilles.</p>
1625 <h2 class="no-num" id="changes">
1626 Changes</h2>
1628 <p>The following major changes have been made since the previous Working Draft:
1629 <dl>
1630 <dt>Remove 'ruby-span' and mentions of <code>rbspan</code>.
1631 <dd>
1632 Explicit spanning is not used in HTML ruby in favor of implicit spanning.
1633 This can't handle some pathological double-sided spanning cases,
1634 but there seems to be no requirement for these at the moment.
1635 (For implementations that support full complex XHTML Ruby,
1636 they can imply spanning from the markup the same magic way
1637 that we handle cell spanning from tables. It doesn't seem
1638 necessary to include controls this in Level 1.)
1640 <dt>Defer 'ruby-overhang' and ''ruby-align: line-end'' to Level 2.
1641 <dd>
1642 It's somewhat complicated, advanced feature.
1643 Proposal is to make this behavior UA-defined
1644 and provide some examples of acceptable options.
1646 <dt>Close issue requesting 'display: rp': use ''display: none''.
1647 <dd>
1648 The i18nwg added an issue requesting a display value for <rp> elements.
1649 They're supposed to be hidden when &tl;ruby> is displayed as ruby.
1650 But this is easily accomplished already with ''display: none''.
1652 <dt>Change 'ruby-position' values to match 'text-emphasis-position'.
1653 <dd>
1654 Other than ''inter-character'', which we need to keep,
1655 it makes more sense to align ruby positions with 'text-emphasis-position',
1656 which can correctly handle various combinations of horizontal/vertical preferences.
1658 <dt>Remove unused values of 'ruby-align'.
1659 <dd>
1660 'left', 'right', and 'end' are not needed.
1662 <dt>Added 'ruby-merge' property to control jukugo rendering.
1663 <dd>
1664 This is a stylistic effect, not a structural one;
1665 the previous model assumed that it was structural and suggested handling it by changing markup. :(
1667 <dt>Remove ''inline'' from 'ruby-position'.
1668 <dd>
1669 This is do-able via ''display: inline'' on all the ruby-related elements,
1670 see <a href="#default-inline">Appendix A</a>
1672 <dt>Added <a href="#default-style">Default Style</a> rules
1673 <dd>
1674 As requested by i18nwg.
1676 <dt>Wrote anonymous box generation rules
1677 <dd>
1678 And defined pairing of bases and annotations.
1679 Should now handle all the crazy proposed permutations of HTML ruby markup.
1680 </dl>
1682 <h2 class=no-num id="references">
1683 References</h2>
1685 <h3 class="no-num" id="normative-references">
1686 Normative references</h3>
1687 <!--normative-->
1689 <h3 class="no-num" id="other-references">
1690 Other references</h3>
1691 <!--informative-->
1693 <h2 class="no-num" id="index">
1694 Index</h2>
1695 <!--index-->
1697 <h2 class="no-num" id="property-index">
1698 Property index</h2>
1699 <!-- properties -->
1701 </body>
1702 </html>
1703 <!-- Keep this comment at the end of the file
1704 Local variables:
1705 mode: sgml
1706 sgml-declaration:"~/SGML/HTML4.decl"
1707 sgml-default-doctype-name:"html"
1708 sgml-minimize-attributes:t
1709 sgml-nofill-elements:("pre" "style" "br")
1710 sgml-live-element-indicator:t
1711 sgml-omittag:nil
1712 sgml-shorttag:nil
1713 sgml-namecase-general:t
1714 sgml-general-insert-case:lower
1715 sgml-always-quote-attributes:t
1716 sgml-indent-step:nil
1717 sgml-indent-data:t
1718 sgml-parent-document:nil
1719 sgml-exposed-tags:nil
1720 sgml-local-catalogs:nil
1721 sgml-local-ecat-files:nil
1722 End:
1723 -->