[css-grid] Different width of grid container between initial load and refresh
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:33:28 +0000 (12:33 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:33:28 +0000 (12:33 +0000)
commit4232bea02d7ba0199c1b93d492c4e9a63c01d605
tree0cf52b1ef92d95caef9a9fe88ec9518a881d4121
parentbfc757efd392d2cfc90c1c19d10002cdf319d087
[css-grid] Different width of grid container between initial load and refresh
https://bugs.webkit.org/show_bug.cgi?id=163535

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

Grid's layout logic manages two different override sizes; one it's
designed to implement the grid item's stretching behavior, identified
with the concept of 'overrideContentLogicalSize'; there is another
override size, known as overrideContainingBlockContentLogicalSize,
used to implement the Grid Area abstraction, which will behave as
the actual containing block of any grid item.

During grid's layout logic these override sizes are set according
to the CSS style rules. This affects how the grid container and its
children are going to be sized during layout. Grid Tracks sizing
algorithm depends on these override sizes.

In order to ensure that the tracks sizing algorithm produces the
same results when it's run consecutively several times, we need to
clear these override sizes and perform a layout of the affected grid
items. Otherwise, the affected items will return sizing values which
depend on the override values set in the previous layout, which in
some cases, like orthogonal flows, may change through different runs
of the sizing algorithm.

Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):

LayoutTests:

Tests to ensure repeated layouts on grid elements produce the same results when using
orthogonal grid items.

* fast/css-grid-layout/repeating-layout-must-produce-the-same-results-expected.txt: Added.
* fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows.html
LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp