[css-grid] Avoid clearing the overrideContainingBlockWidth if possible

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, in the Mac platform we enable the
PreferredSizeMode so that the WebContent process launches messages to
the render process asking for the current preferred size.

Additionally, in some cases like the one described in the bug this 
patch tries to solve, a style change causes a preferred width
invalidation. This implies that any request for the preferred width 
will trigger the preferred size computation logic. The problem is that,
as mentioned before, this happens out of any layout process.

Finally, even though preferred size invalidation implies that the
affected box is marked as needing layout with the kMarkContainerChain
enabled, this is not happening for the case described in the bug. The
Grid container is not marked for layout because the Grid Item is an
'input' element, rendered by a LayoutTextControl which happens to be
an ObjectRelayoutBoundary.

One possible alternative approach for this issue would be to exclude
grid items as possible ObjectRelayoutBoundary, like it happens with
Flexible Box items or TableParts. However, I think it's better to avoid
as much as possible to clear the overrideContainingBlockWidth to reduce
the friction between the intrinsic size computation and the layout
logics.

Bug: 727076,773988 
Change-Id: Ibe4c927f5101b7ceced433084ea81aa2cafdc4a2
Reviewed-on: https://chromium-review.googlesource.com/702437
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Manuel Rego Casasnovas <rego@igalia.com>
Reviewed-by: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#511451}
5 files changed