-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
2695 lines (1944 loc) · 122 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Ruby Layout Module Level 1</title>
<meta content="exploring" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<meta content="Bikeshed 1.0.0" name="generator">
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/">
<img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72">
</a>
</p>
<h1 class="p-name no-ref" id="title">CSS Ruby Layout Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft,
<time class="dt-updated" datetime="2015-06-21">21 June 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://dev.w3.org/csswg/css-ruby-1/">http://dev.w3.org/csswg/css-ruby-1/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css-ruby-1/">http://www.w3.org/TR/css-ruby-1/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2013/WD-css3-ruby-20130919/" rel="previous">http://www.w3.org/TR/2013/WD-css3-ruby-20130919/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-ruby%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-ruby] <var>… message topic …</var></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Issue Tracking:
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a> (<span class="p-org org">Invited Expert</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:kojiishi@gmail.com">Koji Ishii</a> (<span class="p-org org">Google</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2015 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>“Ruby”, a form of interlinear annotation, are short runs of text alongside the base text.
They are typically used in East Asian documents to indicate pronunciation or to provide a short annotation.
This module describes the rendering model and formatting controls related to displaying ruby annotations in CSS.</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
</p>
<p>
The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-ruby%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-ruby” in the subject,
preferably like this:
“[css-ruby] <em>…summary of comment…</em>”
</p>
<p>
This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a>
(part of the <a href="http://www.w3.org/Style/">Style Activity</a>).
</p>
<p>
This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.
</p>
<p>
This document is governed by the <a href="http://www.w3.org/2014/Process-20140801/" id="w3c_process_revision">1 August 2014 W3C Process Document</a>.
</p>
<p>
</p></div>
<div data-fill-with="at-risk"></div>
<h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="content">Table of Contents</span></h2>
<div data-fill-with="table-of-contents" role="navigation">
<ul class="toc" role="directory">
<li><a href="#intro"><span class="secno">1</span> <span class="content">
Introduction</span></a>
<ul class="toc">
<li><a href="#placement"><span class="secno">1.1</span> <span class="content">
Module interactions</span></a>
<li><a href="#values"><span class="secno">1.2</span> <span class="content">
Values</span></a>
<li><a href="#diagram-conventions"><span class="secno">1.3</span> <span class="content">
Diagram conventions</span></a>
<li><a href="#ruby-def"><span class="secno">1.4</span> <span class="content">
What is ruby?</span></a>
</ul>
<li><a href="#ruby-model"><span class="secno">2</span> <span class="content">
Ruby Box Model</span></a>
<ul class="toc">
<li><a href="#ruby-display"><span class="secno">2.1</span> <span class="content">
Ruby-specific <span class="property">display</span> Values</span></a>
<ul class="toc">
<li><a href="#formatting-context"><span class="secno">2.1.1</span> <span class="content">
The Ruby Formatting Context</span></a>
<li><a href="#block-ruby"><span class="secno">2.1.2</span> <span class="content">
Non-Inline Ruby</span></a>
</ul>
<li><a href="#box-fixup"><span class="secno">2.2</span> <span class="content">
Anonymous Ruby Box Generation</span></a>
<li><a href="#ruby-pairing"><span class="secno">2.3</span> <span class="content">
Annotation Pairing</span></a>
<ul class="toc">
<li><a href="#segment-pairing"><span class="secno">2.3.1</span> <span class="content">
Segment Pairing and Annotation Levels</span></a>
<li><a href="#base-annotation-pairing"><span class="secno">2.3.2</span> <span class="content">
Unit Pairing and Spanning Annotations</span></a>
<li><a href="#nested-pairing"><span class="secno">2.3.3</span> <span class="content">
Complex Spanning with Nested Ruby</span></a>
</ul>
<li><a href="#autohide"><span class="secno">2.4</span> <span class="content">
Autohiding Base-identical Annotations</span></a>
<li><a href="#white-space"><span class="secno">2.5</span> <span class="content">
White Space Collapsing</span></a>
</ul>
<li><a href="#ruby-layout"><span class="secno">3</span> <span class="content">
Ruby Layout</span></a>
<ul class="toc">
<li><a href="#inter-character-layout"><span class="secno">3.1</span> <span class="content">
Inter-character Ruby Layout</span></a>
<li><a href="#box-style"><span class="secno">3.2</span> <span class="content">
Styling Ruby Boxes</span></a>
<li><a href="#line-breaks"><span class="secno">3.3</span> <span class="content">
Breaking Across Lines</span></a>
<ul class="toc">
<li><a href="#break-between"><span class="secno">3.3.1</span> <span class="content">
Breaking Between Bases</span></a>
<li><a href="#break-within"><span class="secno">3.3.2</span> <span class="content">
Breaking Within Bases</span></a>
</ul>
<li><a href="#bidi"><span class="secno">3.4</span> <span class="content">
Bidi Reordering</span></a>
<li><a href="#line-height"><span class="secno">3.5</span> <span class="content">
Line Spacing</span></a>
</ul>
<li><a href="#ruby-props"><span class="secno">4</span> <span class="content">
Ruby Formatting Properties</span></a>
<ul class="toc">
<li><a href="#rubypos"><span class="secno">4.1</span> <span class="content">
Ruby Positioning: the <span class="property">ruby-position</span> property</span></a>
<li><a href="#collapsed-ruby"><span class="secno">4.2</span> <span class="content">
Sharing Annotation Space: the <span class="property">ruby-merge</span> property</span></a>
<li><a href="#ruby-align-property"><span class="secno">4.3</span> <span class="content"><span></span>
Ruby Text Distribution: the <span class="property">ruby-align</span> property</span></a>
<li><a href="#ruby-text-decoration"><span class="secno">4.4</span> <span class="content">
Ruby Text Decoration</span></a>
</ul>
<li><a href="#edge-effects"><span class="secno">5</span> <span class="content">
Edge Effects</span></a>
<ul class="toc">
<li><a href="#ruby-overhang"><span class="secno">5.1</span> <span class="content">
Overhanging Ruby</span></a>
<li><a href="#line-edge"><span class="secno">5.2</span> <span class="content">
Line-edge Alignment</span></a>
</ul>
<li><a href="#default-stylesheet"><span class="secno"></span> <span class="content">
Appendix A: Default Style Sheet</span></a>
<ul class="toc">
<li><a href="#default-ua-ruby"><span class="secno"></span> <span class="content">
<span class="secno">A.1</span> Supporting Ruby Layout</span></a>
<li><a href="#default-inline"><span class="secno"></span> <span class="content">
<span class="secno">A.2</span> Inlining Ruby Annotations</span></a>
<li><a href="#default-parens"><span class="secno"></span> <span class="content">
<span class="secno">A.3</span> Generating Parentheses</span></a>
</ul>
<li><a href="#glossary"><span class="secno">6</span> <span class="content">
Glossary</span></a>
<li><a href="#acknowledgments"><span class="secno"></span> <span class="content">
Acknowledgments</span></a>
<li><a href="#changes"><span class="secno"></span> <span class="content">
Changes</span></a>
<li><a href="#conformance"><span class="secno"></span> <span class="content">
Conformance</span></a>
<ul class="toc">
<li><a href="#conventions"><span class="secno"></span> <span class="content">
Document conventions</span></a>
<li><a href="#conformance-classes"><span class="secno"></span> <span class="content">
Conformance classes</span></a>
<li><a href="#partial"><span class="secno"></span> <span class="content">
Partial implementations</span></a>
<li><a href="#experimental"><span class="secno"></span> <span class="content">
Experimental implementations</span></a>
<li><a href="#testing"><span class="secno"></span> <span class="content">
Non-experimental implementations</span></a>
</ul>
<li><a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li><a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ul>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ul></div>
<main>
<p></p>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">
Introduction</span><a class="self-link" href="#intro"></a></h2>
<p><em>This section is not normative.</em>
</p>
<h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content">
Module interactions</span><a class="self-link" href="#placement"></a></h3>
<p>This module extends the inline box model of CSS Level 2 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>
to support ruby.
</p>
<p>None of the properties in this module apply to the <code>::first-line</code> or
<code>::first-letter</code> pseudo-elements.
</p>
<h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content">
Values</span><a class="self-link" href="#values"></a></h3>
<p>This specification follows the
<a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>.
Other CSS modules may expand the definitions of these value types: for
example <a data-link-type="biblio" href="#biblio-css3val">[CSS3VAL]</a>, when combined with this module, expands the
definition of the <var><length></var> value type as used in this specification.</p>
<p>In addition to the property-specific values listed in their definitions,
all properties defined in this specification also accept the
<a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">inherit</a>
keyword as their property value. For readability it has not been repeated
explicitly.
</p>
<h3 class="heading settled" data-level="1.3" id="diagram-conventions"><span class="secno">1.3. </span><span class="content">
Diagram conventions</span><a class="self-link" href="#diagram-conventions"></a></h3>
<p>Many typographical conventions in East Asian typography depend
on whether the character rendered is wide (CJK) or narrow (non-CJK).
There are a number of illustrations in this document
for which the following legend is used:
</p>
<dl>
<dt><img alt="Symbolic wide-cell glyph representation" height="39" src="images/fullwidth.gif" width="39">
<dd>Wide-cell glyph (e.g. Han) that is the <var>n</var>th character in the text run.
They are typically sized to 50% when used as annotations.
<dt><img alt="Symbolic narrow-cell glyph representation" height="39" src="images/halfwidth.gif" width="19">
<dd>Narrow-cell glyph (e.g. Roman) which is the <var>n</var>th glyph in the text run.
</dl>
<p>The orientation which the above symbols assume in the diagrams
corresponds to the orientation that the glyphs they represent
are intended to assume when rendered by the user agent.
Spacing between these characters in the diagrams is incidental,
unless intentionally changed to make a point.
</p>
<h3 class="heading settled" data-level="1.4" id="ruby-def"><span class="secno">1.4. </span><span class="content">
What is ruby?</span><a class="self-link" href="#ruby-def"></a></h3>
<p><dfn data-dfn-type="dfn" data-export="" id="ruby">Ruby<a class="self-link" href="#ruby"></a></dfn> is the commonly-used name for a run of text
that appears alongside another run of text (referred to as the “base”)
and serves as an annotation or a pronunciation guide associated with that run of text.
</p>
<p>The following figures show two examples of Ruby,
a simple case and one with more complicated structure.
</p>
<div class="example" id="example-4569e819"><a class="self-link" href="#example-4569e819"></a>
<p>In this first example, a single annotation is used to annotate the base text.
</p>
<div class="figure">
<p><img alt="Example of ruby applied on top of a Japanese expression" src="images/licence.png">
</p>
<p class="caption">Example of ruby used in Japanese (simple case)
</p>
</div>
<p>In Japanese typography, this case is sometimes called
<span lang="ja">taigo</span> ruby or group-ruby (per-word ruby),
because the annotation as a whole is associated
with multi-character word (as a whole).
</p>
</div>
<div class="example" id="example-694aaa18"><a class="self-link" href="#example-694aaa18"></a>
<p>In this second example,
two levels of annotations are attached to a base sequence:
the hiragana characters on top refer to the pronunciation of each of the base kanji characters,
while the words “Keio” and “University” on the bottom are annotations describing the English translation.
</p>
<div class="figure">
<p><img alt="Example showing complex ruby with annotation text over and under the base characters" src="images/ruby-univ.gif">
</p>
<p class="caption">Complex ruby with annotation text over and under the base characters
</p>
</div>
<p>
</p>
<p>Notice that to allow correct association between the hiragana characters and
their corresponding Kanji base characters,
the spacing between these Kanji characters is adjusted.
(This happens around the fourth Kanji character in the figure above.)
To avoid variable spacing between the Kanji characters in the example above
the hiragana annotations can be styled as a <i>collapsed annotation</i>,
which will look more like the group-ruby example earlier.
However because the base-annotation pairings are recorded in the ruby structure,
if the text breaks across lines, the annotation characters will stay
correctly paired with their respective base characters.
</p>
</div>
<p><i>Ruby</i> formatting as used in Japanese is described in JIS X-4051 <a data-link-type="biblio" href="#biblio-jis4051">[JIS4051]</a> (in Japanese)
and in Requirements for Japanese Text Layout <a data-link-type="biblio" href="#biblio-jlreq">[JLREQ]</a> (in English and Japanese)].
In HTML, ruby structure and markup to represent it is described
in the Ruby Markup Extension specification.
This module describes the CSS rendering model
and formatting controls relevant to ruby layout of such markup.
</p>
<h2 class="heading settled" data-level="2" id="ruby-model"><span class="secno">2. </span><span class="content">
Ruby Box Model</span><a class="self-link" href="#ruby-model"></a></h2>
<p>The CSS ruby model is based on
the <a href="http://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element">W3C HTML5 Ruby Markup</a> model
and the <a href="http://www.w3.org/TR/ruby/">XHTML Ruby Annotation Recommendation</a> <a data-link-type="biblio" href="#biblio-ruby">[RUBY]</a>.
In this model, a ruby structure consists of
one or more <i>ruby base</i> elements representing the base (annotated) text,
associated with one or more levels of <i>ruby annotation</i> elements representing the annotations.
The structure of ruby is similar to that of a table:
there are “rows” (the <i data-lt="base level">base text level</i>, each <i>annotation level</i>)
and “columns” (each <i>ruby base</i> and its corresponding <i>ruby annotations</i>).
</p>
<p>Consecutive bases and annotations are grouped together into <i>ruby segments</i>.
Within a <i>ruby segment</i>, a <i>ruby annotation</i> may span multiple <i>ruby bases</i>.
</p>
<p class="note" role="note">In HTML, a single <code><ruby></code> element may contain multiple <i>ruby segments</i>.
(In the XHTML Ruby model, a single <code><ruby></code> element can only contain one <i>ruby segment</i>.)
</p>
<h3 class="heading settled" data-level="2.1" id="ruby-display"><span class="secno">2.1. </span><span class="content">
Ruby-specific <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> Values</span><a class="self-link" href="#ruby-display"></a></h3>
<p>For document languages (such as XML applications) that do not have pre-defined ruby elements,
authors must map document language elements to ruby elements;
this is done with the <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> property.
</p>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-display">display<a class="self-link" href="#propdef-display"></a></dfn>
<tr>
<th><a href="#values">New Values</a>:
<td>ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container
</table>
<p>The following new <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> values assign ruby layout roles to an arbitrary element:
</p>
<dl>
<dt><dfn class="css" data-dfn-for="display" data-dfn-type="value" data-export="" id="valdef-display-ruby">ruby<a class="self-link" href="#valdef-display-ruby"></a></dfn>
<dd>Specifies that an element generates a <dfn data-dfn-for="" data-dfn-type="dfn" data-export="" data-lt="ruby container | ruby container box" id="ruby-container">ruby container box<a class="self-link" href="#ruby-container"></a></dfn>.
(Corresponds to HTML/XHTML <code><ruby></code> elements.)
<dt><dfn class="css" data-dfn-for="display" data-dfn-type="value" data-export="" id="valdef-display-ruby-base">ruby-base<a class="self-link" href="#valdef-display-ruby-base"></a></dfn>
<dd>Specifies that an element generates a <dfn data-dfn-for="" data-dfn-type="dfn" data-export="" data-lt="ruby base box | ruby base" id="ruby-base-box">ruby base box<a class="self-link" href="#ruby-base-box"></a></dfn>.
(Corresponds to HTML/XHTML <code><rb></code> elements.)
<dt><dfn class="css" data-dfn-for="display" data-dfn-type="value" data-export="" id="valdef-display-ruby-text">ruby-text<a class="self-link" href="#valdef-display-ruby-text"></a></dfn>
<dd>Specifies that an element generates a <dfn data-dfn-for="" data-dfn-type="dfn" data-export="" data-lt="ruby annotation box | ruby annotation | annotation" id="ruby-annotation-box">ruby annotation box<a class="self-link" href="#ruby-annotation-box"></a></dfn>.
(Corresponds to HTML/XHTML <code><rt></code> elements.)
<dt><dfn class="css" data-dfn-for="display" data-dfn-type="value" data-export="" id="valdef-display-ruby-base-container">ruby-base-container<a class="self-link" href="#valdef-display-ruby-base-container"></a></dfn>
<dd>Specifies that an element generates a <dfn data-dfn-for="" data-dfn-type="dfn" data-export="" data-lt="ruby base container box | ruby base container" id="ruby-base-container-box">ruby base container box<a class="self-link" href="#ruby-base-container-box"></a></dfn>.
(Corresponds to XHTML <code><rbc></code> elements; generated as an anonymous box in HTML.)
<dt><dfn class="css" data-dfn-for="display" data-dfn-type="value" data-export="" id="valdef-display-ruby-text-container">ruby-text-container<a class="self-link" href="#valdef-display-ruby-text-container"></a></dfn>
<dd>Specifies that an element generates a <dfn data-dfn-for="" data-dfn-type="dfn" data-export="" data-lt="ruby annotation container box | ruby annotation container" id="ruby-annotation-container-box">ruby annotation container box<a class="self-link" href="#ruby-annotation-container-box"></a></dfn>.
(Corresponds to HTML/XHTML <code><rtc></code> elements.)
</dl>
<p class="advisement">Authors using a language (such as HTML)
that supports dedicated ruby markup
should use that markup rather than
styling arbitrary elements (like <code><span></code>)
with ruby <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> values.
Using the correct markup ensures that screen readers
and non-CSS renderers can interpret the ruby structures.
</p>
<h4 class="heading settled" data-level="2.1.1" id="formatting-context"><span class="secno">2.1.1. </span><span class="content">
The Ruby Formatting Context</span><a class="self-link" href="#formatting-context"></a></h4>
<p><i>Ruby containers</i> are non-atomic inline-level boxes.
Like inline boxes, they break across lines,
and their containing block is the nearest block container ancestor.
And just as the contents of an inline box
participate in the same inline formatting context that contains the inline box itself,
a <i>ruby container</i> and its base-level contents
participate in the same inline formatting context that contains the <i>ruby container</i> itself.
</p>
<p>However <i>ruby containers</i> also establish a <dfn data-dfn-type="dfn" data-export="" id="ruby-formatting-context">ruby formatting context<a class="self-link" href="#ruby-formatting-context"></a></dfn>
that builds further structure around their segment of the inline formatting context.
<i>Ruby bases</i>, <i>ruby annotations</i>, <i>ruby base containers</i>, and <i>ruby annotation containers</i>
are <dfn data-dfn-type="dfn" data-export="" data-lt="internal ruby boxes|internal ruby display types" id="internal-ruby-boxes">internal ruby boxes<a class="self-link" href="#internal-ruby-boxes"></a></dfn>:
like <i>internal table elements</i>,
they have specific roles in ruby layout,
and participate in their <i>ruby container</i>’s <i>ruby formatting context</i>.
</p>
<p>As with the contents of inline boxes,
the containing block for the contents of a <i>ruby container</i> (and all its <i>internal ruby boxes</i>)
is the containing block of the <i>ruby container</i>.
So floats, for example, are trapped by the <i>ruby container</i>’s containing block,
not any of the ruby box types.
</p>
<p class="issue" id="issue-ca88244c"><a class="self-link" href="#issue-ca88244c"></a>Are internal ruby boxes inline-level?
</p>
<h4 class="heading settled" data-level="2.1.2" id="block-ruby"><span class="secno">2.1.2. </span><span class="content">
Non-Inline Ruby</span><a class="self-link" href="#block-ruby"></a></h4>
<p>If an element has an <i>inner display type</i> of <a class="css" data-link-type="maybe" href="#valdef-display-ruby">ruby</a>
and an <i>outer display type</i> other than <a class="css" data-link-type="maybe" href="http://dev.w3.org/csswg/css-display-3/#valdef-display-inline">inline</a>,
then it generates two boxes:
a principal block container box of the required <i>outer display type</i> type,
and an inline-level <i>ruby container</i>.
All properties specified on the element apply to the principal box
(and if inheritable, inherit to the <i>ruby container box</i>).
This allows styling the element as a block,
while correctly maintaining the internal ruby structure.
</p>
<p class="note" role="note">
Note that absolute positioning or floating an element causes its <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> value
to compute to a block-level equivalent. (See <a data-link-type="biblio" href="#biblio-css3-display">[CSS3-DISPLAY]</a> or <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> section 9.7.)
For the <i>internal ruby display types</i>,
this causes their <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> value to compute to <a class="css" data-link-type="maybe" href="http://dev.w3.org/csswg/css-display-3/#valdef-display-block">block</a>.
</p>
<h3 class="heading settled" data-level="2.2" id="box-fixup"><span class="secno">2.2. </span><span class="content">
Anonymous Ruby Box Generation</span><a class="self-link" href="#box-fixup"></a></h3>
<p>The CSS model does not require that the document language
include elements that correspond to each of these components.
Missing parts of the structure are implied through the anonymous box generation rules
<a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">similar to those used to normalize tables</a>. <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>
</p>
<ol>
<li id="anon-gen-anon-ruby"><a class="self-link" href="#anon-gen-anon-ruby"></a><strong>Generate anonymous ruby containers</strong>:
Any <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">consecutive</a> sequence of
improperly-contained
<i>ruby base containers</i>,
<i>ruby annotation containers</i>,
<i>ruby bases</i>,
and/or
<i>ruby annotations</i>
(and any intervening <i>white space</i>)
is wrapped in an anonymous <i>ruby container</i>.
For the purpose of this step:
<ul>
<li>an improperly-contained <i>ruby base</i> is one not parented by a <i>ruby base container</i> or <i>ruby container</i>
<li>an improperly-contained <i>ruby annotation</i> is one not parented by a <i>ruby annotation container</i> or <i>ruby container</i>
<li>an improperly-contained <i>ruby base container</i> or <i>ruby annotation container</i>
is one not parented by a <i>ruby container</i>
</ul>
<li id="anon-gen-inlinize"><a class="self-link" href="#anon-gen-inlinize"></a><strong>Inlinize block-level boxes:</strong>
Any in-flow block-level boxes directly contained by a
<i>ruby container</i>,
<i>ruby base container</i>,
<i>ruby annotation container</i>,
<i>ruby base box</i>,
or <i>ruby annotation box</i>
are forced to be inline-level boxes,
and their <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> value computed accordingly.
For example,
the <a class="property" data-link-type="propdesc" href="#propdef-display">display</a> property of an in-flow element with <a class="css" data-link-type="propdesc" href="#propdef-display">display: block</a>
parented by an element with <a class="css" data-link-type="propdesc" href="#propdef-display">display: ruby-text</a>
computes to <a class="css" data-link-type="maybe" href="http://dev.w3.org/csswg/css-display-3/#valdef-display-inline-block">inline-block</a>.
This computation occurs after any intermediary anonymous-box fixup
(such as that required by internal table elements).
<li id="anon-gen-bare-inlines"><a class="self-link" href="#anon-gen-bare-inlines"></a><strong>Wrap misparented inline-level content:</strong>
Any consecutive sequence of text and inline-level boxes
directly parented by a <i>ruby container</i> or <i>ruby base container</i>
is wrapped in an anonymous <i>ruby base</i>.
Similarly, any consecutive sequence of text and inline-level boxes
directly parented by a <i>ruby annotation container</i>
is wrapped in an anonymous <i>ruby annotation</i>.
<p>However, if an anonymous box so constructed contains only <i>white space</i>,
it is considered <dfn data-dfn-type="dfn" data-noexport="" id="intra_ruby-white-space">intra-ruby white space<a class="self-link" href="#intra_ruby-white-space"></a></dfn>
and is either discarded
or preserved
as described below.</p>
<li id="anony-gen-trim-space"><a class="self-link" href="#anony-gen-trim-space"></a><strong>Trim leading/trailing white space:</strong>
Any <i>intra-ruby white space</i>
that is not the sole child of its parent
and occurs at the beginning or end of
a <i>ruby container</i>, <i>ruby annotation container</i>, or <i>ruby base container</i>
is removed, as if it had <a class="css" data-link-type="propdesc" href="#propdef-display">display: none</a>
<li id="anon-gen-discard-space"><a class="self-link" href="#anon-gen-discard-space"></a><strong>Remove inter-level white space:</strong>
Any <i>intra-ruby white space</i>
whose immediately adjacent siblings match one of the patterns below
is <dfn data-dfn-type="dfn" data-noexport="" id="inter_level-white-space">inter-level white space<a class="self-link" href="#inter_level-white-space"></a></dfn>
and is removed, as if it had <a class="css" data-link-type="propdesc" href="#propdef-display">display: none</a>.
<table class="data">
<thead>
<tr>
<th>Previous box
<th>Next box
<tbody>
<tr>
<td><var>any</var>
<td><i>ruby annotation container</i>
<tr>
<td>not <i>ruby annotation</i>
<td><i>ruby annotation</i>
</table>
<li id="anon-gen-interpret-space"><a class="self-link" href="#anon-gen-interpret-space"></a><strong>Interpret intra-level white space:</strong>
Any <i>intra-ruby white space</i> box
whose immediately adjacent siblings match one of the patterns below
is assigned the box type and subtype defined in the table below:
<table class="data">
<colgroup span="2"></colgroup>
<colgroup span="2"></colgroup>
<thead>
<tr>
<th>Previous box
<th>Next box
<th>Box type
<th>Subtype
<tbody>
<tr>
<td><i>ruby base</i>
<td><i>ruby base</i>
<td><i>ruby base</i>
<td><dfn data-dfn-type="dfn" data-noexport="" id="inter_base-white-space">inter-base white space<a class="self-link" href="#inter_base-white-space"></a></dfn>
<tr>
<td><i>ruby annotation</i>
<td><i>ruby annotation</i>
<td><i>ruby annotation</i>
<td><dfn data-dfn-type="dfn" data-noexport="" id="inter_annotation-white-space">inter-annotation white space<a class="self-link" href="#inter_annotation-white-space"></a></dfn>
<tr>
<td><i>ruby annotation</i> or <i>ruby annotation container</i>
<td><i>ruby base</i> or <i>ruby base container</i>
<td rowspan="3"><i>ruby base</i>
<td rowspan="3"><dfn data-dfn-type="dfn" data-noexport="" id="inter_segment-white-space">inter-segment white space<a class="self-link" href="#inter_segment-white-space"></a></dfn>
<tr>
<td><i>ruby base</i> or <i>ruby base container</i>
<td><i>ruby base container</i>
<tr>
<td><i>ruby base container</i>
<td><i>ruby base</i> or <i>ruby base container</i>
</table>
The <dfn data-dfn-type="dfn" data-noexport="" id="intra_level-white-space">intra-level white space<a class="self-link" href="#intra_level-white-space"></a></dfn> boxes defined above are
treated specially for pairing and layout. See below.
<li id="anon-gen-unbreak"><a class="self-link" href="#anon-gen-unbreak"></a><strong>Suppress line breaks:</strong>
Convert all forced line breaks inside <i>ruby annotations</i> (regardless of <a class="property" data-link-type="propdesc" href="http://dev.w3.org/csswg/css-text-3/#propdef-white-space">white-space</a> value)
as defined for <i>collapsible</i> segment breaks in <a href="http://www.w3.org/TR/css-text-3/#line-break-transform">CSS Text Level 3 § 4.1.2</a>.
<p class="issue" id="issue-8af70305"><a class="self-link" href="#issue-8af70305"></a>The goal of this is to simplify the layout model by suppressing any line breaks within ruby annotations.
Alternatively we could try to define some kind of acceptable behavior for them.
</p>
<li id="anon-gen-anon-containers"><a class="self-link" href="#anon-gen-anon-containers"></a><strong>Generate anonymous level containers:</strong>
Any consecutive sequence of <i>ruby bases</i> and <i>inter-base white space</i>
(and not <i>inter-segment white space</i>)
not parented by a <i>ruby base container</i>
is wrapped in an anonymous <i>ruby base container</i>.
Similarly, any consecutive sequence of <i>ruby annotations</i> and <i>inter-annotation white space</i>
not parented by a <i>ruby annotation container</i>
is wrapped in an anonymous <i>ruby annotation container</i>.
</ol>
<p class="issue" id="issue-778a7acd"><a class="self-link" href="#issue-778a7acd"></a>Make <a href="http://lists.w3.org/Archives/Public/www-archive/2014Jun/att-0027/PastedGraphic-1.png">this diagram</a> into an example.
</p>
<p>Once all ruby layout structures are properly parented,
the UA can start to associate bases with their annotations.
</p>
<p class="note" role="note">
Note that the UA is not required to create any of these anonymous boxes
(or the anonymous empty <i>intra-level white space</i> boxes in the pairing section)
in its internal structures,
as long as pairing and layout behaves as if they existed.
</p>
<h3 class="heading settled" data-level="2.3" id="ruby-pairing"><span class="secno">2.3. </span><span class="content">
Annotation Pairing</span><a class="self-link" href="#ruby-pairing"></a></h3>
<p>Annotation <dfn data-dfn-type="dfn" data-noexport="" id="pairing">pairing<a class="self-link" href="#pairing"></a></dfn> is the process of associating
<i>ruby annotations</i> with <i>ruby bases</i>.
Each <i>ruby annotation</i> is associated with one or more <i>ruby bases</i>,
and is said to <dfn data-dfn-type="dfn" data-noexport="" id="span">span<a class="self-link" href="#span"></a></dfn> those bases.
(A <i>ruby annotation</i> that <i>spans</i> multiple bases is called
a <dfn data-dfn-type="dfn" data-noexport="" id="spanning-annotation">spanning annotation<a class="self-link" href="#spanning-annotation"></a></dfn>.)
</p>
<p>A <i>ruby base</i> is can be associated with
only one <i>ruby annotation</i> per <i>annotation level</i>.
However, if there are multiple <i>annotation levels</i>,
it can be associated with multiple <i>ruby annotations</i>.</p>
<p>Once pairing is complete, ruby “column” units are defined,
each represented by a single <i>ruby base</i>
and one <i>ruby annotation</i> (possibly an empty, anonymous one)
from each <i>annotation level</i> in its <i>ruby segment</i>.</p>
<h4 class="heading settled" data-level="2.3.1" id="segment-pairing"><span class="secno">2.3.1. </span><span class="content">
Segment Pairing and Annotation Levels</span><a class="self-link" href="#segment-pairing"></a></h4>
<p>A ruby structure is divided into <dfn data-dfn-type="dfn" data-noexport="" id="ruby-segments">ruby segments<a class="self-link" href="#ruby-segments"></a></dfn>,
each consisting of a single <i>ruby base container</i>
followed by one or more <i>ruby annotation containers</i>.
Each <i>ruby annotation container</i> in a <i>ruby segment</i>
represents one <dfn data-dfn-type="dfn" data-lt="annotation level | level" data-noexport="" id="annotation-level">level<a class="self-link" href="#annotation-level"></a></dfn> of annotation for the base text:
the first one represents the first level of annotation,
the second one represents the second level of annotation,
and so on.
The <i>ruby base container</i> represents the <dfn data-dfn-type="dfn" data-noexport="" id="base-level">base level<a class="self-link" href="#base-level"></a></dfn>.
The <i>ruby base container</i> in each segment is thus paired
with each of the <i>ruby annotation containers</i> in that segment.
</p>
<p>In order to handle degenerate cases, some empty anonymous containers are assumed:
</p>
<ul>
<li>If the first child of a <i>ruby container</i> is a <i>ruby annotation container</i>,
an anonymous, empty <i>ruby base container</i> is assumed to exist before it.
<li>Similarly, if the <i>ruby container</i> contains consecutive <i>ruby base containers</i>,
anonymous, empty <i>ruby annotation containers</i> are assumed to exist between them.
</ul>
<p><i>Inter-segment white space</i> is effectively a <i>ruby segment</i> of its own.
</p>
<h4 class="heading settled" data-level="2.3.2" id="base-annotation-pairing"><span class="secno">2.3.2. </span><span class="content">
Unit Pairing and Spanning Annotations</span><a class="self-link" href="#base-annotation-pairing"></a></h4>
<p>Within a <i>ruby segment</i>,
each <i>ruby base</i> in the <i>ruby base container</i>
is paired with one <i>ruby annotation</i>
from each <i>ruby annotation container</i> in its <i>ruby segment</i>.
</p>
<p>If a <i>ruby annotation container</i> contains only
a single, anonymous <i>ruby annotation</i>,
then that <i>ruby annotation</i> is paired with (i.e. <i>spans</i> across)
all of the <i>ruby bases</i> in its <i>ruby segment</i>.
</p>
<p>Otherwise, each <i>ruby annotation</i> is paired,
in order, with the corresponding <i>ruby base</i> in that segment.
If there are not enough <i>ruby annotations</i> in a <i>ruby annotation container</i>,
the remaining <i>ruby bases</i> are paired with anonymous empty annotations
inserted at the end of the <i>ruby annotation container</i>.
If there are not enough <i>ruby bases</i>,
any remaining <i>ruby annotations</i> pair with empty, anonymous bases
inserted at the end of the <i>ruby base container</i>.
</p>
<p>If an implementation supports ruby markup with explicit spanning
(e.g. XHTML Complex Ruby Annotations),
it must adjust the pairing rules to pair <i>spanning annotations</i>
to their bases appropriately.
</p>
<p><i>Intra-level white space</i> does not participate in standard annotation <i>pairing</i>.
However, if the immediately-adjacent <i>ruby bases</i> or <i>ruby annotations</i>
are paired
</p>
<ul>
<li>with two <i>ruby bases</i> or <i data-lt="ruby annotations">annotations</i>
that surround corresponding <i>intra-level white space</i> in another level,
then the so-corresponding <i>intra-level white space</i> boxes are also paired.
<li>with a single spanning <i>ruby annotation</i>,
then the <i>intra-level white space</i> is also paired to that <i>ruby annotation</i>
<li>with two <i>ruby bases</i> or <i data-lt="ruby annotations">annotations</i>
with no intervening <i>intra-level white space</i>,
then the <i>intra-level white space</i> box pairs with
an anonymous empty <i>intra-level white space</i> box assumed to exist between them.
</ul>
<p class="issue" id="issue-0230a91a"><a class="self-link" href="#issue-0230a91a"></a>Insert diagram</p>
<h4 class="heading settled" data-level="2.3.3" id="nested-pairing"><span class="secno">2.3.3. </span><span class="content">
Complex Spanning with Nested Ruby</span><a class="self-link" href="#nested-pairing"></a></h4>
<p>When <i>ruby containers</i> are <dfn data-dfn-type="dfn" data-lt="nested ruby" data-noexport="" id="nested-ruby">nested<a class="self-link" href="#nested-ruby"></a></dfn>,
pairing begins with the deepest <i>ruby container</i>,
then expands out.
From the pairing perspective of the outer <i>ruby container</i>,
each <i>ruby container</i> nested within another <i>ruby container</i>
counts as representing a single <i>ruby base</i>/<i>annotation</i> per level.
The outer <i>ruby container</i>’s <i>ruby annotations</i> paired to the <i>nested ruby</i>
are therefore paired with (and <i>span</i>) all of the nested <i>ruby container</i>’s <i>ruby bases</i>.
Each <i>ruby annotation container</i> in the nested <i>ruby container</i>
occupies the same <i>annotation level</i> in the outer <i>ruby container</i>
as it does in the inner one
and participates in its layout as if it were directly contained in the outer <i>ruby container</i>.
</p>
<p>This process is recursive.
Thus, using nested <i>ruby containers</i> allows the representation
of complex spanning relationships.
</p>
<p class="issue" id="issue-9b177ca3"><a class="self-link" href="#issue-9b177ca3"></a>It’s not clear whether this falls out of layout handling of ruby containers inside ruby bases
or needs to be handled specially.
Waiting until layout is better-defined to find out...
</p>
<h3 class="heading settled" data-level="2.4" id="autohide"><span class="secno">2.4. </span><span class="content">
Autohiding Base-identical Annotations</span><a class="self-link" href="#autohide"></a></h3>
<p>If a <i>ruby annotation</i> has the exact same text content as its base,
it is <dfn data-dfn-type="dfn" data-lt="hidden ruby annotation | hidden annotation" data-noexport="" id="hidden-ruby-annotation">hidden<a class="self-link" href="#hidden-ruby-annotation"></a></dfn>.
Hiding a <i>ruby annotation</i> does not affect annotation pairing
or the block-axis positioning of boxes in other <i>levels</i>.
However the <i>hidden annotation</i> is not visible,
and it has no impact on layout
other than to separate adjacent sequences of <i>ruby annotation boxes</i> within its level,
as if they belonged to separate segments
and the <i>hidden annotation</i>’s base were not a <i>ruby base</i> but an intervening inline.
</p>
<div class="example" id="example-8959956b"><a class="self-link" href="#example-8959956b"></a>
<p>This is to allow correct inlined display of annotations
for Japanese words that are a mix of kanji and hiragana.
For example, the word <span lang="ja">振り仮名</span> should be inlined as
</p>
<p class="figure">振り仮名(ふりがな)
</p>
<p>and therefore marked up as
</p>
<pre><ruby>
<rb>振</rb><rb>り</rb><rb>仮</rb><rb>名</rb>
<rp>(</rp><rt>ふ</rt><rt>り</rt><rt>が</rt><rt>な</rt><rp>)</rp>
<ruby></pre>
<p>However, when displayed as ruby, the “り” should be hidden
</p>
<div class="figure">
<p><img alt="Hiragana annotations for 振り仮名 appear, each pronunciation above its kanji base character." src="images/furigana-separate.png">
</p>
<p class="caption">Hiragana ruby for 振り仮名. Notice there is no hiragana annotation above り, since it is already in hiragana.
</p>
</div>
</div>
<p>When the computed value of <a class="property" data-link-type="propdesc" href="#propdef-ruby-merge">ruby-merge</a> is <a class="css" data-link-type="maybe" href="#valdef-ruby-merge-collapse">collapse</a>,
the autohiding is disabled.