css-ruby/Overview.src.html

Tue, 18 Jun 2013 22:59:49 +0900

author
fantasai <fantasai.cvs@inkedblade.net>
date
Tue, 18 Jun 2013 22:59:49 +0900
changeset 8497
0a74bdd0d743
parent 8496
bce44a2a6438
child 8498
cc638536b160
permissions
-rw-r--r--

[css-ruby] Add default UA style sheet and other useful style sheets.

fantasai@8479 1 <!DOCTYPE html>
fantasai@8479 2 <html lang="en">
ishida@1665 3 <head>
fantasai@8493 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
fantasai@8493 5 <title>CSS Ruby Module Level 1</title>
fantasai@8493 6 <link rel=contents href="#contents">
fantasai@8493 7 <link rel=index href="#index">
fantasai@8493 8 <link rel="stylesheet" type="text/css" href="../default.css">
fantasai@8493 9 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
fantasai@8493 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@8493 22 <dt>This version:
fantasai@8493 23 <dd><a class="u-url" href="[VERSION]">[VERSION]</a>
fantasai@7857 24
fantasai@8493 25 <dt>Latest version:
fantasai@8493 26 <dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/css3-ruby/</a>
fantasai@8479 27
fantasai@8493 28 <dt>Editor's draft:
fantasai@8493 29 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
fantasai@8493 30 (<a href="https://dvcs.w3.org/hg/csswg/log/tip/[SHORTNAME]/Overview.src.html">change log</a>)
fantasai@8479 31
fantasai@8493 32 <dt>Previous version:
fantasai@8493 33 <dd><a href="http://www.w3.org/TR/2011/WD-css3-ruby-20110630/">
fantasai@8493 34 http://www.w3.org/TR/2011/WD-css3-ruby-20110630/</a>
fantasai@8479 35
fantasai@8493 36 <dt>Issue Tracking:</dt>
fantasai@8493 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@8493 39 <dt>Feedback:</dt>
fantasai@8493 40 <dd><a href="mailto:www-style@w3.org?subject=%5BSHORTNAME%5D%20feedback"
fantasai@8493 41 >www-style@w3.org</a>
fantasai@8493 42 with subject line &ldquo;<kbd>[[SHORTNAME]]
fantasai@8493 43 <var>&hellip; message topic &hellip;</var></kbd>&rdquo;
fantasai@8493 44 (<a rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/"
fantasai@8493 45 >archives</a>)
fantasai@8479 46
fantasai@8493 47 <dt>Editors:
fantasai@8493 48 <dd class="p-author h-card vcard">
fantasai@8493 49 <a class="p-name fn u-url url" rel="author"
fantasai@8493 50 href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>,
fantasai@8493 51 <a class="p-org org h-org" href="http://www.mozilla.org/">Mozilla</a>
fantasai@8493 52 <dd class="p-author h-card vcard">
fantasai@8493 53 <a class="p-name fn u-url url" rel="author"
fantasai@8493 54 href="mailto:koji.a.ishii@mail.rakuten.com">Koji Ishii</a>,
fantasai@8493 55 <span class="p-org org">Rakuten, Inc.</span>
fantasai@8493 56 <dd class="p-author h-card vcard">
fantasai@8493 57 <a class="p-name fn u-url url" rel="author"
fantasai@8493 58 href="mailto:ishida@w3.org">Richard Ishida</a>,
fantasai@8493 59 <span class="p-org org">W3C</span>
fantasai@8479 60
fantasai@8493 61 <dt>Former editors:
fantasai@8493 62 <dd>Michel Suignard, Microsoft
fantasai@8493 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@8493 73 <p>
fantasai@8493 74 <span class="p-summary">
fantasai@8493 75 “Ruby” are short runs of text alongside the base text,
fantasai@8493 76 typically used in East Asian documents to indicate pronunciation
fantasai@8493 77 or to provide a short annotation.
fantasai@8493 78 This module describes the rendering model and formatting controls
fantasai@8493 79 related to displaying ruby annotations in CSS.
fantasai@8493 80 </span>
fantasai@8493 81
fantasai@8493 82 <a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing
fantasai@8493 83 the rendering of structured documents (such as HTML and XML) on screen, on
fantasai@8493 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@8493 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@8493 105 <p>This module extends the inline box model of CSS Level 2 [[!CSS21]]
fantasai@8493 106 to support ruby.
fantasai@8479 107
fantasai@8493 108 <p>None of the properties in this module apply to the <code>::first-line</code> or
fantasai@8493 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@8493 114 <p>This specification follows the
fantasai@8493 115 <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
fantasai@8493 116 definition conventions</a> from [[!CSS21]]. Value types not defined in
fantasai@8493 117 this specification are defined in CSS Level 2 Revision 1 [[!CSS21]].
fantasai@8493 118 Other CSS modules may expand the definitions of these value types: for
fantasai@8493 119 example [[CSS3VAL]], when combined with this module, expands the
fantasai@8493 120 definition of the <var>&lt;length&gt;</var> value type as used in this specification.</p>
fantasai@8493 121
fantasai@8493 122 <p>In addition to the property-specific values listed in their definitions,
fantasai@8493 123 all properties defined in this specification also accept the
fantasai@8493 124 <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
fantasai@8493 125 keyword as their property value. For readability it has not been repeated
fantasai@8493 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
kojiishi@8496 484 <table class="propdef">
kojiishi@8496 485 <tr>
kojiishi@8496 486 <th>Name:
kojiishi@8496 487 <td><dfn>ruby-position</dfn>
kojiishi@8496 488 <tr>
kojiishi@8496 489 <th><a href="#values">Value</a>:
kojiishi@8496 490 <td>[ over | under | inter-character ] && [ right | left ]
kojiishi@8496 491 <tr>
kojiishi@8496 492 <th>Initial:
kojiishi@8496 493 <td>over right
kojiishi@8496 494 <tr>
kojiishi@8496 495 <th>Applies to:
kojiishi@8496 496 <td>the parent of elements with display: ruby-text.
kojiishi@8496 497 <tr>
kojiishi@8496 498 <th>Inherited:
kojiishi@8496 499 <td>yes
kojiishi@8496 500 <tr>
kojiishi@8496 501 <th>Percentages:
kojiishi@8496 502 <td>N/A
kojiishi@8496 503 <tr>
kojiishi@8496 504 <th>Media:
kojiishi@8496 505 <td>visual
kojiishi@8496 506 <tr>
kojiishi@8496 507 <th>Computed value:
kojiishi@8496 508 <td>specified value (except for initial and inherit)
kojiishi@8496 509 <tr>
kojiishi@8496 510 <th>Animatable:
kojiishi@8496 511 <td>no
kojiishi@8496 512 <tr>
kojiishi@8496 513 <th>Canonical order:
kojiishi@8496 514 <td><abbr title="follows order of property value definition">per grammar</abbr>
kojiishi@8496 515 </table>
kojiishi@8496 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>
kojiishi@8496 517 <p>This property is used by the parent of elements with display: ruby-text to
kojiishi@8496 518 control the position of the ruby text with respect to its base. Such parents
kojiishi@8496 519 are typically either the <samp>ruby</samp> element itself (simple ruby) or the
kojiishi@8496 520 <samp>rtc</samp> element (complex ruby). This assures that all parts of a <samp>rtc</samp>
kojiishi@8496 521 element will be displayed in the same position. Possible values:</p>
kojiishi@8496 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>
kojiishi@8496 523 <dl>
kojiishi@8496 524 <dt><dfn title="ruby-position:over">''over''</dfn></dt>
kojiishi@8496 525 <dd>The ruby text appears over the base in horizontal text.
kojiishi@8496 526 This is the most common setting used in ideographic East Asian writing systems.
kojiishi@8496 527 This is the initial value.
ishida@1665 528
kojiishi@8496 529 <div class="figure">
kojiishi@8496 530 <p>
kojiishi@8496 531 <img
kojiishi@8496 532 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base"
kojiishi@8496 533 src="images/shinkansen-top.gif" width="140" height="33" /></p>
kojiishi@8496 534 <p><b>Figure 4.1.1</b>: Top ruby in horizontal layout applied to
kojiishi@8496 535 Japanese text</p>
kojiishi@8496 536 </div>
kojiishi@8496 537 </dd>
ishida@1665 538
kojiishi@8496 539 <dt><dfn title="ruby-position:right">''right''</dfn></dt>
kojiishi@8496 540 <dd>The ruby text appears on the right side of the base in vertical text.
ishida@1665 541
kojiishi@8496 542 <div class="figure">
kojiishi@8496 543 <p>
kojiishi@8496 544 <img
kojiishi@8496 545 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base"
kojiishi@8496 546 src="images/shinkansen-right.gif" width="33" height="141" /></p>
kojiishi@8496 547 <p><b>Figure 4.1.2</b>: Top ruby in vertical ideographic layout applied
kojiishi@8496 548 to Japanese text</p>
kojiishi@8496 549 </div>
kojiishi@8496 550 </dd>
ishida@1665 551
kojiishi@8496 552 <dt><dfn title="ruby-position:under">''under''</dfn></dt>
kojiishi@8496 553 <dd>The ruby text appears under the base in horizontal text.
kojiishi@8496 554 This is a relatively rare setting used in ideographic East Asian writing systems,
kojiishi@8496 555 most easily found in educational text.
ishida@1665 556
kojiishi@8496 557 <div class="figure">
kojiishi@8496 558 <p>
kojiishi@8496 559 <img
kojiishi@8496 560 alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base"
kojiishi@8496 561 src="images/shinkansen-bottom.gif" width="142" height="36" /></p>
kojiishi@8496 562 <p><b>Figure 4.1.3</b>: Bottom ruby in horizontal layout applied to Japanese text</p>
kojiishi@8496 563 </div>
kojiishi@8496 564 </dd>
ishida@1665 565
kojiishi@8496 566 <dt><dfn title="ruby-position:left">''left''</dfn></dt>
kojiishi@8496 567 <dd>The ruby text appears on the left side of the base in vertical text.
kojiishi@8496 568
kojiishi@8496 569 <div class="figure">
kojiishi@8496 570 <p>
kojiishi@8496 571 <img
kojiishi@8496 572 alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base"
kojiishi@8496 573 src="images/shinkansen-left.gif" width="37" height="141" /></p>
kojiishi@8496 574 <p><b>Figure 4.1.4</b>: Bottom ruby in vertical ideographic layout applied to Japanese text</p>
kojiishi@8496 575 </div>
kojiishi@8496 576 </dd>
kojiishi@8496 577
kojiishi@8496 578 <dt><dfn title="ruby-position:inter-character">''inter-character''</dfn></dt>
kojiishi@8496 579 <dd>
kojiishi@8496 580 <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>
kojiishi@8496 581 <p>The ruby text appears on the right of the base in horizontal text.
kojiishi@8496 582
kojiishi@8496 583 <p>This value is provided for the special case of traditional Chinese as used especially in
kojiishi@8496 584 Taiwan: ruby (made of <a href="#g-bopomofo"><span
kojiishi@8496 585 lang="zh">bopomofo</span></a> glyphs) in that context appears vertically along
kojiishi@8496 586 the right side of the base glyph,
kojiishi@8496 587 even when the layout of the base characters is horizontal:</p>
kojiishi@8496 588
kojiishi@8496 589 <div class="figure">
kojiishi@8496 590 <p><img alt="Example of Taiwanese-style ruby"
kojiishi@8496 591 width="138" height="42" src="images/bopomofo.gif" /></p>
kojiishi@8496 592 <p><b>Figure 4.1.5</b>: "<span lang="zh">Bopomofo</span>" ruby in
kojiishi@8496 593 traditional Chinese (ruby text shown in blue for clarity) in horizontal
kojiishi@8496 594 layout</p>
kojiishi@8496 595 </div>
kojiishi@8496 596 <p class="note"><span class="note-label">Note:</span> The bopomofo
kojiishi@8496 597 transcription is written in the normal way as part of the ruby text.
kojiishi@8496 598 The user agent is responsible for ensuring the correct relative alignment
kojiishi@8496 599 and positioning of the glyphs, including those corresponding to the
kojiishi@8496 600 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>
kojiishi@8496 601 <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>
kojiishi@8496 602 <p>It is not defined how a user-agent should handle ruby text that is not bopomofo
kojiishi@8496 603 when the value of ruby-position is set to 'inter-character'.</p>
kojiishi@8496 604 <!-- See Taiwanese requirements doc for EPUB at http://epub-revision.googlecode.com/files/EGLS_TW_eng.ppt -->
kojiishi@8496 605 </dd>
kojiishi@8496 606
kojiishi@8496 607 <!--
ishida@3034 608 <dt><strong>inline</strong></dt>
ishida@1665 609 <dd>
ishida@3034 610 <p>Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.</p>
fantasai@8479 611 <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 612 <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 613 </dd>
kojiishi@8496 614 -->
kojiishi@8496 615 </dl>
ishida@1665 616
ishida@1665 617 <p>If two rtc elements are set with the same ruby-position value, (for example
ishida@1665 618 both &#39;before&#39;), the relative position of the two elements is undefined. This
ishida@1665 619 setting should not be used.</p>
ishida@1665 620
fantasai@8479 621 <h3 id="rubyalign">
fantasai@8479 622 Ruby alignment: the 'ruby-align' property</h3>
ishida@1665 623
kojiishi@8496 624 <table class="propdef">
kojiishi@8496 625 <tr>
kojiishi@8496 626 <th>Name:
kojiishi@8496 627 <td><dfn>ruby-align</dfn>
kojiishi@8496 628 <tr>
kojiishi@8496 629 <th><a href="#values">Value</a>:
kojiishi@8496 630 <td>auto | start | center |
kojiishi@8496 631 distribute-letter | distribute-space
kojiishi@8496 632 <tr>
kojiishi@8496 633 <th>Initial:
kojiishi@8496 634 <td>auto
kojiishi@8496 635 <tr>
kojiishi@8496 636 <th>Applies to:
kojiishi@8496 637 <td>all elements and generated content
kojiishi@8496 638 <tr>
kojiishi@8496 639 <th>Inherited:
kojiishi@8496 640 <td>yes
kojiishi@8496 641 <tr>
kojiishi@8496 642 <th>Percentages:
kojiishi@8496 643 <td>N/A
kojiishi@8496 644 <tr>
kojiishi@8496 645 <th>Media:
kojiishi@8496 646 <td>visual
kojiishi@8496 647 <tr>
kojiishi@8496 648 <th>Computed value:
kojiishi@8496 649 <td>specified value (except for initial and inherit)
kojiishi@8496 650 </table>
ishida@1665 651
kojiishi@8496 652 <p>This property can be used on any element to control the text alignment of
kojiishi@8496 653 the ruby text and ruby base contents relative to each other. It applies to all
kojiishi@8496 654 the rubys in the element. For simple ruby, the alignment is applied to the
kojiishi@8496 655 ruby child element whose content is shorter: either the <a
kojiishi@8496 656 href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element or the <a
kojiishi@8496 657 href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element [[RUBY]].
kojiishi@8496 658 For complex ruby, the alignment is also applied to the
kojiishi@8496 659 ruby child elements whose content is shorter: either the <samp>rb</samp>
kojiishi@8496 660 element and/or one or two <samp>rt</samp> elements for each related ruby text
kojiishi@8496 661 and ruby base element within the <samp>rtc</samp> and <samp>rbc</samp>
kojiishi@8496 662 element.</p>
ishida@1665 663
kojiishi@8496 664 <p>Possible values:</p>
kojiishi@8496 665 <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>
kojiishi@8496 666 <dl>
kojiishi@8496 667 <dt><dfn title="ruby-align:auto">''auto''</dfn></dt>
kojiishi@8496 668 <dd>
kojiishi@8496 669 <p>The user agent determines how the ruby contents are aligned.
kojiishi@8496 670 This is the initial value.
kojiishi@8496 671 The behavior recommended by [[JLREQ]] is for wide-cell ruby to be aligned in the 'distribute-space' mode:
kojiishi@8496 672 <div class="figure">
kojiishi@8496 673 <p><img width="145" height="91"
kojiishi@8496 674 alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base"
kojiishi@8496 675 src="images/ra-ds.gif" /><img width="145" height="91"
kojiishi@8496 676 alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base"
kojiishi@8496 677 src="images/ra-ds-rb.gif" /></p>
kojiishi@8496 678 <p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is
kojiishi@8496 679 'distribute-space' justified</p>
kojiishi@8496 680 </div>
ishida@1665 681
kojiishi@8496 682 <p>The recommended behavior for narrow-cell glyph ruby is to be
kojiishi@8496 683 aligned in the 'center' mode.</p>
kojiishi@8496 684 <div class="figure">
kojiishi@8496 685 <p><img
kojiishi@8496 686 alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
kojiishi@8496 687 width="145" height="91"
kojiishi@8496 688 src="images/ra-c-h.gif" /><img
kojiishi@8496 689 alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
kojiishi@8496 690 width="145" height="91"
kojiishi@8496 691 src="images/ra-c-rb-h.gif" /></p>
kojiishi@8496 692 <p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment
kojiishi@8496 693 is centered</p>
kojiishi@8496 694 </div>
kojiishi@8496 695 </dd>
ishida@1665 696
kojiishi@8496 697 <dt><dfn title="ruby-align:start">''start''</dfn></dt>
kojiishi@8496 698 <dd>The ruby text content is aligned with the start edge of the base.
kojiishi@8496 699 <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 700
kojiishi@8496 701 <div class="figure">
kojiishi@8496 702 <p><img
kojiishi@8496 703 alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base"
kojiishi@8496 704 width="145" height="91" src="images/ra-l.gif" /><img
kojiishi@8496 705 width="145" height="91"
kojiishi@8496 706 alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base"
kojiishi@8496 707 src="images/ra-l-rb.gif" /></p>
kojiishi@8496 708 <p><b>Figure 4.2.3</b>: Start ruby alignment</p>
kojiishi@8496 709 </div>
kojiishi@8496 710 </dd>
kojiishi@8496 711
kojiishi@8496 712 <dt><dfn title="ruby-align:center">''center''</dfn></dt>
kojiishi@8496 713 <dd>The ruby text content is centered within the width of the base. If the
kojiishi@8496 714 length of the base is smaller than the length of the ruby text, then the
kojiishi@8496 715 base is centered within the width of the ruby text.
kojiishi@8496 716
kojiishi@8496 717 <div class="figure">
kojiishi@8496 718 <p><img width="145" height="91"
kojiishi@8496 719 alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base"
kojiishi@8496 720 src="images/ra-c.gif" /><img width="145" height="91"
kojiishi@8496 721 alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base"
kojiishi@8496 722 src="images/ra-c-rb.gif" /></p>
kojiishi@8496 723 <p><b>Figure 4.2.4</b>: Center ruby alignment</p>
kojiishi@8496 724 </div>
kojiishi@8496 725 </dd>
kojiishi@8496 726
kojiishi@8496 727 <!--
ishida@1665 728 <dt><strong>right</strong></dt>
ishida@1665 729 <dd>The ruby text content is aligned with the end edge of the base.
ishida@3034 730 <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 731 <div class="figure">
ishida@1665 732 <p><img class="example" width="145" height="91"
ishida@1665 733 alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base"
ishida@1666 734 src="images/ra-r.gif" /><img class="example" width="145" height="91"
ishida@1665 735 alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base"
ishida@1666 736 src="images/ra-r-rb.gif" /></p>
ishida@1665 737 <p><b>Figure 4.2.5</b>: End ruby alignment</p>
ishida@1665 738 </div>
ishida@1665 739 </dd>
kojiishi@8496 740 -->
ishida@1665 741
kojiishi@8496 742 <dt><dfn title="ruby-align:distribute-letter">''distribute-letter''</dfn></dt>
kojiishi@8496 743 <dd>If the width of the ruby text is smaller than that of the base, then
kojiishi@8496 744 the ruby text contents are evenly distributed across the width of the
kojiishi@8496 745 base, with the first and last ruby text glyphs lining up with the
kojiishi@8496 746 corresponding first and last base glyphs. If the width of the ruby text
kojiishi@8496 747 is at least the width of the base, then the letters of the base are
kojiishi@8496 748 evenly distributed across the width of the ruby text.
kojiishi@8496 749
kojiishi@8496 750 <div class="figure">
kojiishi@8496 751 <p><img width="145" height="91"
kojiishi@8496 752 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base"
kojiishi@8496 753 src="images/ra-dl.gif" /><img width="145" height="91"
kojiishi@8496 754 alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base"
kojiishi@8496 755 src="images/ra-dl-rb.gif" /></p>
kojiishi@8496 756 <p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p>
kojiishi@8496 757 </div>
kojiishi@8496 758 </dd>
kojiishi@8496 759
kojiishi@8496 760 <dt><dfn title="ruby-align:distribute-space">''distribute-space''</dfn></dt>
kojiishi@8496 761 <dd>If the width of the ruby text is smaller than that of the base, then
kojiishi@8496 762 the ruby text contents are evenly distributed across the width of the
kojiishi@8496 763 base, with a certain amount of white space preceding the first and
kojiishi@8496 764 following the last character in the ruby text. That amount of white
kojiishi@8496 765 space is normally equal to half the amount of inter-character space of
kojiishi@8496 766 the ruby text. If the width of the ruby text is at least the width of
kojiishi@8496 767 the base, then the same type of space distribution applies to the base.
kojiishi@8496 768 In other words, if the base is shorter than the ruby text, the base is
kojiishi@8496 769 distribute-space aligned. This type of alignment
kojiishi@8496 770 is described by [[JLREQ]].
kojiishi@8496 771
kojiishi@8496 772 <div class="figure">
kojiishi@8496 773 <p><img width="145" height="91"
kojiishi@8496 774 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base"
kojiishi@8496 775 src="images/ra-ds.gif" /><img width="145" height="91"
kojiishi@8496 776 alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base"
kojiishi@8496 777 src="images/ra-ds-rb.gif" /></p>
kojiishi@8496 778 <p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p>
kojiishi@8496 779 </div>
kojiishi@8496 780 </dd>
kojiishi@8496 781
kojiishi@8496 782 <!--
ishida@1665 783 <dt><strong>line-edge</strong></dt>
ishida@1665 784 <dd>If the ruby text is not adjacent to a line edge, it is aligned as in
ishida@1665 785 'auto'. If it is adjacent to a line edge, then it is still aligned as in
ishida@1665 786 auto, but the side of the ruby text that touches the end of the line is
ishida@1665 787 lined up with the corresponding edge of the base. This type of alignment
fantasai@8479 788 is described by [[JLREQ]]. This type of alignment is
ishida@1665 789 relevant only to the scenario where the ruby text is longer than the
ishida@1665 790 ruby base. In the other scenarios, this is just 'auto'.
ishida@1665 791 <div class="figure">
ishida@1665 792 <p><img class="example" width="146" height="109"
ishida@1665 793 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base"
ishida@1666 794 src="images/ra-le-l.gif" /><img class="example" width="146"
ishida@1665 795 height="110"
ishida@1665 796 alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base"
ishida@1666 797 src="images/ra-le-r.gif" /></p>
ishida@1665 798 <p><b>Figure 4.2.8</b>: Line edge ruby alignment</p>
ishida@1665 799 </div>
ishida@1665 800 </dd>
kojiishi@8496 801 -->
kojiishi@8496 802 </dl>
ishida@1665 803
kojiishi@8496 804 <p>For a complex ruby with spanning elements, one additional consideration is
kojiishi@8496 805 required. If the spanning element spans multiple 'rows' (other rbc or rtc
kojiishi@8496 806 elements), and the ruby alignment requires space distribution among the
kojiishi@8496 807 'spanned' elements, a ratio must be determined among the 'columns' of spanned
kojiishi@8496 808 elements. This ratio is computed by taking into consideration the widest
kojiishi@8496 809 element within each column.</p>
ishida@1665 810
kojiishi@8496 811 <!--
fantasai@8479 812 <h3 id="rubyover">
fantasai@8479 813 Ruby overhanging: the 'ruby-overhang' property</h3>
ishida@1665 814
fantasai@8479 815 <table class="propdef">
fantasai@8479 816 <tr>
fantasai@8479 817 <th>Name:
fantasai@8479 818 <td><dfn>ruby-overhang</dfn>
fantasai@8479 819 <tr>
fantasai@8479 820 <th>Value:
fantasai@8479 821 <td>auto | start | end | none
fantasai@8479 822 <tr>
fantasai@8479 823 <th>Initial:
fantasai@8479 824 <td>none
fantasai@8479 825 <tr>
fantasai@8479 826 <th>Applies to:
fantasai@8479 827 <td>the parent of elements with display: ruby-text
fantasai@8479 828 <tr>
fantasai@8479 829 <th>Inherited:
fantasai@8479 830 <td>yes
fantasai@8479 831 <tr>
fantasai@8479 832 <th>Percentages:
fantasai@8479 833 <td>N/A
fantasai@8479 834 <tr>
fantasai@8479 835 <th>Media:
fantasai@8479 836 <td>visual
fantasai@8479 837 <tr>
fantasai@8479 838 <th>Computed value:
fantasai@8479 839 <td>specified value (except for initial and inherit)
fantasai@8479 840 </table>
ishida@1665 841
ishida@1665 842 <p>This property determines whether, and on which side, ruby text is allowed
ishida@1665 843 to partially overhang any adjacent text in addition to its own base, when the
ishida@1665 844 ruby text is wider than the ruby base. Note that ruby text is never allowed to
ishida@1665 845 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 846 a maximum amount by which ruby text may overhang adjacent text. The user agent may use
fantasai@8479 847 the [[JIS4051]] recommendation of using one ruby text character
fantasai@8479 848 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 849
ishida@1665 850 <p>Possible values:</p>
ishida@1665 851 <dl>
ishida@1665 852 <dt><strong>auto</strong></dt>
fantasai@8479 853 <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 854 ruby text can overhang. The user agent is free to follow those recommendations or specify its own classes of
ishida@1665 855 characters to overhang. This is the initial value.
ishida@1665 856 <div class="figure">
ishida@1665 857 <p><img class="example" width="177" height="91"
ishida@1666 858 alt="Diagram of glyph layout in overhanging ruby" src="images/ro-a.gif" /></p>
ishida@1665 859 <p><b>Figure 4.3.1</b>: Ruby overhanging adjacent text</p>
ishida@1665 860 </div>
ishida@1665 861 </dd>
ishida@1665 862 <dt><strong>start</strong></dt>
ishida@3034 863 <dd>The ruby text can only overhang the text that precedes it. That means, for
ishida@3034 864 example, that ruby cannot overhang text that is to the right of it in
ishida@3034 865 horizontal LTR layout, and it cannot overhang text that is below it in
ishida@1665 866 vertical-ideographic layout.
ishida@1665 867 <div class="figure">
ishida@1665 868 <p><img class="example" width="199" height="91"
ishida@1665 869 alt="Diagram of glyph layout when ruby overhangs the preceding glyphs only"
ishida@1666 870 src="images/ro-s.gif" /></p>
ishida@1665 871 <p><b>Figure 4.3.2</b>: Ruby overhanging preceding text only</p>
ishida@1665 872 </div>
ishida@1665 873 </dd>
ishida@1665 874 <dt><strong>end</strong></dt>
ishida@3034 875 <dd>The ruby text can only overhang the text that follows it. That means, for
ishida@3034 876 example, that ruby cannot overhang text that is to the left of it in
ishida@3034 877 horizontal LTR layout, and it cannot overhang text that is above it in
ishida@1665 878 vertical-ideographic layout.
ishida@1665 879 <div class="figure">
ishida@1665 880 <p><img class="example" width="198" height="91"
ishida@1665 881 alt="Diagram of glyph layout when ruby overhangs the following characters only"
ishida@1666 882 src="images/ro-e.gif" /></p>
ishida@1665 883 <p><b>Figure 4.3.3</b>: Ruby overhanging following text only</p>
ishida@1665 884 </div>
ishida@1665 885 </dd>
ishida@1665 886 <dt><strong>none</strong></dt>
ishida@1665 887 <dd>The ruby text cannot overhang any text adjacent to its base, only its
ishida@1665 888 own base.
ishida@1665 889
ishida@1665 890 <div class="figure">
ishida@1665 891 <p><img class="example" width="220" height="91"
ishida@1665 892 alt="Diagram of glyph layout in non-overhanging ruby"
ishida@1666 893 src="images/ro-n.gif" /></p>
ishida@1665 894 <p><b>Figure 4.3.4</b>: Ruby not allowed to overhang adjacent text</p>
ishida@1665 895 </div>
ishida@1665 896 </dd>
ishida@1665 897 </dl>
ishida@1665 898
fantasai@8479 899 <h3 id="rubyspan">
fantasai@8479 900 Ruby annotation spanning: the 'ruby-span' property</h3>
ishida@1665 901
fantasai@8479 902 <table class="propdef">
fantasai@8479 903 <tr>
fantasai@8479 904 <th>Name:
fantasai@8479 905 <td><dfn>ruby-span</dfn>
fantasai@8479 906 <tr>
fantasai@8479 907 <th>Value:
fantasai@8479 908 <td>attr(x) | none
fantasai@8479 909 <tr>
fantasai@8479 910 <th>Initial:
fantasai@8479 911 <td>none
fantasai@8479 912 <tr>
fantasai@8479 913 <th>Applies to:
fantasai@8479 914 <td>elements with display: ruby-text
fantasai@8479 915 <tr>
fantasai@8479 916 <th>Inherited:
fantasai@8479 917 <td>no
fantasai@8479 918 <tr>
fantasai@8479 919 <th>Percentages:
fantasai@8479 920 <td>N/A
fantasai@8479 921 <tr>
fantasai@8479 922 <th>Media:
fantasai@8479 923 <td>visual
fantasai@8479 924 <tr>
fantasai@8479 925 <th>Computed value:
fantasai@8479 926 <td>&lt;number&gt;
fantasai@8479 927 </table>
ishida@1665 928
ishida@1665 929 <p>This property controls the spanning behavior of annotation elements. </p>
ishida@1665 930
ishida@1665 931 <p class="note"><span class="note-label">Note:</span> A XHTML user agent may also use the <samp>rbspan</samp>
ishida@1665 932 attribute to get the same effect.</p>
ishida@1665 933
ishida@1665 934 <p>Possible values:</p>
ishida@1665 935
ishida@1665 936 <dl>
ishida@1665 937 <dt><strong>attr(x)</strong></dt>
ishida@1665 938 <dd>The value of attribute 'x' as a string value. The string value is
ishida@1665 939 evaluated as a &lt;number&gt; to determine the number of ruby base elements to be
ishida@1665 940 spanned by the annotation element. If the &lt;number&gt; is &#39;0&#39;, it is replaced by
ishida@1665 941 &#39;1&#39;.The &lt;number&gt; is the computed value. </dd>
ishida@1665 942 <dt>none</dt>
ishida@1665 943 <dd>No spanning. The computed value is &#39;1&#39;.</dd>
ishida@1665 944 </dl>
ishida@1665 945
ishida@1665 946 <p>The following example shows an XML example using the 'display' property
ishida@1665 947 values associated with the 'ruby structure and the 'ruby-span' property</p>
ishida@3034 948 <pre class="xml">myruby { display: ruby; }
ishida@1665 949 myrbc { display: ruby-base-container; }
ishida@1665 950 myrb { display: ruby-base; }
ishida@1665 951 myrtc.before { display: ruby-text-container; ruby-position: before}
ishida@1665 952 myrtc.after { display: ruby-text-container; ruby-position: after}
ishida@1665 953 myrt { display: ruby-text; ruby-span: attr(rbspan); }
ishida@1665 954 ...
ishida@1665 955 &lt;myruby&gt;
ishida@1665 956 &lt;myrbc&gt;
ishida@1665 957 &lt;myrb&gt;10&lt;/myrb&gt;
ishida@1665 958 &lt;myrb&gt;31&lt;/myrb&gt;
ishida@1665 959 &lt;myrb&gt;2002&lt;/myrb&gt;
ishida@1665 960 &lt;/myrbc&gt;
ishida@1665 961 &lt;myrtc class=&quot;before&quot;&gt;
ishida@1665 962 &lt;myrt&gt;Month&lt;/myrt&gt;
ishida@1665 963 &lt;myrt&gt;Day&lt;/myrt&gt;
ishida@1665 964 &lt;myrt&gt;Year&lt;/myrt&gt;
ishida@1665 965 &lt;/myrtc&gt;
ishida@1665 966 &lt;myrtc class=&quot;after&quot;&gt;
ishida@1665 967 &lt;myrt rbspan=&quot;3&quot;&gt;Expiration Date&lt;/myrt&gt;
ishida@1665 968 &lt;/myrtc&gt;
ishida@1665 969 &lt;/myruby&gt;</pre>
kojiishi@8496 970 -->
ishida@1665 971
fantasai@8497 972 <h2 id="default-stylesheet" class="no-num">
fantasai@8497 973 Appendix A: Default Style Sheet</h2>
ishida@1665 974
fantasai@8497 975 <p><em>This section is informative.</em>
ishida@1665 976
fantasai@8497 977 <h3 id="default-ua-ruby" class="no-num">
fantasai@8497 978 <span class="secno">A.1</span> Supporting Ruby Layout</h3>
ishida@1665 979
fantasai@8497 980 <p>The following represents a default UA style sheet
fantasai@8497 981 for rendering HTML and XHTML ruby markup as ruby layout:
ishida@1665 982
fantasai@8497 983 <pre>
fantasai@8497 984 <!-- -->ruby { display: ruby; }
fantasai@8497 985 <!-- -->rb { display: ruby-base; white-space: nowrap; }
fantasai@8497 986 <!-- -->rt { display: ruby-text; white-space: nowrap; font-size: 50%; }
fantasai@8497 987 <!-- -->rbc { display: ruby-base-container; }
fantasai@8497 988 <!-- -->rtc { display: ruby-text-container; }</pre>
fantasai@8497 989
fantasai@8497 990 <p>Additional rules for UAs supporting the relevant features of [[CSS3-TEXT-DECOR]] and [[CSS3-FONTS]]:
fantasai@8497 991 <pre>rt { font-variant-east-asian: ruby; text-emphasis: none; }</pre>
fantasai@8497 992
fantasai@8497 993 <p class="note">Authors should not use the above rules;
fantasai@8497 994 a UA that supports ruby layout should provide these by default.
fantasai@8497 995
fantasai@8497 996 <h3 id="default-inline" class="no-num">
fantasai@8497 997 <span class="secno">A.2</span> Inlining Ruby Annotations</h3>
fantasai@8497 998
fantasai@8497 999 <p>The following represents a sample style sheet
fantasai@8497 1000 for rendering HTML and XHTML ruby markup as inline annotations:
fantasai@8497 1001
fantasai@8497 1002 <pre>ruby, rb, rt, rbc, rtc, rp {
fantasai@8497 1003 <!-- --> display: inline; white-space: inherit;
fantasai@8497 1004 <!-- --> font-variant-east-asian: inherit; text-emphasis: inherit; }</pre>
fantasai@8497 1005
fantasai@8497 1006 <h3 id="default-parens" class="no-num">
fantasai@8497 1007 <span class="secno">A.3</span> Generating Parentheses</h3>
fantasai@8497 1008
fantasai@8497 1009 <p>Unfortunately, because Selectors cannot match against text nodes,
fantasai@8497 1010 it's not possible with CSS to express rules that will automatically and correctly
fantasai@8497 1011 add parentheses to unparenthesized ruby annotations in HTML.
fantasai@8497 1012 However, an author rigorously using <code>&lt;rtc&gt;</code> elements
fantasai@8497 1013 around all annotations
fantasai@8497 1014 can use CSS Level 2 generated content [[!CSS21]] to generate parentheses:
fantasai@8497 1015 <pre>
fantasai@8497 1016 <!-- -->rtc::before { content: "("; }
fantasai@8497 1017 <!-- -->rtc::after { content: ")"; }</pre>
fantasai@8497 1018
fantasai@8497 1019 <p>Alternatively, an author rigorously using
fantasai@8497 1020 both <code>&lt;rb&gt;</code> and <code>&lt;rt&gt;</code> elements but no <code>&lt;rtc&gt;</code> elements
fantasai@8497 1021 can use these rules instead:
fantasai@8497 1022 <pre>
fantasai@8497 1023 <!-- -->rb + rt::before { content: "("; }
fantasai@8497 1024 <!-- -->rt:last-child::after, rt + rb::before { content: ")"; }</pre>
fantasai@8497 1025
fantasai@8497 1026 <p class="Issue">Try to make these smarter somehow?</p>
ishida@1665 1027
fantasai@8479 1028 <h2 id="glossary">
fantasai@8479 1029 Glossary</h2>
ishida@1665 1030 <dl>
ishida@1665 1031 <dt><a id="g-bopomofo"><strong><span
ishida@1665 1032 lang="zh">Bopomofo</span></strong></a></dt>
ishida@1665 1033 <dd>37 characters and 4 tone markings used as phonetics in Chinese,
ishida@1665 1034 especially standard Mandarin.</dd>
ishida@1665 1035 <dt><a id="g-hanja"><strong><span
ishida@1665 1036 lang="ko">Hanja</span></strong></a></dt>
ishida@1665 1037 <dd>Subset of the Korean writing system that utilizes ideographic
ishida@1665 1038 characters borrowed or adapted from the Chinese writing system. Also see
ishida@1665 1039 <a href="#g-kanji"><span lang="ja">Kanji</span></a>.</dd>
ishida@1665 1040 <dt><a id="g-hiragana"><strong><span
ishida@1665 1041 lang="ja">Hiragana</span></strong></a></dt>
ishida@1665 1042 <dd>Japanese syllabic script, or character of that script. Rounded and
ishida@1665 1043 cursive in appearance. Subset of the Japanese writing system, used together
ishida@1665 1044 with kanji and katakana. In recent times, mostly used to write Japanese
ishida@1665 1045 words when kanji are not available or appropriate, and word endings and
ishida@1665 1046 particles. Also see <a
ishida@1665 1047 href="#g-katakana"><span lang="ja">Katakana</span></a>.</dd>
ishida@1665 1048 <dt><a id="g-ideogram"><strong>Ideograph</strong></a></dt>
ishida@1665 1049 <dd>A character that is used to represent an idea, word, or word component,
ishida@1665 1050 in contrast to a character from an alphabetic or syllabic script. The most
ishida@1665 1051 well-known ideographic script is used (with some variation) in East Asia
ishida@1665 1052 (China, Japan, Korea,...).</dd>
ishida@1665 1053 <dt><a id="g-kana"><strong><span lang="ja">Kana</span></strong></a></dt>
ishida@1665 1054 <dd>Collective term for hiragana and katakana.</dd>
ishida@1665 1055 <dt><a id="g-kanji"><strong>Kanji</strong></a></dt>
ishida@1665 1056 <dd>Japanese term for ideographs; ideographs used in Japanese. Subset of the
ishida@1665 1057 Japanese writing system, used together with hiragana and katakana. Also see <a
ishida@1665 1058 href="#g-hanja"><span lang="ko">Hanja</span></a>.</dd>
ishida@1665 1059 <dt><a id="g-katakana"><strong><span
ishida@1665 1060 lang="ja">Katakana</span></strong></a></dt>
ishida@1665 1061 <dd>Japanese syllabic script, or character of that script. Angular in
ishida@1665 1062 appearance. Subset of the Japanese writing system,&nbsp; used together with
ishida@1665 1063 kanji and hiragana. In recent times, mainly used to write foreign words. Also see <a
ishida@1665 1064 href="#g-hiragana"><span lang="ja">Hiragana</span></a>.</dd>
ishida@1665 1065 <dt><a id="g-monoruby" name="g-monoruby"><strong>Mono-ruby</strong></a></dt>
ishida@1665 1066 <dd>In Japanese typography: Ruby associated with a single character of
ishida@1665 1067 the base text.</dd>
ishida@1665 1068 <dt><a id="g-ruby"><strong>Ruby</strong></a></dt>
ishida@1665 1069 <dd>A run of text that appears in the vicinity of another run of text and
ishida@1665 1070 serves as an annotation or a pronunciation guide for that text.</dd>
ishida@1665 1071 </dl>
ishida@1665 1072
fantasai@8479 1073 <h2 id="conformance">
fantasai@8479 1074 Conformance</h2>
fantasai@8479 1075
fantasai@8479 1076 <h3 id="conventions">
fantasai@8479 1077 Document conventions</h3>
fantasai@8479 1078
fantasai@8479 1079 <p>Conformance requirements are expressed with a combination of
fantasai@8479 1080 descriptive assertions and RFC 2119 terminology. The key words “MUST”,
fantasai@8479 1081 “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
fantasai@8479 1082 “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
fantasai@8479 1083 document are to be interpreted as described in RFC 2119.
fantasai@8479 1084 However, for readability, these words do not appear in all uppercase
fantasai@8479 1085 letters in this specification.
fantasai@8479 1086
fantasai@8479 1087 <p>All of the text of this specification is normative except sections
fantasai@8479 1088 explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p>
fantasai@8479 1089
fantasai@8479 1090 <p>Examples in this specification are introduced with the words “for example”
fantasai@8479 1091 or are set apart from the normative text with <code>class="example"</code>,
fantasai@8479 1092 like this:
fantasai@8479 1093
fantasai@8479 1094 <div class="example">
fantasai@8479 1095 <p>This is an example of an informative example.</p>
fantasai@8479 1096 </div>
fantasai@8479 1097
fantasai@8479 1098 <p>Informative notes begin with the word “Note” and are set apart from the
fantasai@8479 1099 normative text with <code>class="note"</code>, like this:
fantasai@8479 1100
fantasai@8479 1101 <p class="note">Note, this is an informative note.</p>
fantasai@8479 1102
fantasai@8479 1103 <h3 id="conformance-classes">
fantasai@8479 1104 Conformance classes</h3>
fantasai@8479 1105
fantasai@8479 1106 <p>Conformance to CSS Ruby Module
fantasai@8479 1107 is defined for three conformance classes:
fantasai@8479 1108 <dl>
fantasai@8479 1109 <dt><dfn title="style sheet!!as conformance class">style sheet</dfn>
fantasai@8479 1110 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
fantasai@8479 1111 style sheet</a>.
fantasai@8479 1112 <dt><dfn>renderer</dfn></dt>
fantasai@8479 1113 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
fantasai@8479 1114 that interprets the semantics of a style sheet and renders
fantasai@8479 1115 documents that use them.
fantasai@8479 1116 <dt><dfn id="authoring-tool">authoring tool</dfn></dt>
fantasai@8479 1117 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
fantasai@8479 1118 that writes a style sheet.
fantasai@8479 1119 </dl>
fantasai@8479 1120
fantasai@8479 1121 <p>A style sheet is conformant to CSS Ruby Module
fantasai@8479 1122 if all of its statements that use syntax defined in this module are valid
fantasai@8479 1123 according to the generic CSS grammar and the individual grammars of each
fantasai@8479 1124 feature defined in this module.
fantasai@8479 1125
fantasai@8479 1126 <p>A renderer is conformant to CSS Ruby Module
fantasai@8479 1127 if, in addition to interpreting the style sheet as defined by the
fantasai@8479 1128 appropriate specifications, it supports all the features defined
fantasai@8479 1129 by CSS Ruby Module by parsing them correctly
fantasai@8479 1130 and rendering the document accordingly. However, the inability of a
fantasai@8479 1131 UA to correctly render a document due to limitations of the device
fantasai@8479 1132 does not make the UA non-conformant. (For example, a UA is not
fantasai@8479 1133 required to render color on a monochrome monitor.)
fantasai@8479 1134
fantasai@8479 1135 <p>An authoring tool is conformant to CSS Ruby Module
fantasai@8479 1136 if it writes style sheets that are syntactically correct according to the
fantasai@8479 1137 generic CSS grammar and the individual grammars of each feature in
fantasai@8479 1138 this module, and meet all other conformance requirements of style sheets
fantasai@8479 1139 as described in this module.
fantasai@8479 1140
fantasai@8479 1141 <h3 id="partial">
fantasai@8479 1142 Partial implementations</h3>
fantasai@8479 1143
fantasai@8479 1144 <p>So that authors can exploit the forward-compatible parsing rules to
fantasai@8479 1145 assign fallback values, CSS renderers <strong>must</strong>
fantasai@8479 1146 treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
fantasai@8479 1147 as appropriate</a>) any at-rules, properties, property values, keywords,
fantasai@8479 1148 and other syntactic constructs for which they have no usable level of
fantasai@8479 1149 support. In particular, user agents <strong>must not</strong> selectively
fantasai@8479 1150 ignore unsupported component values and honor supported values in a single
fantasai@8479 1151 multi-value property declaration: if any value is considered invalid
fantasai@8479 1152 (as unsupported values must be), CSS requires that the entire declaration
fantasai@8479 1153 be ignored.</p>
fantasai@8479 1154
fantasai@8479 1155 <h3 id="experimental">
fantasai@8479 1156 Experimental implementations</h3>
fantasai@8479 1157
fantasai@8479 1158 <p>To avoid clashes with future CSS features, the CSS2.1 specification
fantasai@8479 1159 reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
fantasai@8479 1160 syntax</a> for proprietary and experimental extensions to CSS.
fantasai@8479 1161
fantasai@8479 1162 <p>Prior to a specification reaching the Candidate Recommendation stage
fantasai@8479 1163 in the W3C process, all implementations of a CSS feature are considered
fantasai@8479 1164 experimental. The CSS Working Group recommends that implementations
fantasai@8479 1165 use a vendor-prefixed syntax for such features, including those in
fantasai@8479 1166 W3C Working Drafts. This avoids incompatibilities with future changes
fantasai@8479 1167 in the draft.
fantasai@8479 1168 </p>
fantasai@8479 1169
fantasai@8479 1170 <h3 id="testing">
fantasai@8479 1171 Non-experimental implementations</h3>
fantasai@8479 1172
fantasai@8479 1173 <p>Once a specification reaches the Candidate Recommendation stage,
fantasai@8479 1174 non-experimental implementations are possible, and implementors should
fantasai@8479 1175 release an unprefixed implementation of any CR-level feature they
fantasai@8479 1176 can demonstrate to be correctly implemented according to spec.
fantasai@8479 1177
fantasai@8479 1178 <p>To establish and maintain the interoperability of CSS across
fantasai@8479 1179 implementations, the CSS Working Group requests that non-experimental
fantasai@8479 1180 CSS renderers submit an implementation report (and, if necessary, the
fantasai@8479 1181 testcases used for that implementation report) to the W3C before
fantasai@8479 1182 releasing an unprefixed implementation of any CSS features. Testcases
fantasai@8479 1183 submitted to W3C are subject to review and correction by the CSS
fantasai@8479 1184 Working Group.
fantasai@8479 1185
fantasai@8479 1186 <p>Further information on submitting testcases and implementation reports
fantasai@8479 1187 can be found from on the CSS Working Group's website at
fantasai@8479 1188 <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
fantasai@8479 1189 Questions should be directed to the
fantasai@8479 1190 <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
fantasai@8479 1191 mailing list.
fantasai@8479 1192
fantasai@8479 1193 <h2 class=no-num id="acknowledgments">
fantasai@8479 1194 Acknowledgments</h2>
ishida@1665 1195
ishida@1665 1196 <p>This specification would not have been possible without the help from:</p>
ishida@1665 1197
fantasai@8479 1198 <p>Stephen Deach, Martin Dürst,  Hideki Hiura(<span lang="ja">樋浦 秀樹</span>), Masayasu Ishikawa(<span lang="ja">石川
ishida@1665 1199 雅康</span>), Chris
fantasai@8479 1200 Pratley, Takao Suzuki(<span lang="ja">鈴木 孝雄</span>), Frank Yung-Fong Tang, Chris Thrasher, Masafumi Yabe<span lang="ja">家辺
ishida@1665 1201 勝文</span>), Steve Zilles.</p>
ishida@1665 1202
fantasai@8479 1203 <h2 class=no-num id="references">
fantasai@8479 1204 References</h2>
ishida@1665 1205
fantasai@8479 1206 <h3 class="no-num" id="normative-references">
fantasai@8479 1207 Normative references</h3>
fantasai@8479 1208 <!--normative-->
ishida@1665 1209
fantasai@8479 1210 <h3 class="no-num" id="other-references">
fantasai@8479 1211 Other references</h3>
fantasai@8479 1212 <!--informative-->
ishida@1665 1213
fantasai@8479 1214 <h2 class="no-num" id="index">
fantasai@8479 1215 Index</h2>
fantasai@8479 1216 <!--index-->
ishida@1665 1217
fantasai@8479 1218 <h2 class="no-num" id="property-index">
fantasai@8479 1219 Property index</h2>
fantasai@8479 1220 <!-- properties -->
ishida@1665 1221
ishida@1665 1222 </body>
ishida@1665 1223 </html>
ishida@1665 1224 <!-- Keep this comment at the end of the file
ishida@1665 1225 Local variables:
ishida@1665 1226 mode: sgml
fantasai@8479 1227 sgml-declaration:"~/SGML/HTML4.decl"
ishida@1665 1228 sgml-default-doctype-name:"html"
ishida@1665 1229 sgml-minimize-attributes:t
ishida@1665 1230 sgml-nofill-elements:("pre" "style" "br")
fantasai@8479 1231 sgml-live-element-indicator:t
fantasai@8479 1232 sgml-omittag:nil
fantasai@8479 1233 sgml-shorttag:nil
fantasai@8479 1234 sgml-namecase-general:t
fantasai@8479 1235 sgml-general-insert-case:lower
fantasai@8479 1236 sgml-always-quote-attributes:t
fantasai@8479 1237 sgml-indent-step:nil
fantasai@8479 1238 sgml-indent-data:t
fantasai@8479 1239 sgml-parent-document:nil
fantasai@8479 1240 sgml-exposed-tags:nil
fantasai@8479 1241 sgml-local-catalogs:nil
fantasai@8479 1242 sgml-local-ecat-files:nil
ishida@1665 1243 End:
ishida@1665 1244 -->
fantasai@8479 1245

mercurial