[css-flexbox] Only do the initial child layout in one place

Instead of calling Layout in both ConstructAndAppendFlexItem and
ComputeInnerFlexBaseSize, only call it once in ConstructAndAppendFlexItem.

This has the side-effect that the scrollbar size can't change after
we compute it in ConstructAndAppendFlexItem, thus avoiding a check failure.

This will also avoid double layouts if UpdateBlockChildDirtyBits triggers
a layout.

The change to MainAxisContentExtentForChildIncludingScrollbar is a followup
to https://chromium-review.googlesource.com/c/chromium/src/+/1548326; this
now made a test fail without that change but I should have made the change
back then.

R=dgrogan@chromium.org

Bug: 963137
Change-Id: I28691c5e9d30d8425f16efcc95d2430098ca11f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614058
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: David Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660621}
4 files changed