Skip to content

Commit 4b50dcc

Browse files
committed
[css-ruby] Define bidi handling.
1 parent ce72f77 commit 4b50dcc

File tree

2 files changed

+68
-69
lines changed

2 files changed

+68
-69
lines changed

css-ruby/Overview.html

+42-19
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>CSS Ruby Layout Module Level 1</h1>
5656
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
57-
<span class=dt-updated><span class=value-title title=20140711>11 July 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140712>12 July 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl>
5959
<dt>This version:
6060
<dd><a class=u-url href=http://dev.w3.org/csswg/css-ruby-1/>http://dev.w3.org/csswg/css-ruby-1/</a>
@@ -147,7 +147,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
147147
<ul class=toc>
148148
<li><a href=#break-between><span class=secno>3.3.1</span> Breaking Between Bases</a>
149149
<li><a href=#break-within><span class=secno>3.3.2</span> Breaking Within Bases</a></ul>
150-
<li><a href=#ruby-bidi><span class=secno>3.4</span> Bidi Reordering</a>
150+
<li><a href=#bidi><span class=secno>3.4</span> Bidi Reordering</a>
151151
<li><a href=#line-height><span class=secno>3.5</span> Line Spacing</a></ul>
152152
<li><a href=#ruby-props><span class=secno>4</span> Ruby Formatting Properties</a>
153153
<ul class=toc>
@@ -909,16 +909,46 @@ <h4 class="heading settled heading" data-level=3.3.2 id=break-within><span class
909909

910910
<p>Ruby alignment takes place within each fragment, after line-breaking.
911911

912-
<h3 class="heading settled heading" data-level=3.4 id=ruby-bidi><span class=secno>3.4 </span><span class=content>
913-
Bidi Reordering</span><a class=self-link href=#ruby-bidi></a></h3>
912+
<h3 class="heading settled heading" data-level=3.4 id=bidi><span class=secno>3.4 </span><span class=content>
913+
Bidi Reordering</span><a class=self-link href=#bidi></a></h3>
914914

915-
<p class=issue id=issue-abee447f><a class=self-link href=#issue-abee447f></a>
916-
Constraints:
917-
Text within a ruby base must remain contiguous,
918-
and bases belonging to a single annotation must remain contiguous.
919-
Still figuring out exactly to enforce these limitations in a sensible manner.
915+
<p>The Unicode bidirectional algorithm reorders logically-stored text for visual presentation
916+
when characters from scripts of opposing directionalities are mixed
917+
within a single paragraph.
920918

921-
</p>
919+
<p>To preserve the correspondance of <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a>
920+
to their respective <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a>,
921+
a few restrictions must be imposed:
922+
<ul>
923+
<li>The contents of a <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> or <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> must remain contiguous.
924+
<li>All <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a> spanned by a single <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> must remain contiguous.
925+
</ul>
926+
927+
<p>To this end,
928+
<ul>
929+
<li>
930+
Bidi isolation is forced on all <a data-link-type=dfn href=#internal-ruby-boxes title="internal ruby boxes">internal ruby boxes</a> and the <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>:
931+
the <span class=css data-link-type=maybe title=normal>normal</span> and <span class=css data-link-type=maybe title=embed>embed</span> values of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-writing-modes-3/#propdef-unicode-bidi title=unicode-bidi>unicode-bidi</a> compute to <span class=css data-link-type=maybe title=isolate>isolate</span>,
932+
and <span class=css data-link-type=maybe title=bidi-override>bidi-override</span> computes to <span class=css data-link-type=maybe title=isolate-override>isolate-override</span>.
933+
<li>
934+
During layout, <a data-link-type=dfn href=#ruby-segments title="ruby segments">ruby segments</a>, <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a>, and <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a>
935+
are ordered within their respective containers
936+
by the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-writing-modes-3/#propdef-direction title=direction>direction</a> property of their <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>.
937+
The <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-writing-modes-3/#propdef-direction title=direction>direction</a> property on <a data-link-type=dfn href=#ruby-base-container-box title="ruby base containers">ruby base containers</a> and <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation containers">ruby annotation containers</a>
938+
is ignored for the purpose of layout.
939+
(However, it can still inherit into the container’s children
940+
and thereby affect the <a data-link-type=dfn href=http://dev.w3.org/csswg/css-writing-modes-3/#inline-base-direction title="inline base direction">inline base direction</a>
941+
of any <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a> or <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a> it contains.)
942+
</ul>
943+
944+
<p class=note>
945+
Note this means that implicit bidi reordering does not work across ruby bases,
946+
so authors will need to ensure that the <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>’s declared directionality
947+
does indeed match its contents.
948+
949+
<p>See <a data-biblio-type=informative data-link-type=biblio href=#biblio-css3-writing-modes title=biblio-css3-writing-modes>[CSS3-WRITING-MODES]</a> for a more in-depth discussion of bidirectional text in CSS.
950+
951+
922952

923953
<h3 class="heading settled heading" data-level=3.5 id=line-height><span class=secno>3.5 </span><span class=content>
924954
Line Spacing</span><a class=self-link href=#line-height></a></h3>
@@ -1621,6 +1651,7 @@ <h3 class="no-num no-ref heading settled heading" id=informative><span class=con
16211651
<div data-fill-with=informative-references><dl>
16221652
<dt id=biblio-css3-fonts title=CSS3-FONTS><a class=self-link href=#biblio-css3-fonts></a>[CSS3-FONTS]<dd>John Daggett. <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>CSS Fonts Module Level 3</a>. 12 February 2013. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/WD-css3-fonts-20130212/>http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a></dd>
16231653
<dt id=biblio-css3-text-decor title=CSS3-TEXT-DECOR><a class=self-link href=#biblio-css3-text-decor></a>[CSS3-TEXT-DECOR]<dd>Elika J. Etemad; Koji Ishii. <a href=http://www.w3.org/TR/2013/CR-css-text-decor-3-20130801/>CSS Text Decoration Module Level 3</a>. 1 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css-text-decor-3-20130801/>http://www.w3.org/TR/2013/CR-css-text-decor-3-20130801/</a></dd>
1654+
<dt id=biblio-css3-writing-modes title=CSS3-WRITING-MODES><a class=self-link href=#biblio-css3-writing-modes></a>[CSS3-WRITING-MODES]<dd>Elika J. Etemad; Koji Ishii. <a href=http://www.w3.org/TR/2012/WD-css3-writing-modes-20121115/>CSS Writing Modes Module Level 3</a>. 15 November 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-css3-writing-modes-20121115/>http://www.w3.org/TR/2012/WD-css3-writing-modes-20121115/</a></dd>
16241655
<dt id=biblio-css3val title=CSS3VAL><a class=self-link href=#biblio-css3val></a>[CSS3VAL]<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>CSS Values and Units Module Level 3</a>. 30 July 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>http://www.w3.org/TR/2013/CR-css3-values-20130730/</a></dd>
16251656
<dt id=biblio-jis4051 title=JIS4051><a class=self-link href=#biblio-jis4051></a>[JIS4051]<dd>???. <a href=None>Formatting rules for Japanese documents (『日本語文書の組版方法』)</a>. 2004. In Japanese URL: <a href=None>None</a></dd>
16261657
<dt id=biblio-jlreq title=JLREQ><a class=self-link href=#biblio-jlreq></a>[JLREQ]<dd>Yasuhiro Anan; et al. <a href=http://www.w3.org/TR/2012/NOTE-jlreq-20120403/>Requirements for Japanese Text Layout</a>. 3 April 2012. W3C Working Group Note. URL: <a href=http://www.w3.org/TR/2012/NOTE-jlreq-20120403/>http://www.w3.org/TR/2012/NOTE-jlreq-20120403/</a></dd>
@@ -1726,15 +1757,7 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
17261757
A spanning <div class=issue>
17271758
Insert scanned example so people don’t think this is just the ramblings of an insane spec-writer.
17281759

1729-
<a href=#issue-14d7c6b1></a></div><div class=issue>
1730-
Constraints:
1731-
Text within a ruby base must remain contiguous,
1732-
and bases belonging to a single annotation must remain contiguous.
1733-
Still figuring out exactly to enforce these limitations in a sensible manner.
1734-
1735-
<a href=#issue-abee447f></a></div>
1736-
1737-
<div class=issue><span class=issuehead>Issue-107: </span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&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>.<a href=#issue-8b54b949></a></div>
1760+
<a href=#issue-14d7c6b1></a></div><div class=issue><span class=issuehead>Issue-107: </span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&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>.<a href=#issue-8b54b949></a></div>
17381761
<div class=issue>Add a paragraph explaining how to distribute space in situations with spanning annotations.
17391762

17401763
<a href=#issue-356ec075></a></div><div class=issue>

css-ruby/Overview.src.html

+26-50
Original file line numberDiff line numberDiff line change
@@ -772,70 +772,46 @@ <h4 id="break-within">
772772

773773
<p>Ruby alignment takes place within each fragment, after line-breaking.
774774

775-
<h3 id="ruby-bidi">
775+
<h3 id="bidi">
776776
Bidi Reordering</h3>
777777

778-
<p class="issue">
779-
Constraints:
780-
Text within a ruby base must remain contiguous,
781-
and bases belonging to a single annotation must remain contiguous.
782-
Still figuring out exactly to enforce these limitations in a sensible manner.
783-
784-
<!--
785-
786-
<p>The Unicode bidirectional algorithm orders logically-stored text for visual presentation
778+
<p>The Unicode bidirectional algorithm reorders logically-stored text for visual presentation
787779
when characters from scripts of opposing directionalities are mixed
788780
within a single paragraph.
789-
(See [[CSS3-WRITING-MODES]] for a more in-depth discussion of bidirectional text in CSS.)
790-
Bidi reordering of ruby-annotation pairs is controlled by the ordering of the base text, as follows:
791-
792-
<h4 id="bidi-B">Proposal A</h4>
793-
794-
<p class="note">This proposal is simpler, but will require more frequent tagging of mixed-directionality content.
795-
796-
<p>To avoid the interference of the <i>annotations</i> in the ordering of base text,
797-
all annotations are ignored for the purpose of resolving neutral characters in the base level.
798781

799782
<p>To preserve the correspondance of <i>ruby annotations</i>
800783
to their respective <i>ruby bases</i>,
801-
a few restrictions are imposed:
784+
a few restrictions must be imposed:
802785
<ul>
803786
<li>The contents of a <i>ruby base</i> or <i>ruby annotation</i> must remain contiguous.
804-
To this end, the contents of each <i>ruby base</i> and <i>ruby annotation</i> are treated as if within a <i>bidi isolation</i>.
805-
<li>For the purpose of ordering <i>ruby bases</i> within a <i>ruby container</i>,
806-
each <i>ruby base</i> is treated as a strong character of its specified 'direction'.
807-
(<i>Ruby annotations</i> are positioned with respect to their <i>bases</i>,
808-
so are affected by reordering, but do not themselves participate in reordering.)
809-
<li>All <i>bases</i> spanned by a single <i>annotation</i> must remain contiguous.
810-
To this end, the embedding level of all bases spanned by a spanning <i>annotation</i>
811-
is increased by two prior to reordering.
787+
<li>All <i>ruby bases</i> spanned by a single <i>ruby annotation</i> must remain contiguous.
812788
</ul>
813789

814-
<h4 id="bidi-B">Proposal B</h4>
815-
816-
<p class="note">This preserves some aspects of implicit bidi.
817-
For example, annotating each half of "first-second" would not cause the word to reverse itself to "second-first" within an opposite-order paragraph.
818-
819-
<p>To avoid the interference of the <i>annotations</i> in the ordering of the base text,
820-
all annotations are ignored for the purpose of resolving neutral characters in the base text;
821-
and the base text is resolved exactly as if each <i>ruby base</i> were
822-
just a normal <i>inline box</i> embedded in the <i>ruby container</i>'s inline formatting context.
823-
824-
<p>Furthermore, to preserve the correspondance of <i>ruby annotations</i>
825-
to their respective <i>ruby bases</i>,
826-
a few restrictions are imposed:
790+
<p>To this end,
827791
<ul>
828-
<li>The contents of a <i>ruby base</i> must remain contiguous.
829-
<li>All <i>bases</i> spanned by a single <i>annotation</i> must remain contiguous.
792+
<li>
793+
Bidi isolation is forced on all <i>internal ruby boxes</i> and the <i>ruby container</i>:
794+
the ''normal'' and ''embed'' values of 'unicode-bidi' compute to ''isolate'',
795+
and ''bidi-override'' computes to ''isolate-override''.
796+
<li>
797+
During layout, <i>ruby segments</i>, <i>ruby annotations</i>, and <i>ruby bases</i>
798+
are ordered within their respective containers
799+
by the 'direction' property of their <i>ruby container</i>.
800+
The 'direction' property on <i>ruby base containers</i> and <i>ruby annotation containers</i>
801+
is ignored for the purpose of layout.
802+
(However, it can still inherit into the container's children
803+
and thereby affect the <i>inline base direction</i>
804+
of any <i>ruby bases</i> or <i>ruby annotations</i> it contains.)
830805
</ul>
831-
<p>To this end, the text of <i>ruby base</i> boxes that are not <i>bidi-isolated</i>
832-
must have its embedding level increased by two;
833-
and if an <i>annotation</i> spans more than one <i>ruby base</i>,
834-
the spanned text's embedding level
835-
(or the embedding level assigned to the isolation, if the <i>ruby base</i> is <i>bidi-isolated</i>)
836-
is further increased by two.
837806

838-
-->
807+
<p class="note">
808+
Note this means that implicit bidi reordering does not work across ruby bases,
809+
so authors will need to ensure that the <i>ruby container</i>’s declared directionality
810+
does indeed match its contents.
811+
812+
<p>See [[CSS3-WRITING-MODES]] for a more in-depth discussion of bidirectional text in CSS.
813+
814+
<!-- Some alternate proposals exist in the 2013 draft's comments section. -->
839815

840816
<h3 id="line-height">
841817
Line Spacing</h3>

0 commit comments

Comments
 (0)