Commit a31a8667 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Reuse block_flow variable instead of checking and casting again

Avoids a pointless virtual call

R=eae@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Ie3048af3bc77c1f2dfea7293d823dd2fa5bbdde5
Reviewed-on: https://chromium-review.googlesource.com/c/1287203
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600607}
parent 83de5307
......@@ -183,9 +183,9 @@ scoped_refptr<NGLayoutResult> NGBlockNode::Layout(
box_->IsLayoutNGMixin() ? ToLayoutBlockFlow(box_) : nullptr;
NGLayoutInputNode first_child = FirstChild();
scoped_refptr<NGLayoutResult> layout_result;
if (box_->IsLayoutNGMixin()) {
layout_result = ToLayoutBlockFlow(box_)->CachedLayoutResult(
constraint_space, break_token);
if (block_flow) {
layout_result =
block_flow->CachedLayoutResult(constraint_space, break_token);
if (layout_result) {
// TODO(layoutng): Figure out why these two call can't be inside the
// !constraint_space.IsIntermediateLayout() block below.
......@@ -204,8 +204,8 @@ scoped_refptr<NGLayoutResult> NGBlockNode::Layout(
// LayoutNGMixin::CurrentFragment and therefore has to be up-to-date.
// In particular, that fragment would have an incorrect offset if we
// don't re-set the result here.
ToLayoutBlockFlow(box_)->SetCachedLayoutResult(
constraint_space, break_token, *layout_result);
block_flow->SetCachedLayoutResult(constraint_space, break_token,
*layout_result);
if (!constraint_space.IsIntermediateLayout() && first_child &&
first_child.IsInline()) {
block_flow->UpdatePaintFragmentFromCachedLayoutResult(
......
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