[css-grid] Preemptively store intrinsic sizes during layout

Computing intrinsic sizes after the layout process (as it happens in Mac
with the calls to content::RenderViewImpl::didUpdateLayout()) or when using
the grid as a flex item in some cases, is very problematic, because the
intrinsic size computation did change the override sizes of the items.

One potential solution would be to mark the grid as needs layout after the
preferred widths computation but that is forbidden by the engine (also it
would require an additional layout). There is a better way to do this based
on the fact that the preferred widths computation is actually part of the
track sizing algorithm.

We could store the intrinsic sizes of the grid returned by the track sizing
algorithm after computing the column sizes in the event of the intrinsic
sizes being dirty. Note that this does not affect the other cases where
preferred widths are required as we already execute
computeIntrinsicLogicalWidths() as part of updateLogicalWidths() if
required.

BUG=708159

Review-Url: https://codereview.chromium.org/2834473003
Cr-Commit-Position: refs/heads/master@{#466668}
(cherry picked from commit 41d53a7316548ae2147de1fbb0cb9d1fda4ed3fa)

Review-Url: https://codereview.chromium.org/2839893002 .
Cr-Commit-Position: refs/branch-heads/3071@{#196}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}
4 files changed