Commit 645741b0 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[FragmentItem] Fix CalculateSizeBasedLayoutCacheStatus not to upgrade

This patch ensures that |CalculateSizeBasedLayoutCacheStatus|
can downgrade |kHit| to |kNeedsSimplifiedLayout|, but not to
upgrade |kCanReuseLines|. Upgrading can run simplified layout
even when previously we determined changes in inline content
cannot run the simplified layout.

This fixes |PrintPreviewPagesSettingsTest.InvalidPageRanges|.

Bug: 982194
Change-Id: Ie9fe75a64f7c24cc0bedc8647b38a8c33d8529bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237433Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776809}
parent 907134d6
......@@ -2787,7 +2787,8 @@ scoped_refptr<const NGLayoutResult> LayoutBox::CachedLayoutResult(
// Update our temporary cache status, if the size cache check indicated we
// might need simplified layout.
if (size_cache_status == NGLayoutCacheStatus::kNeedsSimplifiedLayout)
if (size_cache_status == NGLayoutCacheStatus::kNeedsSimplifiedLayout &&
cache_status == NGLayoutCacheStatus::kHit)
cache_status = NGLayoutCacheStatus::kNeedsSimplifiedLayout;
LayoutUnit bfc_line_offset = new_space.BfcOffset().line_offset;
......
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