[CSS Grid Layout] Tracks shrink sometimes with indefinite remaining space
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jan 2015 10:22:45 +0000 (10:22 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jan 2015 10:22:45 +0000 (10:22 +0000)
commit49f8fb1718c7bfdc284c97d401a6e4a6f3778699
treefbb518ea72b1637d210a02436f8ef140560b731b
parent92c52361f27e7b47f17318a75ce0e3ea787fd836
[CSS Grid Layout] Tracks shrink sometimes with indefinite remaining space
https://bugs.webkit.org/show_bug.cgi?id=139059

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/css-grid-layout/grid-grow-tracks-to-their-max.html

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

LayoutTests:

The third step of the grid track sizing algorithm (method
ComputeUsedBreadthOfGridTracks in the old specs version of the
algorithm) tries to grow all grid tracks until the remaining space
is exhausted. Should the remaining space is undefined we should fill
the tracks up to their limits. This is specified in pseudocode like
this:

    For each Grid track t in GridTracks
        t.UsedBreadth = t.MaxBreadth

That's correct for most of the cases, but it becomes
wrong whenever t.UsedBreadth > t.MaxBreadth something that is not
incorrect. What we actually want to do is to grow the track to its
maximum if and only if the used breadth is smaller than the maximum.

* TestExpectations: Added a test which is correct but starts to fail
due to another bug (wkb.ug/139058).
* fast/css-grid-layout/grid-auto-columns-rows-update.html:
* fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt:
* fast/css-grid-layout/grid-content-sized-columns-resolution.html:
* fast/css-grid-layout/grid-grow-tracks-to-their-max-expected.txt: Added.
* fast/css-grid-layout/grid-grow-tracks-to-their-max.html: Added.
* fast/css-grid-layout/grid-item-removal-track-breadth-update.html:
* fast/css-grid-layout/minmax-max-content-resolution-rows.html:
* fast/css-grid-layout/minmax-min-content-column-resolution-rows.html:
* fast/css-grid-layout/percent-of-indefinite-track-size-in-auto.html:
* fast/css-grid-layout/percent-of-indefinite-track-size.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-update.html
LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt
LayoutTests/fast/css-grid-layout/grid-content-sized-columns-resolution.html
LayoutTests/fast/css-grid-layout/grid-grow-tracks-to-their-max-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-grow-tracks-to-their-max.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-removal-track-breadth-update.html
LayoutTests/fast/css-grid-layout/minmax-max-content-resolution-rows.html
LayoutTests/fast/css-grid-layout/minmax-min-content-column-resolution-rows.html
LayoutTests/fast/css-grid-layout/percent-of-indefinite-track-size-in-auto.html
LayoutTests/fast/css-grid-layout/percent-of-indefinite-track-size.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp