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

[FragmentItem] Remove fragmentainer workaround in NGFragmentItems

With r795011 <crrev.com/c/2313736>, |NGInlineCursor| supports
enumerating all fragments across fragmentainers, and that it
made workarounds in |NGFragmentItems| unnecessary.

Bug: 829028, 982194
Change-Id: If387d2882b9e599fb0f3f4f72a513cc3b19e5c3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2342526
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795833}
parent 21043a68
...@@ -281,23 +281,6 @@ void NGFragmentItems::DirtyLinesFromNeedsLayout( ...@@ -281,23 +281,6 @@ void NGFragmentItems::DirtyLinesFromNeedsLayout(
// static // static
void NGFragmentItems::LayoutObjectWillBeMoved( void NGFragmentItems::LayoutObjectWillBeMoved(
const LayoutObject& layout_object) { const LayoutObject& layout_object) {
if (UNLIKELY(layout_object.IsInsideFlowThread())) {
// TODO(crbug.com/829028): Make NGInlineCursor handle block
// fragmentation. For now, perform a slow walk here manually.
const LayoutBlock& container = *layout_object.ContainingBlock();
for (wtf_size_t idx = 0; idx < container.PhysicalFragmentCount(); idx++) {
const NGPhysicalBoxFragment& fragment =
*container.GetPhysicalFragment(idx);
if (const NGFragmentItems* fragment_items = fragment.Items()) {
for (const auto& item : fragment_items->Items()) {
if (item.GetLayoutObject() == &layout_object)
item.LayoutObjectWillBeMoved();
}
}
}
return;
}
NGInlineCursor cursor; NGInlineCursor cursor;
cursor.MoveTo(layout_object); cursor.MoveTo(layout_object);
for (; cursor; cursor.MoveToNextForSameLayoutObject()) { for (; cursor; cursor.MoveToNextForSameLayoutObject()) {
...@@ -309,23 +292,6 @@ void NGFragmentItems::LayoutObjectWillBeMoved( ...@@ -309,23 +292,6 @@ void NGFragmentItems::LayoutObjectWillBeMoved(
// static // static
void NGFragmentItems::LayoutObjectWillBeDestroyed( void NGFragmentItems::LayoutObjectWillBeDestroyed(
const LayoutObject& layout_object) { const LayoutObject& layout_object) {
if (UNLIKELY(layout_object.IsInsideFlowThread())) {
// TODO(crbug.com/829028): Make NGInlineCursor handle block
// fragmentation. For now, perform a slow walk here manually.
const LayoutBlock& container = *layout_object.ContainingBlock();
for (wtf_size_t idx = 0; idx < container.PhysicalFragmentCount(); idx++) {
const NGPhysicalBoxFragment& fragment =
*container.GetPhysicalFragment(idx);
if (const NGFragmentItems* fragment_items = fragment.Items()) {
for (const auto& item : fragment_items->Items()) {
if (item.GetLayoutObject() == &layout_object)
item.LayoutObjectWillBeDestroyed();
}
}
}
return;
}
NGInlineCursor cursor; NGInlineCursor cursor;
cursor.MoveTo(layout_object); cursor.MoveTo(layout_object);
for (; cursor; cursor.MoveToNextForSameLayoutObject()) { for (; cursor; cursor.MoveToNextForSameLayoutObject()) {
......
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