Title: [177064] branches/safari-600.1.4.13-branch

Diff

Modified: branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog (177063 => 177064)


--- branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog	2014-12-10 16:54:40 UTC (rev 177063)
+++ branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog	2014-12-10 16:57:45 UTC (rev 177064)
@@ -1,5 +1,21 @@
 2014-12-10  Babak Shafiei  <bshaf...@apple.com>
 
+        Merge r174946.
+
+    2014-10-21  Manuel Rego Casasnovas  <r...@igalia.com>
+
+            ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
+            https://bugs.webkit.org/show_bug.cgi?id=136939
+
+            Reviewed by Darin Adler.
+
+            Added a test case to reproduce the crash in debug mode.
+
+            * fast/css-grid-layout/grid-was-populated-assert-expected.txt: Added.
+            * fast/css-grid-layout/grid-was-populated-assert.html: Added.
+
+2014-12-10  Babak Shafiei  <bshaf...@apple.com>
+
         Merge r174922.
 
     2014-10-17  Jeffrey Pfau  <jp...@apple.com>

Copied: branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert-expected.txt (from rev 175522, branches/safari-600.3-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert-expected.txt) (0 => 177064)


--- branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert-expected.txt	2014-12-10 16:57:45 UTC (rev 177064)
@@ -0,0 +1,4 @@
+This test passes if it does not crash in debug mode.
+
+
+

Copied: branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert.html (from rev 175522, branches/safari-600.3-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert.html) (0 => 177064)


--- branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert.html	                        (rev 0)
+++ branches/safari-600.1.4.13-branch/LayoutTests/fast/css-grid-layout/grid-was-populated-assert.html	2014-12-10 16:57:45 UTC (rev 177064)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script>
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+    }
+    </script>
+    <style>
+    details {
+        display: -webkit-grid;
+        -webkit-columns: 5;
+    }
+    div {
+        display: -webkit-grid;
+    }
+    input {
+        -webkit-columns: 5;
+    }
+    </style>
+</head>
+<body>
+    <p>This test passes if it does not crash in debug mode.</p>
+    <details open>
+        <button>
+            <div>
+                <input placeholder="testing" />
+            </div>
+        </button>
+    </details>
+</body>
+</html>

Modified: branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog (177063 => 177064)


--- branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog	2014-12-10 16:54:40 UTC (rev 177063)
+++ branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog	2014-12-10 16:57:45 UTC (rev 177064)
@@ -1,5 +1,30 @@
 2014-12-10  Babak Shafiei  <bshaf...@apple.com>
 
+        Merge r174946.
+
+    2014-10-21  Manuel Rego Casasnovas  <r...@igalia.com>
+
+            ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
+            https://bugs.webkit.org/show_bug.cgi?id=136939
+
+            Reviewed by Darin Adler.
+
+            In some particular situations computeIntrinsicLogicalWidths() is called
+            in the middle of layoutGridItems(). In these cases we do not need to
+            populate the grid again, so we should avoid calling placeItemsOnGrid().
+            In addition, we do not need to clean the grid either, as that will be
+            done later by layoutGridItems().
+
+            Test: fast/css-grid-layout/grid-was-populated-assert.html
+
+            * rendering/RenderGrid.cpp:
+            (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Avoid calls to
+            placeItemsOnGrid() and clearGrid() if the grid was already populated.
+            * rendering/RenderGrid.h: Move gridWasPopulated() header out of the
+            debug ifdefs.
+
+2014-12-10  Babak Shafiei  <bshaf...@apple.com>
+
         Merge r174922.
 
     2014-10-17  Jeffrey Pfau  <jp...@apple.com>

Modified: branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.cpp (177063 => 177064)


--- branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.cpp	2014-12-10 16:54:40 UTC (rev 177063)
+++ branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.cpp	2014-12-10 16:57:45 UTC (rev 177064)
@@ -241,7 +241,9 @@
 
 void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
 {
-    const_cast<RenderGrid*>(this)->placeItemsOnGrid();
+    bool wasPopulated = gridWasPopulated();
+    if (!wasPopulated)
+        const_cast<RenderGrid*>(this)->placeItemsOnGrid();
 
     GridSizingData sizingData(gridColumnCount(), gridRowCount());
     LayoutUnit availableLogicalSpace = 0;
@@ -258,7 +260,8 @@
         // FIXME: This should add in the scrollbarWidth (e.g. see RenderFlexibleBox).
     }
 
-    const_cast<RenderGrid*>(this)->clearGrid();
+    if (!wasPopulated)
+        const_cast<RenderGrid*>(this)->clearGrid();
 }
 
 void RenderGrid::computePreferredLogicalWidths()

Modified: branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.h (177063 => 177064)


--- branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.h	2014-12-10 16:54:40 UTC (rev 177063)
+++ branches/safari-600.1.4.13-branch/Source/WebCore/rendering/RenderGrid.h	2014-12-10 16:57:45 UTC (rev 177064)
@@ -109,9 +109,10 @@
 
 #ifndef NDEBUG
     bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vector<GridTrack>&);
-    bool gridWasPopulated() const { return !m_grid.isEmpty() && !m_grid[0].isEmpty(); }
 #endif
 
+    bool gridWasPopulated() const { return !m_grid.isEmpty() && !m_grid[0].isEmpty(); }
+
     size_t gridColumnCount() const
     {
         ASSERT(gridWasPopulated());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to