Commit 6682b8fa authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Get rid of unused function NGInlineFragmentTraversal::SelfFragmentsOf()

This patch gets rid of unused function |SelfFragmentsOf()| for improving
code health.

Change-Id: Ic900ea5921307c92c59a96c9dfae5655a673a60f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888624
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710694}
parent b936d5f1
...@@ -163,27 +163,6 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase { ...@@ -163,27 +163,6 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase {
} // namespace } // namespace
// static
Vector<Result> NGInlineFragmentTraversal::SelfFragmentsOf(
const NGPhysicalContainerFragment& container,
const LayoutObject* layout_object) {
if (const LayoutInline* layout_inline = ToLayoutInlineOrNull(layout_object)) {
// TODO(crbug.com/874361): Stop partial culling of inline boxes, so that we
// can simply check existence of paint fragments below.
if (!layout_inline->HasSelfPaintingLayer()) {
return LayoutInlineCollector(ToLayoutInline(*layout_object))
.CollectFrom(container);
}
}
Vector<Result> result;
for (const NGPaintFragment* fragment :
NGPaintFragment::InlineFragmentsFor(layout_object)) {
result.push_back(Result{&fragment->PhysicalFragment(),
fragment->InlineOffsetToContainerBox()});
}
return result;
}
// static // static
Vector<Result> NGInlineFragmentTraversal::DescendantsOf( Vector<Result> NGInlineFragmentTraversal::DescendantsOf(
const NGPhysicalContainerFragment& container) { const NGPhysicalContainerFragment& container) {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
namespace blink { namespace blink {
class LayoutObject;
class NGPhysicalContainerFragment; class NGPhysicalContainerFragment;
// Utility class for traversing the physical fragment tree. // Utility class for traversing the physical fragment tree.
...@@ -24,20 +23,6 @@ class CORE_EXPORT NGInlineFragmentTraversal { ...@@ -24,20 +23,6 @@ class CORE_EXPORT NGInlineFragmentTraversal {
// specified fragment. // specified fragment.
static Vector<NGPhysicalFragmentWithOffset> DescendantsOf( static Vector<NGPhysicalFragmentWithOffset> DescendantsOf(
const NGPhysicalContainerFragment&); const NGPhysicalContainerFragment&);
// Returns list of inline fragments produced from the specified LayoutObject.
// The search is restricted in the subtree of |container|.
// Note: When |target| is a LayoutInline, some/all of its own box fragments
// may be absent from the fragment tree, in which case the nearest box/text
// descendant fragments are returned.
// Note 2: Most callers should use the enclosing block flow fragment of
// |target| as |container|. The only exception is
// LayoutInline::HitTestCulledInline().
// TODO(xiaochengh): As |container| is redundant in most cases, split this
// function into two variants that takes/omits |container|.
static Vector<NGPhysicalFragmentWithOffset> SelfFragmentsOf(
const NGPhysicalContainerFragment& container,
const LayoutObject* target);
}; };
} // namespace blink } // namespace blink
......
...@@ -67,19 +67,4 @@ TEST_F(NGInlineFragmentTraversalTest, DescendantsOf) { ...@@ -67,19 +67,4 @@ TEST_F(NGInlineFragmentTraversalTest, DescendantsOf) {
EXPECT_EQ(iter, descendants.end()); EXPECT_EQ(iter, descendants.end());
} }
TEST_F(NGInlineFragmentTraversalTest, SelfFragmentsOf) {
SetBodyInnerHTML(
"<style>* { border: 1px solid}</style>"
"<div id=t>foo<b id=filter>bar<br>baz</b>bla</div>");
const auto descendants = NGInlineFragmentTraversal::SelfFragmentsOf(
GetRootFragmentById("t"), GetLayoutObjectByElementId("filter"));
auto* iter = descendants.begin();
// <b> generates two box fragments since its content is in two lines.
EXPECT_NEXT_BOX(iter, "filter");
EXPECT_NEXT_BOX(iter, "filter");
EXPECT_EQ(iter, descendants.end());
}
} // namespace blink } // namespace blink
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