[css-grid] Treat percentages as auto for the minimum contribution

The minimum contribution of a grid item is the outer size resulting from
the minimum size if the computed preferred size behaves as auto, or the
min-content contribution otherwise.

If the preferred size is a percentage, it should be resolved with
respect to the grid area, which depends on the minimum contribution
of the item. Thus the percentage is cyclic and behaves as auto.

Before this change, Blink only checked whether the preferred size is
auto, not whether it behaves as auto. In fact this was according to
an older version of the spec, but it was changed in
https://github.com/w3c/csswg-drafts/issues/2367

Firefox already implemented this change in https://bugzil.la/1462854

BUG=931474
TEST=external/wpt/css/css-grid/grid-items/grid-item-percentage-sizes-001.html
TEST=external/wpt/css/css-grid/grid-items/grid-item-percentage-sizes-002.html

grid-item-percentage-sizes-003.html improves but still fails because of
http://crbug.com/942811

Change-Id: Iaf57a0237c68a5557ff9c7ee7b526975d51ac988
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526051
Reviewed-by: Manuel Rego <rego@igalia.com>
Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#641637}
2 files changed