Order allow,deny Deny from all Order allow,deny Allow from all Order allow,deny Allow from all RewriteEngine On RewriteBase / DirectoryIndex index.php RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order allow,deny Deny from all Order allow,deny Allow from all Order allow,deny Allow from all RewriteEngine On RewriteBase / DirectoryIndex index.php RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] [css-writing-modes] Clarify when bidi induces fragmentation of an inl… · w3c/csswg-drafts@f141345 · GitHub
Skip to content

Commit f141345

Browse files
committed
[css-writing-modes] Clarify when bidi induces fragmentation of an inline box, and what the nearest common ancestor of the two fragments is (for the purpose of finding spacing rules etc.). Fixes #1509.
1 parent 04e733e commit f141345

File tree

2 files changed

+147
-15
lines changed

2 files changed

+147
-15
lines changed

css-writing-modes-3/Overview.bs

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -664,17 +664,83 @@ Paragraph Breaks Within Embeddings and Isolates</h4>
664664
<h4 id="bidi-box-model">
665665
Reordering-induced Box Fragmentation</h4>
666666

667-
<p>Since bidi reordering can split apart and reorder text that is
668-
logically contiguous, bidirectional text can cause an inline box
669-
to be split and reordered within a line.
667+
<p>Since bidi reordering can split apart and reorder text
668+
that is logically contiguous,
669+
bidirectional text can cause an <a>inline box</a> containing such text
670+
to be split and its fragments reordered within a line.
670671

671-
<p class="note">Note that in order to be able to flow inline boxes in a
672-
uniform direction (either entirely left-to-right or entirely
673-
right-to-left), anonymous inline boxes may have to be created.</p>
672+
<h5 id="bidi-fragmentation">
673+
Conditions of Reordering-induced Box Fragmentation</h5>
674+
675+
<p>
676+
When bidi reordering would split apart an inline box
677+
due to intervening content,
678+
the inline box is considered to be broken into multiple <a>box fragments</a>.
679+
[[CSS-BREAK-3]]
680+
The box is considered to be thus <a>fragmented</a>
681+
if it would be divided by intervening content on an infinitely long line,
682+
even if line breaking happens to result in both <a>box fragments</a>
683+
being placed adjacent to each other on the line.
684+
In such cases, the nearest common ancestor of text in the two <a>box fragments</a>
685+
(which determines certain aspects of text formatting
686+
such as <a spec="css-text">tracking</a> and <a href="https://www.w3.org/TR/css-text/#text-justify-property">justification</a>
687+
between the two <a>box fragments</a>, see [[CSS-TEXT-3]])
688+
is considered to be the nearest common ancestor of the two <a>box fragments</a>,
689+
not the <a>inline box</a> itself.
690+
However, an <a>inline box</a> is not considered to be broken
691+
into multiple <a>box fragments</a> due to bidi reordering
692+
if no intervening content would force it to split.
693+
(These rules maintain the integrity of an <a>inline box</a> where possible,
694+
while keeping bidi-induced fragmentation stable
695+
across variations in line-breaking.)
696+
<!-- See https://github.com/w3c/csswg-drafts/issues/1509 -->
697+
698+
<div class="example">
699+
In the following example, where lowercase letters represent LTR letters
700+
and uppercase letters represent RTL letters,
701+
bidi reordering causes the <code>&lt;em></code>’s <a>inline box</a>
702+
to be divided into two <a>box fragments</a>
703+
separated by text outside the <code>&lt;em</code>.
704+
705+
Source code (logical order):
706+
<pre>&lt;p>here is &lt;em>some MIXED&lt;/em> TEXT.&lt;/p></pre>
707+
708+
Rendering (visual order) in a wide containing block, resulting in two inline box fragments separated by external content:
709+
<pre>here is <em style="border: 1px solid; border-right: 1px dashed red">some </em>TXET <em style="border: 1px solid; border-left: 1px dashed red">DEXIM</em>.</pre>
710+
711+
Rendering (visual order) in a narrow containing block, resulting in two inline box fragments placed adjacent to each other:
712+
<pre>
713+
here is <em style="border: 1px solid; border-right: 1px dashed red">some </em><em style="border: 1px solid; border-left: 1px dashed red">DEXIM</em>
714+
TXET.
715+
</pre>
716+
</div>
717+
718+
<div class="example">
719+
By contrast, in this example,
720+
where the mixed-direction phrase is kept together with an isolation,
721+
only one fragment is generated--
722+
the surrounding content will never split the <code>&lt;em></code>’s <a>inline box</a>
723+
even inside an infinitely-long containing block:
724+
725+
Source code (logical order):
726+
<pre>&lt;p>here is &lt;em dir=rtl>some MIXED&lt;/em> TEXT.&lt;/p></pre>
727+
728+
Rendering (visual order) in a wide containing block, resulting in one fragment:
729+
<pre>here is <em style="border: 1px solid; ">some DEXIM</em> TXET.</pre>
730+
731+
Rendering (visual order) in a narrow containing block, resulting in one fragment:
732+
<pre>
733+
here is <em style="border: 1px solid; ">some DEXIM</em>
734+
TXET.
735+
</pre>
736+
</div>
737+
738+
<h5 id="bidi-fragment-boxes">
739+
Box Model of Reordering-induced Box Fragments</h5>
674740

675741
<!-- CSS2.1 8.6 -->
676742
<p>For each line box, UAs must take the fragments of each inline box
677-
and render the margins, borders and padding in visual order (not logical order).
743+
and assign the margins, borders and padding in visual order (not logical order).
678744
The <a>start</a>-most fragment on the first line box in which the box appears
679745
has the <a>start</a> edge's margin, border, and padding;
680746
and the end-most fragment on the last line box in which the box appears

css-writing-modes-4/Overview.bs

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,17 +665,83 @@ Paragraph Breaks Within Embeddings and Isolates</h4>
665665
<h4 id="bidi-box-model">
666666
Reordering-induced Box Fragmentation</h4>
667667

668-
<p>Since bidi reordering can split apart and reorder text that is
669-
logically contiguous, bidirectional text can cause an inline box
670-
to be split and reordered within a line.
668+
<p>Since bidi reordering can split apart and reorder text
669+
that is logically contiguous,
670+
bidirectional text can cause an <a>inline box</a> containing such text
671+
to be split and its fragments reordered within a line.
671672

672-
<p class="note">Note that in order to be able to flow inline boxes in a
673-
uniform direction (either entirely left-to-right or entirely
674-
right-to-left), anonymous inline boxes may have to be created.</p>
673+
<h5 id="bidi-fragmentation">
674+
Conditions of Reordering-induced Box Fragmentation</h5>
675+
676+
<p>
677+
When bidi reordering would split apart an inline box
678+
due to intervening content,
679+
the inline box is considered to be broken into multiple <a>box fragments</a>.
680+
[[CSS-BREAK-3]]
681+
The box is considered to be thus <a>fragmented</a>
682+
if it would be divided by intervening content on an infinitely long line,
683+
even if line breaking happens to result in both <a>box fragments</a>
684+
being placed adjacent to each other on the line.
685+
In such cases, the nearest common ancestor of text in the two <a>box fragments</a>
686+
(which determines certain aspects of text formatting
687+
such as <a spec="css-text">tracking</a> and <a href="https://www.w3.org/TR/css-text/#text-justify-property">justification</a>
688+
between the two <a>box fragments</a>, see [[CSS-TEXT-3]])
689+
is considered to be the nearest common ancestor of the two <a>box fragments</a>,
690+
not the <a>inline box</a> itself.
691+
However, an <a>inline box</a> is not considered to be broken
692+
into multiple <a>box fragments</a> due to bidi reordering
693+
if no intervening content would force it to split.
694+
(These rules maintain the integrity of an <a>inline box</a> where possible,
695+
while keeping bidi-induced fragmentation stable
696+
across variations in line-breaking.)
697+
<!-- See https://github.com/w3c/csswg-drafts/issues/1509 -->
698+
699+
<div class="example">
700+
In the following example, where lowercase letters represent LTR letters
701+
and uppercase letters represent RTL letters,
702+
bidi reordering causes the <code>&lt;em></code>’s <a>inline box</a>
703+
to be divided into two <a>box fragments</a>
704+
separated by text outside the <code>&lt;em</code>.
705+
706+
Source code (logical order):
707+
<pre>&lt;p>here is &lt;em>some MIXED&lt;/em> TEXT.&lt;/p></pre>
708+
709+
Rendering (visual order) in a wide containing block, resulting in two inline box fragments separated by external content:
710+
<pre>here is <em style="border: 1px solid; border-right: 1px dashed red">some </em>TXET <em style="border: 1px solid; border-left: 1px dashed red">DEXIM</em>.</pre>
711+
712+
Rendering (visual order) in a narrow containing block, resulting in two inline box fragments placed adjacent to each other:
713+
<pre>
714+
here is <em style="border: 1px solid; border-right: 1px dashed red">some </em><em style="border: 1px solid; border-left: 1px dashed red">DEXIM</em>
715+
TXET.
716+
</pre>
717+
</div>
718+
719+
<div class="example">
720+
By contrast, in this example,
721+
where the mixed-direction phrase is kept together with an isolation,
722+
only one fragment is generated--
723+
the surrounding content will never split the <code>&lt;em></code>’s <a>inline box</a>
724+
even inside an infinitely-long containing block:
725+
726+
Source code (logical order):
727+
<pre>&lt;p>here is &lt;em dir=rtl>some MIXED&lt;/em> TEXT.&lt;/p></pre>
728+
729+
Rendering (visual order) in a wide containing block, resulting in one fragment:
730+
<pre>here is <em style="border: 1px solid; ">some DEXIM</em> TXET.</pre>
731+
732+
Rendering (visual order) in a narrow containing block, resulting in one fragment:
733+
<pre>
734+
here is <em style="border: 1px solid; ">some DEXIM</em>
735+
TXET.
736+
</pre>
737+
</div>
738+
739+
<h5 id="bidi-fragment-boxes">
740+
Box Model of Reordering-induced Box Fragments</h5>
675741

676742
<!-- CSS2.1 8.6 -->
677743
<p>For each line box, UAs must take the fragments of each inline box
678-
and render the margins, borders and padding in visual order (not logical order).
744+
and assign the margins, borders and padding in visual order (not logical order).
679745
The <a>start</a>-most fragment on the first line box in which the box appears
680746
has the <a>start</a> edge's margin, border, and padding;
681747
and the end-most fragment on the last line box in which the box appears
@@ -696,7 +762,7 @@ Reordering-induced Box Fragmentation</h4>
696762
<p>Analogous rules hold for vertical writing modes.</p>
697763

698764
<p class="note">The 'box-decoration-break' property can override this behavior
699-
to draw box decorations on both sides of each fragment. [[!CSS3-BREAK]]
765+
to draw box decorations on both sides of each fragment. [[!CSS-BREAK-3]]
700766

701767
<h2 id="vertical-modes">
702768
Vertical Writing Modes</h2>

0 commit comments

Comments
 (0)