Commit 0218d465 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[FlexNG] Clear (all) layout results when scrollbars change.

Simplified layout DCHECKs save the day again!
We need to clear all cached layout results when scrollbars change.

As we now have the "measure" cache slot it was possible to keep around
a layout result with the incorrect scrollbar state.

The bug caught on the trybots manifested as layout result having
"simplified" layout performed, but failing as the inline-size of the
fragment changed during simplified layout.

Clearing all layout results when scrollbars change fixes this class
of issue.

Bug: 845235
Change-Id: I627eab1be0adacad27668fc087fb64446a70b95e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037729
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738591}
parent af428822
......@@ -404,6 +404,11 @@ scoped_refptr<const NGLayoutResult> NGBlockNode::Layout(
box_->PreferredLogicalWidthsDirty())) {
PaintLayerScrollableArea::FreezeScrollbarsScope freeze_scrollbars;
// We need to clear any previous results when scrollbars change. For
// example - we may have stored a "measure" layout result which will be
// incorrect if we try and reuse it.
box_->ClearLayoutResults();
#if DCHECK_IS_ON()
// Ensure turning on/off scrollbars only once at most, when we call
// |LayoutWithAlgorithm| recursively.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment