css-ruby/Overview.src.html

Wed, 10 Jul 2013 19:08:33 -0700

author
fantasai <fantasai.cvs@inkedblade.net>
date
Wed, 10 Jul 2013 19:08:33 -0700
changeset 8682
9cea024667c6
parent 8663
8f5483049df7
child 8833
0bd7993fcfef
permissions
-rw-r--r--

[css-ruby] Some fixup in the line breaking section

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

mercurial