[css-grid] Only clear the override size for relative margin/padding

The patch landed in r699290 tried to avoid errors when computing the
the used value of relative margins or padding due old/outdated item's
override size. The solution was to clear the both the inline and block
override size whenever an item had an intrinsic or auto size, or a
relative margin or padding.

However, the change mentioned above caused a performance regression, as
described in the bug. The root cause is an excessive number of relayouts
of the items that had to clear their override-size.

This CL tries to solve the performance issue by reducing the cases where
the override-size has to be cleared. It's not necessary to reset the
inline override-size unless the item has relative margin or padding.

Bug: 1046310
Change-Id: I988ab05e0552af75bf57f5d82dc73714f377ca0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033507
Reviewed-by: Manuel Rego <rego@igalia.com>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#737766}
2 files changed