Commit e305a642 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

LayoutNG: Auto outline should take into account of overflowed text

Bug: 1116959
Change-Id: I10141b2bea344d320fe49a721b554de62a019449
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371864
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801269}
parent ef8825ff
......@@ -110,6 +110,14 @@ void NGPhysicalContainerFragment::AddOutlineRectsForNormalChildren(
outline_rects, additional_offset, outline_type, containing_block);
continue;
}
if (item.IsText()) {
if (outline_type == NGOutlineType::kDontIncludeBlockVisualOverflow)
continue;
outline_rects->push_back(
PhysicalRect(additional_offset + item.OffsetInContainerBlock(),
item.Size().ToLayoutSize()));
continue;
}
if (item.Type() == NGFragmentItem::kBox) {
if (const NGPhysicalBoxFragment* child_box =
item.PostLayoutBoxFragment()) {
......@@ -120,7 +128,6 @@ void NGPhysicalContainerFragment::AddOutlineRectsForNormalChildren(
}
continue;
}
DCHECK(item.IsText());
}
// Don't add |Children()|. If |this| has |NGFragmentItems|, children are
// either line box, which we already handled in items, or OOF, which we
......
<html>
<style>
.test3 {
outline: auto 3px #1f5ccf;
background-color: lightblue;
margin: 20px;
font-size: 30px;
line-height: 16px;
height: 16px;
width: fit-content;
}
</style>
<body>
<div style="outline:solid 3px #1f5ccf; background-color: lightblue; margin: 20px">
<p>There should be one outline around the whole div</p>
......@@ -8,5 +19,7 @@
<p>There should be one outline around the whole div</p>
<p style="margin-left: -20px">Not around each element</p>
</div>
<div class="test3">Auto outline should be taller than the div height.</div>
</body>
</html>
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