Commit d1278b38 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Check earlier if we have a cached fragment at all.

Before we do "a lot of" work to check if we can use the cached fragment,
check if we have one at all.

Change-Id: I13662fbf2a1bd3b377ba91e9b345fd5093b060ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1624328
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662147}
parent afefa715
...@@ -2332,6 +2332,10 @@ scoped_refptr<const NGLayoutResult> LayoutBox::CachedLayoutResult( ...@@ -2332,6 +2332,10 @@ scoped_refptr<const NGLayoutResult> LayoutBox::CachedLayoutResult(
if (!RuntimeEnabledFeatures::LayoutNGFragmentCachingEnabled()) if (!RuntimeEnabledFeatures::LayoutNGFragmentCachingEnabled())
return nullptr; return nullptr;
const NGLayoutResult* cached_layout_result = GetCachedLayoutResult();
if (!cached_layout_result)
return nullptr;
// TODO(cbiesinger): Support caching fragmented boxes. // TODO(cbiesinger): Support caching fragmented boxes.
if (break_token) if (break_token)
return nullptr; return nullptr;
...@@ -2357,10 +2361,6 @@ scoped_refptr<const NGLayoutResult> LayoutBox::CachedLayoutResult( ...@@ -2357,10 +2361,6 @@ scoped_refptr<const NGLayoutResult> LayoutBox::CachedLayoutResult(
return nullptr; return nullptr;
} }
const NGLayoutResult* cached_layout_result = GetCachedLayoutResult();
if (!cached_layout_result)
return nullptr;
const NGPhysicalContainerFragment& physical_fragment = const NGPhysicalContainerFragment& physical_fragment =
cached_layout_result->PhysicalFragment(); cached_layout_result->PhysicalFragment();
......
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