ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 12:11:29 +0000 (12:11 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Oct 2014 12:11:29 +0000 (12:11 +0000)
commit2fec4691e88391787a96fbb5d671dcdb83dc5d28
tree0af4f65ee2d209cf6ffe69b379da6ff966f1aae5
parenta7d99c1a827cbc092cd1624c083481ebafb733da
ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
https://bugs.webkit.org/show_bug.cgi?id=136939

Reviewed by Darin Adler.

Source/WebCore:

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.

LayoutTests:

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-was-populated-assert-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-was-populated-assert.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h