[CSS Grid Layout] handle undefined RemainingSpace in computeUsedBreadthOfGridTracks...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Feb 2014 22:29:20 +0000 (22:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Feb 2014 22:29:20 +0000 (22:29 +0000)
commit2bd269f90cf35edbc68f0e9bd4cf30dca5fe9bcc
tree72b7e2ba805b93652a87104a7bb45ca6fcc91b4e
parentea150d5c90c528ab8fffb4f82abbc6438de30d79
[CSS Grid Layout] handle undefined RemainingSpace in computeUsedBreadthOfGridTracks algorithm
https://bugs.webkit.org/show_bug.cgi?id=128372

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-02-24
Reviewed by David Hyatt.

From Blink r165692 by <svillar@igalia.com>

Source/WebCore:

The spec defines a different code path for the computeUsedBreadthOfGridTracks algorithm
http://dev.w3.org/csswg/css-grid/#function-ComputeUsedBreadthOfGridTracks.

Basically the track breadth is different when the available size is undefined and thus,
cannot be taken into account during the computations.
The available size is undefined whenever the height is auto or the grid element has a
shrink-to-fit behavior.

It was also renamed the function to match the specs so the function name starts with
'compute' instead of 'computed'.

No new tests, but added new cases to some of them.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::gridElementIsShrinkToFit):
(WebCore::RenderGrid::computeNormalizedFractionBreadth):
(WebCore::RenderGrid::layoutGridItems):
* rendering/RenderGrid.h:

LayoutTests:

Adapt tests to consider also cases for undefined RemainingSpace.

* fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt:
* fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html:
* fast/css-grid-layout/flex-content-resolution-rows-expected.txt:
* fast/css-grid-layout/flex-content-resolution-rows.html:
* fast/css-grid-layout/grid-auto-columns-rows-update-expected.txt:
* fast/css-grid-layout/grid-auto-columns-rows-update.html:
* fast/css-grid-layout/grid-dynamic-updates-relayout-expected.txt:
* fast/css-grid-layout/grid-dynamic-updates-relayout.html:
* fast/css-grid-layout/grid-item-addition-track-breadth-update-expected.txt:
* fast/css-grid-layout/grid-item-addition-track-breadth-update.html:
* fast/css-grid-layout/grid-item-multiple-minmax-content-resolution-expected.txt:
* fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html:
* fast/css-grid-layout/grid-item-removal-track-breadth-update-expected.txt:
* fast/css-grid-layout/grid-item-removal-track-breadth-update.html:
* fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt:
* fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html:
* fast/css-grid-layout/implicit-position-dynamic-change-expected.txt:
* fast/css-grid-layout/implicit-position-dynamic-change.html:
* fast/css-grid-layout/minmax-max-content-resolution-rows-expected.txt:
* fast/css-grid-layout/minmax-max-content-resolution-rows.html:
* fast/css-grid-layout/minmax-min-content-column-resolution-rows-expected.txt:
* fast/css-grid-layout/minmax-min-content-column-resolution-rows.html:
* fast/css-grid-layout/minmax-spanning-resolution-rows-expected.txt:
* fast/css-grid-layout/minmax-spanning-resolution-rows.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt
LayoutTests/fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html
LayoutTests/fast/css-grid-layout/flex-content-resolution-rows-expected.txt
LayoutTests/fast/css-grid-layout/flex-content-resolution-rows.html
LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-update-expected.txt
LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-update.html
LayoutTests/fast/css-grid-layout/grid-dynamic-updates-relayout-expected.txt
LayoutTests/fast/css-grid-layout/grid-dynamic-updates-relayout.html
LayoutTests/fast/css-grid-layout/grid-item-addition-track-breadth-update-expected.txt
LayoutTests/fast/css-grid-layout/grid-item-addition-track-breadth-update.html
LayoutTests/fast/css-grid-layout/grid-item-multiple-minmax-content-resolution-expected.txt
LayoutTests/fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html
LayoutTests/fast/css-grid-layout/grid-item-removal-track-breadth-update-expected.txt
LayoutTests/fast/css-grid-layout/grid-item-removal-track-breadth-update.html
LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt
LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
LayoutTests/fast/css-grid-layout/implicit-position-dynamic-change-expected.txt
LayoutTests/fast/css-grid-layout/implicit-position-dynamic-change.html
LayoutTests/fast/css-grid-layout/minmax-max-content-resolution-rows-expected.txt
LayoutTests/fast/css-grid-layout/minmax-max-content-resolution-rows.html
LayoutTests/fast/css-grid-layout/minmax-min-content-column-resolution-rows-expected.txt
LayoutTests/fast/css-grid-layout/minmax-min-content-column-resolution-rows.html
LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-rows-expected.txt
LayoutTests/fast/css-grid-layout/minmax-spanning-resolution-rows.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h