css-ruby/Overview.src.html

Wed, 14 Aug 2013 10:40:00 -0700

author
fantasai <fantasai.cvs@inkedblade.net>
date
Wed, 14 Aug 2013 10:40:00 -0700
changeset 8833
0bd7993fcfef
parent 8682
9cea024667c6
child 8854
c159c7601557
permissions
-rw-r--r--

[css-text] Simplify letter-spacing: normal definition per <http://lists.w3.org/Archives/Public/www-style/2013Aug/0212.html>

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

mercurial