css-ruby/Overview.src.html

Mon, 17 Jun 2013 21:35:27 +0900

author
fantasai <fantasai.cvs@inkedblade.net>
date
Mon, 17 Jun 2013 21:35:27 +0900
changeset 8479
8a1d4d700090
parent 8271
css-ruby/Overview.html@431d7b028f22
child 8490
32c9ef6fe05c
permissions
-rw-r--r--

[css-ruby] Switch to using preprocessor for CSS Ruby

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

mercurial