Title: [124532] branches/safari-536.26-branch

Diff

Modified: branches/safari-536.26-branch/LayoutTests/ChangeLog (124531 => 124532)


--- branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-08-02 23:38:38 UTC (rev 124531)
+++ branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-08-02 23:48:14 UTC (rev 124532)
@@ -1,5 +1,28 @@
 2012-08-02  Lucas Forschler  <[email protected]>
 
+    Merge 121275
+
+    2012-06-26  Julien Chaffraix  <[email protected]>
+
+            Crash in FixedTableLayout::layout
+            https://bugs.webkit.org/show_bug.cgi?id=88676
+
+            Reviewed by Abhishek Arya.
+
+            * fast/table/auto-table-layout-colgroup-removal-crash-expected.txt: Added.
+            * fast/table/auto-table-layout-colgroup-removal-crash.html: Added.
+            * fast/table/fixed-table-layout/colgroup-removal-crash-expected.txt: Added.
+            * fast/table/fixed-table-layout/colgroup-removal-crash.html: Added.
+            2 cases where we remove a colgroup after having done layout.
+
+            * fast/table/fixed-table-layout/prepend-in-fixed-table-expected.txt: Added.
+            * fast/table/fixed-table-layout/prepend-in-fixed-table.html: Added.
+            This is a copy of fast/table/prepend-in-anonymous-table.html modified to work with
+            fixed table layout. This covers a bug found during testing that is fixed as part of
+            this broader change.
+
+2012-08-02  Lucas Forschler  <[email protected]>
+
     Merge 121031
 
     2012-06-22  Abhishek Arya  <[email protected]>

Copied: branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash-expected.txt (from rev 121275, trunk/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash-expected.txt) (0 => 124532)


--- branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash-expected.txt	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash-expected.txt	2012-08-02 23:48:14 UTC (rev 124532)
@@ -0,0 +1,5 @@
+Bug 88676: Crash in FixedTableLayout::layout
+
+PASSED, the test didn't crash.
+
+

Copied: branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash.html (from rev 121275, trunk/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash.html) (0 => 124532)


--- branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash.html	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/fast/table/auto-table-layout-colgroup-removal-crash.html	2012-08-02 23:48:14 UTC (rev 124532)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<p>Bug <a href="" Crash in FixedTableLayout::layout</p>
+<p id="console">FAILED, the test didn't run.</p>
+<table id="table">
+    <tbody>
+        <tr></tr>
+    </tbody>
+    <colgroup id="colGroup"></colgroup>
+</table>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    document.body.offsetTop;
+    table.removeChild(colGroup);
+    document.getElementById("console").innerHTML = "PASSED, the test didn't crash.";
+</script>

Modified: branches/safari-536.26-branch/Source/WebCore/ChangeLog (124531 => 124532)


--- branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-08-02 23:38:38 UTC (rev 124531)
+++ branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-08-02 23:48:14 UTC (rev 124532)
@@ -1,5 +1,39 @@
 2012-08-02  Lucas Forschler  <[email protected]>
 
+    Merge 121275
+
+    2012-06-26  Julien Chaffraix  <[email protected]>
+
+            Crash in FixedTableLayout::layout
+            https://bugs.webkit.org/show_bug.cgi?id=88676
+
+            Reviewed by Abhishek Arya.
+
+            Tests: fast/table/auto-table-layout-colgroup-removal-crash.html
+                   fast/table/fixed-table-layout/colgroup-removal-crash.html
+                   fast/table/fixed-table-layout/prepend-in-fixed-table.html
+
+            The issue comes from RenderTable not properly dirtying its preferred logical
+            widths. As the table layout codes (both fixed and auto), recomputes their internal
+            structures at computePreferredLogicalWidth, the internal structure doesn't match
+            the table sizing and we crash.
+
+            This fix adds a work-around in FixedTableLayout::layout (which matches AutoTableLayout).
+            The long-term fix would be to properly fix the logic but this is a lot safer, especially
+            since our logic is really not bullet-proof at the moment.
+
+            * rendering/FixedTableLayout.cpp:
+            (WebCore::FixedTableLayout::layout):
+            Added an internal structure recomputation, if we have drifted from our table's structure.
+            Also we need to update nEffCols if we call calcWidthArray.
+
+            * rendering/AutoTableLayout.cpp:
+            (WebCore::AutoTableLayout::layout):
+            Added a comment matching FixedTableLayout. The nEffCols is unneeded but kept for consistency
+            with FixedTableLayout.
+
+2012-08-02  Lucas Forschler  <[email protected]>
+
     Merge 121031
 
     2012-06-22  Abhishek Arya  <[email protected]>

Modified: branches/safari-536.26-branch/Source/WebCore/rendering/AutoTableLayout.cpp (124531 => 124532)


--- branches/safari-536.26-branch/Source/WebCore/rendering/AutoTableLayout.cpp	2012-08-02 23:38:38 UTC (rev 124531)
+++ branches/safari-536.26-branch/Source/WebCore/rendering/AutoTableLayout.cpp	2012-08-02 23:48:14 UTC (rev 124532)
@@ -505,8 +505,11 @@
     int available = tableLogicalWidth;
     size_t nEffCols = m_table->numEffCols();
 
+    // FIXME: It is possible to be called without having properly updated our internal representation.
+    // This means that our preferred logical widths were not recomputed as expected.
     if (nEffCols != m_layoutStruct.size()) {
         fullRecalc();
+        // FIXME: Table layout shouldn't modify our table structure (but does due to columns and colum-groups).
         nEffCols = m_table->numEffCols();
     }
 

Modified: branches/safari-536.26-branch/Source/WebCore/rendering/FixedTableLayout.cpp (124531 => 124532)


--- branches/safari-536.26-branch/Source/WebCore/rendering/FixedTableLayout.cpp	2012-08-02 23:38:38 UTC (rev 124531)
+++ branches/safari-536.26-branch/Source/WebCore/rendering/FixedTableLayout.cpp	2012-08-02 23:48:14 UTC (rev 124532)
@@ -229,6 +229,15 @@
 {
     int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAndSpacingInRowDirection();
     unsigned nEffCols = m_table->numEffCols();
+
+    // FIXME: It is possible to be called without having properly updated our internal representation.
+    // This means that our preferred logical widths were not recomputed as expected.
+    if (nEffCols != m_width.size()) {
+        calcWidthArray(tableLogicalWidth);
+        // FIXME: Table layout shouldn't modify our table structure (but does due to columns and colum-groups).
+        nEffCols = m_table->numEffCols();
+    }
+
     Vector<int> calcWidth(nEffCols, 0);
 
     unsigned numAuto = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to