[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 16:38:14 +0000 (16:38 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 16:38:14 +0000 (16:38 +0000)
commit36a0c138e6c49535818d92dae22066d3978698b1
treef5e5d0771b8fbfb0adcc056dc031c42d392a6d8b
parent6be53575b6193640416b488087c3b86835345c59
[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
https://bugs.webkit.org/show_bug.cgi?id=178260

Reviewed by Sergio Villar Senin.

Since the intrinsic width computation uses the same logic than the
track sizing algorithm we are clearing the overrideContainingBlockWidth
of some grid items that are required to laid out them properly.

It's very uncommon that any intrinsic size computation isn't performed
as part of a layout process. However, if it happens, once cleared the
overrideContainingBlockWidth it may lead to an incorrect layout of the
affected grid items.

This change is a defensive approach to avoid the issues caused by
such off-layout preferred size requests, which may imply recomputing
the grid container intrinsic size.

No new tests, because we are only removing some redundant logic.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
* rendering/GridTrackSizingAlgorithm.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
Source/WebCore/rendering/GridTrackSizingAlgorithm.h