Title: [96431] trunk
Revision
96431
Author
[email protected]
Date
2011-09-30 15:12:37 -0700 (Fri, 30 Sep 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=69173
        
RTL/LTR mixtures still not correct in regions. Simplify the loop once I realized it's only
your directionality that matters and not your containing block's.

Reviewed by Dan Bernstein.

Source/WebCore: 

Added new test in fast/regions.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderBoxRectInRegion):

LayoutTests: 

* fast/regions/multiple-directionality-changes-in-variable-width-regions.html: Added.
* platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Added.
* platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96430 => 96431)


--- trunk/LayoutTests/ChangeLog	2011-09-30 22:00:33 UTC (rev 96430)
+++ trunk/LayoutTests/ChangeLog	2011-09-30 22:12:37 UTC (rev 96431)
@@ -1,3 +1,16 @@
+2011-09-30  David Hyatt  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=69173
+        
+        RTL/LTR mixtures still not correct in regions. Simplify the loop once I realized it's only
+        your directionality that matters and not your containing block's.
+
+        Reviewed by Dan Bernstein.
+
+        * fast/regions/multiple-directionality-changes-in-variable-width-regions.html: Added.
+        * platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Added.
+        * platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt: Added.
+
 2011-09-30  Dan Bernstein  <[email protected]>
 
         <rdar://problem/10208291> first-letter in generated before content with display: table is not updated

Added: trunk/LayoutTests/fast/regions/multiple-directionality-changes-in-variable-width-regions.html (0 => 96431)


--- trunk/LayoutTests/fast/regions/multiple-directionality-changes-in-variable-width-regions.html	                        (rev 0)
+++ trunk/LayoutTests/fast/regions/multiple-directionality-changes-in-variable-width-regions.html	2011-09-30 22:12:37 UTC (rev 96431)
@@ -0,0 +1,64 @@
+<!doctype html>
+<html>
+<head>
+ <style>
+    #content {
+        -webkit-flow: "flow1";
+        text-align: justify;
+        padding: 5px;
+        direction: rtl;
+        margin:0 5%;
+    }
+    
+    #first-box {
+        border: 1px solid blue;
+        margin:10px 5%;
+        direction:ltr;
+        height:340px;
+    }
+    
+    #second-box {
+        margin:10px 10%;
+        border: 1px solid green;
+        direction:rtl
+    }
+    
+    #region1, #region2, #region3 {
+        border: 1px solid black;
+        content: -webkit-from-flow("flow1");
+    }
+
+    #region1 {
+        width: 400px;
+        height: 100px;
+    }
+    
+    #region2 {
+        width: 500px;
+        height: 180px;
+    }
+    
+    #region3 {
+        width: 200px;
+        height: 120px;
+    }
+    
+    p { direction: ltr }
+</style>
+</head>
+<body>
+<div id="content">
+   <div id="first-box">
+        <div id="second-box">
+            <p>This line of text should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region.</p>
+            <p>This line of text should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region. This line of text should not get out of the region.</p>
+            <p>This line of text should not get out of the region.</p>
+        </div>
+    </div>
+</div>
+
+<div id="container">
+    <div id="region1"></div>
+    <div id="region2"></div>
+    <div id="region3"></div>
+</div>
\ No newline at end of file

Added: trunk/LayoutTests/platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt (0 => 96431)


--- trunk/LayoutTests/platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt	2011-09-30 22:12:37 UTC (rev 96431)
@@ -0,0 +1,36 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x422
+  RenderBlock {HTML} at (0,0) size 800x422
+    RenderBody {BODY} at (8,8) size 784x406
+      RenderBlock {DIV} at (0,0) size 784x406
+        RenderRegion {DIV} at (0,0) size 402x102 [border: (1px solid #000000)]
+        RenderRegion {DIV} at (0,102) size 502x182 [border: (1px solid #000000)]
+        RenderRegion {DIV} at (0,284) size 202x122 [border: (1px solid #000000)]
+Flow Threads
+  Thread with flow-name 'flow1'
+    layer at (0,0) size 500x400
+      RenderFlowThread at (0,0) size 500x400
+        RenderBlock {DIV} at (25,0) size 450x372
+          RenderBlock {DIV} at (27,15) size 396x342 [border: (1px solid #0000FF)]
+            RenderBlock {DIV} at (40,11) size 316x249 [border: (1px solid #008000)]
+              RenderBlock {P} at (1,17) size 314x93
+                RenderText {#text} at (-18,0) size 332x93
+                  text run at (-18,0) width 250: "This line of text should not get out of"
+                  text run at (-18,18) width 250: "the region. This line of text should not"
+                  text run at (-18,36) width 250: "get out of the region. This line of text"
+                  text run at (0,57) width 314: "should not get out of the region. This line of text"
+                  text run at (0,75) width 201: "should not get out of the region."
+              RenderBlock {P} at (1,126) size 314x72
+                RenderText {#text} at (0,0) size 314x72
+                  text run at (0,0) width 314: "This line of text should not get out of the region."
+                  text run at (0,18) width 314: "This line of text should not get out of the region."
+                  text run at (0,36) width 314: "This line of text should not get out of the region."
+                  text run at (0,54) width 304: "This line of text should not get out of the region."
+              RenderBlock {P} at (1,214) size 314x18
+                RenderText {#text} at (0,0) size 304x18
+                  text run at (0,0) width 304: "This line of text should not get out of the region."
+  Regions for flow 'flow1'
+    RenderRegion {DIV} #region1 with index 0
+    RenderRegion {DIV} #region2 with index 0
+    RenderRegion {DIV} #region3 with index 0

Modified: trunk/Source/WebCore/ChangeLog (96430 => 96431)


--- trunk/Source/WebCore/ChangeLog	2011-09-30 22:00:33 UTC (rev 96430)
+++ trunk/Source/WebCore/ChangeLog	2011-09-30 22:12:37 UTC (rev 96431)
@@ -1,3 +1,17 @@
+2011-09-30  David Hyatt  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=69173
+        
+        RTL/LTR mixtures still not correct in regions. Simplify the loop once I realized it's only
+        your directionality that matters and not your containing block's.
+
+        Reviewed by Dan Bernstein.
+
+        Added new test in fast/regions.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::borderBoxRectInRegion):
+
 2011-09-30  Dan Bernstein  <[email protected]>
 
         <rdar://problem/10208291> first-letter in generated before content with display: table is not updated

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (96430 => 96431)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-09-30 22:00:33 UTC (rev 96430)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-09-30 22:12:37 UTC (rev 96431)
@@ -215,21 +215,11 @@
     const RenderBox* currentBox = containingBlock();
     boxInfo = currentBox->renderBoxRegionInfo(region);
     while (boxInfo && boxInfo->isShifted()) {
-        RenderBox* containerBox = currentBox->containingBlock();
-        LayoutUnit widthDelta = currentBox->logicalWidth() - boxInfo->logicalWidth();
-        if (containerBox->style()->direction() == LTR) {
-            if (currentBox->style()->direction() == RTL)
-                logicalLeft -= widthDelta;
-            else
-                logicalLeft += boxInfo->logicalLeft();
-            
-        } else {
-            if (currentBox->style()->direction() == LTR)
-                logicalLeft += widthDelta;
-            else
-                logicalLeft -= widthDelta - boxInfo->logicalLeft();
-        }
-        currentBox = containerBox;
+        if (currentBox->style()->direction() == LTR)
+            logicalLeft += boxInfo->logicalLeft();
+        else
+            logicalLeft -= (currentBox->logicalWidth() - boxInfo->logicalWidth()) - boxInfo->logicalLeft();
+        currentBox = currentBox->containingBlock();
         boxInfo = currentBox->renderBoxRegionInfo(region);
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to