Title: [97693] trunk
Revision
97693
Author
[email protected]
Date
2011-10-17 18:33:11 -0700 (Mon, 17 Oct 2011)

Log Message

Unreviewed, rolling out r97661.
http://trac.webkit.org/changeset/97661

Confirmed this patch was not the cause of the test failures.

Source/WebCore:

display:inline-block elements don't correctly handle orthogonal writing-modes
https://bugs.webkit.org/show_bug.cgi?id=69957

Reading min/maxPreferredLogicalWidth from a child uses the child's writing-mode.
Instead, we need to grab the result based on the parent's writing-mode.
In the case of orthogonal writing-modes, we need the child's logical height.

Tests: fast/writing-mode/borders-expected.html
       fast/writing-mode/borders.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):

LayoutTests:

display:inline-block elements don't correctly handle orthogonal writing-modes
https://bugs.webkit.org/show_bug.cgi?id=69957

* fast/writing-mode/borders-expected.html: Added.
* fast/writing-mode/borders.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97692 => 97693)


--- trunk/LayoutTests/ChangeLog	2011-10-18 01:24:02 UTC (rev 97692)
+++ trunk/LayoutTests/ChangeLog	2011-10-18 01:33:11 UTC (rev 97693)
@@ -1,3 +1,16 @@
+2011-10-12  Ojan Vafai  <[email protected]>
+
+        Unreviewed, rolling out r97661.
+        http://trac.webkit.org/changeset/97661
+
+        Confirmed this patch was not the cause of the test failures.
+
+        display:inline-block elements don't correctly handle orthogonal writing-modes 
+        https://bugs.webkit.org/show_bug.cgi?id=69957 
+        
+        * fast/writing-mode/borders-expected.html: Added. 
+        * fast/writing-mode/borders.html: Added. 
+
 2011-10-17  Kenji Imasaki  <[email protected]>
 
         [Chromium] rebaseline fullscreen layout tests using rebaseline tools.

Added: trunk/LayoutTests/fast/writing-mode/borders-expected.html (0 => 97693)


--- trunk/LayoutTests/fast/writing-mode/borders-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/borders-expected.html	2011-10-18 01:33:11 UTC (rev 97693)
@@ -0,0 +1,29 @@
+<style>
+.container {
+    border: 5px solid red;
+    display: inline-block;
+}
+.box {
+    border: 5px solid;
+    width: 100px;
+    height: 50px;
+}
+</style>
+
+<div>The four boxes below should look identical.</div>
+
+<div class="container">
+    <div class="box"></div>
+</div>
+
+<div class="container">
+    <div class="box"></div>
+</div>
+
+<div class="container">
+    <div class="box"></div>
+</div>
+
+<div class="container">
+    <div class="box"></div>
+</div>
Property changes on: trunk/LayoutTests/fast/writing-mode/borders-expected.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/writing-mode/borders.html (0 => 97693)


--- trunk/LayoutTests/fast/writing-mode/borders.html	                        (rev 0)
+++ trunk/LayoutTests/fast/writing-mode/borders.html	2011-10-18 01:33:11 UTC (rev 97693)
@@ -0,0 +1,29 @@
+<style>
+.container {
+    border: 5px solid red;
+    display: inline-block;
+}
+.box {
+    border: 5px solid;
+    width: 100px;
+    height: 50px;
+}
+</style>
+
+<div>The four boxes below should look identical.</div>
+
+<div class="container">
+    <div class="box" style="-webkit-writing-mode: horizontal-tb;"></div>
+</div>
+
+<div class="container">
+    <div class="box" style="-webkit-writing-mode: horitzontal-bt;"></div>
+</div>
+
+<div class="container">
+    <div class="box" style="-webkit-writing-mode: vertical-lr;"></div>
+</div>
+
+<div class="container">
+    <div class="box" style="-webkit-writing-mode: vertical-rl;"></div>
+</div>
Property changes on: trunk/LayoutTests/fast/writing-mode/borders.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (97692 => 97693)


--- trunk/Source/WebCore/ChangeLog	2011-10-18 01:24:02 UTC (rev 97692)
+++ trunk/Source/WebCore/ChangeLog	2011-10-18 01:33:11 UTC (rev 97693)
@@ -1,3 +1,23 @@
+2011-10-12  Ojan Vafai  <[email protected]>
+
+        Unreviewed, rolling out r97661.
+        http://trac.webkit.org/changeset/97661
+
+        Confirmed this patch was not the cause of the test failures.
+
+        display:inline-block elements don't correctly handle orthogonal writing-modes 
+        https://bugs.webkit.org/show_bug.cgi?id=69957 
+        
+        Reading min/maxPreferredLogicalWidth from a child uses the child's writing-mode. 
+        Instead, we need to grab the result based on the parent's writing-mode. 
+        In the case of orthogonal writing-modes, we need the child's logical height. 
+    
+        Tests: fast/writing-mode/borders-expected.html 
+               fast/writing-mode/borders.html 
+        
+        * rendering/RenderBlock.cpp: 
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): 
+
 2011-10-17  James Robinson  <[email protected]>
 
         Unreviewed, rolling out r97690.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (97692 => 97693)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-10-18 01:24:02 UTC (rev 97692)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-10-18 01:33:11 UTC (rev 97693)
@@ -5248,14 +5248,27 @@
             marginEnd += endMarginLength.value();
         margin = marginStart + marginEnd;
 
-        LayoutUnit w = child->minPreferredLogicalWidth() + margin;
+        LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogicalWidth;
+        if (child->isBox() && child->isHorizontalWritingMode() != isHorizontalWritingMode()) {
+            RenderBox* childBox = toRenderBox(child);
+            LayoutUnit oldHeight = childBox->logicalHeight();
+            setLogicalHeight(childBox->borderAndPaddingLogicalHeight());
+            childBox->computeLogicalHeight();
+            childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = childBox->logicalHeight();
+            childBox->setLogicalHeight(oldHeight);
+        } else {
+            childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
+            childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
+        }
+
+        LayoutUnit w = childMinPreferredLogicalWidth + margin;
         m_minPreferredLogicalWidth = max(w, m_minPreferredLogicalWidth);
         
         // IE ignores tables for calculation of nowrap. Makes some sense.
         if (nowrap && !child->isTable())
             m_maxPreferredLogicalWidth = max(w, m_maxPreferredLogicalWidth);
 
-        w = child->maxPreferredLogicalWidth() + margin;
+        w = childMaxPreferredLogicalWidth + margin;
 
         if (!child->isFloating()) {
             if (child->isBox() && toRenderBox(child)->avoidsFloats()) {
@@ -5267,7 +5280,7 @@
                 LayoutUnit marginLogicalRight = ltr ? marginEnd : marginStart;
                 LayoutUnit maxLeft = marginLogicalLeft > 0 ? max(floatLeftWidth, marginLogicalLeft) : floatLeftWidth + marginLogicalLeft;
                 LayoutUnit maxRight = marginLogicalRight > 0 ? max(floatRightWidth, marginLogicalRight) : floatRightWidth + marginLogicalRight;
-                w = child->maxPreferredLogicalWidth() + maxLeft + maxRight;
+                w = childMaxPreferredLogicalWidth + maxLeft + maxRight;
                 w = max(w, floatLeftWidth + floatRightWidth);
             }
             else
@@ -5296,6 +5309,7 @@
         // of 100px because of the table.
         // We can achieve this effect by making the maxwidth of blocks that contain tables
         // with percentage widths be infinite (as long as they are not inside a table cell).
+        // FIXME: There is probably a bug here with orthogonal writing modes since we check logicalWidth only using the child's writing mode.
         if (containingBlock && document()->inQuirksMode() && child->style()->logicalWidth().isPercent()
             && !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
             RenderBlock* cb = containingBlock;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to