[CSS Grid Layout] Fix missing layout in flexible and content sized columns
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Feb 2014 10:57:43 +0000 (10:57 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Feb 2014 10:57:43 +0000 (10:57 +0000)
commit4cd496adb85a51c7df85729f1c14714ce8707677
tree1d2f20aa6fb39d1e670abd4d640020b0e949c96a
parent5d795a7227663825b36b9efe3a62fa8745aba901
[CSS Grid Layout] Fix missing layout in flexible and content sized columns
https://bugs.webkit.org/show_bug.cgi?id=128672

Reviewed by Sergio Villar Senin.

Source/WebCore:

RenderGrid::logicalContentHeightForChild() is called for some items at the beginning of RenderGrid::layoutGridItems()
from RenderGrid::computeUsedBreadthOfGridTracks(). This causes that the comparison inside the for loop in
RenderGrid::layoutGridItems() does not detect width changes, so elements won't be marked as needsLayout.

So the comparison is done in RenderGrid::logicalContentHeightForChild() and the element is marked to perform a layout if
the width has changed.

The issue can be reproduced easily with a simple grid with one flexible or content sized column, all the available width
is not used. On top of that, when you resize the window the flexible or content sized columns are not updating their
size properly.

CSS Grid Layout perftest results are around 4% worse, which is expected as we're adding a missing layout.

Test: fast/css-grid-layout/flex-content-sized-column-use-available-width.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::logicalContentHeightForChild): Check width changes and mark element as needed layout if required.

LayoutTests:

Add test that reproduce the issue for both cases flexible and content sized columns.

* fast/css-grid-layout/flex-content-sized-column-use-available-width-expected.html: Added.
* fast/css-grid-layout/flex-content-sized-column-use-available-width.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/flex-content-sized-column-use-available-width-expected.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/flex-content-sized-column-use-available-width.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp