[CSS Grid Layout] Don't need to reset auto-margins during grid items layout
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Oct 2015 19:23:52 +0000 (19:23 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Oct 2015 19:23:52 +0000 (19:23 +0000)
commit121f3a2e67458ebfef89fea78341545e839fd89a
tree3c1df7dde7354bf099a41244dcc7e40ca9159464
parentbe8df56b7a1bcb19ce73b1f26bbe3e32166d4140
[CSS Grid Layout] Don't need to reset auto-margins during grid items layout
https://bugs.webkit.org/show_bug.cgi?id=149764

Reviewed by Darin Adler.

Source/WebCore:

This patch implements a refactoring of the auto-margin alignment code for grid
items so it uses start/end and before/after margin logic terms.

I addition, it avoids resetting the auto-margin values, which requires an extra
layout, before applying the alignment logic.

No new tests because there is no behavior change.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeMarginLogicalHeightForChild): Computing margins if child needs layout.
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
(WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded): Using start/end logical margins.
(WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded): Using before/after logical margins.
(WebCore::RenderGrid::columnAxisOffsetForChild): Just added comment.
(WebCore::RenderGrid::rowAxisOffsetForChild): Just added comment.

LayoutTests:

Removed a duplicated layout tests.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190633 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 [deleted file]
LayoutTests/fast/css-grid-layout/grid-item-should-not-be-stretched-when-height-or-margin-change.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp