Commit 73afe6fe authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Fix AddOutlineRects to include continuation when the first line is empty

This patch fixes AddOutlineRects to include continuation
when the first line is empty.

In such case, NGInlineLayoutAlgorithm suppresses box
fragments, and thus we cannot reach to the continuation by
traversing fragment tree.

This patch detects such case and traverse the first
LayoutInline instead.

Bug: 889721
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I0e3bbd895501231b76775b074b35310037a3e113
Reviewed-on: https://chromium-review.googlesource.com/1252484Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595693}
parent fc66ae44
......@@ -353,7 +353,6 @@ crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Pass ]
crbug.com/591099 fast/css/case-transform.html [ Failure ]
crbug.com/835484 fast/css/focus-ring-recursive-continuations.html [ Failure ]
crbug.com/591099 fast/css/getComputedStyle/computed-style-percentage-top-with-position-inline.html [ Failure ]
crbug.com/835484 fast/css/outline-auto-empty-rects.html [ Failure ]
crbug.com/835484 fast/css/outline-narrowLine.html [ Failure ]
crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ Failure ]
crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
......
......@@ -118,6 +118,20 @@ void NGPhysicalContainerFragment::AddOutlineRectsForDescendant(
if (!descendant_line_box->Size().IsEmpty()) {
outline_rects->emplace_back(additional_offset,
descendant_line_box->Size().ToLayoutSize());
} else if (descendant_line_box->Children().IsEmpty()) {
// Special-case for when the first continuation does not generate
// fragments. NGInlineLayoutAlgorithm suppresses box fragments when the
// line is "empty". When there is a continuation from the LayoutInline,
// the suppression makes such continuation not reachable. Check the
// continuation from LayoutInline in such case.
DCHECK(GetLayoutObject());
if (LayoutInline* first_layout_inline =
ToLayoutInlineOrNull(GetLayoutObject()->SlowFirstChild())) {
if (!first_layout_inline->IsElementContinuation()) {
first_layout_inline->AddOutlineRectsForChildrenAndContinuations(
*outline_rects, additional_offset, outline_type);
}
}
}
}
}
......
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