css-ruby/Overview.src.html

Tue, 18 Jun 2013 22:06:47 +0900

author
fantasai <fantasai.cvs@inkedblade.net>
date
Tue, 18 Jun 2013 22:06:47 +0900
changeset 8492
c0946931cbe8
parent 8490
32c9ef6fe05c
child 8493
7c1714a409cb
permissions
-rw-r--r--

[css-ruby] Rewrite Ruby intro, display type sections

fantasai@8479 1 <!DOCTYPE html>
fantasai@8479 2 <html lang="en">
ishida@1665 3 <head>
fantasai@8479 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
fantasai@8479 5 <title>CSS Ruby Module Level 1</title>
fantasai@8479 6 <link rel=contents href="#contents">
fantasai@8479 7 <link rel=index href="#index">
fantasai@8479 8 <link rel="stylesheet" type="text/css" href="../default.css">
fantasai@8479 9 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
fantasai@8479 10 <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
ishida@1665 11 </head>
ishida@1665 12
fantasai@8479 13 <body class="h-entry">
ishida@1665 14
ishida@1665 15 <div class="head">
fantasai@8479 16 <!--logo-->
ishida@1665 17
fantasai@8479 18 <h1 class="p-name">CSS Ruby Module Level 1</h1>
ishida@1665 19
fantasai@8479 20 <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>
ishida@1665 21 <dl>
fantasai@8479 22 <dt>This version:
fantasai@8479 23 <dd><a class="u-url" href="[VERSION]">[VERSION]</a>
fantasai@7857 24
fantasai@8479 25 <dt>Latest version:
fantasai@8479 26 <dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/css3-ruby/</a>
fantasai@8479 27
fantasai@8479 28 <dt>Editor's draft:
fantasai@8479 29 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
fantasai@8479 30 (<a href="https://dvcs.w3.org/hg/csswg/log/tip/[SHORTNAME]/Overview.src.html">change log</a>)
fantasai@8479 31
fantasai@8479 32 <dt>Previous version:
fantasai@8479 33 <dd><a href="http://www.w3.org/TR/2011/WD-css3-ruby-20110630/">
fantasai@8479 34 http://www.w3.org/TR/2011/WD-css3-ruby-20110630/</a>
fantasai@8479 35
fantasai@8479 36 <dt>Issue Tracking:</dt>
fantasai@8479 37 <dd><a rel="issues" href="http://www.w3.org/Style/CSS/Tracker/products/FIXME">http://www.w3.org/Style/CSS/Tracker/products/FIXME</a>
fantasai@8479 38
fantasai@8479 39 <dt>Feedback:</dt>
fantasai@8479 40 <dd><a href="mailto:www-style@w3.org?subject=%5BSHORTNAME%5D%20feedback"
fantasai@8479 41 >www-style@w3.org</a>
fantasai@8479 42 with subject line &ldquo;<kbd>[[SHORTNAME]]
fantasai@8479 43 <var>&hellip; message topic &hellip;</var></kbd>&rdquo;
fantasai@8479 44 (<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/"
fantasai@8479 45 >archives</a>)
fantasai@8479 46
fantasai@8479 47 <dt>Editors:
fantasai@8479 48 <dd class="p-author h-card vcard">
fantasai@8479 49 <a class="p-name fn u-url url" rel="author"
fantasai@8479 50 href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>,
fantasai@8479 51 <a class="p-org org h-org" href="http://www.mozilla.org/">Mozilla</a>
fantasai@8479 52 <dd class="p-author h-card vcard">
fantasai@8479 53 <a class="p-name fn u-url url" rel="author"
fantasai@8479 54 href="mailto:koji.a.ishii@mail.rakuten.com">Koji Ishii</a>,
fantasai@8479 55 <span class="p-org org">Rakuten, Inc.</span>
fantasai@8479 56 <dd class="p-author h-card vcard">
fantasai@8479 57 <a class="p-name fn u-url url" rel="author"
fantasai@8479 58 href="mailto:ishida@w3.org">Richard Ishida</a>,
fantasai@8479 59 <span class="p-org org">W3C</span>
fantasai@8479 60
fantasai@8479 61 <dt>Former editors:
fantasai@8479 62 <dd>Michel Suignard, Microsoft
fantasai@8479 63 <dd>Marcin Sawicki, Microsoft
ishida@1665 64 </dl>
ishida@1665 65
fantasai@8479 66 <!--copyright-->
ishida@1665 67
fantasai@8479 68 <hr title="Separator for header">
ishida@1665 69 </div>
ishida@1665 70
fantasai@8479 71 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
ishida@1665 72
fantasai@8479 73 <p>
fantasai@8479 74 <span class="p-summary">
fantasai@8479 75 “Ruby” are short runs of text alongside the base text,
fantasai@8479 76 typically used in East Asian documents to indicate pronunciation
fantasai@8479 77 or to provide a short annotation.
fantasai@8479 78 This module describes the rendering model and formatting controls
fantasai@8479 79 related to displaying ruby annotations in CSS.
fantasai@8479 80 </span>
fantasai@8479 81
fantasai@8479 82 <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing
fantasai@8479 83 the rendering of structured documents (such as HTML and XML) on screen, on
fantasai@8479 84 paper, in speech, etc.
ishida@1665 85
fantasai@8479 86 <h2 class="no-num no-toc" id="status">Status of this document</h2>
ishida@1665 87
fantasai@8479 88 <!--status-->
fantasai@8479 89
fantasai@8479 90 <p>The following features are at risk: &hellip;
fantasai@8479 91
fantasai@8479 92 <h2 class="no-num no-toc" id="contents">
fantasai@8479 93 Table of Contents</h2>
fantasai@8479 94
fantasai@8479 95 <!--toc-->
fantasai@8479 96
fantasai@8479 97 <h2 id="intro">
fantasai@8479 98 Introduction</h2>
fantasai@8479 99
fantasai@8479 100 <p><em>This section is not normative.</em>
fantasai@8479 101
fantasai@8479 102 <h3 id="placement">
fantasai@8479 103 Module interactions</h3>
fantasai@8479 104
fantasai@8479 105 <p>This module extends the inline box model of CSS Level 2 [[!CSS21]]
fantasai@8479 106 to support ruby.
fantasai@8479 107
fantasai@8479 108 <p>None of the properties in this module apply to the <code>::first-line</code> or
fantasai@8479 109 <code>::first-letter</code> pseudo-elements.
fantasai@8479 110
fantasai@8479 111 <h3 id="values">
fantasai@8479 112 Values</h3>
fantasai@8479 113
fantasai@8479 114 <p>This specification follows the
fantasai@8479 115 <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
fantasai@8479 116 definition conventions</a> from [[!CSS21]]. Value types not defined in
fantasai@8479 117 this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
fantasai@8479 118 Other CSS modules may expand the definitions of these value types: for
fantasai@8479 119 example [[CSS3VAL]], when combined with this module, expands the
fantasai@8479 120 definition of the <var>&lt;length&gt;</var> value type as used in this specification.</p>
fantasai@8479 121
fantasai@8479 122 <p>In addition to the property-specific values listed in their definitions,
fantasai@8479 123 all properties defined in this specification also accept the
fantasai@8479 124 <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
fantasai@8479 125 keyword as their property value. For readability it has not been repeated
fantasai@8479 126 explicitly.
fantasai@8479 127
fantasai@8479 128 <h3 id="conventions">
fantasai@8479 129 Document conventions</h3>
ishida@1665 130
fantasai@8492 131 <p>Many typographical conventions in East Asian typography depend
fantasai@8492 132 on whether the character rendered is wide (CJK) or narrow (non-CJK).
fantasai@8492 133 There are a number of illustrations in this document
fantasai@8492 134 for which the following legend is used:
ishida@1665 135
fantasai@8492 136 <dl>
fantasai@8492 137 <dt><img alt="Symbolic wide-cell glyph representation" width="39" height="39" src="images/fullwidth.gif">
fantasai@8492 138 <dd>Wide-cell glyph (e.g. Han) that is the <var>n</var>th character in the text run.
fantasai@8492 139 They are typically sized to 50% when used as annotations.
fantasai@8492 140 <dt><img alt="Symbolic narrow-cell glyph representation" width="19" height="39" src="images/halfwidth.gif">
fantasai@8492 141 <dd>Narrow-cell glyph (e.g. Roman) which is the <var>n</var>th glyph in the text run.
ishida@1665 142
fantasai@8492 143 <p>The orientation which the above symbols assume in the diagrams
fantasai@8492 144 corresponds to the orientation that the glyphs they represent
fantasai@8492 145 are intended to assume when rendered by the user agent.
fantasai@8492 146 Spacing between these characters in the diagrams is incidental,
fantasai@8492 147 unless intentionally changed to make a point.
ishida@1665 148
fantasai@8479 149 <h3 id="ruby-def">
fantasai@8479 150 What is ruby?</h3>
ishida@1665 151
fantasai@8492 152 <p><dfn>Ruby</dfn> is the commonly-used name for a run of text
fantasai@8492 153 that appears alongside another run of text (referred to as the “base”)
fantasai@8492 154 and serves as an annotation or a pronunciation guide associated with that run of text.
ishida@1665 155
fantasai@8492 156 <p>The following figures show two examples of Ruby,
fantasai@8492 157 a simple case and one with more complicated structure.
ishida@1665 158
fantasai@8492 159 <div class="example">
fantasai@8492 160 <p>In this first example, a single annotation is used to annotate the base text.
fantasai@8492 161 <div class="figure">
fantasai@8492 162 <p><img src="images/licence.png"
fantasai@8492 163 alt="Example of ruby applied on top of a Japanese expression">
fantasai@8492 164 <p class="caption">Example of ruby used in Japanese (simple case)
fantasai@8492 165 </div>
fantasai@8492 166 <p>In Japanese typography, this case is sometimes called
fantasai@8492 167 <i lang="ja">taigo</i> ruby or group-ruby (per-word ruby),
fantasai@8492 168 because the annotation as a whole is associated
fantasai@8492 169 with multi-character word (as a whole).
fantasai@8492 170 </div>
ishida@1665 171
fantasai@8492 172 <div class="example">
fantasai@8492 173 <p>In this second example,
fantasai@8492 174 two levels of annotations are attached to a base sequence:
fantasai@8492 175 the hiragana characters on top refer to the pronunciation of each of the base kanji characters,
fantasai@8492 176 while the words “Keio” and “University” on the bottom are annotations describing the English translation.
fantasai@8492 177 <div class="figure">
fantasai@8492 178 <p><img src="images/ruby-univ.gif"
fantasai@8492 179 alt="Example showing complex ruby with annotation text over and under the base characters">
fantasai@8492 180 <p class="caption">Complex ruby with annotation text over and under the base characters
fantasai@8492 181 </div>
fantasai@8492 182 <p>
fantasai@8492 183 <p>Notice that to allow correct association between the hiragana characters and
fantasai@8492 184 their corresponding Kanji base characters,
fantasai@8492 185 the spacing between these Kanji characters is adjusted.
fantasai@8492 186 (This happens around the fourth Kanji character in the figure above.)
fantasai@8492 187 To avoid variable spacing between the Kanji characters in the example above
fantasai@8492 188 the hiragana annotations can be styled as a <i>collapsed annotation</i>,
fantasai@8492 189 which will look more like the group-ruby example earlier.
fantasai@8492 190 However because the base-annotation pairings are recorded in the ruby structure,
fantasai@8492 191 if the text breaks across lines, the annotation characters will stay
fantasai@8492 192 correctly paired with their respective base characters.
fantasai@8492 193 </div>
ishida@1665 194
fantasai@8492 195 <i>Ruby</i> formatting as used in Japanese is described in JIS X-4051 [[JIS4051]] (in Japanese)
fantasai@8492 196 and in Requirements for Japanese Text Layout [[JLREQ]] (in English and Japanese)].
fantasai@8492 197 In HTML, ruby structure and markup to represent it is described
fantasai@8492 198 in the Ruby Markup Extension specification.
fantasai@8492 199 This module describes the CSS rendering model
fantasai@8492 200 and formatting controls relevant to ruby layout of such markup.
ishida@1665 201
fantasai@8479 202 <h2 id="ruby-model">
fantasai@8479 203 Ruby Formatting Model</h2>
ishida@1665 204
fantasai@8492 205 <p>The CSS ruby model is based on
fantasai@8492 206 the <a href="http://darobin.github.io/html-ruby/">HTML Ruby Markup Extension</a>
fantasai@8492 207 and <a href="http://www.w3.org/TR/ruby/">XHTML Ruby Annotation Recommendation</a> [[RUBY]].
fantasai@8492 208 In this model, a ruby structure consists of
fantasai@8492 209 one or more <dfn>ruby base</dfn> elements representing the base (annotated) text,
fantasai@8492 210 associated with one or more levels of <dfn>ruby annotation</dfn> elements representing the annotations.
fantasai@8492 211 The structure of ruby is similar to that of a table:
fantasai@8492 212 there are “rows” (the base text level, each annotation level)
fantasai@8492 213 and “columns” (each <i>ruby base</i> and its corresponding <i>ruby annotations</i>).
ishida@1665 214
fantasai@8492 215 <p>Consecutive bases and annotations are grouped together into <dfn>ruby segments</dfn>.
fantasai@8492 216 Within a <i>ruby segment</i>, a <i>ruby annotation</i> may span multiple <i>ruby bases<i>.
ishida@1665 217
fantasai@8492 218 <p class="note">In HTML, a single <code>&lt;ruby&gt;</code> element may contain multiple <i>ruby segments</i>.
fantasai@8492 219 (In the XHTML Ruby model, a single <code>&lt;ruby&gt;</code> element can only contain one <i>ruby segment</i>.)
ishida@1665 220
fantasai@8492 221 <h3 id="ruby-display">
fantasai@8492 222 Ruby-specific 'display' property values</h3>
ishida@1665 223
fantasai@8492 224 <p>For document languages (such as XML applications) that do not have pre-defined ruby elements,
fantasai@8492 225 authors must map document language elements to ruby elements;
fantasai@8492 226 this is done with the 'display' property.
fantasai@8492 227
fantasai@8492 228 <table class="propdef">
fantasai@8492 229 <tr>
fantasai@8492 230 <th>Name:
fantasai@8492 231 <td>display
fantasai@8492 232 <tr>
fantasai@8492 233 <th><a href="#values">New Values</a>:
fantasai@8492 234 <td>ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container
fantasai@8492 235 </table>
fantasai@8492 236
fantasai@8492 237 <p>The following new 'display' values assign ruby layout roles to an arbitrary element:
fantasai@8492 238
fantasai@8492 239 <dl>
fantasai@8492 240 <dt>''ruby''
fantasai@8492 241 <dd>Specifies that an element generates a <dfn>ruby container box</dfn>.
fantasai@8492 242 (Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
fantasai@8492 243 <dt>''ruby-base''
fantasai@8492 244 <dd>Specifies that an element generates a <dfn>ruby base box</dfn>.
fantasai@8492 245 (Corresponds to HTML/XHTML <code>&lt;rb&gt;</code> elements.)
fantasai@8492 246 <dt>''ruby-text''
fantasai@8492 247 <dd>Specifies that an element generates a <dfn>ruby annotation box</dfn>.
fantasai@8492 248 (Corresponds to HTML/XHTML <code>&lt;rt&gt;</code> elements.)
fantasai@8492 249 <dt>''ruby-base-container''
fantasai@8492 250 <dd>Specifies that an element generates a <dfn>ruby base container box</dfn>.
fantasai@8492 251 (Corresponds to XHTML <code>&lt;rbc&gt;</code> elements; always implied in HTML.)
fantasai@8492 252 <dt>''ruby-text-container''
fantasai@8492 253 <dd>Specifies that an element generates a <dfn>ruby annotation container box</dfn>.
fantasai@8492 254 (Corresponds to HTML/XHTML <code>&lt;ruby&gt;</code> elements.)
fantasai@8492 255 </dl>
fantasai@8492 256
fantasai@8492 257 <p>The CSS model does not require that the document language
fantasai@8492 258 include elements that correspond to each of these components.
fantasai@8492 259 Missing parts of the structure are implied through the anonymous box generation rules.
fantasai@8492 260
fantasai@8492 261 <p class="issue">The spec needs to address anonymous box generation rules (and to make them compatible with HTML5 ruby markup).
fantasai@8492 262 <p class="issue">How should box generation rules deal with ruby elements that contain block-level boxes?
fantasai@8492 263 Turn them into inline blocks? Treat them as 'display: none'? Force them to float? Something else?
ishida@1665 264
fantasai@8479 265 <h3 id="box-model">
fantasai@8479 266 Ruby box model</h3>
ishida@1665 267
ishida@1665 268 <p>In the following description, the elements specified by Ruby
fantasai@8479 269 Annotation [[RUBY]] are used to describe the box model. As mentioned
ishida@1665 270 earlier, a user agent can obtain the same results by using the Ruby specific 'display'
ishida@1665 271 property values. </p>
ishida@1665 272
ishida@1665 273 <p>For a user agent that supports the ruby markup, the ruby structure consists of three or more
ishida@1665 274 boxes. The outermost container is the <a
ishida@1665 275 href="http://www.w3.org/TR/ruby/#ruby"><samp>ruby</samp></a> element itself.
ishida@1665 276 In the simple case, it is a container for two non-overlapping boxes: the ruby
ishida@1665 277 text box (<a href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element)
ishida@1665 278 and the ruby base box (<a
ishida@1665 279 href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element). The
ishida@1665 280 positioning of these two boxes relative to each other is controlled by the <a
ishida@1665 281 href="#rubypos">'ruby-position'</a> property.</p>
ishida@1665 282
ishida@1665 283 <div class="figure">
ishida@1665 284 <img class="example" width="223" height="93"
ishida@1665 285 alt="Diagram of the ruby box model consisting of two boxes, one on top of the other, enclosed within a third box representing the ruby element"
ishida@1666 286 src="images/r-box-t.gif" />
ishida@1665 287
ishida@1665 288 <p><b>Figure 3.2.1</b>: Ruby box model (simple case)</p>
ishida@1665 289 </div>
ishida@1665 290
ishida@1665 291 <p>In the case of complex ruby, the ruby element is a container for two or
ishida@1665 292 three non-overlapping boxes: one ruby base collection (<a
ishida@1665 293 href="http://www.w3.org/TR/ruby/#rbc"><samp>rbc</samp></a> element), and one
ishida@1665 294 or two ruby text collections (<a
ishida@1665 295 href="http://www.w3.org/TR/ruby/#rtc"><samp>rtc</samp></a> element). The
ishida@1665 296 <samp>rbc</samp> element is itself a container for one or several ruby base
ishida@1665 297 box (<samp>rb</samp> element), while each <samp>rtc</samp> element is a
ishida@1665 298 container for one or several ruby text box (rt element). The position of the
ishida@1665 299 <samp>rtc</samp> element in relation to the related <samp>rbc</samp> element
ishida@1665 300 is controlled by the <a href="#rubypos">'ruby-position'</a> property. The two
ishida@1665 301 following figures show examples of these complex ruby.</p>
ishida@1665 302
ishida@1665 303 <div class="figure">
ishida@1666 304 <img src="images/r-box-g.gif"
ishida@1665 305 alt="Diagram of a group ruby with a full ruby text above and partial ruby text below" width="408" height="170" />
ishida@1665 306
ishida@1665 307 <p><b>Figure 3.2.2</b>: Ruby box model (complex ruby with an empty rt element
ishida@1665 308 after)</p>
ishida@1665 309 </div>
ishida@1665 310
ishida@1665 311 <p>In the example above, the ruby text after (below) the ruby bases contains two <samp>rt</samp> elements with the first one
ishida@1665 312 being empty, the empty <samp>rt</samp> element corresponds to the first part
ishida@1665 313 of the ruby base collection (the first part is identified by the first <samp>rb</samp> element
ishida@1665 314 within the <samp> rbc</samp> element).</p>
ishida@1665 315
ishida@1665 316 <div class="figure">
ishida@1666 317 <img src="images/r-box-h.gif"
ishida@1665 318 alt="Diagram of a group ruby with a spanning ruby text above and partial ruby text below" width="400" height="173" />
ishida@1665 319
ishida@1665 320 <p><b>Figure 3.2.3</b>: Ruby box model (complex ruby with a spanning ruby text
ishida@1665 321 element)</p>
ishida@1665 322 </div>
ishida@1665 323
ishida@1665 324 <p>In the example above, the ruby text before (above) the ruby bases spans the whole ruby base collection. The
ishida@1665 325 ruby text after (below) the ruby bases still contain two <samp>rt</samp> elements, one of
ishida@1665 326 which is empty. The spanning behavior of <samp>rt</samp> text elements is
ishida@1665 327 controlled by the <a
ishida@1665 328 href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute in a
ishida@1665 329 way similar to the <samp>colspan</samp> attribute used for table column.</p>
ishida@1665 330
ishida@1665 331 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> The examples above contain the term 'group ruby', which is not used elsewhere in this specification. It appears to be used in a way that is different to the use of the term in JLREQ. I propose to replace it with just 'ruby'.</p>
ishida@1665 332 <p class="note"><span class="note-label">Note:</span> The visual description of the ruby elements does not refer
ishida@1665 333 necessarily to the logical orders of the elements</p>
ishida@1665 334
ishida@1665 335 <p>The width of the ruby box is by default determined by its widest child
ishida@1665 336 element, whose width in turn is determined by its content. The width of all direct
ishida@1665 337 children of the <samp>ruby</samp> element is the width of the widest children. In this respect, the ruby
ishida@1665 338 box is much like a two or three row <samp>table</samp> element, with the
ishida@1665 339 following exceptions:</p>
ishida@1665 340 <ul>
ishida@1665 341 <li>the ruby box is an inline element, like an image, even though it itself,
ishida@1665 342 like a table, is a container of other boxes</li>
ishida@1665 343 <li>the equivalent of the cells: the <samp>rb</samp> element and the
ishida@1665 344 <samp>rt</samp> text element can only contain inline-level elements.</li>
ishida@1665 345 <li>the content of each 'cell' is always measured at its maximum width</li>
ishida@1665 346 <li>unlike a table, a ruby element doesn't have to fit in a line, the ruby
ishida@1665 347 box may be split into several boxes at line boundary, depending of the
ishida@1665 348 spanning of the ruby texts. This is however only possible for the complex
ishida@1665 349 ruby and can only happen at the boundary of non spanning elements.</li>
ishida@1665 350 <li>both the ruby text and the ruby base boxes may overlap with adjacent
ishida@1665 351 text (outside of the ruby element) if an appropriate <a
ishida@1665 352 href="#rubyover">'ruby-overhang'</a> parameter is set via CSS. Note
ishida@1665 353 however that the actual content of the ruby base cannot overlap with that
ishida@1665 354 adjacent text. The distribution of the content of the ruby base within the
ishida@1665 355 ruby base box is controlled by the <a href="#rubyalign">'ruby-align'</a>
ishida@1665 356 property.</li>
ishida@1665 357 </ul>
ishida@1665 358
ishida@1665 359 <p>If the ruby text is not allowed to overhang, then the ruby behaves like a
ishida@1665 360 traditional box, i.e. only its contents are rendered within its boundaries and
ishida@1665 361 adjacent elements do not cross the box boundary:</p>
ishida@1665 362
ishida@1665 363 <div class="figure">
ishida@1665 364 <p><img class="example" width="220" height="91"
ishida@1665 365 alt="Diagram showing the ruby boxes interacting with adjacent text"
ishida@1666 366 src="images/ro-n.gif" /></p>
ishida@1665 367
ishida@1665 368 <p><b>Figure 3.2.4</b>: Simple ruby whose text is not allowed to overhang
ishida@1665 369 adjacent text</p>
ishida@1665 370 </div>
ishida@1665 371
ishida@1665 372 <p>However, if ruby text is allowed to overhang adjacent elements and it
ishida@1665 373 happens to be wider than its base, then the adjacent content is partially
ishida@1665 374 rendered within the area of the ruby base box, while the ruby text may be
ishida@1665 375 partially overlapping with the upper blank parts of the adjacent content:</p>
ishida@1665 376
ishida@1665 377 <div class="figure">
ishida@1665 378 <p><img class="example" width="177" height="91"
ishida@1665 379 alt="Diagram showing the ruby boxes interacting with adjacent text"
ishida@1666 380 src="images/ro-a.gif" /></p>
ishida@1665 381
ishida@1665 382 <p><b>Figure 3.2.5</b>: Simple ruby whose text is allowed to overhang adjacent
ishida@1665 383 text</p>
ishida@1665 384 </div>
ishida@1665 385
ishida@1665 386 <p>The ruby text related to a ruby base can never overhang another ruby
ishida@1665 387 base.</p>
ishida@1665 388
ishida@1665 389 <p>The alignment of the contents of the base or the ruby text is not affected
ishida@1665 390 by the overhanging behavior. The alignment is achieved the same way regardless
ishida@1665 391 of the overhang behavior setting and it is computed before the space available
ishida@1665 392 for overlap is determined. It is controlled by the <a
ishida@1665 393 href="#rubyalign">'ruby-align'</a> property.</p>
ishida@1665 394
ishida@1665 395 <p>The exact circumstances in which the ruby text will overhang other
ishida@1665 396 elements, and to what degree it will do so, will be controlled by the <a
ishida@1665 397 href="#rubyover">'ruby-overhang'</a> property.</p>
ishida@1665 398
ishida@1665 399 <p>This entire logic applies the same way in vertical ideographic layout, only
ishida@1665 400 the dimension in which it works in such a layout is vertical, instead of
ishida@1665 401 horizontal.</p>
ishida@1665 402
fantasai@8479 403 <p class="note"><span class="note-label">Note:</span> Because the purpose of the XHTML <samp>rp</samp> element
fantasai@8479 404 [[RUBY]] is to allow pre-existing user agents
ishida@1665 405 to parenthesize ruby text content, an XHTML user agent should use a styling rule
ishida@1665 406 for these elements that avoids rendering them such as&nbsp; <samp>rp {display:
ishida@1665 407 none}</samp>.</p>
ishida@1665 408
fantasai@8479 409 <h3 id="ruby-line-height">
fantasai@8479 410 Ruby box and line stacking</h3>
ishida@1665 411
ishida@1665 412 <p>The interaction of the ruby box and line stacking is controlled by the
ishida@1665 413 'line-stacking-ruby' property described in the CSS3 Line Module. That property
ishida@1665 414 takes two values: 'include-ruby' and 'exclude-ruby. Depending on the property
ishida@1665 415 value, the ruby box is considered or excluded for line stacking. Even if the
ishida@1665 416 ruby box is considered for line stacking, some values of the
ishida@1665 417 'line-stacking-strategy' property (also described in the CSS3 Line module) can
ishida@1665 418 still create occurrences where a the ruby box will eventually be ignored (e.g.
ishida@1665 419 case where the 'line-stacking-strategy' value is 'block-line-height').</p>
ishida@1665 420
ishida@1665 421 <p>In the following figure, each line box is shown with leading space
ishida@1665 422 distributed before and after the two text segments ('Previous line' and 'Ruby
ishida@1665 423 base'); the dotted lines show the line box for each line. The
ishida@1665 424 'line-stacking-ruby' property is set to 'exclude-ruby'. The achieved effect is
ishida@1665 425 that the ruby box does not affect the line to line spacing. It is however the
ishida@1665 426 responsibility of the style author to avoid 'bleeding' effects between the ruby
ishida@1665 427 text and the surrounding text of images.</p>
ishida@1665 428
ishida@1665 429 <div class="figure">
ishida@1665 430 <p>
ishida@1665 431 <img class="example"
ishida@1665 432 alt="Diagram showing the ruby text using 2 half leading"
ishida@1666 433 src="images/rlh-a.gif" width="210" height="138" /></p>
ishida@1665 434
ishida@1665 435 <p><b>Figure 3.3.1</b>: Excluded Ruby text</p>
ishida@1665 436 </div>
ishida@1665 437
ishida@1665 438
ishida@1665 439 <p>In the following figure, the line boxes have no extra leading space. The
ishida@1665 440 'line-stacking-ruby' property is set to 'include-ruby' and the
ishida@1665 441 'line-stacking-strategy' property is set to a value where inline boxes are
ishida@1665 442 considered for line stacking. In this case, the line box with
ishida@1665 443 the ruby text is affected and has its 'stack-height' increased by the amount
ishida@1665 444 necessary to fit the ruby text.</p>
ishida@1665 445
ishida@1665 446 <div class="figure">
ishida@1665 447 <p>
ishida@1665 448 <img class="example"
ishida@1665 449 alt="Diagram showing the ruby text expanding above base text"
ishida@1666 450 src="images/rlh-b.gif" width="210" height="111" /></p>
ishida@1665 451
ishida@1665 452 <p><b>Figure 3.3.2</b>: Ruby text increasing line height</p>
ishida@1665 453 </div>
ishida@1665 454 <p>This mechanism allows rendering of evenly spaced lines of text within a
ishida@1665 455 block-level element, whether a line contains ruby or not. The authors need
ishida@1665 456 only to set for the block-level element a line height value larger than the
ishida@1665 457 computed line-height of the largest ruby element within the block.</p>
ishida@1665 458
fantasai@8479 459 <h3 id="ruby-line-breaking">
fantasai@8479 460 Ruby box and line breaking</h3>
ishida@1665 461
ishida@1665 462 <p>When a ruby falls at the end of a line where there is not sufficient room for the entire ruby to fit on the line, the complex ruby may be broken at locations where boxes of the ruby container align. Some examples are provided below to provide more clarity.</p>
ishida@1665 463
ishida@1665 464 <p>
ishida@1665 465 <img class="example"
ishida@1665 466 alt="Diagram showing the line breaking opportunity in a complex ruby"
ishida@1666 467 src="images/r-break-a.gif" width="408" height="201" /></p>
ishida@1665 468
ishida@1665 469 <p><b>Figure 3.4.1</b>: Complex ruby line breaking opportunity</p>
ishida@1665 470
ishida@1665 471 <p>
ishida@1665 472 <img class="example"
ishida@1665 473 alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'
ishida@1666 474 src="images/r-break-b.gif" width="300" height="90" /></p>
ishida@1665 475
ishida@1665 476 <p><b>Figure 3.4.1</b>: "Bopomofo" ruby line breaking opportunity</p>
ishida@2228 477 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> Line breaks should only be allowed within ruby if the ruby base text can be broken at that point. E.g. if complex Ruby is used to annotate the two morphemes of &quot;butterfly&quot;, the fact that we have added ruby annotations should not cause a line breaking opportunity to be present between &quot;butter&quot; and &quot;fly&quot; </p>
fantasai@8479 478 <h2 id="ruby-props">
fantasai@8479 479 Ruby Properties</h2>
ishida@1665 480
fantasai@8479 481 <h3 id="rubypos">
fantasai@8479 482 Ruby positioning: the 'ruby-position' property</h3>
ishida@1665 483
fantasai@8479 484 <table class="propdef">
fantasai@8479 485 <tr>
fantasai@8479 486 <th>Name:
fantasai@8479 487 <td><dfn>ruby-position</dfn>
ishida@1665 488 <tr>
fantasai@8479 489 <th>Value:
fantasai@8479 490 <td>before | after | inter-character | inline
ishida@1665 491 <tr>
fantasai@8479 492 <th>Initial:
fantasai@8479 493 <td>before
ishida@1665 494 <tr>
fantasai@8479 495 <th>Applies to:
fantasai@8479 496 <td>the parent of elements with display: ruby-text.
ishida@1665 497 <tr>
fantasai@8479 498 <th>Inherited:
fantasai@8479 499 <td>yes
ishida@1665 500 <tr>
fantasai@8479 501 <th>Percentages:
fantasai@8479 502 <td>N/A
ishida@1665 503 <tr>
fantasai@8479 504 <th>Media:
fantasai@8479 505 <td>visual
ishida@1665 506 <tr>
fantasai@8479 507 <th>Computed value:
fantasai@8479 508 <td>specified value (except for initial and inherit)
fantasai@8479 509 <tr>
fantasai@8479 510 <th>Animatable:
fantasai@8479 511 <td>no
fantasai@8479 512 <tr>
fantasai@8479 513 <th>Canonical order:
fantasai@8479 514 <td><abbr title="follows order of property value definition">per grammar</abbr>
fantasai@8479 515 </table>
ishida@3034 516 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> We replaced 'right' with 'inter-character', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.)</p>
ishida@1665 517 <p>This property is used by the parent of elements with display: ruby-text to
ishida@2361 518 control the position of the ruby text with respect to its base. Such parents
ishida@2361 519 are typically either the <samp>ruby</samp> element itself (simple ruby) or the
ishida@2361 520 <samp>rtc</samp> element (complex ruby). This assures that all parts of a <samp>rtc</samp>
ishida@1665 521 element will be displayed in the same position. Possible values:</p>
ishida@2229 522 <p class="issue"><span class="issuehead">Issue-107:&nbsp;</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=&amp;hdr-1-name=subject&amp;hdr-1-query=ruby-position%3A+undesirable+default+value+%27before%27+for+complex+ruby&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;period_month=&amp;period_year=&amp;index-grp=Public__FULL&amp;index-type=t&amp;type-index=www-style&amp;resultsperpage=20&amp;sortby=date">this thread</a> and <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=Styling+of+complex+Ruby&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;period_month=&amp;period_year=&amp;index-grp=Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core&amp;resultsperpage=20&amp;sortby=date">this one</a>.</p>
ishida@1665 523 <dl>
ishida@1665 524 <dt><strong>before</strong></dt>
ishida@1665 525 <dd>The ruby text appears before the base. This is the most common setting
ishida@1665 526 used in ideographic East Asian writing systems. This is the initial
ishida@1665 527 value.
ishida@1665 528
ishida@1665 529 <div class="figure">
ishida@1665 530 <p>
ishida@1665 531 <img
ishida@1665 532 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base"
ishida@1666 533 class="example" src="images/shinkansen-top.gif" width="140" height="33" /></p>
ishida@1665 534 <p><b>Figure 4.1.1</b>: Top ruby in horizontal layout applied to
ishida@1665 535 Japanese text</p>
ishida@1665 536 </div>
ishida@1665 537 <p>If the base appears in a vertical-ideographic layout mode, the ruby
ishida@1665 538 appears on the right side of the base and is rendered in the same layout
ishida@1665 539 mode as the base (i.e. vertical-ideographic).</p>
ishida@1665 540
ishida@1665 541 <div class="figure">
ishida@1665 542 <p>
ishida@1665 543 <img
ishida@1665 544 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base"
ishida@1666 545 class="example" src="images/shinkansen-right.gif" width="33" height="141" /></p>
ishida@1665 546 <p><b>Figure 4.1.2</b>: Top ruby in vertical ideographic layout applied
ishida@1665 547 to Japanese text</p>
ishida@1665 548 </div>
ishida@1665 549 </dd>
ishida@1665 550 <dt><strong>after</strong></dt>
ishida@1665 551 <dd>The ruby text appears after the base. This is a relatively rare
ishida@1665 552 setting used in ideographic East Asian writing systems, most easily
ishida@1665 553 found in educational text.
ishida@1665 554
ishida@1665 555 <div class="figure">
ishida@1665 556 <p>
ishida@1665 557 <img
ishida@1665 558 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base"
ishida@1666 559 class="example" src="images/shinkansen-bottom.gif" width="142" height="36" /></p>
ishida@1665 560 <p><b>Figure 4.1.3</b>: Bottom ruby in horizontal layout applied to
ishida@1665 561 Japanese text</p>
ishida@1665 562 </div>
ishida@1665 563 <p>If the base appears in a vertical ideographic mode, the bottom ruby
ishida@1665 564 appears on the left side of the base and is rendered in the same layout
ishida@1665 565 mode as the base (i.e. vertical).</p>
ishida@1665 566
ishida@1665 567 <div class="figure">
ishida@1665 568 <p>
ishida@1665 569 <img
ishida@1665 570 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base"
ishida@1666 571 class="example" src="images/shinkansen-left.gif" width="37" height="141" /></p>
ishida@1665 572 <p><b>Figure 4.1.4</b>: Bottom ruby in vertical ideographic layout applied
ishida@1665 573 to Japanese text</p>
ishida@1665 574 </div>
ishida@1665 575 </dd>
ishida@3034 576 <dt><strong>inter-character</strong></dt>
ishida@1665 577 <dd>
ishida@3034 578 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> We replaced 'right' with 'inter-character', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.) See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20Vertical+layout+not+enough+for+bopomofo&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a> following a request from the i18n WG.</p>
ishida@1665 579 <p>The ruby text appears on the right of the base. Unlike 'before' and
ishida@1665 580 'after', this value is visual and is not relative to the text flow direction.</p>
ishida@1665 581
ishida@3034 582 <p>This value is provided for the special case of traditional Chinese as used especially in
ishida@1665 583 Taiwan: ruby (made of <a href="#g-bopomofo"><span
ishida@3034 584 lang="zh">bopomofo</span></a> glyphs) in that context appears vertically along
ishida@3034 585 the right side of the base glyph, whether the layout of the base characters is vertical or horizontal:</p>
ishida@1665 586
ishida@1665 587 <div class="figure">
ishida@1665 588 <p><img alt="Example of Taiwanese-style ruby" class="example"
ishida@1666 589 width="138" height="42" src="images/bopomofo.gif" /></p>
ishida@1665 590 <p><b>Figure 4.1.5</b>: "<span lang="zh">Bopomofo</span>" ruby in
ishida@1665 591 traditional Chinese (ruby text shown in blue for clarity) in horizontal
ishida@1665 592 layout</p>
ishida@1665 593 </div>
ishida@1665 594 <p class="note"><span class="note-label">Note:</span> The bopomofo
ishida@1665 595 transcription is written in the normal way as part of the ruby text.
ishida@1665 596 The user agent is responsible for ensuring the correct relative alignment
ishida@1665 597 and positioning of the glyphs, including those corresponding to the
ishida@3034 598 tone marks, when displaying. Tone marks are spacing characters that occur in memory at the end of the ruby text for each base character. They are usually displayed in a separate column to the right of the bopomofo characters, and the height of the tone mark depends on the number of characters in the syllable. One tone mark, however, is placed above the bopomofo, not to the right of it.</p>
ishida@3034 599 <p class="note"><span class="note-label">Note:</span> To make bopomofo annotations appear before or after the base text, like annotations for most other East Asian writing systems, use the 'before' and 'after' values of ruby-position.</p>
ishida@3034 600 <p>It is not defined how a user-agent should handle ruby text that is not bopomofo when the value of ruby-position is set to 'right'.</p>
fantasai@7165 601 <!-- See Taiwanese requirements doc for EPUB at http://epub-revision.googlecode.com/files/EGLS_TW_eng.ppt -->
ishida@1665 602 </dd>
ishida@3034 603 <dt><strong>inline</strong></dt>
ishida@1665 604 <dd>
ishida@3034 605 <p>Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.</p>
fantasai@8479 606 <p>If the author has used the XHTML <samp>rp</samp> element [[RUBY]] they should set the <samp>display</samp> value for that element to <samp>inline</samp>, so that the ruby text is distinguishable from the base text. If no <samp>rp</samp> element has been used, the author can use the <samp>content</samp> property with the <samp>:before</samp> and <samp>:after</samp> pseudo-elements to set off the ruby text. </p>
ishida@1665 607 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> Here is a <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20inline+value+description+missing&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">request </a>for this section to be added, from the i18n WG..</p>
ishida@1665 608 </dd>
ishida@1665 609 </dl>
ishida@1665 610
ishida@1665 611 <p>If two rtc elements are set with the same ruby-position value, (for example
ishida@1665 612 both &#39;before&#39;), the relative position of the two elements is undefined. This
ishida@1665 613 setting should not be used.</p>
ishida@1665 614
fantasai@8479 615 <h3 id="rubyalign">
fantasai@8479 616 Ruby alignment: the 'ruby-align' property</h3>
ishida@1665 617
fantasai@8479 618 <table class="propdef">
fantasai@8479 619 <tr>
fantasai@8479 620 <th>Name:
fantasai@8479 621 <td><dfn>ruby-align</dfn>
fantasai@8479 622 <tr>
fantasai@8479 623 <th>Value:
fantasai@8479 624 <td>auto | start | left | center | end | right | distribute-letter |
fantasai@8479 625 distribute-space | line-edge
fantasai@8479 626 <tr>
fantasai@8479 627 <th>Initial:
fantasai@8479 628 <td>auto
fantasai@8479 629 <tr>
fantasai@8479 630 <th>Applies to:
fantasai@8479 631 <td>all elements and generated content
fantasai@8479 632 <tr>
fantasai@8479 633 <th>Inherited:
fantasai@8479 634 <td>yes
fantasai@8479 635 <tr>
fantasai@8479 636 <th>Percentages:
fantasai@8479 637 <td>N/A
fantasai@8479 638 <tr>
fantasai@8479 639 <th>Media:
fantasai@8479 640 <td>visual
fantasai@8479 641 <tr>
fantasai@8479 642 <th>Computed value:
fantasai@8479 643 <td>specified value (except for initial and inherit)
fantasai@8479 644 </table>
ishida@1665 645
ishida@1665 646 <p>This property can be used on any element to control the text alignment of
ishida@1665 647 the ruby text and ruby base contents relative to each other. It applies to all
ishida@3034 648 the rubys in the element. For simple ruby, the alignment is applied to the
ishida@1665 649 ruby child element whose content is shorter: either the <a
ishida@1665 650 href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element or the <a
fantasai@8479 651 href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element [[RUBY]].
fantasai@8479 652 For complex ruby, the alignment is also applied to the
ishida@1665 653 ruby child elements whose content is shorter: either the <samp>rb</samp>
ishida@1665 654 element and/or one or two <samp>rt</samp> elements for each related ruby text
ishida@1665 655 and ruby base element within the <samp>rtc</samp> and <samp>rbc</samp>
ishida@1665 656 element.</p>
ishida@1665 657
ishida@1665 658 <p>Possible values:</p>
ishida@1665 659 <p class="issue"><span class="issuehead">Issue:&nbsp;</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>
ishida@1665 660 <dl>
ishida@1665 661 <dt><strong>auto</strong></dt>
ishida@1665 662 <dd>The user agent determines how the ruby contents are aligned. This is
fantasai@8479 663 the initial value. The behavior recommended by [[JLREQ]] is for wide-cell ruby to be aligned in the 'distribute-space' mode:
ishida@1665 664 <div class="figure">
ishida@1665 665 <p><img class="example" width="145" height="91"
ishida@1665 666 alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base"
ishida@1666 667 src="images/ra-ds.gif" /><img class="example" width="145" height="91"
ishida@1665 668 alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base"
ishida@1666 669 src="images/ra-ds-rb.gif" /></p>
ishida@1665 670 <p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is
ishida@1665 671 'distribute-space' justified</p>
ishida@1665 672 </div>
ishida@3034 673 <p>The recommended behavior for narrow-cell glyph ruby is to be
ishida@1665 674 aligned in the 'center' mode.</p>
ishida@1665 675
ishida@1665 676 <div class="figure">
ishida@1665 677 <p><img
ishida@1665 678 alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
ishida@1665 679 class="example" width="145" height="91"
ishida@1666 680 src="images/ra-c-h.gif" /><img
ishida@1665 681 alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
ishida@1665 682 class="example" width="145" height="91"
ishida@1666 683 src="images/ra-c-rb-h.gif" /></p>
ishida@1665 684 <p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment
ishida@1665 685 is centered</p>
ishida@1665 686 </div>
ishida@1665 687 </dd>
ishida@1665 688 <dt><strong>left</strong></dt>
ishida@1665 689 <dd>The ruby text content is aligned with the start edge of the base.
ishida@1665 690
ishida@3034 691 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> The i18n WG feels that start and left should not be synonymous, and proposed to drop left (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
ishida@1665 692
ishida@1665 693 <div class="figure">
ishida@1665 694 <p><img
ishida@1665 695 alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base"
ishida@1666 696 class="example" width="145" height="91" src="images/ra-l.gif" /><img
ishida@1665 697 class="example" width="145" height="91"
ishida@1665 698 alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base"
ishida@1666 699 src="images/ra-l-rb.gif" /></p>
ishida@1665 700 <p><b>Figure 4.2.3</b>: Start ruby alignment</p>
ishida@1665 701 </div>
ishida@1665 702 </dd>
ishida@1665 703 <dt><strong>center</strong></dt>
ishida@1665 704 <dd>The ruby text content is centered within the width of the base. If the
ishida@1665 705 length of the base is smaller than the length of the ruby text, then the
ishida@1665 706 base is centered within the width of the ruby text.
ishida@1665 707
ishida@1665 708 <div class="figure">
ishida@1665 709 <p><img class="example" width="145" height="91"
ishida@1665 710 alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base"
ishida@1666 711 src="images/ra-c.gif" /><img class="example" width="145" height="91"
ishida@1665 712 alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base"
ishida@1666 713 src="images/ra-c-rb.gif" /></p>
ishida@1665 714 <p><b>Figure 4.2.4</b>: Center ruby alignment</p>
ishida@1665 715 </div>
ishida@1665 716 </dd>
ishida@1665 717 <dt><strong>right</strong></dt>
ishida@1665 718 <dd>The ruby text content is aligned with the end edge of the base.
ishida@3034 719 <p class="issue"><span class="issuehead">Issue:&nbsp;</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=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
ishida@1665 720 <div class="figure">
ishida@1665 721 <p><img class="example" width="145" height="91"
ishida@1665 722 alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base"
ishida@1666 723 src="images/ra-r.gif" /><img class="example" width="145" height="91"
ishida@1665 724 alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base"
ishida@1666 725 src="images/ra-r-rb.gif" /></p>
ishida@1665 726 <p><b>Figure 4.2.5</b>: End ruby alignment</p>
ishida@1665 727 </div>
ishida@1665 728 </dd>
ishida@1665 729 <dt><strong>distribute-letter</strong></dt>
ishida@1665 730 <dd>If the width of the ruby text is smaller than that of the base, then
ishida@1665 731 the ruby text contents are evenly distributed across the width of the
ishida@1665 732 base, with the first and last ruby text glyphs lining up with the
ishida@1665 733 corresponding first and last base glyphs. If the width of the ruby text
ishida@1665 734 is at least the width of the base, then the letters of the base are
ishida@1665 735 evenly distributed across the width of the ruby text.
ishida@1665 736
ishida@1665 737 <div class="figure">
ishida@1665 738 <p><img class="example" width="145" height="91"
ishida@1665 739 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base"
ishida@1666 740 src="images/ra-dl.gif" /><img class="example" width="145" height="91"
ishida@1665 741 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base"
ishida@1666 742 src="images/ra-dl-rb.gif" /></p>
ishida@1665 743 <p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p>
ishida@1665 744 </div>
ishida@1665 745 </dd>
ishida@1665 746 <dt><strong>distribute-space</strong></dt>
ishida@1665 747 <dd>If the width of the ruby text is smaller than that of the base, then
ishida@1665 748 the ruby text contents are evenly distributed across the width of the
ishida@1665 749 base, with a certain amount of white space preceding the first and
ishida@1665 750 following the last character in the ruby text. That amount of white
ishida@1665 751 space is normally equal to half the amount of inter-character space of
ishida@1665 752 the ruby text. If the width of the ruby text is at least the width of
ishida@1665 753 the base, then the same type of space distribution applies to the base.
ishida@1665 754 In other words, if the base is shorter than the ruby text, the base is
ishida@3034 755 distribute-space aligned. This type of alignment
fantasai@8479 756 is described by [[JLREQ]].
ishida@1665 757 <div class="figure">
ishida@1665 758 <p><img class="example" width="145" height="91"
ishida@1665 759 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base"
ishida@1666 760 src="images/ra-ds.gif" /><img class="example" width="145" height="91"
ishida@1665 761 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base"
ishida@1666 762 src="images/ra-ds-rb.gif" /></p>
ishida@1665 763 <p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p>
ishida@1665 764 </div>
ishida@1665 765 </dd>
ishida@1665 766 <dt><strong>line-edge</strong></dt>
ishida@1665 767 <dd>If the ruby text is not adjacent to a line edge, it is aligned as in
ishida@1665 768 'auto'. If it is adjacent to a line edge, then it is still aligned as in
ishida@1665 769 auto, but the side of the ruby text that touches the end of the line is
ishida@1665 770 lined up with the corresponding edge of the base. This type of alignment
fantasai@8479 771 is described by [[JLREQ]]. This type of alignment is
ishida@1665 772 relevant only to the scenario where the ruby text is longer than the
ishida@1665 773 ruby base. In the other scenarios, this is just 'auto'.
ishida@1665 774 <div class="figure">
ishida@1665 775 <p><img class="example" width="146" height="109"
ishida@1665 776 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base"
ishida@1666 777 src="images/ra-le-l.gif" /><img class="example" width="146"
ishida@1665 778 height="110"
ishida@1665 779 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base"
ishida@1666 780 src="images/ra-le-r.gif" /></p>
ishida@1665 781 <p><b>Figure 4.2.8</b>: Line edge ruby alignment</p>
ishida@1665 782 </div>
ishida@1665 783 </dd>
ishida@1665 784 </dl>
ishida@1665 785
ishida@1665 786 <p>For a complex ruby with spanning elements, one additional consideration is
ishida@1665 787 required. If the spanning element spans multiple 'rows' (other rbc or rtc
ishida@1665 788 elements), and the ruby alignment requires space distribution among the
ishida@1665 789 'spanned' elements, a ratio must be determined among the 'columns' of spanned
ishida@1665 790 elements. This ratio is computed by taking into consideration the widest
ishida@1665 791 element within each column.</p>
ishida@1665 792
ishida@1665 793 <p>In the context of this property, the 'left' and 'right' values are
ishida@1665 794 synonymous with the 'start' and 'end' values respectively. I.e. their meaning
ishida@1665 795 is relative according to the text layout flow. Most of the other CSS
ishida@1665 796 properties interpret 'left' and 'right' on an 'absolute' term. See Appendix A
ishida@1665 797 of the <a href="#CSS3TEXT">CSS3 Text Module</a> for further details.</p>
ishida@1665 798
fantasai@8479 799 <h3 id="rubyover">
fantasai@8479 800 Ruby overhanging: the 'ruby-overhang' property</h3>
ishida@1665 801
fantasai@8479 802 <table class="propdef">
fantasai@8479 803 <tr>
fantasai@8479 804 <th>Name:
fantasai@8479 805 <td><dfn>ruby-overhang</dfn>
fantasai@8479 806 <tr>
fantasai@8479 807 <th>Value:
fantasai@8479 808 <td>auto | start | end | none
fantasai@8479 809 <tr>
fantasai@8479 810 <th>Initial:
fantasai@8479 811 <td>none
fantasai@8479 812 <tr>
fantasai@8479 813 <th>Applies to:
fantasai@8479 814 <td>the parent of elements with display: ruby-text
fantasai@8479 815 <tr>
fantasai@8479 816 <th>Inherited:
fantasai@8479 817 <td>yes
fantasai@8479 818 <tr>
fantasai@8479 819 <th>Percentages:
fantasai@8479 820 <td>N/A
fantasai@8479 821 <tr>
fantasai@8479 822 <th>Media:
fantasai@8479 823 <td>visual
fantasai@8479 824 <tr>
fantasai@8479 825 <th>Computed value:
fantasai@8479 826 <td>specified value (except for initial and inherit)
fantasai@8479 827 </table>
ishida@1665 828
ishida@1665 829 <p>This property determines whether, and on which side, ruby text is allowed
ishida@1665 830 to partially overhang any adjacent text in addition to its own base, when the
ishida@1665 831 ruby text is wider than the ruby base. Note that ruby text is never allowed to
ishida@1665 832 overhang glyphs belonging to another ruby base. <span class="issue"><span class="issuehead">Issue:&nbsp;</span> This rule must be broken if we are to allow support for jukugo ruby.</span> Also the user agent is free to assume
ishida@1665 833 a maximum amount by which ruby text may overhang adjacent text. The user agent may use
fantasai@8479 834 the [[JIS4051]] recommendation of using one ruby text character
fantasai@8479 835 length as the maximum overhang length. Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [[JLREQ]].</p>
ishida@1665 836
ishida@1665 837 <p>Possible values:</p>
ishida@1665 838 <dl>
ishida@1665 839 <dt><strong>auto</strong></dt>
fantasai@8479 840 <dd>The ruby text can overhang text adjacent to the base on either side. [[JLREQ]] and [[JIS4051]] specify the categories of characters that
ishida@3034 841 ruby text can overhang. The user agent is free to follow those recommendations or specify its own classes of
ishida@1665 842 characters to overhang. This is the initial value.
ishida@1665 843 <div class="figure">
ishida@1665 844 <p><img class="example" width="177" height="91"
ishida@1666 845 alt="Diagram of glyph layout in overhanging ruby" src="images/ro-a.gif" /></p>
ishida@1665 846 <p><b>Figure 4.3.1</b>: Ruby overhanging adjacent text</p>
ishida@1665 847 </div>
ishida@1665 848 </dd>
ishida@1665 849 <dt><strong>start</strong></dt>
ishida@3034 850 <dd>The ruby text can only overhang the text that precedes it. That means, for
ishida@3034 851 example, that ruby cannot overhang text that is to the right of it in
ishida@3034 852 horizontal LTR layout, and it cannot overhang text that is below it in
ishida@1665 853 vertical-ideographic layout.
ishida@1665 854 <div class="figure">
ishida@1665 855 <p><img class="example" width="199" height="91"
ishida@1665 856 alt="Diagram of glyph layout when ruby overhangs the preceding glyphs only"
ishida@1666 857 src="images/ro-s.gif" /></p>
ishida@1665 858 <p><b>Figure 4.3.2</b>: Ruby overhanging preceding text only</p>
ishida@1665 859 </div>
ishida@1665 860 </dd>
ishida@1665 861 <dt><strong>end</strong></dt>
ishida@3034 862 <dd>The ruby text can only overhang the text that follows it. That means, for
ishida@3034 863 example, that ruby cannot overhang text that is to the left of it in
ishida@3034 864 horizontal LTR layout, and it cannot overhang text that is above it in
ishida@1665 865 vertical-ideographic layout.
ishida@1665 866 <div class="figure">
ishida@1665 867 <p><img class="example" width="198" height="91"
ishida@1665 868 alt="Diagram of glyph layout when ruby overhangs the following characters only"
ishida@1666 869 src="images/ro-e.gif" /></p>
ishida@1665 870 <p><b>Figure 4.3.3</b>: Ruby overhanging following text only</p>
ishida@1665 871 </div>
ishida@1665 872 </dd>
ishida@1665 873 <dt><strong>none</strong></dt>
ishida@1665 874 <dd>The ruby text cannot overhang any text adjacent to its base, only its
ishida@1665 875 own base.
ishida@1665 876
ishida@1665 877 <div class="figure">
ishida@1665 878 <p><img class="example" width="220" height="91"
ishida@1665 879 alt="Diagram of glyph layout in non-overhanging ruby"
ishida@1666 880 src="images/ro-n.gif" /></p>
ishida@1665 881 <p><b>Figure 4.3.4</b>: Ruby not allowed to overhang adjacent text</p>
ishida@1665 882 </div>
ishida@1665 883 </dd>
ishida@1665 884 </dl>
ishida@1665 885
fantasai@8479 886 <h3 id="rubyspan">
fantasai@8479 887 Ruby annotation spanning: the 'ruby-span' property</h3>
ishida@1665 888
fantasai@8479 889 <table class="propdef">
fantasai@8479 890 <tr>
fantasai@8479 891 <th>Name:
fantasai@8479 892 <td><dfn>ruby-span</dfn>
fantasai@8479 893 <tr>
fantasai@8479 894 <th>Value:
fantasai@8479 895 <td>attr(x) | none
fantasai@8479 896 <tr>
fantasai@8479 897 <th>Initial:
fantasai@8479 898 <td>none
fantasai@8479 899 <tr>
fantasai@8479 900 <th>Applies to:
fantasai@8479 901 <td>elements with display: ruby-text
fantasai@8479 902 <tr>
fantasai@8479 903 <th>Inherited:
fantasai@8479 904 <td>no
fantasai@8479 905 <tr>
fantasai@8479 906 <th>Percentages:
fantasai@8479 907 <td>N/A
fantasai@8479 908 <tr>
fantasai@8479 909 <th>Media:
fantasai@8479 910 <td>visual
fantasai@8479 911 <tr>
fantasai@8479 912 <th>Computed value:
fantasai@8479 913 <td>&lt;number&gt;
fantasai@8479 914 </table>
ishida@1665 915
ishida@1665 916 <p>This property controls the spanning behavior of annotation elements. </p>
ishida@1665 917
ishida@1665 918 <p class="note"><span class="note-label">Note:</span> A XHTML user agent may also use the <samp>rbspan</samp>
ishida@1665 919 attribute to get the same effect.</p>
ishida@1665 920
ishida@1665 921 <p>Possible values:</p>
ishida@1665 922
ishida@1665 923 <dl>
ishida@1665 924 <dt><strong>attr(x)</strong></dt>
ishida@1665 925 <dd>The value of attribute 'x' as a string value. The string value is
ishida@1665 926 evaluated as a &lt;number&gt; to determine the number of ruby base elements to be
ishida@1665 927 spanned by the annotation element. If the &lt;number&gt; is &#39;0&#39;, it is replaced by
ishida@1665 928 &#39;1&#39;.The &lt;number&gt; is the computed value. </dd>
ishida@1665 929 <dt>none</dt>
ishida@1665 930 <dd>No spanning. The computed value is &#39;1&#39;.</dd>
ishida@1665 931 </dl>
ishida@1665 932
ishida@1665 933 <p>The following example shows an XML example using the 'display' property
ishida@1665 934 values associated with the 'ruby structure and the 'ruby-span' property</p>
ishida@3034 935 <pre class="xml">myruby { display: ruby; }
ishida@1665 936 myrbc { display: ruby-base-container; }
ishida@1665 937 myrb { display: ruby-base; }
ishida@1665 938 myrtc.before { display: ruby-text-container; ruby-position: before}
ishida@1665 939 myrtc.after { display: ruby-text-container; ruby-position: after}
ishida@1665 940 myrt { display: ruby-text; ruby-span: attr(rbspan); }
ishida@1665 941 ...
ishida@1665 942 &lt;myruby&gt;
ishida@1665 943 &lt;myrbc&gt;
ishida@1665 944 &lt;myrb&gt;10&lt;/myrb&gt;
ishida@1665 945 &lt;myrb&gt;31&lt;/myrb&gt;
ishida@1665 946 &lt;myrb&gt;2002&lt;/myrb&gt;
ishida@1665 947 &lt;/myrbc&gt;
ishida@1665 948 &lt;myrtc class=&quot;before&quot;&gt;
ishida@1665 949 &lt;myrt&gt;Month&lt;/myrt&gt;
ishida@1665 950 &lt;myrt&gt;Day&lt;/myrt&gt;
ishida@1665 951 &lt;myrt&gt;Year&lt;/myrt&gt;
ishida@1665 952 &lt;/myrtc&gt;
ishida@1665 953 &lt;myrtc class=&quot;after&quot;&gt;
ishida@1665 954 &lt;myrt rbspan=&quot;3&quot;&gt;Expiration Date&lt;/myrt&gt;
ishida@1665 955 &lt;/myrtc&gt;
ishida@1665 956 &lt;/myruby&gt;</pre>
ishida@1665 957
fantasai@8479 958 <p class="issue"><span class="issuehead">Issue:&nbsp;</span> The i18n WG has requested the addition of a sample user agent default style sheet, as promised by Ruby Annotation section 3.4. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20Default+stylesheet&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
ishida@1665 959
fantasai@8479 960 <h2 id="profiles">
fantasai@8479 961 Profiles</h2>
ishida@1665 962
ishida@3034 963 <p>There are two modules defined by this module:</p>
ishida@1665 964
ishida@1665 965 <p>CSS3 Simple Ruby model</p>
ishida@1665 966
ishida@1665 967 <p>CSS3 Complex Ruby model.</p>
ishida@1665 968
ishida@1665 969 <p>They both contain all the properties specified by this CSS chapter, i.e. <a
ishida@1665 970 href="#rubyalign">'ruby-align'</a>, <a href="#rubyover">'ruby-overhang'</a>, <a href="#rubypos">'ruby-position'</a>
ishida@1665 971 and <a href="#rubyspan">'ruby-span'</a>. They differ by the required
ishida@1665 972 'display' property values. The Simple Ruby model requires the values: 'ruby',
ishida@1665 973 'ruby-base' and 'ruby-text'. The Complex Ruby model requires in addition the
ishida@1665 974 values: 'ruby-base-container' and 'ruby-text-container'.</p>
ishida@1665 975
fantasai@8479 976 <h2 id="glossary">
fantasai@8479 977 Glossary</h2>
ishida@1665 978 <dl>
ishida@1665 979 <dt><a id="g-bopomofo"><strong><span
ishida@1665 980 lang="zh">Bopomofo</span></strong></a></dt>
ishida@1665 981 <dd>37 characters and 4 tone markings used as phonetics in Chinese,
ishida@1665 982 especially standard Mandarin.</dd>
ishida@1665 983 <dt><a id="g-hanja"><strong><span
ishida@1665 984 lang="ko">Hanja</span></strong></a></dt>
ishida@1665 985 <dd>Subset of the Korean writing system that utilizes ideographic
ishida@1665 986 characters borrowed or adapted from the Chinese writing system. Also see
ishida@1665 987 <a href="#g-kanji"><span lang="ja">Kanji</span></a>.</dd>
ishida@1665 988 <dt><a id="g-hiragana"><strong><span
ishida@1665 989 lang="ja">Hiragana</span></strong></a></dt>
ishida@1665 990 <dd>Japanese syllabic script, or character of that script. Rounded and
ishida@1665 991 cursive in appearance. Subset of the Japanese writing system, used together
ishida@1665 992 with kanji and katakana. In recent times, mostly used to write Japanese
ishida@1665 993 words when kanji are not available or appropriate, and word endings and
ishida@1665 994 particles. Also see <a
ishida@1665 995 href="#g-katakana"><span lang="ja">Katakana</span></a>.</dd>
ishida@1665 996 <dt><a id="g-ideogram"><strong>Ideograph</strong></a></dt>
ishida@1665 997 <dd>A character that is used to represent an idea, word, or word component,
ishida@1665 998 in contrast to a character from an alphabetic or syllabic script. The most
ishida@1665 999 well-known ideographic script is used (with some variation) in East Asia
ishida@1665 1000 (China, Japan, Korea,...).</dd>
ishida@1665 1001 <dt><a id="g-kana"><strong><span lang="ja">Kana</span></strong></a></dt>
ishida@1665 1002 <dd>Collective term for hiragana and katakana.</dd>
ishida@1665 1003 <dt><a id="g-kanji"><strong>Kanji</strong></a></dt>
ishida@1665 1004 <dd>Japanese term for ideographs; ideographs used in Japanese. Subset of the
ishida@1665 1005 Japanese writing system, used together with hiragana and katakana. Also see <a
ishida@1665 1006 href="#g-hanja"><span lang="ko">Hanja</span></a>.</dd>
ishida@1665 1007 <dt><a id="g-katakana"><strong><span
ishida@1665 1008 lang="ja">Katakana</span></strong></a></dt>
ishida@1665 1009 <dd>Japanese syllabic script, or character of that script. Angular in
ishida@1665 1010 appearance. Subset of the Japanese writing system,&nbsp; used together with
ishida@1665 1011 kanji and hiragana. In recent times, mainly used to write foreign words. Also see <a
ishida@1665 1012 href="#g-hiragana"><span lang="ja">Hiragana</span></a>.</dd>
ishida@1665 1013 <dt><a id="g-monoruby" name="g-monoruby"><strong>Mono-ruby</strong></a></dt>
ishida@1665 1014 <dd>In Japanese typography: Ruby associated with a single character of
ishida@1665 1015 the base text.</dd>
ishida@1665 1016 <dt><a id="g-ruby"><strong>Ruby</strong></a></dt>
ishida@1665 1017 <dd>A run of text that appears in the vicinity of another run of text and
ishida@1665 1018 serves as an annotation or a pronunciation guide for that text.</dd>
ishida@1665 1019 </dl>
ishida@1665 1020
fantasai@8479 1021 <h2 id="conformance">
fantasai@8479 1022 Conformance</h2>
fantasai@8479 1023
fantasai@8479 1024 <h3 id="conventions">
fantasai@8479 1025 Document conventions</h3>
fantasai@8479 1026
fantasai@8479 1027 <p>Conformance requirements are expressed with a combination of
fantasai@8479 1028 descriptive assertions and RFC 2119 terminology. The key words “MUST”,
fantasai@8479 1029 “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
fantasai@8479 1030 “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
fantasai@8479 1031 document are to be interpreted as described in RFC 2119.
fantasai@8479 1032 However, for readability, these words do not appear in all uppercase
fantasai@8479 1033 letters in this specification.
fantasai@8479 1034
fantasai@8479 1035 <p>All of the text of this specification is normative except sections
fantasai@8479 1036 explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p>
fantasai@8479 1037
fantasai@8479 1038 <p>Examples in this specification are introduced with the words “for example”
fantasai@8479 1039 or are set apart from the normative text with <code>class="example"</code>,
fantasai@8479 1040 like this:
fantasai@8479 1041
fantasai@8479 1042 <div class="example">
fantasai@8479 1043 <p>This is an example of an informative example.</p>
fantasai@8479 1044 </div>
fantasai@8479 1045
fantasai@8479 1046 <p>Informative notes begin with the word “Note” and are set apart from the
fantasai@8479 1047 normative text with <code>class="note"</code>, like this:
fantasai@8479 1048
fantasai@8479 1049 <p class="note">Note, this is an informative note.</p>
fantasai@8479 1050
fantasai@8479 1051 <h3 id="conformance-classes">
fantasai@8479 1052 Conformance classes</h3>
fantasai@8479 1053
fantasai@8479 1054 <p>Conformance to CSS Ruby Module
fantasai@8479 1055 is defined for three conformance classes:
fantasai@8479 1056 <dl>
fantasai@8479 1057 <dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
fantasai@8479 1058 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
fantasai@8479 1059 style sheet</a>.
fantasai@8479 1060 <dt><dfn>renderer</dfn></dt>
fantasai@8479 1061 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
fantasai@8479 1062 that interprets the semantics of a style sheet and renders
fantasai@8479 1063 documents that use them.
fantasai@8479 1064 <dt><dfn id="authoring-tool">authoring tool</dfn></dt>
fantasai@8479 1065 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
fantasai@8479 1066 that writes a style sheet.
fantasai@8479 1067 </dl>
fantasai@8479 1068
fantasai@8479 1069 <p>A style sheet is conformant to CSS Ruby Module
fantasai@8479 1070 if all of its statements that use syntax defined in this module are valid
fantasai@8479 1071 according to the generic CSS grammar and the individual grammars of each
fantasai@8479 1072 feature defined in this module.
fantasai@8479 1073
fantasai@8479 1074 <p>A renderer is conformant to CSS Ruby Module
fantasai@8479 1075 if, in addition to interpreting the style sheet as defined by the
fantasai@8479 1076 appropriate specifications, it supports all the features defined
fantasai@8479 1077 by CSS Ruby Module by parsing them correctly
fantasai@8479 1078 and rendering the document accordingly. However, the inability of a
fantasai@8479 1079 UA to correctly render a document due to limitations of the device
fantasai@8479 1080 does not make the UA non-conformant. (For example, a UA is not
fantasai@8479 1081 required to render color on a monochrome monitor.)
fantasai@8479 1082
fantasai@8479 1083 <p>An authoring tool is conformant to CSS Ruby Module
fantasai@8479 1084 if it writes style sheets that are syntactically correct according to the
fantasai@8479 1085 generic CSS grammar and the individual grammars of each feature in
fantasai@8479 1086 this module, and meet all other conformance requirements of style sheets
fantasai@8479 1087 as described in this module.
fantasai@8479 1088
fantasai@8479 1089 <h3 id="partial">
fantasai@8479 1090 Partial implementations</h3>
fantasai@8479 1091
fantasai@8479 1092 <p>So that authors can exploit the forward-compatible parsing rules to
fantasai@8479 1093 assign fallback values, CSS renderers <strong>must</strong>
fantasai@8479 1094 treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
fantasai@8479 1095 as appropriate</a>) any at-rules, properties, property values, keywords,
fantasai@8479 1096 and other syntactic constructs for which they have no usable level of
fantasai@8479 1097 support. In particular, user agents <strong>must not</strong> selectively
fantasai@8479 1098 ignore unsupported component values and honor supported values in a single
fantasai@8479 1099 multi-value property declaration: if any value is considered invalid
fantasai@8479 1100 (as unsupported values must be), CSS requires that the entire declaration
fantasai@8479 1101 be ignored.</p>
fantasai@8479 1102
fantasai@8479 1103 <h3 id="experimental">
fantasai@8479 1104 Experimental implementations</h3>
fantasai@8479 1105
fantasai@8479 1106 <p>To avoid clashes with future CSS features, the CSS2.1 specification
fantasai@8479 1107 reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
fantasai@8479 1108 syntax</a> for proprietary and experimental extensions to CSS.
fantasai@8479 1109
fantasai@8479 1110 <p>Prior to a specification reaching the Candidate Recommendation stage
fantasai@8479 1111 in the W3C process, all implementations of a CSS feature are considered
fantasai@8479 1112 experimental. The CSS Working Group recommends that implementations
fantasai@8479 1113 use a vendor-prefixed syntax for such features, including those in
fantasai@8479 1114 W3C Working Drafts. This avoids incompatibilities with future changes
fantasai@8479 1115 in the draft.
fantasai@8479 1116 </p>
fantasai@8479 1117
fantasai@8479 1118 <h3 id="testing">
fantasai@8479 1119 Non-experimental implementations</h3>
fantasai@8479 1120
fantasai@8479 1121 <p>Once a specification reaches the Candidate Recommendation stage,
fantasai@8479 1122 non-experimental implementations are possible, and implementors should
fantasai@8479 1123 release an unprefixed implementation of any CR-level feature they
fantasai@8479 1124 can demonstrate to be correctly implemented according to spec.
fantasai@8479 1125
fantasai@8479 1126 <p>To establish and maintain the interoperability of CSS across
fantasai@8479 1127 implementations, the CSS Working Group requests that non-experimental
fantasai@8479 1128 CSS renderers submit an implementation report (and, if necessary, the
fantasai@8479 1129 testcases used for that implementation report) to the W3C before
fantasai@8479 1130 releasing an unprefixed implementation of any CSS features. Testcases
fantasai@8479 1131 submitted to W3C are subject to review and correction by the CSS
fantasai@8479 1132 Working Group.
fantasai@8479 1133
fantasai@8479 1134 <p>Further information on submitting testcases and implementation reports
fantasai@8479 1135 can be found from on the CSS Working Group's website at
fantasai@8479 1136 <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
fantasai@8479 1137 Questions should be directed to the
fantasai@8479 1138 <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
fantasai@8479 1139 mailing list.
fantasai@8479 1140
fantasai@8479 1141 <h2 class=no-num id="acknowledgments">
fantasai@8479 1142 Acknowledgments</h2>
ishida@1665 1143
ishida@1665 1144 <p>This specification would not have been possible without the help from:</p>
ishida@1665 1145
fantasai@8479 1146 <p>Stephen Deach, Martin Dürst,  Hideki Hiura(<span lang="ja">樋浦 秀樹</span>), Masayasu Ishikawa(<span lang="ja">石川
ishida@1665 1147 雅康</span>), Chris
fantasai@8479 1148 Pratley, Takao Suzuki(<span lang="ja">鈴木 孝雄</span>), Frank Yung-Fong Tang, Chris Thrasher, Masafumi Yabe<span lang="ja">家辺
ishida@1665 1149 勝文</span>), Steve Zilles.</p>
ishida@1665 1150
fantasai@8479 1151 <h2 class=no-num id="references">
fantasai@8479 1152 References</h2>
ishida@1665 1153
fantasai@8479 1154 <h3 class="no-num" id="normative-references">
fantasai@8479 1155 Normative references</h3>
fantasai@8479 1156 <!--normative-->
ishida@1665 1157
fantasai@8479 1158 <h3 class="no-num" id="other-references">
fantasai@8479 1159 Other references</h3>
fantasai@8479 1160 <!--informative-->
ishida@1665 1161
fantasai@8479 1162 <h2 class="no-num" id="index">
fantasai@8479 1163 Index</h2>
fantasai@8479 1164 <!--index-->
ishida@1665 1165
fantasai@8479 1166 <h2 class="no-num" id="property-index">
fantasai@8479 1167 Property index</h2>
fantasai@8479 1168 <!-- properties -->
ishida@1665 1169
ishida@1665 1170 </body>
ishida@1665 1171 </html>
ishida@1665 1172 <!-- Keep this comment at the end of the file
ishida@1665 1173 Local variables:
ishida@1665 1174 mode: sgml
fantasai@8479 1175 sgml-declaration:"~/SGML/HTML4.decl"
ishida@1665 1176 sgml-default-doctype-name:"html"
ishida@1665 1177 sgml-minimize-attributes:t
ishida@1665 1178 sgml-nofill-elements:("pre" "style" "br")
fantasai@8479 1179 sgml-live-element-indicator:t
fantasai@8479 1180 sgml-omittag:nil
fantasai@8479 1181 sgml-shorttag:nil
fantasai@8479 1182 sgml-namecase-general:t
fantasai@8479 1183 sgml-general-insert-case:lower
fantasai@8479 1184 sgml-always-quote-attributes:t
fantasai@8479 1185 sgml-indent-step:nil
fantasai@8479 1186 sgml-indent-data:t
fantasai@8479 1187 sgml-parent-document:nil
fantasai@8479 1188 sgml-exposed-tags:nil
fantasai@8479 1189 sgml-local-catalogs:nil
fantasai@8479 1190 sgml-local-ecat-files:nil
ishida@1665 1191 End:
ishida@1665 1192 -->
fantasai@8479 1193

mercurial