Title: [96157] trunk
Revision
96157
Author
commit-qu...@webkit.org
Date
2011-09-27 14:19:16 -0700 (Tue, 27 Sep 2011)

Log Message

Unreviewed, rolling out r96139.
http://trac.webkit.org/changeset/96139
https://bugs.webkit.org/show_bug.cgi?id=68933

Broke table-percent-height.html on Mac bots (Requested by
mwenge2 on #webkit).

Patch by Sheriff Bot <webkit.review....@gmail.com> on 2011-09-27

Source/WebCore:

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
* rendering/RenderBox.h:

LayoutTests:

* fast/replaced/table-percent-width-expected.txt: Removed.
* fast/replaced/table-percent-width.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96156 => 96157)


--- trunk/LayoutTests/ChangeLog	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/LayoutTests/ChangeLog	2011-09-27 21:19:16 UTC (rev 96157)
@@ -1,3 +1,15 @@
+2011-09-27  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r96139.
+        http://trac.webkit.org/changeset/96139
+        https://bugs.webkit.org/show_bug.cgi?id=68933
+
+        Broke table-percent-height.html on Mac bots (Requested by
+        mwenge2 on #webkit).
+
+        * fast/replaced/table-percent-width-expected.txt: Removed.
+        * fast/replaced/table-percent-width.html: Removed.
+
 2011-09-27  Mike Reed  <r...@google.com>
 
         need to rebseline these once new aa-gdi-text code lands in skia

Deleted: trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt (96156 => 96157)


--- trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt	2011-09-27 21:19:16 UTC (rev 96157)
@@ -1,25 +0,0 @@
-
-
-
-
-
-This test checks that a replaced element with percentage width (and no height specified) within a table cell is squeezed to the dimensions of the table cell.
-See bug #29447.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS getWidth('img-1') is '105px'
-PASS getHeight('img-1') is '105px'
-PASS getWidth('img-2') is '98px'
-PASS getHeight('img-2') is '98px'
-PASS getWidth('img-3') is '40px'
-PASS getHeight('img-3') is '40px'
-PASS getWidth('img-4') is '36px'
-PASS getHeight('img-4') is '36px'
-PASS getWidth('img-5') is '40px'
-PASS getHeight('img-5') is '36px'
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/replaced/table-percent-width.html (96156 => 96157)


--- trunk/LayoutTests/fast/replaced/table-percent-width.html	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/LayoutTests/fast/replaced/table-percent-width.html	2011-09-27 21:19:16 UTC (rev 96157)
@@ -1,115 +0,0 @@
-<html>
-<head>
-<title> webkit.org/b/29447: Replaced elements squeezed when width is specified as percentage inside a table with Auto layout</title>
-<link rel="stylesheet" href=""
-<script src=""
-<script src=""
-<script>
-if (window.layoutTestController) {
-    layoutTestController.waitUntilDone();
-    layoutTestController.dumpAsText();
-}
-
-function getComputedStyleForElement(element, cssPropertyName)
-{
-    if (!element) {
-        return null;
-    }
-    if (window.getComputedStyle) {
-        return window.getComputedStyle(element, '').getPropertyValue(cssPropertyName.replace(/([A-Z])/g, "-$1").toLowerCase());
-    }
-    if (element.currentStyle) {
-        return element.currentStyle[cssPropertyName];
-    }
-    return null;
-}
-
-function getWidth(id)
-{
-    return getComputedStyleForElement(document.getElementById(id), 'width');
-}
-
-function getHeight(id)
-{
-    return getComputedStyleForElement(document.getElementById(id), 'height');
-}
-
-function parsePixelValue(str)
-{
-    if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") {
-        testFailed(str + " is unparsable.");
-        return -1;
-    }
-    return parseFloat(str);
-}
-
-function test()
-{
-    description("This test checks that a replaced element with percentage width (and no height specified) within a table cell is squeezed to the dimensions of the table cell.<br>See bug #29447.");
-
-    shouldBe("getWidth('img-1')", "'105px'");
-    shouldBe("getHeight('img-1')", "'105px'");
-    shouldBe("getWidth('img-2')", "'98px'");
-    shouldBe("getHeight('img-2')", "'98px'");
-    shouldBe("getWidth('img-3')", "'40px'");
-    shouldBe("getHeight('img-3')", "'40px'");
-    shouldBe("getWidth('img-4')", "'36px'");
-    shouldBe("getHeight('img-4')", "'36px'");
-    shouldBe("getWidth('img-5')", "'40px'");
-    shouldBe("getHeight('img-5')", "'36px'");
-
-    isSuccessfullyParsed();
-
-    if (window.layoutTestController) {
-        layoutTestController.notifyDone();
-    }
-}
-
-var successfullyParsed = true;
-</script>
-</head>
-<body _onload_="test()">
-   <table>
-    <tr>
-    <td>
-      <img id="img-1" src="" width="100%" align="LEFT" border="1">
-    </td>
-    </tr>
-   </table>
-
-   <table>
-    <tr>
-    <td>
-      <img id="img-2" src="" height="100%" align="LEFT" border="1">
-    </td>
-    </tr>
-   </table>
-
-   <table height="50" width="50" border="1">
-    <tr>
-    <td>
-      <img id="img-3" src="" width="100%" align="LEFT" border="1">
-    </td>
-    </tr>
-   </table>
-
-   <table height="50" width="50" border="1">
-    <tr>
-    <td>
-      <img id="img-4" src="" height="100%" align="LEFT" border="1">
-    </td>
-    </tr>
-   </table>
-
-   <table height="50" width="50" border="1">
-    <tr>
-    <td>
-      <img id="img-5" src="" width="100%" height="100%" align="LEFT" border="1">
-    </td>
-    </tr>
-   </table>
-
-<p id="description"></p>
-<div id="console"></div>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (96156 => 96157)


--- trunk/Source/WebCore/ChangeLog	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/Source/WebCore/ChangeLog	2011-09-27 21:19:16 UTC (rev 96157)
@@ -1,3 +1,17 @@
+2011-09-27  Sheriff Bot  <webkit.review....@gmail.com>
+
+        Unreviewed, rolling out r96139.
+        http://trac.webkit.org/changeset/96139
+        https://bugs.webkit.org/show_bug.cgi?id=68933
+
+        Broke table-percent-height.html on Mac bots (Requested by
+        mwenge2 on #webkit).
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        * rendering/RenderBox.h:
+
 2011-09-27  Tim Horton  <timothy_hor...@apple.com>
 
         REGRESSION(65665): Pattern size being clamped to SVG size can prevent transformed elements from being fully covered by userSpaceOnUse patterns

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (96156 => 96157)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-09-27 21:19:16 UTC (rev 96157)
@@ -1216,37 +1216,6 @@
     return clipRect;
 }
 
-static bool avoidSqueezingWidth(RenderBlock* cb)
-{
-    while (cb && !cb->isRenderView()) {
-        if (!cb->style()->logicalWidth().isAuto() && !cb->style()->logicalWidth().isPercent())
-            return false;
-        cb = cb->containingBlock();
-    }
-    return true;
-}
-
-static bool avoidSqueezingHeight(RenderBlock* cb)
-{
-    while (cb && !cb->isRenderView()) {
-        if (!cb->style()->logicalHeight().isAuto() && !cb->style()->logicalHeight().isPercent())
-            return false;
-        cb = cb->containingBlock();
-    }
-    return true;
-}
-
-int RenderBox::containingBlockReplacedLogicalWidthForContent() const
-{
-    RenderBlock* cb = containingBlock();
-    // Don't let table cells squeeze percent-height replaced elements
-    // <http://bugs.webkit.org/show_bug.cgi?id=29447>
-    if (cb->isTableCell() && avoidSqueezingWidth(cb))
-        return max(shrinkToAvoidFloats() ? cb->availableLogicalWidthForLine(y(), false) : cb->availableLogicalWidth(), intrinsicLogicalWidth());
-
-    return containingBlockLogicalWidthForContent();
-}
-
 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
 {
     RenderBlock* cb = containingBlock();
@@ -2045,7 +2014,7 @@
             // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
             // containing block's block-flow.
             // https://bugs.webkit.org/show_bug.cgi?id=46496
-            const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockReplacedLogicalWidthForContent();
+            const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
             if (cw > 0)
                 return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw));
         }
@@ -2105,11 +2074,14 @@
                 // table cells using percentage heights.
                 // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
                 // https://bugs.webkit.org/show_bug.cgi?id=46997
-                if (cb->isTableCell() && avoidSqueezingHeight(toRenderBlock(cb))) {
-                    // Don't let table cells squeeze percent-height replaced elements
-                    // <http://bugs.webkit.org/show_bug.cgi?id=15359>
-                    availableHeight = max(availableHeight, intrinsicLogicalHeight());
-                    return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
+                while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
+                    if (cb->isTableCell()) {
+                        // Don't let table cells squeeze percent-height replaced elements
+                        // <http://bugs.webkit.org/show_bug.cgi?id=15359>
+                        availableHeight = max(availableHeight, intrinsicLogicalHeight());
+                        return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
+                    }
+                    cb = cb->containingBlock();
                 }
             }
             return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight));

Modified: trunk/Source/WebCore/rendering/RenderBox.h (96156 => 96157)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-09-27 21:12:28 UTC (rev 96156)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-09-27 21:19:16 UTC (rev 96157)
@@ -290,7 +290,6 @@
 
     virtual LayoutUnit containingBlockLogicalWidthForContent() const;
     LayoutUnit perpendicularContainingBlockLogicalHeight() const;
-    int containingBlockReplacedLogicalWidthForContent() const;
     
     virtual void computeLogicalWidth();
     virtual void computeLogicalHeight();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to