diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc b/chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc index 6275cba58ee..c3d6fe3245f 100644 --- a/chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc +++ b/chromium/third_party/blink/renderer/core/layout/ng/ng_fragment_child_iterator.cc @@ -97,7 +97,7 @@ void NGFragmentChildIterator::UpdateSelfFromFragment( current_.link_.fragment->GetLayoutObject()); current_.break_token_for_fragmentainer_only_ = false; } else if (is_fragmentation_context_root_ && previous_fragment) { - if (previous_fragment->IsColumnBox()) { + if (previous_fragment->IsFragmentainerBox()) { // The outgoing break token from one fragmentainer is the incoming break // token to the next one. This is also true when there are column spanners // between two columns (fragmentainers); the outgoing break token from the @@ -112,8 +112,10 @@ void NGFragmentChildIterator::UpdateSelfFromFragment( // rendered legend. We'll leave |current_block_break_token_| alone here, // as it will be used as in incoming break token when we get to the next // column. + // TODO(almaher): Remove check for out of flow. DCHECK( previous_fragment->IsRenderedLegend() || + previous_fragment->IsOutOfFlowPositioned() || NGBlockNode(ToLayoutBox(previous_fragment->GetMutableLayoutObject())) .IsColumnSpanAll()); @@ -129,28 +131,7 @@ void NGFragmentChildIterator::UpdateSelfFromFragment( bool NGFragmentChildIterator::AdvanceWithCursor() { DCHECK(current_.cursor_); - const NGFragmentItem* item = current_.cursor_->CurrentItem(); - if (item->HasChildren()) { - // If we're advancing past a non-atomic inline, we also need to advance past - // any break tokens for fragments in there. - for (wtf_size_t remaining = item->DescendantsCount(); remaining; - remaining--) { - if (item->IsFloating()) { - SkipToBlockBreakToken(); - if (child_break_token_idx_ < child_break_tokens_.size()) { - DCHECK_EQ(child_break_tokens_[child_break_token_idx_] - ->InputNode() - .GetLayoutBox(), - item->GetLayoutObject()); - child_break_token_idx_++; - } - } - current_.cursor_->MoveToNext(); - item = current_.cursor_->CurrentItem(); - } - } else { - current_.cursor_->MoveToNext(); - } + current_.cursor_->MoveToNextSkippingChildren(); UpdateSelfFromCursor(); if (current_.cursor_->CurrentItem()) return true; @@ -175,25 +156,6 @@ void NGFragmentChildIterator::UpdateSelfFromCursor() { return; } current_.link_ = {item->BoxFragment(), item->OffsetInContainerBlock()}; - if (!current_.link_.fragment || !current_.link_.fragment->IsFloating()) { - DCHECK(!current_.link_.fragment || - current_.link_.fragment->GetLayoutObject()->IsInline()); - return; - } - if (!parent_break_token_) - return; - // Floats may fragment, in which case there's a designated break token for - // them. - SkipToBlockBreakToken(); - if (child_break_token_idx_ >= child_break_tokens_.size()) { - current_.block_break_token_ = nullptr; - return; - } - current_.block_break_token_ = - To<NGBlockBreakToken>(child_break_tokens_[child_break_token_idx_]); - DCHECK(!current_.link_.fragment->GetLayoutObject() || - current_.block_break_token_->InputNode().GetLayoutBox() == - current_.link_.fragment->GetLayoutObject()); } void NGFragmentChildIterator::SkipToBoxFragment() { |