[CSS Grid Layout] Setting height on a grid item doesn't have any effect
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jun 2015 20:26:02 +0000 (20:26 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jun 2015 20:26:02 +0000 (20:26 +0000)
commit10cb0b669e84a432a7ff3c3a61ddcf443f78a58f
tree619a6aa32bb27b3732e0b9daee4a9dc8bcb9790f
parentb3bf00b64160d3ea87db0b1b45906630dbd1e37e
[CSS Grid Layout] Setting height on a grid item doesn't have any effect
https://bugs.webkit.org/show_bug.cgi?id=145604

Reviewed by Sergio Villar Senin.

Source/WebCore:

Box Alignment spec states that stretch is only possible when height is
'auto' and no 'auto' margins are used.

It might be the case that style changes so that stretching is not allowed,
hence we need to detect it and clear the override height the stretching
algorithm previously set. The new layout triggered by the style change
will then set grid item's height according to the new style rules.

Test: fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html

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

LayoutTests:

Tests to verify that we clear the override height set by the stretching logic
whenever height or margin change in a way they don't allow stretching anymore.

* fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change-expected.txt: Added.
* fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp