Fix issue with flex layout.
Fix issue with flex layout.

Modeled after https://codereview.chromium.org/1839063002/

BUG=skia:

Review-Url: https://codereview.chromium.org/1962093002

google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot