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

Remove DCHECKs from |PostLayout|

r789656 crrev.com/c/2302984 added a few DCHECKs to
|PostLayout| based on our existing assumptions, but they
did hit in DCHECK-enabled Canary.

While not all reasons are clear, we've got 20 crash logs
in a few days. This patch removes these DCHECKs.

Bug: 1107204
Change-Id: I78e247675278a5c9944bbc0d153a6d1543a8e033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309494Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790297}
parent 36206cc9
......@@ -357,20 +357,23 @@ const NGPhysicalFragment* NGPhysicalFragment::PostLayout() const {
const auto* layout_box = ToLayoutBoxOrNull(GetLayoutObject());
if (UNLIKELY(!layout_box))
return nullptr;
const wtf_size_t fragment_count = layout_box->PhysicalFragmentCount();
if (fragment_count == 0) {
// This should not happen, but DCHECK hits. crbug.com/1107204
return nullptr;
}
DCHECK_GT(layout_box->PhysicalFragmentCount(), 0u);
if (layout_box->PhysicalFragmentCount() == 1) {
if (fragment_count == 1) {
const NGPhysicalFragment* post_layout = layout_box->GetPhysicalFragment(0);
DCHECK(post_layout);
if (UNLIKELY(post_layout && post_layout != this)) {
// Relayout boundary is the only case this can happen. crbug.com/829028
// This can happen at the relayout boundary crbug.com/829028
// but DCHECKing |IsRelayoutBoundary| hits. crbug.com/1107204
DCHECK(layout_box->IsRelayoutBoundary());
return post_layout;
}
} else {
// TODO(crbug.com/829028): Block fragmentation not supported yet.
DCHECK(!layout_box->IsRelayoutBoundary());
}
// TODO(crbug.com/829028): Block fragmentation not supported yet.
DCHECK(std::any_of(layout_box->PhysicalFragments().begin(),
layout_box->PhysicalFragments().end(),
[this](const NGPhysicalFragment& fragment) {
......
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