Commit 828bad46 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[FragmentItem] All items are initially first and last for node.

NGFragmentItems::FinalizeAfterLayout() will typically update the bits
after layout, but apparently not always.

This should have been part of CL:2169929

This hopefully fixes:
https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20MSAN/5530
https://ci.chromium.org/p/chromium/builders/ci/Win7%20Tests%20%281%29/102130

TBR=kojii@chromium.org

Bug: 1075993
Change-Id: I53207183f6fa7f9c4ccd7db6b64fa8e5c755c332
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2170098Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763415}
parent bc69383e
...@@ -25,7 +25,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalTextFragment& text) ...@@ -25,7 +25,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalTextFragment& text)
is_hidden_for_paint_(text.IsHiddenForPaint()), is_hidden_for_paint_(text.IsHiddenForPaint()),
text_direction_(static_cast<unsigned>(text.ResolvedDirection())), text_direction_(static_cast<unsigned>(text.ResolvedDirection())),
ink_overflow_computed_(false), ink_overflow_computed_(false),
is_first_for_node_(text.IsFirstForNode()) { is_first_for_node_(true),
is_last_for_node_(true) {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
if (text_.shape_result) { if (text_.shape_result) {
DCHECK_EQ(text_.shape_result->StartIndex(), StartOffset()); DCHECK_EQ(text_.shape_result->StartIndex(), StartOffset());
...@@ -53,7 +54,8 @@ NGFragmentItem::NGFragmentItem(NGInlineItemResult&& item_result, ...@@ -53,7 +54,8 @@ NGFragmentItem::NGFragmentItem(NGInlineItemResult&& item_result,
is_hidden_for_paint_(false), // TODO(kojii): not supported yet. is_hidden_for_paint_(false), // TODO(kojii): not supported yet.
text_direction_(static_cast<unsigned>(item_result.item->Direction())), text_direction_(static_cast<unsigned>(item_result.item->Direction())),
ink_overflow_computed_(false), ink_overflow_computed_(false),
is_first_for_node_(item_result.IsFirstForNode()) { is_first_for_node_(true),
is_last_for_node_(true) {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
if (text_.shape_result) { if (text_.shape_result) {
DCHECK_EQ(text_.shape_result->StartIndex(), StartOffset()); DCHECK_EQ(text_.shape_result->StartIndex(), StartOffset());
...@@ -76,7 +78,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalLineBoxFragment& line, ...@@ -76,7 +78,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalLineBoxFragment& line,
is_hidden_for_paint_(false), is_hidden_for_paint_(false),
text_direction_(static_cast<unsigned>(line.BaseDirection())), text_direction_(static_cast<unsigned>(line.BaseDirection())),
ink_overflow_computed_(false), ink_overflow_computed_(false),
is_first_for_node_(true) { is_first_for_node_(true),
is_last_for_node_(true) {
DCHECK(!IsFormattingContextRoot()); DCHECK(!IsFormattingContextRoot());
} }
...@@ -90,7 +93,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalBoxFragment& box, ...@@ -90,7 +93,8 @@ NGFragmentItem::NGFragmentItem(const NGPhysicalBoxFragment& box,
is_hidden_for_paint_(box.IsHiddenForPaint()), is_hidden_for_paint_(box.IsHiddenForPaint()),
text_direction_(static_cast<unsigned>(resolved_direction)), text_direction_(static_cast<unsigned>(resolved_direction)),
ink_overflow_computed_(false), ink_overflow_computed_(false),
is_first_for_node_(box.IsFirstForNode()) { is_first_for_node_(true),
is_last_for_node_(true) {
DCHECK_EQ(IsFormattingContextRoot(), box.IsFormattingContextRoot()); DCHECK_EQ(IsFormattingContextRoot(), box.IsFormattingContextRoot());
} }
...@@ -104,7 +108,8 @@ NGFragmentItem::NGFragmentItem(const NGInlineItem& inline_item, ...@@ -104,7 +108,8 @@ NGFragmentItem::NGFragmentItem(const NGInlineItem& inline_item,
is_hidden_for_paint_(false), is_hidden_for_paint_(false),
text_direction_(static_cast<unsigned>(TextDirection::kLtr)), text_direction_(static_cast<unsigned>(TextDirection::kLtr)),
ink_overflow_computed_(false), ink_overflow_computed_(false),
is_first_for_node_(true) { is_first_for_node_(true),
is_last_for_node_(true) {
DCHECK_EQ(inline_item.Type(), NGInlineItem::kOpenTag); DCHECK_EQ(inline_item.Type(), NGInlineItem::kOpenTag);
DCHECK(layout_object_); DCHECK(layout_object_);
DCHECK(layout_object_->IsLayoutInline()); DCHECK(layout_object_->IsLayoutInline());
......
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