Commit 63cac401 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Improved legacy write-back for multicol.

This fixes crashers in layout tests.

A recent change, probably
https://chromium-review.googlesource.com/c/chromium/src/+/912551
triggered a bunch of crashers in fast/multicol/ , because it calls
LayoutFlowThread::PageRemainingLogicalHeightForOffset(), which DCHECKs
on IsPageLogicalHeightKnown(). So have NG mark logical height as known,
to avoid the DCHECK failure.

In addition to fixing those 91 new crashers (note that the test
expectation file hadn't been updated to expect crashers for those), this
also fixes some old crashers. Most of them go from Crash to Failure, but
a few even pass now.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ia3405e7dc18cb11026927836d07be5e3271817bb
Reviewed-on: https://chromium-review.googlesource.com/921227
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537005}
parent 1d692b44
...@@ -687,6 +687,17 @@ void LayoutMultiColumnFlowThread::AppendNewFragmentainerGroupIfNeeded( ...@@ -687,6 +687,17 @@ void LayoutMultiColumnFlowThread::AppendNewFragmentainerGroupIfNeeded(
} }
} }
void LayoutMultiColumnFlowThread::UpdateFromNG() {
all_columns_have_known_height_ = true;
for (LayoutBox* column_box = FirstMultiColumnBox(); column_box;
column_box = column_box->NextSiblingMultiColumnBox()) {
if (column_box->IsLayoutMultiColumnSet())
ToLayoutMultiColumnSet(column_box)->UpdateFromNG();
column_box->ClearNeedsLayout();
column_box->UpdateAfterLayout();
}
}
bool LayoutMultiColumnFlowThread::IsFragmentainerLogicalHeightKnown() { bool LayoutMultiColumnFlowThread::IsFragmentainerLogicalHeightKnown() {
return IsPageLogicalHeightKnown(); return IsPageLogicalHeightKnown();
} }
......
...@@ -281,6 +281,8 @@ class CORE_EXPORT LayoutMultiColumnFlowThread : public LayoutFlowThread, ...@@ -281,6 +281,8 @@ class CORE_EXPORT LayoutMultiColumnFlowThread : public LayoutFlowThread,
void AppendNewFragmentainerGroupIfNeeded(LayoutUnit offset_in_flow_thread, void AppendNewFragmentainerGroupIfNeeded(LayoutUnit offset_in_flow_thread,
PageBoundaryRule); PageBoundaryRule);
void UpdateFromNG();
// Implementing FragmentationContext: // Implementing FragmentationContext:
bool IsFragmentainerLogicalHeightKnown() final; bool IsFragmentainerLogicalHeightKnown() final;
LayoutUnit FragmentainerLogicalHeightAt(LayoutUnit block_offset) final; LayoutUnit FragmentainerLogicalHeightAt(LayoutUnit block_offset) final;
......
...@@ -653,7 +653,6 @@ void LayoutMultiColumnSet::UpdateFromNG() { ...@@ -653,7 +653,6 @@ void LayoutMultiColumnSet::UpdateFromNG() {
auto& group = fragmentainer_groups_[0]; auto& group = fragmentainer_groups_[0];
group.UpdateFromNG(LogicalHeight()); group.UpdateFromNG(LogicalHeight());
ComputeOverflow(LogicalHeight()); ComputeOverflow(LogicalHeight());
ClearNeedsLayout();
} }
} // namespace blink } // namespace blink
...@@ -104,16 +104,11 @@ void UpdateLegacyMultiColumnFlowThread( ...@@ -104,16 +104,11 @@ void UpdateLegacyMultiColumnFlowThread(
border_scrollbar_padding.InlineSum()); border_scrollbar_padding.InlineSum());
column_set->SetLogicalHeight(column_block_size); column_set->SetLogicalHeight(column_block_size);
column_set->EndFlow(flow_end); column_set->EndFlow(flow_end);
column_set->UpdateFromNG();
} }
// TODO(mstensho): Update all column boxes, not just the first column set // TODO(mstensho): Update all column boxes, not just the first column set
// (like we do above). This is needed to support column-span:all. // (like we do above). This is needed to support column-span:all.
for (LayoutBox* column_box = flow_thread->FirstMultiColumnBox(); column_box;
column_box = column_box->NextSiblingMultiColumnBox()) {
column_box->ClearNeedsLayout();
column_box->UpdateAfterLayout();
}
flow_thread->UpdateFromNG();
flow_thread->ValidateColumnSets(); flow_thread->ValidateColumnSets();
flow_thread->SetLogicalHeight(flow_end); flow_thread->SetLogicalHeight(flow_end);
flow_thread->UpdateAfterLayout(); flow_thread->UpdateAfterLayout();
......
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