Skip to content

Commit

Permalink
[css-text-3] Simplify examples. #5759
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Dec 2, 2020
1 parent eb61086 commit 83e344e
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions css-text-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5721,51 +5721,37 @@ Bidirectionality and Line Boxes</h3>


<div class="example">
<p>In the following example:
<p>Because neutral characters (such as punctuation)
and isolated runs are skipped
when <a href="http://unicode.org/reports/tr9/#P2">finding the inline base direction of a plaintext bidi paragraph</a>,
the line box in the following example will be left-to-right
(and thus left-aligned given ''text-align: start''),
as dictated by the first strong character, ‘h’:
<pre>
&lt;para style="display: block; direction: rtl; unicode-bidi:plaintext">
&lt;quote style="unicode-bidi:plaintext">שלום!&lt;/quote>", he said.
&lt;quote style="unicode-bidi:plaintext">שלום!&lt;/quote>, he said.
&lt;/para&gt;</pre>

<p>The result should be a left-aligned line looking like this:
<pre>"!&#1513;&#1500;&#1493;&#1501;", he said.</pre>

<p>The line is left-aligned
(despite the containing block having ''direction: rtl'')
because the containing block (the <code>&lt;para></code>) has ''unicode-bidi:plaintext'',
and the line box belongs to a bidi paragraph that is LTR.
This is because that paragraph's first character with a strong direction
is the LTR "h" from "he". The RTL "שלום!" does precede the "he",
but it sits in its own bidi-isolated paragraph that is <em>not</em>
immediately contained by the <code>&lt;para&gt;</code>,
and is thus irrelevant to the line box's alignment.
From from the standpoint of the bidi paragraph immediately contained
by the <code>&lt;para&gt;</code> containing block,
the <code>&lt;quote&gt;</code>&rsquo;s bidi-isolated paragraph inside it is,
by definition, just a neutral U+FFFC character,
so the immediately-contained paragraph becomes LTR by virtue
of the "he" following it.
</div>

<div class="example">
<pre>
&lt;fieldset style="direction: rtl">
&lt;textarea style="unicode-bidi:plaintext">
&lt;textarea style="direction: rtl; unicode-bidi:plaintext">

Hello!

&lt;/textarea>
&lt;/fieldset></pre>

<p>As expected, the "Hello!" should be displayed LTR
(i.e. with the exclamation mark on the right end,
despite the <code>&lt;textarea></code>’s ''direction:rtl'')
and left-aligned.
This makes the empty line following it left-aligned as well,
which means that the caret on that line should appear at its
left edge. The first empty line, on the other hand, should
be right-aligned, due to the RTL direction of its containing
paragraph, the <code>&lt;textarea></code>.
</pre>

<p>Because of ''unicode-bidi: plaintext'',
the “Hello!” is typeset LTR
(i.e. with the exclamation mark on the right side)
and left-aligned,
ignoring the containing block’s RTL 'direction'.
This makes the empty line following it LTR as well,
which means that a caret on that line should appear at its left edge.
The empty first line, however, is right-aligned:
having no preceding line,
it assumes the RTL direction of its containing block.
</div>

<h2 class="no-num" id="order">Appendix A:
Expand Down

0 comments on commit 83e344e

Please sign in to comment.