Unreviewed, rolling out r163165.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 17:43:04 +0000 (17:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 17:43:04 +0000 (17:43 +0000)
http://trac.webkit.org/changeset/163165
https://bugs.webkit.org/show_bug.cgi?id=127997

broke 2 fast/table tests (Requested by kling on #webkit).

Source/WebCore:

* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
(WebCore::RenderTable::computePreferredLogicalWidths):

LayoutTests:

* fast/table/css-table-max-width-expected.txt:
* fast/table/css-table-max-width.html:
* fast/table/html-table-width-max-width-constrained-expected.txt: Removed.
* fast/table/html-table-width-max-width-constrained.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/table/css-table-max-width-expected.txt
LayoutTests/fast/table/css-table-max-width.html
LayoutTests/fast/table/html-table-width-max-width-constrained-expected.txt [deleted file]
LayoutTests/fast/table/html-table-width-max-width-constrained.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.cpp

index 2110f76..3fd132b 100644 (file)
@@ -1,3 +1,16 @@
+2014-01-31  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r163165.
+        http://trac.webkit.org/changeset/163165
+        https://bugs.webkit.org/show_bug.cgi?id=127997
+
+        broke 2 fast/table tests (Requested by kling on #webkit).
+
+        * fast/table/css-table-max-width-expected.txt:
+        * fast/table/css-table-max-width.html:
+        * fast/table/html-table-width-max-width-constrained-expected.txt: Removed.
+        * fast/table/html-table-width-max-width-constrained.html: Removed.
+
 2014-01-31  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSSRegions] Add test(s) for list item as region
index 993d84a..831df2b 100644 (file)
@@ -10,11 +10,11 @@ Note:The width of the css tables inclusive of its border width.
 PASS maxGreatThanMinWidthAutoLayout.getBoundingClientRect().width is 202
 PASS minGreatThanMaxWidthAutoLayout.getBoundingClientRect().width is 202
 PASS onlyMaxWidthAutoLayout.getBoundingClientRect().width is 202
-PASS maxWidthZeroAutoLayout.getBoundingClientRect().width is 182
+PASS maxWidthZeroAutoLayout.getBoundingClientRect().width is 0
 PASS maxGreatThanMinWidthFixedLayout.getBoundingClientRect().width is 202
 PASS minGreatThanMaxWidthFixedLayout.getBoundingClientRect().width is 202
 PASS onlyMaxWidthFixedLayout.getBoundingClientRect().width is 202
-PASS maxWidthZeroFixedLayout.getBoundingClientRect().width is 2
+PASS maxWidthZeroFixedLayout.getBoundingClientRect().width is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
index be55971..7d67056 100644 (file)
@@ -42,7 +42,7 @@
         fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident, sunt in culpa 
         qui officia deserunt mollit anim id est laborum.
     </div>
-    <div id="maxWidthZeroAutoLayout" class="child" style="display:table; max-width:0; width:100%; font: 10px/1 Ahem;">
+    <div id="maxWidthZeroAutoLayout" class="child" style="display:table; max-width:0; width:100%;">
         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 
         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
@@ -97,7 +97,7 @@ shouldBe("minGreatThanMaxWidthAutoLayout.getBoundingClientRect().width","202");
 onlyMaxWidthAutoLayout = document.getElementById("onlyMaxWidthAutoLayout");
 shouldBe("onlyMaxWidthAutoLayout.getBoundingClientRect().width","202");
 maxWidthZeroAutoLayout = document.getElementById("maxWidthZeroAutoLayout");
-shouldBe("maxWidthZeroAutoLayout.getBoundingClientRect().width","182");
+shouldBe("maxWidthZeroAutoLayout.getBoundingClientRect().width","0");
 maxGreatThanMinWidthFixedLayout = document.getElementById("maxGreatThanMinWidthFixedLayout");
 shouldBe("maxGreatThanMinWidthFixedLayout.getBoundingClientRect().width","202");
 minGreatThanMaxWidthFixedLayout = document.getElementById("minGreatThanMaxWidthFixedLayout");
@@ -105,7 +105,7 @@ shouldBe("minGreatThanMaxWidthFixedLayout.getBoundingClientRect().width","202");
 onlyMaxWidthFixedLayout = document.getElementById("onlyMaxWidthFixedLayout");
 shouldBe("onlyMaxWidthFixedLayout.getBoundingClientRect().width","202");
 maxWidthZeroFixedLayout = document.getElementById("maxWidthZeroFixedLayout");
-shouldBe("maxWidthZeroFixedLayout.getBoundingClientRect().width","2");
+shouldBe("maxWidthZeroFixedLayout.getBoundingClientRect().width","0");
 
 document.body.removeChild(document.getElementById('container'));
 </script>
diff --git a/LayoutTests/fast/table/html-table-width-max-width-constrained-expected.txt b/LayoutTests/fast/table/html-table-width-max-width-constrained-expected.txt
deleted file mode 100644 (file)
index b9fe2e9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This test checks that a fixed table layout with max-width doesn't over-constraint the cell (ie the content width still wins over max-width per the specification).
-For this test to pass, the second cell shouldn't bleed out of the table.
-Cell text      Cell text text text text
-PASS
diff --git a/LayoutTests/fast/table/html-table-width-max-width-constrained.html b/LayoutTests/fast/table/html-table-width-max-width-constrained.html
deleted file mode 100644 (file)
index 6021212..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-table {
-    font: 20px/1 Ahem;
-    border-collapse: separate;
-    table-layout: fixed;
-    max-width: 300px;
-    width: 300px;
-    border: 1px solid #dddddd;
-    border-spacing: 0px;
-}
-
-td {
-    padding: 0px;
-    width: 200px;
-    border-left: 1px solid #dddddd;
-}
-</style>
-<script src="../../resources/check-layout.js"></script>
-</head>
-<body onload="checkLayout('table')">
-    <div>This test checks that a fixed table layout with max-width doesn't over-constraint the cell (ie the content width still wins over max-width per the specification).</div>
-    <div>For this test to pass, the second cell shouldn't bleed out of the table.</div>
-    <table data-expected-width="404">
-        <tbody>
-            <tr>
-            <td>Cell text</td>
-            <td>Cell text text text text</td>
-            </tr>
-        </tbody>
-    </table>
-</body></html>
index 29bfcdd..16b53c6 100644 (file)
@@ -1,3 +1,15 @@
+2014-01-31  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r163165.
+        http://trac.webkit.org/changeset/163165
+        https://bugs.webkit.org/show_bug.cgi?id=127997
+
+        broke 2 fast/table tests (Requested by kling on #webkit).
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::updateLogicalWidth):
+        (WebCore::RenderTable::computePreferredLogicalWidths):
+
 2014-01-31  Anders Carlsson  <andersca@apple.com>
 
         Don't allocate a new XMLHttpRequestStaticData every time staticData() is called
index c7312d5..ff87f98 100644 (file)
@@ -292,16 +292,16 @@ void RenderTable::updateLogicalWidth()
         setLogicalWidth(std::min<int>(availableContentLogicalWidth, maxPreferredLogicalWidth()));
     }
 
+    // Ensure we aren't smaller than our min preferred width.
+    setLogicalWidth(std::max<int>(logicalWidth(), minPreferredLogicalWidth()));
+
+    
     // Ensure we aren't bigger than our max-width style.
     Length styleMaxLogicalWidth = style().logicalMaxWidth();
     if ((styleMaxLogicalWidth.isSpecified() && !styleMaxLogicalWidth.isNegative()) || styleMaxLogicalWidth.isIntrinsic()) {
         LayoutUnit computedMaxLogicalWidth = convertStyleLogicalWidthToComputedWidth(styleMaxLogicalWidth, availableLogicalWidth);
         setLogicalWidth(std::min<int>(logicalWidth(), computedMaxLogicalWidth));
     }
-    
-    // Ensure we aren't smaller than our min preferred width. This MUST be done after 'max-width' as
-    // we ignore it if it means we wouldn't accomodate our content.
-    setLogicalWidth(std::max<int>(logicalWidth(), minPreferredLogicalWidth()));
 
     // Ensure we aren't smaller than our min-width style.
     Length styleMinLogicalWidth = style().logicalMinWidth();
@@ -328,10 +328,6 @@ void RenderTable::updateLogicalWidth()
         setMarginStart(minimumValueForLength(style().marginStart(), availableLogicalWidth));
         setMarginEnd(minimumValueForLength(style().marginEnd(), availableLogicalWidth));
     }
-
-    // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate
-    // its own content which doesn't match CSS nor what authors expect.
-    ASSERT(logicalWidth() >= minPreferredLogicalWidth());
 }
 
 // This method takes a RenderStyle's logical width, min-width, or max-width length and computes its actual value.
@@ -782,9 +778,8 @@ void RenderTable::computePreferredLogicalWidths()
 
     // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
     if (styleToUse.logicalMaxWidth().isFixed()) {
-        // We don't constrain m_minPreferredLogicalWidth as the table should be at least the size of its min-content, regardless of 'max-width'.
         m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
-        m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
+        m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));
     }
 
     // FIXME: We should be adding borderAndPaddingLogicalWidth here, but m_tableLayout->computePreferredLogicalWidths already does,