[css-grid] Display issues with child with max-width
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Nov 2017 09:29:07 +0000 (09:29 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Nov 2017 09:29:07 +0000 (09:29 +0000)
commit42d9fc8f133121ab459db3dd8f50dd48dc89ee4f
tree7533069f28e2aab30d64a92480e8d479d3abd1fd
parent09e9dea74027c8fa6db4092fcf1f0177b0e425b6
[css-grid] Display issues with child with max-width
https://bugs.webkit.org/show_bug.cgi?id=178973

Reviewed by Darin Adler.

Source/WebCore:

We have an utility function to compute the grid item's margins
when the item still needs to layout. We used the function
RenderStyle::hasMarings to decide whether such margin computation
worths. However, we need that function to operate on a specific
axis, hence I added a new function adding such logic.

Additionally, we must treat any 'auto' margin as 0px during the
tracks sizing algorithm, as the CSS Grid spec states:

  - https://drafts.csswg.org/css-grid/#auto-margins

Test: fast/css-grid-layout/auto-margins-ignored-during-track-sizing.html

* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::childHasMargin): New funciton with axis dependent logic.
(WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild): Ignore auto margins.
(WebCore::GridLayoutFunctions::marginLogicalSizeForChild): Ignore auto margins.

LayoutTests:

Regression test for the bug.

* fast/css-grid-layout/auto-margins-ignored-during-track-sizing-expected.html: Added.
* fast/css-grid-layout/auto-margins-ignored-during-track-sizing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/auto-margins-ignored-during-track-sizing-expected.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/auto-margins-ignored-during-track-sizing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/GridLayoutFunctions.cpp