Commit 93174b5d authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Only set paint fragment on inline nodes

Addresses kojii@'s comment on https://crrev.com/c/1001721

R=kojii@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I3632cc61d4eb957d1cff67bbdd41cd9cbe0d0f75
Reviewed-on: https://chromium-review.googlesource.com/1005095Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549501}
parent b543c229
......@@ -163,12 +163,15 @@ scoped_refptr<NGLayoutResult> NGBlockNode::Layout(
}
LayoutBlockFlow* block_flow =
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 (layout_result) {
block_flow->SetPaintFragment(layout_result->PhysicalFragment());
block_flow->ClearPaintFragment();
if (first_child && first_child.IsInline())
block_flow->SetPaintFragment(layout_result->PhysicalFragment());
return layout_result;
}
}
......@@ -185,7 +188,6 @@ scoped_refptr<NGLayoutResult> NGBlockNode::Layout(
layout_result->UnpositionedFloats().IsEmpty()) {
DCHECK(layout_result->PhysicalFragment());
NGLayoutInputNode first_child = FirstChild();
if (block_flow && first_child && first_child.IsInline()) {
CopyFragmentDataToLayoutBoxForInlineChildren(
ToNGPhysicalBoxFragment(*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