Wed, 19 Jun 2013 00:31:59 +0900
[css-ruby] First draft of anonymous box generation rules...
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 “<kbd>[[SHORTNAME]] |
fantasai@8493 | 43 | <var>… message topic …</var></kbd>” |
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: … |
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><length></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><ruby></code> element may contain multiple <i>ruby segments</i>. |
fantasai@8492 | 219 | (In the XHTML Ruby model, a single <code><ruby></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@8504 | 241 | <dd>Specifies that an element generates a <dfn title="ruby container | ruby container box">ruby container box</dfn>. |
fantasai@8492 | 242 | (Corresponds to HTML/XHTML <code><ruby></code> elements.) |
fantasai@8492 | 243 | <dt>''ruby-base'' |
fantasai@8504 | 244 | <dd>Specifies that an element generates a <dfn title="ruby base box | ruby base">ruby base box</dfn>. |
fantasai@8492 | 245 | (Corresponds to HTML/XHTML <code><rb></code> elements.) |
fantasai@8492 | 246 | <dt>''ruby-text'' |
fantasai@8504 | 247 | <dd>Specifies that an element generates a <dfn title="ruby annotation box | ruby annotation">ruby annotation box</dfn>. |
fantasai@8492 | 248 | (Corresponds to HTML/XHTML <code><rt></code> elements.) |
fantasai@8492 | 249 | <dt>''ruby-base-container'' |
fantasai@8504 | 250 | <dd>Specifies that an element generates a <dfn title="ruby base container box | ruby base container">ruby base container box</dfn>. |
fantasai@8492 | 251 | (Corresponds to XHTML <code><rbc></code> elements; always implied in HTML.) |
fantasai@8492 | 252 | <dt>''ruby-text-container'' |
fantasai@8504 | 253 | <dd>Specifies that an element generates a <dfn title="ruby annotation container box | ruby annotation container">ruby annotation container box</dfn>. |
fantasai@8492 | 254 | (Corresponds to HTML/XHTML <code><ruby></code> elements.) |
fantasai@8492 | 255 | </dl> |
fantasai@8492 | 256 | |
fantasai@8504 | 257 | <h3 id="box-fixup"> |
fantasai@8504 | 258 | Anonymous Ruby Box Generation</h3> |
fantasai@8504 | 259 | |
fantasai@8492 | 260 | <p>The CSS model does not require that the document language |
fantasai@8492 | 261 | include elements that correspond to each of these components. |
fantasai@8504 | 262 | Missing parts of the structure are implied through the anonymous box generation rules |
fantasai@8504 | 263 | <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to those used to normalize tables</a>. [[!CSS21]] |
fantasai@8492 | 264 | |
fantasai@8504 | 265 | <ol> |
fantasai@8504 | 266 | <li>Any in-flow block-level boxes directly contained by a |
fantasai@8504 | 267 | <i>ruby container</i>, |
fantasai@8504 | 268 | <i>ruby base container</i>, |
fantasai@8504 | 269 | <i>ruby annotation container</i>, |
fantasai@8504 | 270 | <i>ruby base box</i>, |
fantasai@8504 | 271 | or <i>ruby annotation box</i> |
fantasai@8504 | 272 | are forced to be inline-level boxes, |
fantasai@8504 | 273 | and their 'display' value computed accordingly. |
fantasai@8504 | 274 | For example, |
fantasai@8504 | 275 | the 'display' property of an in-flow element with ''display: block'' |
fantasai@8504 | 276 | parented by an element with ''display: ruby-text'' |
fantasai@8504 | 277 | computes to ''inline-block''. |
fantasai@8504 | 278 | This computation occurs after any intermediary anonymous-box fixup |
fantasai@8504 | 279 | (such as that required by internal table elements). |
fantasai@8504 | 280 | |
fantasai@8504 | 281 | <li>Any consecutive sequence of <i>ruby bases</i> not parented by a <i>ruby base container</i> |
fantasai@8504 | 282 | is wrapped in an anonymous <i>ruby base container</i>. |
fantasai@8504 | 283 | Similarly, any consecutive sequence of <i>ruby annotations</i> not parented by a <i>ruby annotation container</i> |
fantasai@8504 | 284 | is wrapped in an anonymous <i>ruby annotation container</i>. |
fantasai@8504 | 285 | |
fantasai@8504 | 286 | <li>Within each <i>ruby base container</i>, |
fantasai@8504 | 287 | each sequence of inline-level boxes is wrapped in an anonymous <i>ruby base box</i>. |
fantasai@8504 | 288 | Similarly, within each <i>ruby annotation container</i>, |
fantasai@8504 | 289 | each sequence of inline-level boxes is wrapped in an anonymous <i>ruby annotation box</i>. |
fantasai@8504 | 290 | |
fantasai@8504 | 291 | <li>A sequence of <i>ruby base containers</i> and/or <i>ruby annotation containers</i> |
fantasai@8504 | 292 | not parented by a <i>ruby container</i> |
fantasai@8504 | 293 | is wrapped in an anonymous <i>ruby container</i>. |
fantasai@8504 | 294 | </ol> |
fantasai@8504 | 295 | |
fantasai@8504 | 296 | <p>At this point, all ruby layout structures are properly parented, |
fantasai@8504 | 297 | and the UA can start to associate bases with their annotations. |
fantasai@8504 | 298 | |
fantasai@8504 | 299 | <p class="note"> |
fantasai@8504 | 300 | Note that the UA is not required to create any of these anonymous boxes in its internal structures, |
fantasai@8504 | 301 | as long as pairing and layout behaves as if they existed. |
fantasai@8504 | 302 | |
fantasai@8504 | 303 | <h3 id="pairing"> |
fantasai@8504 | 304 | Ruby Pairing and Annotation Levels</h3> |
fantasai@8504 | 305 | |
fantasai@8504 | 306 | <p>Within a ruby structure, |
fantasai@8504 | 307 | each <i>ruby bases</i> are associated with <i>ruby annotations</i> |
fantasai@8504 | 308 | and vice versa. |
fantasai@8504 | 309 | A <i>ruby base</i> can be associated with at most one <i>ruby annotation</i> per annotation level. |
fantasai@8504 | 310 | If there are multiple annotation levels, it can therefore be associated with multiple <i>ruby annotations</i>. |
fantasai@8504 | 311 | A <i>ruby annotation</i> is associated with one or more <i>ruby bases</i>; |
fantasai@8504 | 312 | annotations can span multiple bases. |
fantasai@8504 | 313 | |
fantasai@8504 | 314 | <p><dfn>Annotation pairing</dfn> is the process of associating |
fantasai@8504 | 315 | <i>ruby annotations</i> with <i>ruby bases</i>. |
fantasai@8504 | 316 | |
fantasai@8504 | 317 | <ol> |
fantasai@8504 | 318 | <li> |
fantasai@8504 | 319 | <p>First, the ruby structure is divided into <i>ruby segments</i>, |
fantasai@8504 | 320 | each consisting of a single <i>ruby base container</i> |
fantasai@8504 | 321 | followed by one or more <i>ruby annotation containers</i>. |
fantasai@8504 | 322 | If the first child of a <i>ruby container</i> is a <i>ruby annotation container</i>, |
fantasai@8504 | 323 | an anonymous, empty <i>ruby base container</i> is assumed to exist before it. |
fantasai@8504 | 324 | Similarly, if the <i>ruby container</i> contains consecutive <i>ruby base containers</i>, |
fantasai@8504 | 325 | anonymous, empty <i>ruby annotation containers</i> are assumed to exist between them. |
fantasai@8504 | 326 | The <i>ruby base container</i> in each segment is thus associated |
fantasai@8504 | 327 | with each of the <i>ruby annotation containers</i> in that segment. |
fantasai@8504 | 328 | |
fantasai@8504 | 329 | <p>Each <i>ruby annotation containers</i> in a <i>ruby segment</i> |
fantasai@8504 | 330 | represents one <dfn title="annotation level | level">level</dfn> of annotation: |
fantasai@8504 | 331 | the first one represents the first level of annotation, |
fantasai@8504 | 332 | the second one represents the second level of annotation, |
fantasai@8504 | 333 | and so on. |
fantasai@8504 | 334 | |
fantasai@8504 | 335 | <li>Within each <i>ruby segment</i>, |
fantasai@8504 | 336 | each <i>ruby base box</i> in the <i>ruby base container</i> |
fantasai@8504 | 337 | is paired with one <i>ruby annotation box</i> |
fantasai@8504 | 338 | from each <i>ruby annotation container</i> in its <i>ruby segment</i>. |
fantasai@8504 | 339 | If there are not enough <i>ruby annotations</i> in a <i>ruby annotation container</i>, |
fantasai@8504 | 340 | the last one is associated with any excess <i>ruby bases</i>. |
fantasai@8504 | 341 | (If there are not any in the <i>ruby annotation container</i>, an anonymous empty one is assumed to exist.) |
fantasai@8504 | 342 | If there are not enough <i>ruby bases</i>, |
fantasai@8504 | 343 | any remaining <i>ruby annotations</i> are assumed to be associated |
fantasai@8504 | 344 | with empty, anonymous bases inserted at the end of the <i>ruby base container</i>. |
fantasai@8504 | 345 | </ol> |
fantasai@8504 | 346 | |
fantasai@8504 | 347 | <p>A this point, ruby “columns” are defined, |
fantasai@8504 | 348 | each represented by a single <i>ruby base</i> |
fantasai@8504 | 349 | and associated with one <i>ruby annotation</i> (possibly an empty, anonymous one) |
fantasai@8504 | 350 | from each <i>annotation level</i>. |
fantasai@8504 | 351 | |
fantasai@8504 | 352 | <h4 id="nested-pairing"> |
fantasai@8504 | 353 | Nested Ruby</h4> |
fantasai@8504 | 354 | |
fantasai@8504 | 355 | <p>When <i>ruby containers</i> are nested, |
fantasai@8504 | 356 | pairing begins with the deepest <i>ruby container</i>, |
fantasai@8504 | 357 | then expands out, |
fantasai@8504 | 358 | treating each <i>ruby container</i> nested within another <i>ruby container</i> |
fantasai@8504 | 359 | as a <i>ruby base</i>, |
fantasai@8504 | 360 | and associating each <i>ruby annotation</i> |
fantasai@8504 | 361 | associated with the nested <i>ruby container</i> |
fantasai@8504 | 362 | as being associated with (spanning) all of its <i>ruby bases</i>. |
fantasai@8504 | 363 | |
fantasai@8504 | 364 | <p>Using nested <i>ruby containers</i> thus allows the representation |
fantasai@8504 | 365 | of complex spanning relationships. |
fantasai@8504 | 366 | |
fantasai@8504 | 367 | <p class="issue">This shouldn't belong in Level 1. But HTML5 allows it, so we have to handle it. Yay HTML5. |
fantasai@8504 | 368 | |
fantasai@8504 | 369 | <h3 id="box-model"> |
fantasai@8504 | 370 | Generating Ruby Structure</h3> |
fantasai@8504 | 371 | |
fantasai@8504 | 372 | <p> |
ishida@1665 | 373 | |
fantasai@8479 | 374 | <h3 id="box-model"> |
fantasai@8479 | 375 | Ruby box model</h3> |
ishida@1665 | 376 | |
ishida@1665 | 377 | <p>In the following description, the elements specified by Ruby |
fantasai@8479 | 378 | Annotation [[RUBY]] are used to describe the box model. As mentioned |
ishida@1665 | 379 | earlier, a user agent can obtain the same results by using the Ruby specific 'display' |
ishida@1665 | 380 | property values. </p> |
ishida@1665 | 381 | |
ishida@1665 | 382 | <p>For a user agent that supports the ruby markup, the ruby structure consists of three or more |
ishida@1665 | 383 | boxes. The outermost container is the <a |
ishida@1665 | 384 | href="http://www.w3.org/TR/ruby/#ruby"><samp>ruby</samp></a> element itself. |
ishida@1665 | 385 | In the simple case, it is a container for two non-overlapping boxes: the ruby |
ishida@1665 | 386 | text box (<a href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element) |
ishida@1665 | 387 | and the ruby base box (<a |
ishida@1665 | 388 | href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element). The |
ishida@1665 | 389 | positioning of these two boxes relative to each other is controlled by the <a |
ishida@1665 | 390 | href="#rubypos">'ruby-position'</a> property.</p> |
ishida@1665 | 391 | |
ishida@1665 | 392 | <div class="figure"> |
ishida@1665 | 393 | <img class="example" width="223" height="93" |
ishida@1665 | 394 | 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 | 395 | src="images/r-box-t.gif" /> |
ishida@1665 | 396 | |
ishida@1665 | 397 | <p><b>Figure 3.2.1</b>: Ruby box model (simple case)</p> |
ishida@1665 | 398 | </div> |
ishida@1665 | 399 | |
ishida@1665 | 400 | <p>In the case of complex ruby, the ruby element is a container for two or |
ishida@1665 | 401 | three non-overlapping boxes: one ruby base collection (<a |
ishida@1665 | 402 | href="http://www.w3.org/TR/ruby/#rbc"><samp>rbc</samp></a> element), and one |
ishida@1665 | 403 | or two ruby text collections (<a |
ishida@1665 | 404 | href="http://www.w3.org/TR/ruby/#rtc"><samp>rtc</samp></a> element). The |
ishida@1665 | 405 | <samp>rbc</samp> element is itself a container for one or several ruby base |
ishida@1665 | 406 | box (<samp>rb</samp> element), while each <samp>rtc</samp> element is a |
ishida@1665 | 407 | container for one or several ruby text box (rt element). The position of the |
ishida@1665 | 408 | <samp>rtc</samp> element in relation to the related <samp>rbc</samp> element |
ishida@1665 | 409 | is controlled by the <a href="#rubypos">'ruby-position'</a> property. The two |
ishida@1665 | 410 | following figures show examples of these complex ruby.</p> |
ishida@1665 | 411 | |
ishida@1665 | 412 | <div class="figure"> |
ishida@1666 | 413 | <img src="images/r-box-g.gif" |
ishida@1665 | 414 | alt="Diagram of a group ruby with a full ruby text above and partial ruby text below" width="408" height="170" /> |
ishida@1665 | 415 | |
ishida@1665 | 416 | <p><b>Figure 3.2.2</b>: Ruby box model (complex ruby with an empty rt element |
ishida@1665 | 417 | after)</p> |
ishida@1665 | 418 | </div> |
ishida@1665 | 419 | |
ishida@1665 | 420 | <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 | 421 | being empty, the empty <samp>rt</samp> element corresponds to the first part |
ishida@1665 | 422 | of the ruby base collection (the first part is identified by the first <samp>rb</samp> element |
ishida@1665 | 423 | within the <samp> rbc</samp> element).</p> |
ishida@1665 | 424 | |
ishida@1665 | 425 | <div class="figure"> |
ishida@1666 | 426 | <img src="images/r-box-h.gif" |
ishida@1665 | 427 | alt="Diagram of a group ruby with a spanning ruby text above and partial ruby text below" width="400" height="173" /> |
ishida@1665 | 428 | |
ishida@1665 | 429 | <p><b>Figure 3.2.3</b>: Ruby box model (complex ruby with a spanning ruby text |
ishida@1665 | 430 | element)</p> |
ishida@1665 | 431 | </div> |
ishida@1665 | 432 | |
ishida@1665 | 433 | <p>In the example above, the ruby text before (above) the ruby bases spans the whole ruby base collection. The |
ishida@1665 | 434 | ruby text after (below) the ruby bases still contain two <samp>rt</samp> elements, one of |
ishida@1665 | 435 | which is empty. The spanning behavior of <samp>rt</samp> text elements is |
ishida@1665 | 436 | controlled by the <a |
ishida@1665 | 437 | href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute in a |
ishida@1665 | 438 | way similar to the <samp>colspan</samp> attribute used for table column.</p> |
ishida@1665 | 439 | |
ishida@1665 | 440 | <p class="issue"><span class="issuehead">Issue: </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 | 441 | <p class="note"><span class="note-label">Note:</span> The visual description of the ruby elements does not refer |
ishida@1665 | 442 | necessarily to the logical orders of the elements</p> |
ishida@1665 | 443 | |
ishida@1665 | 444 | <p>The width of the ruby box is by default determined by its widest child |
ishida@1665 | 445 | element, whose width in turn is determined by its content. The width of all direct |
ishida@1665 | 446 | children of the <samp>ruby</samp> element is the width of the widest children. In this respect, the ruby |
ishida@1665 | 447 | box is much like a two or three row <samp>table</samp> element, with the |
ishida@1665 | 448 | following exceptions:</p> |
ishida@1665 | 449 | <ul> |
ishida@1665 | 450 | <li>the ruby box is an inline element, like an image, even though it itself, |
ishida@1665 | 451 | like a table, is a container of other boxes</li> |
ishida@1665 | 452 | <li>the equivalent of the cells: the <samp>rb</samp> element and the |
ishida@1665 | 453 | <samp>rt</samp> text element can only contain inline-level elements.</li> |
ishida@1665 | 454 | <li>the content of each 'cell' is always measured at its maximum width</li> |
ishida@1665 | 455 | <li>unlike a table, a ruby element doesn't have to fit in a line, the ruby |
ishida@1665 | 456 | box may be split into several boxes at line boundary, depending of the |
ishida@1665 | 457 | spanning of the ruby texts. This is however only possible for the complex |
ishida@1665 | 458 | ruby and can only happen at the boundary of non spanning elements.</li> |
ishida@1665 | 459 | <li>both the ruby text and the ruby base boxes may overlap with adjacent |
ishida@1665 | 460 | text (outside of the ruby element) if an appropriate <a |
ishida@1665 | 461 | href="#rubyover">'ruby-overhang'</a> parameter is set via CSS. Note |
ishida@1665 | 462 | however that the actual content of the ruby base cannot overlap with that |
ishida@1665 | 463 | adjacent text. The distribution of the content of the ruby base within the |
ishida@1665 | 464 | ruby base box is controlled by the <a href="#rubyalign">'ruby-align'</a> |
ishida@1665 | 465 | property.</li> |
ishida@1665 | 466 | </ul> |
ishida@1665 | 467 | |
ishida@1665 | 468 | <p>If the ruby text is not allowed to overhang, then the ruby behaves like a |
ishida@1665 | 469 | traditional box, i.e. only its contents are rendered within its boundaries and |
ishida@1665 | 470 | adjacent elements do not cross the box boundary:</p> |
ishida@1665 | 471 | |
ishida@1665 | 472 | <div class="figure"> |
ishida@1665 | 473 | <p><img class="example" width="220" height="91" |
ishida@1665 | 474 | alt="Diagram showing the ruby boxes interacting with adjacent text" |
ishida@1666 | 475 | src="images/ro-n.gif" /></p> |
ishida@1665 | 476 | |
ishida@1665 | 477 | <p><b>Figure 3.2.4</b>: Simple ruby whose text is not allowed to overhang |
ishida@1665 | 478 | adjacent text</p> |
ishida@1665 | 479 | </div> |
ishida@1665 | 480 | |
ishida@1665 | 481 | <p>However, if ruby text is allowed to overhang adjacent elements and it |
ishida@1665 | 482 | happens to be wider than its base, then the adjacent content is partially |
ishida@1665 | 483 | rendered within the area of the ruby base box, while the ruby text may be |
ishida@1665 | 484 | partially overlapping with the upper blank parts of the adjacent content:</p> |
ishida@1665 | 485 | |
ishida@1665 | 486 | <div class="figure"> |
ishida@1665 | 487 | <p><img class="example" width="177" height="91" |
ishida@1665 | 488 | alt="Diagram showing the ruby boxes interacting with adjacent text" |
ishida@1666 | 489 | src="images/ro-a.gif" /></p> |
ishida@1665 | 490 | |
ishida@1665 | 491 | <p><b>Figure 3.2.5</b>: Simple ruby whose text is allowed to overhang adjacent |
ishida@1665 | 492 | text</p> |
ishida@1665 | 493 | </div> |
ishida@1665 | 494 | |
ishida@1665 | 495 | <p>The ruby text related to a ruby base can never overhang another ruby |
ishida@1665 | 496 | base.</p> |
ishida@1665 | 497 | |
ishida@1665 | 498 | <p>The alignment of the contents of the base or the ruby text is not affected |
ishida@1665 | 499 | by the overhanging behavior. The alignment is achieved the same way regardless |
ishida@1665 | 500 | of the overhang behavior setting and it is computed before the space available |
ishida@1665 | 501 | for overlap is determined. It is controlled by the <a |
ishida@1665 | 502 | href="#rubyalign">'ruby-align'</a> property.</p> |
ishida@1665 | 503 | |
ishida@1665 | 504 | <p>The exact circumstances in which the ruby text will overhang other |
ishida@1665 | 505 | elements, and to what degree it will do so, will be controlled by the <a |
ishida@1665 | 506 | href="#rubyover">'ruby-overhang'</a> property.</p> |
ishida@1665 | 507 | |
ishida@1665 | 508 | <p>This entire logic applies the same way in vertical ideographic layout, only |
ishida@1665 | 509 | the dimension in which it works in such a layout is vertical, instead of |
ishida@1665 | 510 | horizontal.</p> |
ishida@1665 | 511 | |
fantasai@8479 | 512 | <p class="note"><span class="note-label">Note:</span> Because the purpose of the XHTML <samp>rp</samp> element |
fantasai@8479 | 513 | [[RUBY]] is to allow pre-existing user agents |
ishida@1665 | 514 | to parenthesize ruby text content, an XHTML user agent should use a styling rule |
ishida@1665 | 515 | for these elements that avoids rendering them such as <samp>rp {display: |
ishida@1665 | 516 | none}</samp>.</p> |
ishida@1665 | 517 | |
fantasai@8479 | 518 | <h3 id="ruby-line-height"> |
fantasai@8479 | 519 | Ruby box and line stacking</h3> |
ishida@1665 | 520 | |
ishida@1665 | 521 | <p>The interaction of the ruby box and line stacking is controlled by the |
ishida@1665 | 522 | 'line-stacking-ruby' property described in the CSS3 Line Module. That property |
ishida@1665 | 523 | takes two values: 'include-ruby' and 'exclude-ruby. Depending on the property |
ishida@1665 | 524 | value, the ruby box is considered or excluded for line stacking. Even if the |
ishida@1665 | 525 | ruby box is considered for line stacking, some values of the |
ishida@1665 | 526 | 'line-stacking-strategy' property (also described in the CSS3 Line module) can |
ishida@1665 | 527 | still create occurrences where a the ruby box will eventually be ignored (e.g. |
ishida@1665 | 528 | case where the 'line-stacking-strategy' value is 'block-line-height').</p> |
ishida@1665 | 529 | |
ishida@1665 | 530 | <p>In the following figure, each line box is shown with leading space |
ishida@1665 | 531 | distributed before and after the two text segments ('Previous line' and 'Ruby |
ishida@1665 | 532 | base'); the dotted lines show the line box for each line. The |
ishida@1665 | 533 | 'line-stacking-ruby' property is set to 'exclude-ruby'. The achieved effect is |
ishida@1665 | 534 | that the ruby box does not affect the line to line spacing. It is however the |
ishida@1665 | 535 | responsibility of the style author to avoid 'bleeding' effects between the ruby |
ishida@1665 | 536 | text and the surrounding text of images.</p> |
ishida@1665 | 537 | |
ishida@1665 | 538 | <div class="figure"> |
ishida@1665 | 539 | <p> |
ishida@1665 | 540 | <img class="example" |
ishida@1665 | 541 | alt="Diagram showing the ruby text using 2 half leading" |
ishida@1666 | 542 | src="images/rlh-a.gif" width="210" height="138" /></p> |
ishida@1665 | 543 | |
ishida@1665 | 544 | <p><b>Figure 3.3.1</b>: Excluded Ruby text</p> |
ishida@1665 | 545 | </div> |
ishida@1665 | 546 | |
ishida@1665 | 547 | |
ishida@1665 | 548 | <p>In the following figure, the line boxes have no extra leading space. The |
ishida@1665 | 549 | 'line-stacking-ruby' property is set to 'include-ruby' and the |
ishida@1665 | 550 | 'line-stacking-strategy' property is set to a value where inline boxes are |
ishida@1665 | 551 | considered for line stacking. In this case, the line box with |
ishida@1665 | 552 | the ruby text is affected and has its 'stack-height' increased by the amount |
ishida@1665 | 553 | necessary to fit the ruby text.</p> |
ishida@1665 | 554 | |
ishida@1665 | 555 | <div class="figure"> |
ishida@1665 | 556 | <p> |
ishida@1665 | 557 | <img class="example" |
ishida@1665 | 558 | alt="Diagram showing the ruby text expanding above base text" |
ishida@1666 | 559 | src="images/rlh-b.gif" width="210" height="111" /></p> |
ishida@1665 | 560 | |
ishida@1665 | 561 | <p><b>Figure 3.3.2</b>: Ruby text increasing line height</p> |
ishida@1665 | 562 | </div> |
ishida@1665 | 563 | <p>This mechanism allows rendering of evenly spaced lines of text within a |
ishida@1665 | 564 | block-level element, whether a line contains ruby or not. The authors need |
ishida@1665 | 565 | only to set for the block-level element a line height value larger than the |
ishida@1665 | 566 | computed line-height of the largest ruby element within the block.</p> |
ishida@1665 | 567 | |
fantasai@8479 | 568 | <h3 id="ruby-line-breaking"> |
fantasai@8479 | 569 | Ruby box and line breaking</h3> |
ishida@1665 | 570 | |
ishida@1665 | 571 | <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 | 572 | |
ishida@1665 | 573 | <p> |
ishida@1665 | 574 | <img class="example" |
ishida@1665 | 575 | alt="Diagram showing the line breaking opportunity in a complex ruby" |
ishida@1666 | 576 | src="images/r-break-a.gif" width="408" height="201" /></p> |
ishida@1665 | 577 | |
ishida@1665 | 578 | <p><b>Figure 3.4.1</b>: Complex ruby line breaking opportunity</p> |
ishida@1665 | 579 | |
ishida@1665 | 580 | <p> |
ishida@1665 | 581 | <img class="example" |
ishida@1665 | 582 | alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby' |
ishida@1666 | 583 | src="images/r-break-b.gif" width="300" height="90" /></p> |
ishida@1665 | 584 | |
ishida@1665 | 585 | <p><b>Figure 3.4.1</b>: "Bopomofo" ruby line breaking opportunity</p> |
ishida@2228 | 586 | <p class="issue"><span class="issuehead">Issue: </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 "butterfly", the fact that we have added ruby annotations should not cause a line breaking opportunity to be present between "butter" and "fly" </p> |
fantasai@8479 | 587 | <h2 id="ruby-props"> |
fantasai@8479 | 588 | Ruby Properties</h2> |
ishida@1665 | 589 | |
fantasai@8479 | 590 | <h3 id="rubypos"> |
fantasai@8479 | 591 | Ruby positioning: the 'ruby-position' property</h3> |
ishida@1665 | 592 | |
kojiishi@8496 | 593 | <table class="propdef"> |
kojiishi@8496 | 594 | <tr> |
kojiishi@8496 | 595 | <th>Name: |
kojiishi@8496 | 596 | <td><dfn>ruby-position</dfn> |
kojiishi@8496 | 597 | <tr> |
kojiishi@8496 | 598 | <th><a href="#values">Value</a>: |
kojiishi@8496 | 599 | <td>[ over | under | inter-character ] && [ right | left ] |
kojiishi@8496 | 600 | <tr> |
kojiishi@8496 | 601 | <th>Initial: |
kojiishi@8496 | 602 | <td>over right |
kojiishi@8496 | 603 | <tr> |
kojiishi@8496 | 604 | <th>Applies to: |
kojiishi@8496 | 605 | <td>the parent of elements with display: ruby-text. |
kojiishi@8496 | 606 | <tr> |
kojiishi@8496 | 607 | <th>Inherited: |
kojiishi@8496 | 608 | <td>yes |
kojiishi@8496 | 609 | <tr> |
kojiishi@8496 | 610 | <th>Percentages: |
kojiishi@8496 | 611 | <td>N/A |
kojiishi@8496 | 612 | <tr> |
kojiishi@8496 | 613 | <th>Media: |
kojiishi@8496 | 614 | <td>visual |
kojiishi@8496 | 615 | <tr> |
kojiishi@8496 | 616 | <th>Computed value: |
kojiishi@8496 | 617 | <td>specified value (except for initial and inherit) |
kojiishi@8496 | 618 | <tr> |
kojiishi@8496 | 619 | <th>Animatable: |
kojiishi@8496 | 620 | <td>no |
kojiishi@8496 | 621 | <tr> |
kojiishi@8496 | 622 | <th>Canonical order: |
kojiishi@8496 | 623 | <td><abbr title="follows order of property value definition">per grammar</abbr> |
kojiishi@8496 | 624 | </table> |
kojiishi@8496 | 625 | <p class="issue"><span class="issuehead">Issue: </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 | 626 | <p>This property is used by the parent of elements with display: ruby-text to |
kojiishi@8496 | 627 | control the position of the ruby text with respect to its base. Such parents |
kojiishi@8496 | 628 | are typically either the <samp>ruby</samp> element itself (simple ruby) or the |
kojiishi@8496 | 629 | <samp>rtc</samp> element (complex ruby). This assures that all parts of a <samp>rtc</samp> |
kojiishi@8496 | 630 | element will be displayed in the same position. Possible values:</p> |
kojiishi@8496 | 631 | <p class="issue"><span class="issuehead">Issue-107: </span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=ruby-position%3A+undesirable+default+value+%27before%27+for+complex+ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=www-style&resultsperpage=20&sortby=date">this thread</a> and <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=Styling+of+complex+Ruby&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-grp=Public__FULL&index-type=t&type-index=public-i18n-core&resultsperpage=20&sortby=date">this one</a>.</p> |
kojiishi@8496 | 632 | <dl> |
kojiishi@8496 | 633 | <dt><dfn title="ruby-position:over">''over''</dfn></dt> |
kojiishi@8496 | 634 | <dd>The ruby text appears over the base in horizontal text. |
kojiishi@8496 | 635 | This is the most common setting used in ideographic East Asian writing systems. |
kojiishi@8496 | 636 | This is the initial value. |
ishida@1665 | 637 | |
kojiishi@8496 | 638 | <div class="figure"> |
kojiishi@8496 | 639 | <p> |
kojiishi@8496 | 640 | <img |
kojiishi@8496 | 641 | alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base" |
kojiishi@8496 | 642 | src="images/shinkansen-top.gif" width="140" height="33" /></p> |
kojiishi@8496 | 643 | <p><b>Figure 4.1.1</b>: Top ruby in horizontal layout applied to |
kojiishi@8496 | 644 | Japanese text</p> |
kojiishi@8496 | 645 | </div> |
kojiishi@8496 | 646 | </dd> |
ishida@1665 | 647 | |
kojiishi@8496 | 648 | <dt><dfn title="ruby-position:right">''right''</dfn></dt> |
kojiishi@8496 | 649 | <dd>The ruby text appears on the right side of the base in vertical text. |
ishida@1665 | 650 | |
kojiishi@8496 | 651 | <div class="figure"> |
kojiishi@8496 | 652 | <p> |
kojiishi@8496 | 653 | <img |
kojiishi@8496 | 654 | alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base" |
kojiishi@8496 | 655 | src="images/shinkansen-right.gif" width="33" height="141" /></p> |
kojiishi@8496 | 656 | <p><b>Figure 4.1.2</b>: Top ruby in vertical ideographic layout applied |
kojiishi@8496 | 657 | to Japanese text</p> |
kojiishi@8496 | 658 | </div> |
kojiishi@8496 | 659 | </dd> |
ishida@1665 | 660 | |
kojiishi@8496 | 661 | <dt><dfn title="ruby-position:under">''under''</dfn></dt> |
kojiishi@8496 | 662 | <dd>The ruby text appears under the base in horizontal text. |
kojiishi@8496 | 663 | This is a relatively rare setting used in ideographic East Asian writing systems, |
kojiishi@8496 | 664 | most easily found in educational text. |
ishida@1665 | 665 | |
kojiishi@8496 | 666 | <div class="figure"> |
kojiishi@8496 | 667 | <p> |
kojiishi@8496 | 668 | <img |
kojiishi@8496 | 669 | alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base" |
kojiishi@8496 | 670 | src="images/shinkansen-bottom.gif" width="142" height="36" /></p> |
kojiishi@8496 | 671 | <p><b>Figure 4.1.3</b>: Bottom ruby in horizontal layout applied to Japanese text</p> |
kojiishi@8496 | 672 | </div> |
kojiishi@8496 | 673 | </dd> |
ishida@1665 | 674 | |
kojiishi@8496 | 675 | <dt><dfn title="ruby-position:left">''left''</dfn></dt> |
kojiishi@8496 | 676 | <dd>The ruby text appears on the left side of the base in vertical text. |
kojiishi@8496 | 677 | |
kojiishi@8496 | 678 | <div class="figure"> |
kojiishi@8496 | 679 | <p> |
kojiishi@8496 | 680 | <img |
kojiishi@8496 | 681 | alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base" |
kojiishi@8496 | 682 | src="images/shinkansen-left.gif" width="37" height="141" /></p> |
kojiishi@8496 | 683 | <p><b>Figure 4.1.4</b>: Bottom ruby in vertical ideographic layout applied to Japanese text</p> |
kojiishi@8496 | 684 | </div> |
kojiishi@8496 | 685 | </dd> |
kojiishi@8496 | 686 | |
kojiishi@8496 | 687 | <dt><dfn title="ruby-position:inter-character">''inter-character''</dfn></dt> |
kojiishi@8496 | 688 | <dd> |
kojiishi@8496 | 689 | <p class="issue"><span class="issuehead">Issue: </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=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20Vertical+layout+not+enough+for+bopomofo&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a> following a request from the i18n WG.</p> |
kojiishi@8496 | 690 | <p>The ruby text appears on the right of the base in horizontal text. |
kojiishi@8496 | 691 | |
kojiishi@8496 | 692 | <p>This value is provided for the special case of traditional Chinese as used especially in |
kojiishi@8496 | 693 | Taiwan: ruby (made of <a href="#g-bopomofo"><span |
kojiishi@8496 | 694 | lang="zh">bopomofo</span></a> glyphs) in that context appears vertically along |
kojiishi@8496 | 695 | the right side of the base glyph, |
kojiishi@8496 | 696 | even when the layout of the base characters is horizontal:</p> |
kojiishi@8496 | 697 | |
kojiishi@8496 | 698 | <div class="figure"> |
kojiishi@8496 | 699 | <p><img alt="Example of Taiwanese-style ruby" |
kojiishi@8496 | 700 | width="138" height="42" src="images/bopomofo.gif" /></p> |
kojiishi@8496 | 701 | <p><b>Figure 4.1.5</b>: "<span lang="zh">Bopomofo</span>" ruby in |
kojiishi@8496 | 702 | traditional Chinese (ruby text shown in blue for clarity) in horizontal |
kojiishi@8496 | 703 | layout</p> |
kojiishi@8496 | 704 | </div> |
kojiishi@8496 | 705 | <p class="note"><span class="note-label">Note:</span> The bopomofo |
kojiishi@8496 | 706 | transcription is written in the normal way as part of the ruby text. |
kojiishi@8496 | 707 | The user agent is responsible for ensuring the correct relative alignment |
kojiishi@8496 | 708 | and positioning of the glyphs, including those corresponding to the |
kojiishi@8496 | 709 | 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 | 710 | <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 | 711 | <p>It is not defined how a user-agent should handle ruby text that is not bopomofo |
kojiishi@8496 | 712 | when the value of ruby-position is set to 'inter-character'.</p> |
kojiishi@8496 | 713 | <!-- See Taiwanese requirements doc for EPUB at http://epub-revision.googlecode.com/files/EGLS_TW_eng.ppt --> |
kojiishi@8496 | 714 | </dd> |
kojiishi@8496 | 715 | |
kojiishi@8496 | 716 | <!-- |
ishida@3034 | 717 | <dt><strong>inline</strong></dt> |
ishida@1665 | 718 | <dd> |
ishida@3034 | 719 | <p>Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.</p> |
fantasai@8479 | 720 | <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 | 721 | <p class="issue"><span class="issuehead">Issue: </span> Here is a <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20inline+value+description+missing&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">request </a>for this section to be added, from the i18n WG..</p> |
ishida@1665 | 722 | </dd> |
kojiishi@8496 | 723 | --> |
kojiishi@8496 | 724 | </dl> |
ishida@1665 | 725 | |
ishida@1665 | 726 | <p>If two rtc elements are set with the same ruby-position value, (for example |
ishida@1665 | 727 | both 'before'), the relative position of the two elements is undefined. This |
ishida@1665 | 728 | setting should not be used.</p> |
ishida@1665 | 729 | |
kojiishi@8499 | 730 | <h3 id="rubymerge">Ruby merge: the 'ruby-merge' property</h3> |
kojiishi@8499 | 731 | |
kojiishi@8499 | 732 | <table class="propdef"> |
kojiishi@8499 | 733 | <tr> |
kojiishi@8499 | 734 | <th>Name: |
kojiishi@8499 | 735 | <td><dfn>ruby-merge</dfn> |
kojiishi@8499 | 736 | <tr> |
kojiishi@8499 | 737 | <th><a href="#values">Value</a>: |
kojiishi@8499 | 738 | <td>separate | collapse | auto |
kojiishi@8499 | 739 | <tr> |
kojiishi@8499 | 740 | <th>Initial: |
kojiishi@8499 | 741 | <td>separate |
kojiishi@8499 | 742 | <tr> |
kojiishi@8499 | 743 | <th>Applies to: |
kojiishi@8499 | 744 | <td>all elements and generated content |
kojiishi@8499 | 745 | <tr> |
kojiishi@8499 | 746 | <th>Inherited: |
kojiishi@8499 | 747 | <td>yes |
kojiishi@8499 | 748 | <tr> |
kojiishi@8499 | 749 | <th>Percentages: |
kojiishi@8499 | 750 | <td>N/A |
kojiishi@8499 | 751 | <tr> |
kojiishi@8499 | 752 | <th>Media: |
kojiishi@8499 | 753 | <td>visual |
kojiishi@8499 | 754 | <tr> |
kojiishi@8499 | 755 | <th>Computed value: |
kojiishi@8499 | 756 | <td>specified value (except for initial and inherit) |
kojiishi@8499 | 757 | </table> |
kojiishi@8499 | 758 | |
kojiishi@8499 | 759 | <p> |
kojiishi@8499 | 760 | This property controls how ruby annotation boxes should be rendered |
kojiishi@8499 | 761 | when there are more than one in a ruby container box. |
kojiishi@8499 | 762 | </p> |
kojiishi@8499 | 763 | |
kojiishi@8499 | 764 | <p>Possible values:</p> |
kojiishi@8499 | 765 | <dl> |
kojiishi@8499 | 766 | <dt><dfn title="ruby-merge:separate">''separate''</dfn></dt> |
kojiishi@8499 | 767 | <dd> |
kojiishi@8499 | 768 | <p> |
kojiishi@8499 | 769 | Each ruby annotation box is rendered in the same column as its corresponding base box. |
kojiishi@8499 | 770 | This style is called Mono-ruby in [[JLREQ]]. |
kojiishi@8499 | 771 | </p> |
kojiishi@8499 | 772 | |
kojiishi@8499 | 773 | <div class="example"> |
kojiishi@8499 | 774 | <p>The following two markups render the same:</p> |
kojiishi@8500 | 775 | <pre><ruby>無<rt>む</ruby><ruby>常<rt>じょう</ruby></pre> |
kojiishi@8499 | 776 | <p>and:</p> |
kojiishi@8500 | 777 | <pre><ruby style="ruby-merge:separate"><rb>無<rb>常<rt>む<rt>じょう</ruby></pre> |
kojiishi@8499 | 778 | </div> |
kojiishi@8499 | 779 | </dd> |
kojiishi@8499 | 780 | |
kojiishi@8499 | 781 | <dt><dfn title="ruby-merge:collapse">''collapse''</dfn></dt> |
kojiishi@8499 | 782 | <dd> |
kojiishi@8499 | 783 | <p> |
kojiishi@8499 | 784 | All ruby annotation boxes are concatenated, |
kojiishi@8499 | 785 | and rendered to the concatenated ruby base boxes. |
kojiishi@8499 | 786 | This style is called Group-ruby in [[JLREQ]]. |
kojiishi@8499 | 787 | </p> |
kojiishi@8499 | 788 | |
kojiishi@8499 | 789 | <div class="example"> |
kojiishi@8499 | 790 | <p>The following two markups render the same:</p> |
kojiishi@8500 | 791 | <pre><ruby>無常<rt>むじょう</ruby></pre> |
kojiishi@8499 | 792 | <p>and:</p> |
kojiishi@8500 | 793 | <pre><ruby style="ruby-merge:collapse"><rb>無<rb>常<rt>む<rt>じょう</ruby></pre> |
kojiishi@8499 | 794 | </div> |
kojiishi@8499 | 795 | </dd> |
kojiishi@8499 | 796 | |
kojiishi@8499 | 797 | <dt><dfn title="ruby-merge:auto">''auto''</dfn></dt> |
kojiishi@8499 | 798 | <dd> |
kojiishi@8499 | 799 | <p> |
kojiishi@8499 | 800 | The user agent may use any algorithm to determine how each ruby annotation box |
kojiishi@8499 | 801 | is rendered to its corresponding base box. |
kojiishi@8499 | 802 | </p> |
kojiishi@8501 | 803 | <div class="example"> |
kojiishi@8499 | 804 | <p> |
kojiishi@8499 | 805 | One possible algorithm is described as Jukugo-ruby in [[JLREQ]]. |
kojiishi@8499 | 806 | </p> |
kojiishi@8499 | 807 | <p> |
kojiishi@8499 | 808 | Another, more simplified algorithm of Jukugo-ruby is |
kojiishi@8499 | 809 | to render as Mono-ruby if all ruby annotation boxes fit within |
kojiishi@8499 | 810 | advances of their corresponding base boxes, |
kojiishi@8499 | 811 | and render as Group-ruby otherwise. |
kojiishi@8499 | 812 | </p> |
kojiishi@8501 | 813 | </div> |
kojiishi@8499 | 814 | </dd> |
kojiishi@8499 | 815 | </dl> |
kojiishi@8499 | 816 | |
fantasai@8479 | 817 | <h3 id="rubyalign"> |
fantasai@8479 | 818 | Ruby alignment: the 'ruby-align' property</h3> |
ishida@1665 | 819 | |
kojiishi@8496 | 820 | <table class="propdef"> |
kojiishi@8496 | 821 | <tr> |
kojiishi@8496 | 822 | <th>Name: |
kojiishi@8496 | 823 | <td><dfn>ruby-align</dfn> |
kojiishi@8496 | 824 | <tr> |
kojiishi@8496 | 825 | <th><a href="#values">Value</a>: |
kojiishi@8496 | 826 | <td>auto | start | center | |
kojiishi@8496 | 827 | distribute-letter | distribute-space |
kojiishi@8496 | 828 | <tr> |
kojiishi@8496 | 829 | <th>Initial: |
kojiishi@8496 | 830 | <td>auto |
kojiishi@8496 | 831 | <tr> |
kojiishi@8496 | 832 | <th>Applies to: |
kojiishi@8496 | 833 | <td>all elements and generated content |
kojiishi@8496 | 834 | <tr> |
kojiishi@8496 | 835 | <th>Inherited: |
kojiishi@8496 | 836 | <td>yes |
kojiishi@8496 | 837 | <tr> |
kojiishi@8496 | 838 | <th>Percentages: |
kojiishi@8496 | 839 | <td>N/A |
kojiishi@8496 | 840 | <tr> |
kojiishi@8496 | 841 | <th>Media: |
kojiishi@8496 | 842 | <td>visual |
kojiishi@8496 | 843 | <tr> |
kojiishi@8496 | 844 | <th>Computed value: |
kojiishi@8496 | 845 | <td>specified value (except for initial and inherit) |
kojiishi@8496 | 846 | </table> |
ishida@1665 | 847 | |
kojiishi@8496 | 848 | <p>This property can be used on any element to control the text alignment of |
kojiishi@8496 | 849 | the ruby text and ruby base contents relative to each other. It applies to all |
kojiishi@8496 | 850 | the rubys in the element. For simple ruby, the alignment is applied to the |
kojiishi@8496 | 851 | ruby child element whose content is shorter: either the <a |
kojiishi@8496 | 852 | href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element or the <a |
kojiishi@8496 | 853 | href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element [[RUBY]]. |
kojiishi@8496 | 854 | For complex ruby, the alignment is also applied to the |
kojiishi@8496 | 855 | ruby child elements whose content is shorter: either the <samp>rb</samp> |
kojiishi@8496 | 856 | element and/or one or two <samp>rt</samp> elements for each related ruby text |
kojiishi@8496 | 857 | and ruby base element within the <samp>rtc</samp> and <samp>rbc</samp> |
kojiishi@8496 | 858 | element.</p> |
ishida@1665 | 859 | |
kojiishi@8496 | 860 | <p>Possible values:</p> |
kojiishi@8496 | 861 | <p class="issue"><span class="issuehead">Issue: </span> Tony Graham has <a href="http://www.w3.org/Style/XSL/Group/FO/wiki/Ruby#Treat_CSS3_.22ruby-align.22_As_Shorthand.3F">suggested </a>that distribute-letter and distribute-space be values of a ruby-group-distribution property, and line-edge be moved to a ruby-alignment-edge property, and that the rest be gathered under a ruby-alignment property. And that ruby-align become a shorthand.</p> |
kojiishi@8496 | 862 | <dl> |
kojiishi@8496 | 863 | <dt><dfn title="ruby-align:auto">''auto''</dfn></dt> |
kojiishi@8496 | 864 | <dd> |
kojiishi@8496 | 865 | <p>The user agent determines how the ruby contents are aligned. |
kojiishi@8496 | 866 | This is the initial value. |
kojiishi@8496 | 867 | The behavior recommended by [[JLREQ]] is for wide-cell ruby to be aligned in the 'distribute-space' mode: |
kojiishi@8496 | 868 | <div class="figure"> |
kojiishi@8496 | 869 | <p><img width="145" height="91" |
kojiishi@8496 | 870 | alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base" |
kojiishi@8496 | 871 | src="images/ra-ds.gif" /><img width="145" height="91" |
kojiishi@8496 | 872 | alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base" |
kojiishi@8496 | 873 | src="images/ra-ds-rb.gif" /></p> |
kojiishi@8496 | 874 | <p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is |
kojiishi@8496 | 875 | 'distribute-space' justified</p> |
kojiishi@8496 | 876 | </div> |
ishida@1665 | 877 | |
kojiishi@8496 | 878 | <p>The recommended behavior for narrow-cell glyph ruby is to be |
kojiishi@8496 | 879 | aligned in the 'center' mode.</p> |
kojiishi@8496 | 880 | <div class="figure"> |
kojiishi@8496 | 881 | <p><img |
kojiishi@8496 | 882 | alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base" |
kojiishi@8496 | 883 | width="145" height="91" |
kojiishi@8496 | 884 | src="images/ra-c-h.gif" /><img |
kojiishi@8496 | 885 | alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base" |
kojiishi@8496 | 886 | width="145" height="91" |
kojiishi@8496 | 887 | src="images/ra-c-rb-h.gif" /></p> |
kojiishi@8496 | 888 | <p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment |
kojiishi@8496 | 889 | is centered</p> |
kojiishi@8496 | 890 | </div> |
kojiishi@8496 | 891 | </dd> |
ishida@1665 | 892 | |
kojiishi@8496 | 893 | <dt><dfn title="ruby-align:start">''start''</dfn></dt> |
kojiishi@8496 | 894 | <dd>The ruby text content is aligned with the start edge of the base. |
kojiishi@8496 | 895 | <p class="issue"><span class="issuehead">Issue: </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=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a>.</p> |
ishida@1665 | 896 | |
kojiishi@8496 | 897 | <div class="figure"> |
kojiishi@8496 | 898 | <p><img |
kojiishi@8496 | 899 | alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base" |
kojiishi@8496 | 900 | width="145" height="91" src="images/ra-l.gif" /><img |
kojiishi@8496 | 901 | width="145" height="91" |
kojiishi@8496 | 902 | alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base" |
kojiishi@8496 | 903 | src="images/ra-l-rb.gif" /></p> |
kojiishi@8496 | 904 | <p><b>Figure 4.2.3</b>: Start ruby alignment</p> |
kojiishi@8496 | 905 | </div> |
kojiishi@8496 | 906 | </dd> |
kojiishi@8496 | 907 | |
kojiishi@8496 | 908 | <dt><dfn title="ruby-align:center">''center''</dfn></dt> |
kojiishi@8496 | 909 | <dd>The ruby text content is centered within the width of the base. If the |
kojiishi@8496 | 910 | length of the base is smaller than the length of the ruby text, then the |
kojiishi@8496 | 911 | base is centered within the width of the ruby text. |
kojiishi@8496 | 912 | |
kojiishi@8496 | 913 | <div class="figure"> |
kojiishi@8496 | 914 | <p><img width="145" height="91" |
kojiishi@8496 | 915 | alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base" |
kojiishi@8496 | 916 | src="images/ra-c.gif" /><img width="145" height="91" |
kojiishi@8496 | 917 | alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base" |
kojiishi@8496 | 918 | src="images/ra-c-rb.gif" /></p> |
kojiishi@8496 | 919 | <p><b>Figure 4.2.4</b>: Center ruby alignment</p> |
kojiishi@8496 | 920 | </div> |
kojiishi@8496 | 921 | </dd> |
kojiishi@8496 | 922 | |
kojiishi@8496 | 923 | <!-- |
ishida@1665 | 924 | <dt><strong>right</strong></dt> |
ishida@1665 | 925 | <dd>The ruby text content is aligned with the end edge of the base. |
ishida@3034 | 926 | <p class="issue"><span class="issuehead">Issue: </span> The i18n WG feels that end and right should not be synonymous, and proposed to drop right (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&index-grp=Member__FULL+Public__FULL&index-type=t&type-index=public-i18n-core%40w3.org&resultsperpage=20&sortby=date">this thread</a>.</p> |
ishida@1665 | 927 | <div class="figure"> |
ishida@1665 | 928 | <p><img class="example" width="145" height="91" |
ishida@1665 | 929 | alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base" |
ishida@1666 | 930 | src="images/ra-r.gif" /><img class="example" width="145" height="91" |
ishida@1665 | 931 | alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base" |
ishida@1666 | 932 | src="images/ra-r-rb.gif" /></p> |
ishida@1665 | 933 | <p><b>Figure 4.2.5</b>: End ruby alignment</p> |
ishida@1665 | 934 | </div> |
ishida@1665 | 935 | </dd> |
kojiishi@8496 | 936 | --> |
ishida@1665 | 937 | |
kojiishi@8496 | 938 | <dt><dfn title="ruby-align:distribute-letter">''distribute-letter''</dfn></dt> |
kojiishi@8496 | 939 | <dd>If the width of the ruby text is smaller than that of the base, then |
kojiishi@8496 | 940 | the ruby text contents are evenly distributed across the width of the |
kojiishi@8496 | 941 | base, with the first and last ruby text glyphs lining up with the |
kojiishi@8496 | 942 | corresponding first and last base glyphs. If the width of the ruby text |
kojiishi@8496 | 943 | is at least the width of the base, then the letters of the base are |
kojiishi@8496 | 944 | evenly distributed across the width of the ruby text. |
kojiishi@8496 | 945 | |
kojiishi@8496 | 946 | <div class="figure"> |
kojiishi@8496 | 947 | <p><img width="145" height="91" |
kojiishi@8496 | 948 | alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base" |
kojiishi@8496 | 949 | src="images/ra-dl.gif" /><img width="145" height="91" |
kojiishi@8496 | 950 | alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base" |
kojiishi@8496 | 951 | src="images/ra-dl-rb.gif" /></p> |
kojiishi@8496 | 952 | <p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p> |
kojiishi@8496 | 953 | </div> |
kojiishi@8496 | 954 | </dd> |
kojiishi@8496 | 955 | |
kojiishi@8496 | 956 | <dt><dfn title="ruby-align:distribute-space">''distribute-space''</dfn></dt> |
kojiishi@8496 | 957 | <dd>If the width of the ruby text is smaller than that of the base, then |
kojiishi@8496 | 958 | the ruby text contents are evenly distributed across the width of the |
kojiishi@8496 | 959 | base, with a certain amount of white space preceding the first and |
kojiishi@8496 | 960 | following the last character in the ruby text. That amount of white |
kojiishi@8496 | 961 | space is normally equal to half the amount of inter-character space of |
kojiishi@8496 | 962 | the ruby text. If the width of the ruby text is at least the width of |
kojiishi@8496 | 963 | the base, then the same type of space distribution applies to the base. |
kojiishi@8496 | 964 | In other words, if the base is shorter than the ruby text, the base is |
kojiishi@8496 | 965 | distribute-space aligned. This type of alignment |
kojiishi@8496 | 966 | is described by [[JLREQ]]. |
kojiishi@8496 | 967 | |
kojiishi@8496 | 968 | <div class="figure"> |
kojiishi@8496 | 969 | <p><img width="145" height="91" |
kojiishi@8496 | 970 | alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base" |
kojiishi@8496 | 971 | src="images/ra-ds.gif" /><img width="145" height="91" |
kojiishi@8496 | 972 | alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base" |
kojiishi@8496 | 973 | src="images/ra-ds-rb.gif" /></p> |
kojiishi@8496 | 974 | <p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p> |
kojiishi@8496 | 975 | </div> |
kojiishi@8496 | 976 | </dd> |
kojiishi@8496 | 977 | |
kojiishi@8496 | 978 | <!-- |
ishida@1665 | 979 | <dt><strong>line-edge</strong></dt> |
ishida@1665 | 980 | <dd>If the ruby text is not adjacent to a line edge, it is aligned as in |
ishida@1665 | 981 | 'auto'. If it is adjacent to a line edge, then it is still aligned as in |
ishida@1665 | 982 | auto, but the side of the ruby text that touches the end of the line is |
ishida@1665 | 983 | lined up with the corresponding edge of the base. This type of alignment |
fantasai@8479 | 984 | is described by [[JLREQ]]. This type of alignment is |
ishida@1665 | 985 | relevant only to the scenario where the ruby text is longer than the |
ishida@1665 | 986 | ruby base. In the other scenarios, this is just 'auto'. |
ishida@1665 | 987 | <div class="figure"> |
ishida@1665 | 988 | <p><img class="example" width="146" height="109" |
ishida@1665 | 989 | alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base" |
ishida@1666 | 990 | src="images/ra-le-l.gif" /><img class="example" width="146" |
ishida@1665 | 991 | height="110" |
ishida@1665 | 992 | alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base" |
ishida@1666 | 993 | src="images/ra-le-r.gif" /></p> |
ishida@1665 | 994 | <p><b>Figure 4.2.8</b>: Line edge ruby alignment</p> |
ishida@1665 | 995 | </div> |
ishida@1665 | 996 | </dd> |
kojiishi@8496 | 997 | --> |
kojiishi@8496 | 998 | </dl> |
ishida@1665 | 999 | |
kojiishi@8496 | 1000 | <p>For a complex ruby with spanning elements, one additional consideration is |
kojiishi@8496 | 1001 | required. If the spanning element spans multiple 'rows' (other rbc or rtc |
kojiishi@8496 | 1002 | elements), and the ruby alignment requires space distribution among the |
kojiishi@8496 | 1003 | 'spanned' elements, a ratio must be determined among the 'columns' of spanned |
kojiishi@8496 | 1004 | elements. This ratio is computed by taking into consideration the widest |
kojiishi@8496 | 1005 | element within each column.</p> |
ishida@1665 | 1006 | |
kojiishi@8502 | 1007 | <h2 id="rubyover"> |
kojiishi@8502 | 1008 | Ruby Overhang and Edge Effects</h2> |
kojiishi@8502 | 1009 | |
kojiishi@8502 | 1010 | <p> |
kojiishi@8502 | 1011 | When <i>ruby annotation box</i> is longer than its corresponding <i>ruby base box</i>, |
kojiishi@8502 | 1012 | the <i>ruby annotation box</i> may partially overhang adjacent boxes. |
kojiishi@8502 | 1013 | </p> |
kojiishi@8502 | 1014 | <p> |
kojiishi@8502 | 1015 | This level of the specificaiton does not define |
kojiishi@8503 | 1016 | how much the overhang may be allowed, and under what conditions. |
kojiishi@8502 | 1017 | </p> |
kojiishi@8502 | 1018 | <div class="example"> |
kojiishi@8502 | 1019 | <p> |
kojiishi@8502 | 1020 | The user agent may use [[JIS4051]] recommendation of |
kojiishi@8502 | 1021 | using one ruby text character length as the maximum overhang length. |
kojiishi@8502 | 1022 | Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [[JLREQ]]. |
kojiishi@8502 | 1023 | </p> |
kojiishi@8502 | 1024 | </div> |
kojiishi@8502 | 1025 | |
kojiishi@8502 | 1026 | <p> |
kojiishi@8502 | 1027 | When such <i>ruby annotation box</i> is at the start or end edge of a line, |
kojiishi@8502 | 1028 | user agent may align the side of the ruby text that touches the edge of the line |
kojiishi@8502 | 1029 | to the corresponding edge of the base. |
kojiishi@8502 | 1030 | This type of alignment is described by [[JLREQ]]. |
kojiishi@8502 | 1031 | </p> |
kojiishi@8502 | 1032 | <p> |
kojiishi@8502 | 1033 | This level of the specificaiton does not provide a mechanism to control this behavior. |
kojiishi@8502 | 1034 | </p> |
kojiishi@8502 | 1035 | <div class="figure"> |
kojiishi@8502 | 1036 | <p><img width="146" height="109" |
kojiishi@8502 | 1037 | alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base" |
kojiishi@8502 | 1038 | src="images/ra-le-l.gif" /><img width="146" |
kojiishi@8502 | 1039 | height="110" |
kojiishi@8502 | 1040 | alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base" |
kojiishi@8502 | 1041 | src="images/ra-le-r.gif" /></p> |
kojiishi@8502 | 1042 | <p><b>Figure 4.2.8</b>: Line edge ruby alignment</p> |
kojiishi@8502 | 1043 | </div> |
kojiishi@8502 | 1044 | |
kojiishi@8496 | 1045 | <!-- |
fantasai@8479 | 1046 | <h3 id="rubyover"> |
fantasai@8479 | 1047 | Ruby overhanging: the 'ruby-overhang' property</h3> |
ishida@1665 | 1048 | |
fantasai@8479 | 1049 | <table class="propdef"> |
fantasai@8479 | 1050 | <tr> |
fantasai@8479 | 1051 | <th>Name: |
fantasai@8479 | 1052 | <td><dfn>ruby-overhang</dfn> |
fantasai@8479 | 1053 | <tr> |
fantasai@8479 | 1054 | <th>Value: |
fantasai@8479 | 1055 | <td>auto | start | end | none |
fantasai@8479 | 1056 | <tr> |
fantasai@8479 | 1057 | <th>Initial: |
fantasai@8479 | 1058 | <td>none |
fantasai@8479 | 1059 | <tr> |
fantasai@8479 | 1060 | <th>Applies to: |
fantasai@8479 | 1061 | <td>the parent of elements with display: ruby-text |
fantasai@8479 | 1062 | <tr> |
fantasai@8479 | 1063 | <th>Inherited: |
fantasai@8479 | 1064 | <td>yes |
fantasai@8479 | 1065 | <tr> |
fantasai@8479 | 1066 | <th>Percentages: |
fantasai@8479 | 1067 | <td>N/A |
fantasai@8479 | 1068 | <tr> |
fantasai@8479 | 1069 | <th>Media: |
fantasai@8479 | 1070 | <td>visual |
fantasai@8479 | 1071 | <tr> |
fantasai@8479 | 1072 | <th>Computed value: |
fantasai@8479 | 1073 | <td>specified value (except for initial and inherit) |
fantasai@8479 | 1074 | </table> |
ishida@1665 | 1075 | |
ishida@1665 | 1076 | <p>This property determines whether, and on which side, ruby text is allowed |
ishida@1665 | 1077 | to partially overhang any adjacent text in addition to its own base, when the |
ishida@1665 | 1078 | ruby text is wider than the ruby base. Note that ruby text is never allowed to |
ishida@1665 | 1079 | overhang glyphs belonging to another ruby base. <span class="issue"><span class="issuehead">Issue: </span> This rule must be broken if we are to allow support for jukugo ruby.</span> Also the user agent is free to assume |
ishida@1665 | 1080 | a maximum amount by which ruby text may overhang adjacent text. The user agent may use |
fantasai@8479 | 1081 | the [[JIS4051]] recommendation of using one ruby text character |
fantasai@8479 | 1082 | 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 | 1083 | |
ishida@1665 | 1084 | <p>Possible values:</p> |
ishida@1665 | 1085 | <dl> |
ishida@1665 | 1086 | <dt><strong>auto</strong></dt> |
fantasai@8479 | 1087 | <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 | 1088 | ruby text can overhang. The user agent is free to follow those recommendations or specify its own classes of |
ishida@1665 | 1089 | characters to overhang. This is the initial value. |
ishida@1665 | 1090 | <div class="figure"> |
ishida@1665 | 1091 | <p><img class="example" width="177" height="91" |
ishida@1666 | 1092 | alt="Diagram of glyph layout in overhanging ruby" src="images/ro-a.gif" /></p> |
ishida@1665 | 1093 | <p><b>Figure 4.3.1</b>: Ruby overhanging adjacent text</p> |
ishida@1665 | 1094 | </div> |
ishida@1665 | 1095 | </dd> |
ishida@1665 | 1096 | <dt><strong>start</strong></dt> |
ishida@3034 | 1097 | <dd>The ruby text can only overhang the text that precedes it. That means, for |
ishida@3034 | 1098 | example, that ruby cannot overhang text that is to the right of it in |
ishida@3034 | 1099 | horizontal LTR layout, and it cannot overhang text that is below it in |
ishida@1665 | 1100 | vertical-ideographic layout. |
ishida@1665 | 1101 | <div class="figure"> |
ishida@1665 | 1102 | <p><img class="example" width="199" height="91" |
ishida@1665 | 1103 | alt="Diagram of glyph layout when ruby overhangs the preceding glyphs only" |
ishida@1666 | 1104 | src="images/ro-s.gif" /></p> |
ishida@1665 | 1105 | <p><b>Figure 4.3.2</b>: Ruby overhanging preceding text only</p> |
ishida@1665 | 1106 | </div> |
ishida@1665 | 1107 | </dd> |
ishida@1665 | 1108 | <dt><strong>end</strong></dt> |
ishida@3034 | 1109 | <dd>The ruby text can only overhang the text that follows it. That means, for |
ishida@3034 | 1110 | example, that ruby cannot overhang text that is to the left of it in |
ishida@3034 | 1111 | horizontal LTR layout, and it cannot overhang text that is above it in |
ishida@1665 | 1112 | vertical-ideographic layout. |
ishida@1665 | 1113 | <div class="figure"> |
ishida@1665 | 1114 | <p><img class="example" width="198" height="91" |
ishida@1665 | 1115 | alt="Diagram of glyph layout when ruby overhangs the following characters only" |
ishida@1666 | 1116 | src="images/ro-e.gif" /></p> |
ishida@1665 | 1117 | <p><b>Figure 4.3.3</b>: Ruby overhanging following text only</p> |
ishida@1665 | 1118 | </div> |
ishida@1665 | 1119 | </dd> |
ishida@1665 | 1120 | <dt><strong>none</strong></dt> |
ishida@1665 | 1121 | <dd>The ruby text cannot overhang any text adjacent to its base, only its |
ishida@1665 | 1122 | own base. |
ishida@1665 | 1123 | |
ishida@1665 | 1124 | <div class="figure"> |
ishida@1665 | 1125 | <p><img class="example" width="220" height="91" |
ishida@1665 | 1126 | alt="Diagram of glyph layout in non-overhanging ruby" |
ishida@1666 | 1127 | src="images/ro-n.gif" /></p> |
ishida@1665 | 1128 | <p><b>Figure 4.3.4</b>: Ruby not allowed to overhang adjacent text</p> |
ishida@1665 | 1129 | </div> |
ishida@1665 | 1130 | </dd> |
ishida@1665 | 1131 | </dl> |
ishida@1665 | 1132 | |
fantasai@8479 | 1133 | <h3 id="rubyspan"> |
fantasai@8479 | 1134 | Ruby annotation spanning: the 'ruby-span' property</h3> |
ishida@1665 | 1135 | |
fantasai@8479 | 1136 | <table class="propdef"> |
fantasai@8479 | 1137 | <tr> |
fantasai@8479 | 1138 | <th>Name: |
fantasai@8479 | 1139 | <td><dfn>ruby-span</dfn> |
fantasai@8479 | 1140 | <tr> |
fantasai@8479 | 1141 | <th>Value: |
fantasai@8479 | 1142 | <td>attr(x) | none |
fantasai@8479 | 1143 | <tr> |
fantasai@8479 | 1144 | <th>Initial: |
fantasai@8479 | 1145 | <td>none |
fantasai@8479 | 1146 | <tr> |
fantasai@8479 | 1147 | <th>Applies to: |
fantasai@8479 | 1148 | <td>elements with display: ruby-text |
fantasai@8479 | 1149 | <tr> |
fantasai@8479 | 1150 | <th>Inherited: |
fantasai@8479 | 1151 | <td>no |
fantasai@8479 | 1152 | <tr> |
fantasai@8479 | 1153 | <th>Percentages: |
fantasai@8479 | 1154 | <td>N/A |
fantasai@8479 | 1155 | <tr> |
fantasai@8479 | 1156 | <th>Media: |
fantasai@8479 | 1157 | <td>visual |
fantasai@8479 | 1158 | <tr> |
fantasai@8479 | 1159 | <th>Computed value: |
fantasai@8479 | 1160 | <td><number> |
fantasai@8479 | 1161 | </table> |
ishida@1665 | 1162 | |
ishida@1665 | 1163 | <p>This property controls the spanning behavior of annotation elements. </p> |
ishida@1665 | 1164 | |
ishida@1665 | 1165 | <p class="note"><span class="note-label">Note:</span> A XHTML user agent may also use the <samp>rbspan</samp> |
ishida@1665 | 1166 | attribute to get the same effect.</p> |
ishida@1665 | 1167 | |
ishida@1665 | 1168 | <p>Possible values:</p> |
ishida@1665 | 1169 | |
ishida@1665 | 1170 | <dl> |
ishida@1665 | 1171 | <dt><strong>attr(x)</strong></dt> |
ishida@1665 | 1172 | <dd>The value of attribute 'x' as a string value. The string value is |
ishida@1665 | 1173 | evaluated as a <number> to determine the number of ruby base elements to be |
ishida@1665 | 1174 | spanned by the annotation element. If the <number> is '0', it is replaced by |
ishida@1665 | 1175 | '1'.The <number> is the computed value. </dd> |
ishida@1665 | 1176 | <dt>none</dt> |
ishida@1665 | 1177 | <dd>No spanning. The computed value is '1'.</dd> |
ishida@1665 | 1178 | </dl> |
ishida@1665 | 1179 | |
ishida@1665 | 1180 | <p>The following example shows an XML example using the 'display' property |
ishida@1665 | 1181 | values associated with the 'ruby structure and the 'ruby-span' property</p> |
ishida@3034 | 1182 | <pre class="xml">myruby { display: ruby; } |
ishida@1665 | 1183 | myrbc { display: ruby-base-container; } |
ishida@1665 | 1184 | myrb { display: ruby-base; } |
ishida@1665 | 1185 | myrtc.before { display: ruby-text-container; ruby-position: before} |
ishida@1665 | 1186 | myrtc.after { display: ruby-text-container; ruby-position: after} |
ishida@1665 | 1187 | myrt { display: ruby-text; ruby-span: attr(rbspan); } |
ishida@1665 | 1188 | ... |
ishida@1665 | 1189 | <myruby> |
ishida@1665 | 1190 | <myrbc> |
ishida@1665 | 1191 | <myrb>10</myrb> |
ishida@1665 | 1192 | <myrb>31</myrb> |
ishida@1665 | 1193 | <myrb>2002</myrb> |
ishida@1665 | 1194 | </myrbc> |
ishida@1665 | 1195 | <myrtc class="before"> |
ishida@1665 | 1196 | <myrt>Month</myrt> |
ishida@1665 | 1197 | <myrt>Day</myrt> |
ishida@1665 | 1198 | <myrt>Year</myrt> |
ishida@1665 | 1199 | </myrtc> |
ishida@1665 | 1200 | <myrtc class="after"> |
ishida@1665 | 1201 | <myrt rbspan="3">Expiration Date</myrt> |
ishida@1665 | 1202 | </myrtc> |
ishida@1665 | 1203 | </myruby></pre> |
kojiishi@8496 | 1204 | --> |
ishida@1665 | 1205 | |
fantasai@8497 | 1206 | <h2 id="default-stylesheet" class="no-num"> |
fantasai@8497 | 1207 | Appendix A: Default Style Sheet</h2> |
ishida@1665 | 1208 | |
fantasai@8497 | 1209 | <p><em>This section is informative.</em> |
ishida@1665 | 1210 | |
fantasai@8497 | 1211 | <h3 id="default-ua-ruby" class="no-num"> |
fantasai@8497 | 1212 | <span class="secno">A.1</span> Supporting Ruby Layout</h3> |
ishida@1665 | 1213 | |
fantasai@8497 | 1214 | <p>The following represents a default UA style sheet |
fantasai@8497 | 1215 | for rendering HTML and XHTML ruby markup as ruby layout: |
ishida@1665 | 1216 | |
fantasai@8497 | 1217 | <pre> |
fantasai@8497 | 1218 | <!-- -->ruby { display: ruby; } |
fantasai@8497 | 1219 | <!-- -->rb { display: ruby-base; white-space: nowrap; } |
fantasai@8497 | 1220 | <!-- -->rt { display: ruby-text; white-space: nowrap; font-size: 50%; } |
fantasai@8497 | 1221 | <!-- -->rbc { display: ruby-base-container; } |
fantasai@8497 | 1222 | <!-- -->rtc { display: ruby-text-container; }</pre> |
fantasai@8497 | 1223 | |
fantasai@8497 | 1224 | <p>Additional rules for UAs supporting the relevant features of [[CSS3-TEXT-DECOR]] and [[CSS3-FONTS]]: |
fantasai@8497 | 1225 | <pre>rt { font-variant-east-asian: ruby; text-emphasis: none; }</pre> |
fantasai@8497 | 1226 | |
fantasai@8497 | 1227 | <p class="note">Authors should not use the above rules; |
fantasai@8497 | 1228 | a UA that supports ruby layout should provide these by default. |
fantasai@8497 | 1229 | |
fantasai@8497 | 1230 | <h3 id="default-inline" class="no-num"> |
fantasai@8497 | 1231 | <span class="secno">A.2</span> Inlining Ruby Annotations</h3> |
fantasai@8497 | 1232 | |
fantasai@8497 | 1233 | <p>The following represents a sample style sheet |
fantasai@8497 | 1234 | for rendering HTML and XHTML ruby markup as inline annotations: |
fantasai@8497 | 1235 | |
fantasai@8497 | 1236 | <pre>ruby, rb, rt, rbc, rtc, rp { |
fantasai@8497 | 1237 | <!-- --> display: inline; white-space: inherit; |
fantasai@8497 | 1238 | <!-- --> font-variant-east-asian: inherit; text-emphasis: inherit; }</pre> |
fantasai@8497 | 1239 | |
fantasai@8497 | 1240 | <h3 id="default-parens" class="no-num"> |
fantasai@8497 | 1241 | <span class="secno">A.3</span> Generating Parentheses</h3> |
fantasai@8497 | 1242 | |
fantasai@8497 | 1243 | <p>Unfortunately, because Selectors cannot match against text nodes, |
fantasai@8497 | 1244 | it's not possible with CSS to express rules that will automatically and correctly |
fantasai@8497 | 1245 | add parentheses to unparenthesized ruby annotations in HTML. |
fantasai@8498 | 1246 | (This is because HTML ruby allows implying the <i>ruby base</i> from raw text, without a corresponding element.) |
fantasai@8498 | 1247 | However, these rules will handle cases where either <code><rb></code> |
fantasai@8498 | 1248 | or <code><rtc></code> is used rigorously. |
fantasai@8498 | 1249 | |
fantasai@8497 | 1250 | <pre> |
fantasai@8498 | 1251 | <!-- -->/* Parens around <rtc> */ |
fantasai@8497 | 1252 | <!-- -->rtc::before { content: "("; } |
fantasai@8498 | 1253 | <!-- -->rtc::after { content: ")"; } |
fantasai@8497 | 1254 | |
fantasai@8498 | 1255 | <!-- -->/* Parens before first <rt> not inside <rtc> */ |
fantasai@8498 | 1256 | <!-- -->rb + rt::before, |
fantasai@8498 | 1257 | <!-- -->rtc + rt::before { content: "("; } |
fantasai@8497 | 1258 | |
fantasai@8498 | 1259 | <!-- -->/* Parens after <rt> not inside <rtc> */ |
fantasai@8498 | 1260 | <!-- -->rb ~ rt:last-child::after, |
fantasai@8498 | 1261 | <!-- -->rt + rb::before { content: ")"; } |
fantasai@8498 | 1262 | <!-- -->rt + rtc::before { content: ")("; }</pre> |
ishida@1665 | 1263 | |
fantasai@8479 | 1264 | <h2 id="glossary"> |
fantasai@8479 | 1265 | Glossary</h2> |
ishida@1665 | 1266 | <dl> |
ishida@1665 | 1267 | <dt><a id="g-bopomofo"><strong><span |
ishida@1665 | 1268 | lang="zh">Bopomofo</span></strong></a></dt> |
ishida@1665 | 1269 | <dd>37 characters and 4 tone markings used as phonetics in Chinese, |
ishida@1665 | 1270 | especially standard Mandarin.</dd> |
ishida@1665 | 1271 | <dt><a id="g-hanja"><strong><span |
ishida@1665 | 1272 | lang="ko">Hanja</span></strong></a></dt> |
ishida@1665 | 1273 | <dd>Subset of the Korean writing system that utilizes ideographic |
ishida@1665 | 1274 | characters borrowed or adapted from the Chinese writing system. Also see |
ishida@1665 | 1275 | <a href="#g-kanji"><span lang="ja">Kanji</span></a>.</dd> |
ishida@1665 | 1276 | <dt><a id="g-hiragana"><strong><span |
ishida@1665 | 1277 | lang="ja">Hiragana</span></strong></a></dt> |
ishida@1665 | 1278 | <dd>Japanese syllabic script, or character of that script. Rounded and |
ishida@1665 | 1279 | cursive in appearance. Subset of the Japanese writing system, used together |
ishida@1665 | 1280 | with kanji and katakana. In recent times, mostly used to write Japanese |
ishida@1665 | 1281 | words when kanji are not available or appropriate, and word endings and |
ishida@1665 | 1282 | particles. Also see <a |
ishida@1665 | 1283 | href="#g-katakana"><span lang="ja">Katakana</span></a>.</dd> |
ishida@1665 | 1284 | <dt><a id="g-ideogram"><strong>Ideograph</strong></a></dt> |
ishida@1665 | 1285 | <dd>A character that is used to represent an idea, word, or word component, |
ishida@1665 | 1286 | in contrast to a character from an alphabetic or syllabic script. The most |
ishida@1665 | 1287 | well-known ideographic script is used (with some variation) in East Asia |
ishida@1665 | 1288 | (China, Japan, Korea,...).</dd> |
ishida@1665 | 1289 | <dt><a id="g-kana"><strong><span lang="ja">Kana</span></strong></a></dt> |
ishida@1665 | 1290 | <dd>Collective term for hiragana and katakana.</dd> |
ishida@1665 | 1291 | <dt><a id="g-kanji"><strong>Kanji</strong></a></dt> |
ishida@1665 | 1292 | <dd>Japanese term for ideographs; ideographs used in Japanese. Subset of the |
ishida@1665 | 1293 | Japanese writing system, used together with hiragana and katakana. Also see <a |
ishida@1665 | 1294 | href="#g-hanja"><span lang="ko">Hanja</span></a>.</dd> |
ishida@1665 | 1295 | <dt><a id="g-katakana"><strong><span |
ishida@1665 | 1296 | lang="ja">Katakana</span></strong></a></dt> |
ishida@1665 | 1297 | <dd>Japanese syllabic script, or character of that script. Angular in |
ishida@1665 | 1298 | appearance. Subset of the Japanese writing system, used together with |
ishida@1665 | 1299 | kanji and hiragana. In recent times, mainly used to write foreign words. Also see <a |
ishida@1665 | 1300 | href="#g-hiragana"><span lang="ja">Hiragana</span></a>.</dd> |
ishida@1665 | 1301 | <dt><a id="g-monoruby" name="g-monoruby"><strong>Mono-ruby</strong></a></dt> |
ishida@1665 | 1302 | <dd>In Japanese typography: Ruby associated with a single character of |
ishida@1665 | 1303 | the base text.</dd> |
ishida@1665 | 1304 | <dt><a id="g-ruby"><strong>Ruby</strong></a></dt> |
ishida@1665 | 1305 | <dd>A run of text that appears in the vicinity of another run of text and |
ishida@1665 | 1306 | serves as an annotation or a pronunciation guide for that text.</dd> |
ishida@1665 | 1307 | </dl> |
ishida@1665 | 1308 | |
fantasai@8479 | 1309 | <h2 id="conformance"> |
fantasai@8479 | 1310 | Conformance</h2> |
fantasai@8479 | 1311 | |
fantasai@8479 | 1312 | <h3 id="conventions"> |
fantasai@8479 | 1313 | Document conventions</h3> |
fantasai@8479 | 1314 | |
fantasai@8479 | 1315 | <p>Conformance requirements are expressed with a combination of |
fantasai@8479 | 1316 | descriptive assertions and RFC 2119 terminology. The key words “MUST”, |
fantasai@8479 | 1317 | “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, |
fantasai@8479 | 1318 | “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this |
fantasai@8479 | 1319 | document are to be interpreted as described in RFC 2119. |
fantasai@8479 | 1320 | However, for readability, these words do not appear in all uppercase |
fantasai@8479 | 1321 | letters in this specification. |
fantasai@8479 | 1322 | |
fantasai@8479 | 1323 | <p>All of the text of this specification is normative except sections |
fantasai@8479 | 1324 | explicitly marked as non-normative, examples, and notes. [[!RFC2119]]</p> |
fantasai@8479 | 1325 | |
fantasai@8479 | 1326 | <p>Examples in this specification are introduced with the words “for example” |
fantasai@8479 | 1327 | or are set apart from the normative text with <code>class="example"</code>, |
fantasai@8479 | 1328 | like this: |
fantasai@8479 | 1329 | |
fantasai@8479 | 1330 | <div class="example"> |
fantasai@8479 | 1331 | <p>This is an example of an informative example.</p> |
fantasai@8479 | 1332 | </div> |
fantasai@8479 | 1333 | |
fantasai@8479 | 1334 | <p>Informative notes begin with the word “Note” and are set apart from the |
fantasai@8479 | 1335 | normative text with <code>class="note"</code>, like this: |
fantasai@8479 | 1336 | |
fantasai@8479 | 1337 | <p class="note">Note, this is an informative note.</p> |
fantasai@8479 | 1338 | |
fantasai@8479 | 1339 | <h3 id="conformance-classes"> |
fantasai@8479 | 1340 | Conformance classes</h3> |
fantasai@8479 | 1341 | |
fantasai@8479 | 1342 | <p>Conformance to CSS Ruby Module |
fantasai@8479 | 1343 | is defined for three conformance classes: |
fantasai@8479 | 1344 | <dl> |
fantasai@8479 | 1345 | <dt><dfn title="style sheet!!as conformance class">style sheet</dfn> |
fantasai@8479 | 1346 | <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS |
fantasai@8479 | 1347 | style sheet</a>. |
fantasai@8479 | 1348 | <dt><dfn>renderer</dfn></dt> |
fantasai@8479 | 1349 | <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> |
fantasai@8479 | 1350 | that interprets the semantics of a style sheet and renders |
fantasai@8479 | 1351 | documents that use them. |
fantasai@8479 | 1352 | <dt><dfn id="authoring-tool">authoring tool</dfn></dt> |
fantasai@8479 | 1353 | <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> |
fantasai@8479 | 1354 | that writes a style sheet. |
fantasai@8479 | 1355 | </dl> |
fantasai@8479 | 1356 | |
fantasai@8479 | 1357 | <p>A style sheet is conformant to CSS Ruby Module |
fantasai@8479 | 1358 | if all of its statements that use syntax defined in this module are valid |
fantasai@8479 | 1359 | according to the generic CSS grammar and the individual grammars of each |
fantasai@8479 | 1360 | feature defined in this module. |
fantasai@8479 | 1361 | |
fantasai@8479 | 1362 | <p>A renderer is conformant to CSS Ruby Module |
fantasai@8479 | 1363 | if, in addition to interpreting the style sheet as defined by the |
fantasai@8479 | 1364 | appropriate specifications, it supports all the features defined |
fantasai@8479 | 1365 | by CSS Ruby Module by parsing them correctly |
fantasai@8479 | 1366 | and rendering the document accordingly. However, the inability of a |
fantasai@8479 | 1367 | UA to correctly render a document due to limitations of the device |
fantasai@8479 | 1368 | does not make the UA non-conformant. (For example, a UA is not |
fantasai@8479 | 1369 | required to render color on a monochrome monitor.) |
fantasai@8479 | 1370 | |
fantasai@8479 | 1371 | <p>An authoring tool is conformant to CSS Ruby Module |
fantasai@8479 | 1372 | if it writes style sheets that are syntactically correct according to the |
fantasai@8479 | 1373 | generic CSS grammar and the individual grammars of each feature in |
fantasai@8479 | 1374 | this module, and meet all other conformance requirements of style sheets |
fantasai@8479 | 1375 | as described in this module. |
fantasai@8479 | 1376 | |
fantasai@8479 | 1377 | <h3 id="partial"> |
fantasai@8479 | 1378 | Partial implementations</h3> |
fantasai@8479 | 1379 | |
fantasai@8479 | 1380 | <p>So that authors can exploit the forward-compatible parsing rules to |
fantasai@8479 | 1381 | assign fallback values, CSS renderers <strong>must</strong> |
fantasai@8479 | 1382 | treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore |
fantasai@8479 | 1383 | as appropriate</a>) any at-rules, properties, property values, keywords, |
fantasai@8479 | 1384 | and other syntactic constructs for which they have no usable level of |
fantasai@8479 | 1385 | support. In particular, user agents <strong>must not</strong> selectively |
fantasai@8479 | 1386 | ignore unsupported component values and honor supported values in a single |
fantasai@8479 | 1387 | multi-value property declaration: if any value is considered invalid |
fantasai@8479 | 1388 | (as unsupported values must be), CSS requires that the entire declaration |
fantasai@8479 | 1389 | be ignored.</p> |
fantasai@8479 | 1390 | |
fantasai@8479 | 1391 | <h3 id="experimental"> |
fantasai@8479 | 1392 | Experimental implementations</h3> |
fantasai@8479 | 1393 | |
fantasai@8479 | 1394 | <p>To avoid clashes with future CSS features, the CSS2.1 specification |
fantasai@8479 | 1395 | reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed |
fantasai@8479 | 1396 | syntax</a> for proprietary and experimental extensions to CSS. |
fantasai@8479 | 1397 | |
fantasai@8479 | 1398 | <p>Prior to a specification reaching the Candidate Recommendation stage |
fantasai@8479 | 1399 | in the W3C process, all implementations of a CSS feature are considered |
fantasai@8479 | 1400 | experimental. The CSS Working Group recommends that implementations |
fantasai@8479 | 1401 | use a vendor-prefixed syntax for such features, including those in |
fantasai@8479 | 1402 | W3C Working Drafts. This avoids incompatibilities with future changes |
fantasai@8479 | 1403 | in the draft. |
fantasai@8479 | 1404 | </p> |
fantasai@8479 | 1405 | |
fantasai@8479 | 1406 | <h3 id="testing"> |
fantasai@8479 | 1407 | Non-experimental implementations</h3> |
fantasai@8479 | 1408 | |
fantasai@8479 | 1409 | <p>Once a specification reaches the Candidate Recommendation stage, |
fantasai@8479 | 1410 | non-experimental implementations are possible, and implementors should |
fantasai@8479 | 1411 | release an unprefixed implementation of any CR-level feature they |
fantasai@8479 | 1412 | can demonstrate to be correctly implemented according to spec. |
fantasai@8479 | 1413 | |
fantasai@8479 | 1414 | <p>To establish and maintain the interoperability of CSS across |
fantasai@8479 | 1415 | implementations, the CSS Working Group requests that non-experimental |
fantasai@8479 | 1416 | CSS renderers submit an implementation report (and, if necessary, the |
fantasai@8479 | 1417 | testcases used for that implementation report) to the W3C before |
fantasai@8479 | 1418 | releasing an unprefixed implementation of any CSS features. Testcases |
fantasai@8479 | 1419 | submitted to W3C are subject to review and correction by the CSS |
fantasai@8479 | 1420 | Working Group. |
fantasai@8479 | 1421 | |
fantasai@8479 | 1422 | <p>Further information on submitting testcases and implementation reports |
fantasai@8479 | 1423 | can be found from on the CSS Working Group's website at |
fantasai@8479 | 1424 | <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. |
fantasai@8479 | 1425 | Questions should be directed to the |
fantasai@8479 | 1426 | <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> |
fantasai@8479 | 1427 | mailing list. |
fantasai@8479 | 1428 | |
fantasai@8479 | 1429 | <h2 class=no-num id="acknowledgments"> |
fantasai@8479 | 1430 | Acknowledgments</h2> |
ishida@1665 | 1431 | |
ishida@1665 | 1432 | <p>This specification would not have been possible without the help from:</p> |
ishida@1665 | 1433 | |
fantasai@8479 | 1434 | <p>Stephen Deach, Martin Dürst, Hideki Hiura(<span lang="ja">樋浦 秀樹</span>), Masayasu Ishikawa(<span lang="ja">石川 |
ishida@1665 | 1435 | 雅康</span>), Chris |
fantasai@8479 | 1436 | Pratley, Takao Suzuki(<span lang="ja">鈴木 孝雄</span>), Frank Yung-Fong Tang, Chris Thrasher, Masafumi Yabe<span lang="ja">家辺 |
ishida@1665 | 1437 | 勝文</span>), Steve Zilles.</p> |
ishida@1665 | 1438 | |
fantasai@8479 | 1439 | <h2 class=no-num id="references"> |
fantasai@8479 | 1440 | References</h2> |
ishida@1665 | 1441 | |
fantasai@8479 | 1442 | <h3 class="no-num" id="normative-references"> |
fantasai@8479 | 1443 | Normative references</h3> |
fantasai@8479 | 1444 | <!--normative--> |
ishida@1665 | 1445 | |
fantasai@8479 | 1446 | <h3 class="no-num" id="other-references"> |
fantasai@8479 | 1447 | Other references</h3> |
fantasai@8479 | 1448 | <!--informative--> |
ishida@1665 | 1449 | |
fantasai@8479 | 1450 | <h2 class="no-num" id="index"> |
fantasai@8479 | 1451 | Index</h2> |
fantasai@8479 | 1452 | <!--index--> |
ishida@1665 | 1453 | |
fantasai@8479 | 1454 | <h2 class="no-num" id="property-index"> |
fantasai@8479 | 1455 | Property index</h2> |
fantasai@8479 | 1456 | <!-- properties --> |
ishida@1665 | 1457 | |
ishida@1665 | 1458 | </body> |
ishida@1665 | 1459 | </html> |
ishida@1665 | 1460 | <!-- Keep this comment at the end of the file |
ishida@1665 | 1461 | Local variables: |
ishida@1665 | 1462 | mode: sgml |
fantasai@8479 | 1463 | sgml-declaration:"~/SGML/HTML4.decl" |
ishida@1665 | 1464 | sgml-default-doctype-name:"html" |
ishida@1665 | 1465 | sgml-minimize-attributes:t |
ishida@1665 | 1466 | sgml-nofill-elements:("pre" "style" "br") |
fantasai@8479 | 1467 | sgml-live-element-indicator:t |
fantasai@8479 | 1468 | sgml-omittag:nil |
fantasai@8479 | 1469 | sgml-shorttag:nil |
fantasai@8479 | 1470 | sgml-namecase-general:t |
fantasai@8479 | 1471 | sgml-general-insert-case:lower |
fantasai@8479 | 1472 | sgml-always-quote-attributes:t |
fantasai@8479 | 1473 | sgml-indent-step:nil |
fantasai@8479 | 1474 | sgml-indent-data:t |
fantasai@8479 | 1475 | sgml-parent-document:nil |
fantasai@8479 | 1476 | sgml-exposed-tags:nil |
fantasai@8479 | 1477 | sgml-local-catalogs:nil |
fantasai@8479 | 1478 | sgml-local-ecat-files:nil |
ishida@1665 | 1479 | End: |
ishida@1665 | 1480 | --> |
fantasai@8479 | 1481 |