Commit e27bd1c8 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[FragmentItem] Fix DCHECK failures for virtual/layout_ng_block_frag/

Fixes DCHECK failures when NGFragmenttItem is enabled for:
virtual/layout_ng_block_frag/external/wpt/css/css-break/widows-orphans-005.html

There are 120 other DCHECK failures at the same stack,
probably fixes them too.

Bug: 829028, 982194
Change-Id: I1ed7257d72cd43ddc5a1f3901f5ff89189a247ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1942596Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720308}
parent 8c47526e
...@@ -424,11 +424,11 @@ const Vector<NGInlineItem>& NGPhysicalFragment::InlineItemsOfContainingBlock() ...@@ -424,11 +424,11 @@ const Vector<NGInlineItem>& NGPhysicalFragment::InlineItemsOfContainingBlock()
const { const {
DCHECK(IsInline()); DCHECK(IsInline());
DCHECK(GetLayoutObject()); DCHECK(GetLayoutObject());
LayoutBlockFlow* block_flow = GetLayoutObject()->ContainingNGBlockFlow(); LayoutBlockFlow* block_flow =
GetLayoutObject()->RootInlineFormattingContext();
// TODO(xiaochengh): Code below is copied from ng_offset_mapping.cc with // TODO(xiaochengh): Code below is copied from ng_offset_mapping.cc with
// modification. Unify them. // modification. Unify them.
DCHECK(block_flow); DCHECK(block_flow);
DCHECK(block_flow->ChildrenInline());
NGBlockNode block_node = NGBlockNode(block_flow); NGBlockNode block_node = NGBlockNode(block_flow);
DCHECK(block_node.CanUseNewLayout()); DCHECK(block_node.CanUseNewLayout());
NGLayoutInputNode node = block_node.FirstChild(); NGLayoutInputNode node = block_node.FirstChild();
......
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