Commit 1a72f714 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Implement LayoutInline::LinesVisualOverflowBoundingBox

This patch supports LayoutInline::LinesVisualOverflowBoundingBox()
when LayoutNGPaintFragments is enabled.

Layer painting use this function to determine dirty regions.

This is a split of CL:803875 to measure the fix impacts. Estimated
to fix 385 tests in LayoutNGPaintFragments.

Bug: 714962
Change-Id: I2822528a56d116037fd507dc2c086cdb27c50b2e
Reviewed-on: https://chromium-review.googlesource.com/807972
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avataryosin (OOO Dec 11 to Jan 8) <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521660}
parent 89ce5e63
...@@ -1113,6 +1113,19 @@ LayoutRect LayoutInline::CulledInlineVisualOverflowBoundingBox() const { ...@@ -1113,6 +1113,19 @@ LayoutRect LayoutInline::CulledInlineVisualOverflowBoundingBox() const {
} }
LayoutRect LayoutInline::LinesVisualOverflowBoundingBox() const { LayoutRect LayoutInline::LinesVisualOverflowBoundingBox() const {
if (const NGPhysicalBoxFragment* box_fragment =
EnclosingBlockFlowFragmentOf(*this)) {
NGPhysicalOffsetRect result;
NGInlineFragmentIterator children(*box_fragment, this);
for (const auto& child : children) {
NGPhysicalOffsetRect child_rect =
child.fragment->VisualRectWithContents();
child_rect.offset += child.offset_to_container_box;
result.Unite(child_rect);
}
return result.ToLayoutRect();
}
if (!AlwaysCreateLineBoxes()) if (!AlwaysCreateLineBoxes())
return CulledInlineVisualOverflowBoundingBox(); return CulledInlineVisualOverflowBoundingBox();
......
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