@@ -665,17 +665,83 @@ Paragraph Breaks Within Embeddings and Isolates</h4>
665
665
<h4 id="bidi-box-model">
666
666
Reordering-induced Box Fragmentation</h4>
667
667
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.
671
672
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> <em></code> ’s <a>inline box</a>
703
+ to be divided into two <a>box fragments</a>
704
+ separated by text outside the <code> <em</code> .
705
+
706
+ Source code (logical order):
707
+ <pre> <p>here is <em>some MIXED</em> TEXT.</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> <em></code> ’s <a>inline box</a>
724
+ even inside an infinitely-long containing block:
725
+
726
+ Source code (logical order):
727
+ <pre> <p>here is <em dir=rtl>some MIXED</em> TEXT.</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>
675
741
676
742
<!-- CSS2.1 8.6 -->
677
743
<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).
679
745
The <a>start</a> -most fragment on the first line box in which the box appears
680
746
has the <a>start</a> edge's margin, border, and padding;
681
747
and the end-most fragment on the last line box in which the box appears
@@ -696,7 +762,7 @@ Reordering-induced Box Fragmentation</h4>
696
762
<p> Analogous rules hold for vertical writing modes.</p>
697
763
698
764
<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 ]]
700
766
701
767
<h2 id="vertical-modes">
702
768
Vertical Writing Modes</h2>
0 commit comments