[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

xji at chromium.org xji at chromium.org
Mon Feb 21 00:32:22 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit b0ad6eb828de07284c50876ae5052ed09395f904
Author: xji at chromium.org <xji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 1 20:02:06 2011 +0000

    2011-02-01  Xiaomei Ji  <xji at chromium.org>
    
            Reviewed by David Hyatt.
    
            Fix a text rendering problem when enclosing block is RTL and text runs
            are in different directionality.
            https://bugs.webkit.org/show_bug.cgi?id=34176
    
            The problem happens in the following example scenario (ABC represents
            Hebrew characters):
            <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
    
            The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which
            TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1.
            TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1.
    
            The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2.
    
            Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes()
            creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for
            the run's render object's ancestor (not only its parent) has already
            been constructed or has something following it on the line, in which
            case, create a new box for TextRun2 instead of sharing the same box with
            TextRun3.
    
            In other words, the following 2 div should render the same results
            (ABC represents Hebrew characters).
            <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
            <div dir=rtl>this is a <span>Test <span>ABC</span></span></div>
    
            Test: fast/dom/34176.html
    
            * rendering/RenderBlockLineLayout.cpp:
            (WebCore::parentIsConstructedOrHaveNext):
            (WebCore::RenderBlock::createLineBoxes):
    2011-02-01  Xiaomei Ji  <xji at chromium.org>
    
            Reviewed by David Hyatt.
    
            Fix a text rendering problem when enclosing block is RTL and text runs
            are in different directionality.
            https://bugs.webkit.org/show_bug.cgi?id=34176
    
            The problem happens in the following example scenario (ABC represents
            Hebrew characters):
            <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
    
            The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which
            TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1.
            TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1.
    
            The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2.
    
            Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes()
            creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for
            the run's render object's ancestor (not only its parent) has already
            been constructed or has something following it on the line, in which
            case, create a new box for TextRun2 instead of sharing the same box with
            TextRun3.
    
            In other words, the following 2 div should render the same results
            (ABC represents Hebrew characters).
            <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
            <div dir=rtl>this is a <span>Test <span>ABC</span></span></div>
    
            * fast/dom/34176.html: Added.
            * platform/mac/fast/dom/34176-expected.checksum: Added.
            * platform/mac/fast/dom/34176-expected.png: Added.
            * platform/mac/fast/dom/34176-expected.txt: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77267 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 02693aa..5f313f5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,38 @@
+2011-02-01  Xiaomei Ji  <xji at chromium.org>
+
+        Reviewed by David Hyatt.
+
+        Fix a text rendering problem when enclosing block is RTL and text runs
+        are in different directionality.
+        https://bugs.webkit.org/show_bug.cgi?id=34176
+
+        The problem happens in the following example scenario (ABC represents 
+        Hebrew characters):
+        <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
+
+        The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which
+        TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1.
+        TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1.
+
+        The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2.
+
+        Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes()
+        creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for
+        the run's render object's ancestor (not only its parent) has already 
+        been constructed or has something following it on the line, in which 
+        case, create a new box for TextRun2 instead of sharing the same box with
+        TextRun3.
+
+        In other words, the following 2 div should render the same results
+        (ABC represents Hebrew characters).
+        <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
+        <div dir=rtl>this is a <span>Test <span>ABC</span></span></div>
+
+        * fast/dom/34176.html: Added.
+        * platform/mac/fast/dom/34176-expected.checksum: Added.
+        * platform/mac/fast/dom/34176-expected.png: Added.
+        * platform/mac/fast/dom/34176-expected.txt: Added.
+
 2011-02-01  Mihai Parparita  <mihaip at chromium.org>
 
         Unreviewed. Include actual values in fast/canvas/webgl/gl-teximage.html
diff --git a/LayoutTests/fast/dom/34176.html b/LayoutTests/fast/dom/34176.html
new file mode 100755
index 0000000..e20a7b3
Binary files /dev/null and b/LayoutTests/fast/dom/34176.html differ
diff --git a/LayoutTests/platform/mac/fast/dom/34176-expected.checksum b/LayoutTests/platform/mac/fast/dom/34176-expected.checksum
new file mode 100644
index 0000000..f94cc9a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/dom/34176-expected.checksum
@@ -0,0 +1 @@
+9cae7936753d75b4040cf4985efd25a5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/dom/34176-expected.png b/LayoutTests/platform/mac/fast/dom/34176-expected.png
new file mode 100644
index 0000000..415e838
Binary files /dev/null and b/LayoutTests/platform/mac/fast/dom/34176-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/dom/34176-expected.txt b/LayoutTests/platform/mac/fast/dom/34176-expected.txt
new file mode 100644
index 0000000..3300810
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/dom/34176-expected.txt
@@ -0,0 +1,389 @@
+layer at (0,0) size 785x1458
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x1458
+  RenderBlock {HTML} at (0,0) size 785x1458
+    RenderBody {BODY} at (8,16) size 769x1426
+      RenderBlock {P} at (0,0) size 769x54
+        RenderText {#text} at (10,0) size 759x54
+          text run at (10,0) width 404: "Test rendering of 3 text runs -- TextRun1 TextRun2 TextRun3, "
+          text run at (414,0) width 355: "in which TextRun1 and TextRun2's bidi level are 2, and"
+          text run at (50,18) width 719: "TextRun3's bidi level is 1. TextRun2 and TextRun3 are siblings. But their ancestor (not their parent) is a sibling of"
+          text run at (89,36) width 72: "TextRun1. "
+          text run at (161,36) width 608: "The visual order should be TextRun3 TextRun1 TextRun2, not TextRun3 TextRun2 TextRun1."
+      RenderBlock {HR} at (0,70) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,88) size 769x19
+        RenderText {#text} at (305,1) size 464x18
+          text run at (305,1) width 341: "Pure text. The following 3 lines should all display as \""
+          text run at (646,1) width 28 RTL: "\x{5E9}\x{5E0}\x{5D1}"
+          text run at (674,1) width 95: " This is a Test\""
+      RenderBlock {DIV} at (0,123) size 769x19 [bgcolor=#FF0000]
+        RenderText {#text} at (685,1) size 57x18
+          text run at (685,1) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 116x18
+          RenderInline {SPAN} at (0,0) size 116x18
+            RenderText {#text} at (681,1) size 88x18
+              text run at (681,1) width 4 RTL: " "
+              text run at (742,1) width 27: "Test"
+            RenderInline {SPAN} at (0,0) size 28x18
+              RenderText {#text} at (653,1) size 28x18
+                text run at (653,1) width 28 RTL: "\x{5E9}\x{5E0}\x{5D1}"
+      RenderBlock {DIV} at (0,142) size 769x19 [bgcolor=#FF0000]
+        RenderText {#text} at (685,1) size 57x18
+          text run at (685,1) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 116x18
+          RenderInline {SPAN} at (0,0) size 116x18
+            RenderInline {SPAN} at (0,0) size 116x18
+              RenderText {#text} at (681,1) size 88x18
+                text run at (681,1) width 4 RTL: " "
+                text run at (742,1) width 27: "Test"
+              RenderInline {SPAN} at (0,0) size 28x18
+                RenderText {#text} at (653,1) size 28x18
+                  text run at (653,1) width 28 RTL: "\x{5E9}\x{5E0}\x{5D1}"
+      RenderBlock {DIV} at (0,161) size 769x19
+        RenderText {#text} at (685,1) size 57x18
+          text run at (685,1) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 116x18
+          RenderText {#text} at (681,1) size 88x18
+            text run at (681,1) width 4 RTL: " "
+            text run at (742,1) width 27: "Test"
+          RenderInline {SPAN} at (0,0) size 28x18
+            RenderText {#text} at (653,1) size 28x18
+              text run at (653,1) width 28 RTL: "\x{5E9}\x{5E0}\x{5D1}"
+      RenderBlock {HR} at (0,188) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,206) size 769x18
+        RenderText {#text} at (319,0) size 450x18
+          text run at (319,0) width 450: "Text in <em>. The English text should be displayed as \"This is a Test\"."
+      RenderBlock {DIV} at (0,240) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 83x18
+          RenderInline {EM} at (0,0) size 83x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,258) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 83x18
+          RenderInline {EM} at (0,0) size 83x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,276) size 769x19 [bgcolor=#FF0000]
+        RenderText {#text} at (686,1) size 57x18
+          text run at (686,1) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 118x18
+          RenderInline {EM} at (0,0) size 118x18
+            RenderText {#text} at (682,1) size 87x18
+              text run at (682,1) width 4 RTL: " "
+              text run at (743,1) width 26: "Test"
+            RenderInline {SPAN} at (0,0) size 31x18
+              RenderText {#text} at (651,1) size 31x18
+                text run at (651,1) width 31 RTL: "\x{5D3}\x{5DE}\x{5D4}"
+      RenderBlock {DIV} at (0,295) size 769x18
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 26x18
+          RenderInline {EM} at (0,0) size 26x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+      RenderBlock {DIV} at (0,313) size 769x18
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 26x18
+          RenderInline {EM} at (0,0) size 26x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+      RenderBlock {HR} at (0,339) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,357) size 769x18
+        RenderText {#text} at (295,0) size 474x18
+          text run at (295,0) width 474: "Text in <strong>. The following lines should all display as \"This is a Test\"."
+      RenderBlock {DIV} at (0,391) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 86x18
+          RenderInline {STRONG} at (0,0) size 86x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,409) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 86x18
+          RenderInline {STRONG} at (0,0) size 86x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,427) size 769x18
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 29x18
+          RenderInline {STRONG} at (0,0) size 29x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+      RenderBlock {DIV} at (0,445) size 769x18
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 29x18
+          RenderInline {STRONG} at (0,0) size 29x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+      RenderBlock {HR} at (0,471) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,489) size 769x18
+        RenderText {#text} at (330,0) size 439x18
+          text run at (330,0) width 439: "Text in <i>. The following lines should all display as \"This is a Test\"."
+      RenderBlock {DIV} at (0,523) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 83x18
+          RenderInline {I} at (0,0) size 83x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,541) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 83x18
+          RenderInline {I} at (0,0) size 83x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,559) size 769x18
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 26x18
+          RenderInline {I} at (0,0) size 26x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+      RenderBlock {DIV} at (0,577) size 769x18
+        RenderText {#text} at (686,0) size 57x18
+          text run at (686,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 26x18
+          RenderInline {I} at (0,0) size 26x18
+            RenderText {#text} at (743,0) size 26x18
+              text run at (743,0) width 26: "Test"
+      RenderBlock {HR} at (0,603) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,621) size 769x18
+        RenderText {#text} at (326,0) size 443x18
+          text run at (326,0) width 443: "Text in <b>. The following lines should all display as \"This is a Test\"."
+      RenderBlock {DIV} at (0,655) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 86x18
+          RenderInline {B} at (0,0) size 86x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,673) size 769x18 [bgcolor=#FF0000]
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 86x18
+          RenderInline {B} at (0,0) size 86x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+            RenderInline {SPAN} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,691) size 769x18
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 29x18
+          RenderInline {B} at (0,0) size 29x18
+            RenderInline {SPAN} at (0,0) size 0x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+      RenderBlock {DIV} at (0,709) size 769x18
+        RenderText {#text} at (683,0) size 57x18
+          text run at (683,0) width 57: "This is a "
+        RenderInline {SPAN} at (0,0) size 29x18
+          RenderInline {B} at (0,0) size 29x18
+            RenderText {#text} at (740,0) size 29x18
+              text run at (740,0) width 29: "Test"
+      RenderBlock (anonymous) at (0,727) size 769x0
+        RenderInline {B} at (0,0) size 0x0
+          RenderText {#text} at (0,0) size 0x0
+      RenderBlock (anonymous) at (0,735) size 769x691
+        RenderBlock {HR} at (0,0) size 769x2 [border: (1px inset #000000)]
+        RenderBlock {P} at (0,18) size 769x18
+          RenderText {#text} at (97,0) size 672x18
+            text run at (97,0) width 672: "Text in <img>, <href>, <em>, <tr>. The following English text should all display as \"This is a Test\"."
+        RenderBlock {DIV} at (0,52) size 769x24 [bgcolor=#FF0000]
+          RenderText {#text} at (680,6) size 60x18
+            text run at (680,6) width 60: "This is a "
+          RenderInline {SPAN} at (0,0) size 109x18
+            RenderInline {A} at (0,0) size 109x18 [color=#0000EE]
+              RenderText {#text} at (740,6) size 29x18
+                text run at (740,6) width 29: "Test"
+              RenderInline {SPAN} at (0,0) size 20x18
+                RenderImage {IMG} at (660,0) size 20x20
+        RenderBlock {DIV} at (0,76) size 769x19 [bgcolor=#FF0000]
+          RenderText {#text} at (680,1) size 60x18
+            text run at (680,1) width 60: "This is a "
+          RenderInline {SPAN} at (0,0) size 122x18
+            RenderInline {A} at (0,0) size 122x18 [color=#0000EE]
+              RenderText {#text} at (676,1) size 93x18
+                text run at (676,1) width 4 RTL: " "
+                text run at (740,1) width 29: "Test"
+              RenderInline {SPAN} at (0,0) size 29x18
+                RenderText {#text} at (647,1) size 29x18
+                  text run at (647,1) width 29 RTL: "\x{5E9}\x{5E0}\x{5D1}"
+        RenderBlock {DIV} at (0,95) size 769x18 [bgcolor=#FF0000]
+          RenderText {#text} at (682,0) size 60x18
+            text run at (682,0) width 60: "This is a "
+          RenderInline {SPAN} at (0,0) size 87x18
+            RenderInline {EM} at (0,0) size 87x18
+              RenderText {#text} at (742,0) size 27x18
+                text run at (742,0) width 27: "Test"
+              RenderInline {A} at (0,0) size 0x18 [color=#0000EE]
+        RenderBlock {DIV} at (0,113) size 769x24 [bgcolor=#FF0000]
+          RenderText {#text} at (682,6) size 60x18
+            text run at (682,6) width 60: "This is a "
+          RenderInline {SPAN} at (0,0) size 107x18
+            RenderInline {EM} at (0,0) size 107x18
+              RenderText {#text} at (742,6) size 27x18
+                text run at (742,6) width 27: "Test"
+              RenderInline {SPAN} at (0,0) size 20x18
+                RenderImage {IMG} at (662,0) size 20x20
+        RenderBlock {DIV} at (0,137) size 769x18
+          RenderText {#text} at (639,0) size 60x18
+            text run at (639,0) width 60: "This is a "
+          RenderInline {SPAN} at (0,0) size 70x18
+            RenderInline {A} at (0,0) size 70x18 [color=#0000EE]
+              RenderText {#text} at (699,0) size 33x18
+                text run at (699,0) width 33: "Test "
+              RenderInline {SPAN} at (0,0) size 37x18
+                RenderText {#text} at (732,0) size 37x18
+                  text run at (732,0) width 37: "again"
+        RenderBlock {DIV} at (0,155) size 769x42
+          RenderBlock (anonymous) at (0,0) size 769x18
+            RenderText {#text} at (682,0) size 60x18
+              text run at (682,0) width 60: "This is a "
+            RenderInline {SPAN} at (0,0) size 27x18
+              RenderInline {EM} at (0,0) size 27x18
+                RenderText {#text} at (742,0) size 27x18
+                  text run at (742,0) width 27: "Test"
+          RenderBlock (anonymous) at (0,18) size 769x24
+            RenderTable {TABLE} at (755,0) size 14x24
+              RenderTableSection {TBODY} at (0,0) size 14x24
+                RenderTableRow {TR} at (0,2) size 14x20
+                  RenderTableCell {TD} at (2,2) size 10x20 [r=0 c=0 rs=1 cs=1]
+                    RenderText {#text} at (1,1) size 8x18
+                      text run at (1,1) width 8: "a"
+          RenderBlock (anonymous) at (0,42) size 769x0
+            RenderInline {SPAN} at (0,0) size 0x0
+              RenderInline {EM} at (0,0) size 0x0
+        RenderBlock {HR} at (0,205) size 769x2 [border: (1px inset #000000)]
+        RenderBlock {UL} at (0,223) size 769x468
+          RenderListItem {LI} at (40,0) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 0: : Success"
+          RenderListItem {LI} at (40,18) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 1: : Success"
+          RenderListItem {LI} at (40,36) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 2: : Success"
+          RenderListItem {LI} at (40,54) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 3: : Success"
+          RenderListItem {LI} at (40,72) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 4: : Success"
+          RenderListItem {LI} at (40,90) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 5: : Success"
+          RenderListItem {LI} at (40,108) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 6: : Success"
+          RenderListItem {LI} at (40,126) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 7: : Success"
+          RenderListItem {LI} at (40,144) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 8: : Success"
+          RenderListItem {LI} at (40,162) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 110x18
+              text run at (0,0) width 110: "Test 9: : Success"
+          RenderListItem {LI} at (40,180) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 10: : Success"
+          RenderListItem {LI} at (40,198) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 11: : Success"
+          RenderListItem {LI} at (40,216) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 12: : Success"
+          RenderListItem {LI} at (40,234) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 13: : Success"
+          RenderListItem {LI} at (40,252) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 14: : Success"
+          RenderListItem {LI} at (40,270) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 15: : Success"
+          RenderListItem {LI} at (40,288) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 16: : Success"
+          RenderListItem {LI} at (40,306) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 17: : Success"
+          RenderListItem {LI} at (40,324) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 18: : Success"
+          RenderListItem {LI} at (40,342) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 19: : Success"
+          RenderListItem {LI} at (40,360) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 20: : Success"
+          RenderListItem {LI} at (40,378) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 21: : Success"
+          RenderListItem {LI} at (40,396) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 22: : Success"
+          RenderListItem {LI} at (40,414) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 23: : Success"
+          RenderListItem {LI} at (40,432) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 24: : Success"
+          RenderListItem {LI} at (40,450) size 729x18
+            RenderListMarker at (-17,0) size 7x18: bullet
+            RenderText {#text} at (0,0) size 118x18
+              text run at (0,0) width 118: "Test 25: : Success"
+      RenderBlock (anonymous) at (0,1442) size 769x0
+        RenderInline {B} at (0,0) size 0x0
+selection start: position 0 of child 0 {#text} of child 14 {DIV} of child 56 {B} of body
+selection end:   position 4 of child 0 {#text} of child 14 {DIV} of child 56 {B} of body
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 09ed729..1384de6 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,39 @@
+2011-02-01  Xiaomei Ji  <xji at chromium.org>
+
+        Reviewed by David Hyatt.
+
+        Fix a text rendering problem when enclosing block is RTL and text runs
+        are in different directionality.
+        https://bugs.webkit.org/show_bug.cgi?id=34176
+
+        The problem happens in the following example scenario (ABC represents 
+        Hebrew characters):
+        <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
+
+        The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which
+        TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1.
+        TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1.
+
+        The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2.
+
+        Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes()
+        creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for
+        the run's render object's ancestor (not only its parent) has already 
+        been constructed or has something following it on the line, in which 
+        case, create a new box for TextRun2 instead of sharing the same box with
+        TextRun3.
+
+        In other words, the following 2 div should render the same results
+        (ABC represents Hebrew characters).
+        <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div>
+        <div dir=rtl>this is a <span>Test <span>ABC</span></span></div>
+
+        Test: fast/dom/34176.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::parentIsConstructedOrHaveNext):
+        (WebCore::RenderBlock::createLineBoxes):
+
 2011-02-01  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by Dan Bernstein.
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 34a1a2c..9909d98 100644
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -184,6 +184,16 @@ static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout)
         toRenderInline(o)->dirtyLineBoxes(fullLayout);
 }
 
+static bool parentIsConstructedOrHaveNext(InlineFlowBox* parentBox)
+{
+    do {
+        if (parentBox->isConstructed() || parentBox->nextOnLine())
+            return true;
+        parentBox = parentBox->parent();
+    } while (parentBox);
+    return false;
+}
+
 InlineFlowBox* RenderBlock::createLineBoxes(RenderObject* obj, bool firstLine)
 {
     // See if we have an unconstructed line box for this object that is also
@@ -198,13 +208,13 @@ InlineFlowBox* RenderBlock::createLineBoxes(RenderObject* obj, bool firstLine)
         // Get the last box we made for this render object.
         parentBox = obj->isRenderInline() ? toRenderInline(obj)->lastLineBox() : toRenderBlock(obj)->lastLineBox();
 
-        // If this box is constructed then it is from a previous line, and we need
-        // to make a new box for our line.  If this box is unconstructed but it has
+        // If this box or its ancestor is constructed then it is from a previous line, and we need
+        // to make a new box for our line.  If this box or its ancestor is unconstructed but it has
         // something following it on the line, then we know we have to make a new box
         // as well.  In this situation our inline has actually been split in two on
         // the same line (this can happen with very fancy language mixtures).
         bool constructedNewBox = false;
-        if (!parentBox || parentBox->isConstructed() || parentBox->nextOnLine()) {
+        if (!parentBox || parentIsConstructedOrHaveNext(parentBox)) {
             // We need to make a new box for this render object.  Once
             // made, we need to place it at the end of the current line.
             InlineBox* newBox = createInlineBoxForRenderer(obj, obj == this);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list