Commit ec11fe81 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Revert "[LayoutNG] Turn AssertLaidOut into a CHECK for LayoutNG"

This reverts commit bade42c5.

Reason for revert: New crashes already caught. Reverting CHECKs
back into DCHECKs to reduce noises.

Original change's description:
> [LayoutNG] Turn AssertLaidOut into a CHECK for LayoutNG
> 
> Bug: 946004
> Change-Id: I9e2aa69a32f7a0373196d57e629256dbc7d78d2a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1540305
> Reviewed-by: Koji Ishii <kojii@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#644907}

TBR=eae@chromium.org,kojii@chromium.org,xiaochengh@chromium.org

Change-Id: I15fb43370f58757e09e7b7abc7c40d4af4a6101a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 946004
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1544156Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645407}
parent c4ef0de8
......@@ -961,11 +961,11 @@ void LocalFrameView::UpdateLayout() {
if (nested_layout_count_)
return;
// TODO(crbug.com/946004): Move the following line into a DCHECK_IS_ON() block
// when we no longer see missing layout reports in LayoutNG.
#if DCHECK_IS_ON()
// Post-layout assert that nobody was re-marked as needing layout during
// layout.
GetLayoutView()->AssertSubtreeIsLaidOut();
#endif
if (frame_->IsMainFrame()) {
// Scrollbars changing state can cause a visual viewport size change.
......@@ -2886,9 +2886,9 @@ void LocalFrameView::UpdateStyleAndLayoutIfNeededRecursive() {
// These asserts ensure that parent frames are clean, when child frames
// finished updating layout and style.
CheckDoesNotNeedLayout();
// TODO(crbug.com/946004): Move the following line into a DCHECK_IS_ON() block
// when we no longer see missing layout reports in LayoutNG.
#if DCHECK_IS_ON()
frame_->GetDocument()->GetLayoutView()->AssertLaidOut();
#endif
UpdateGeometriesIfNeeded();
......
......@@ -392,11 +392,6 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
LayoutObject& layout_object_;
bool preexisting_forbidden_;
};
#endif // DCHECK_IS_ON()
// TODO(crbug.com/946004): When we no longer see missing layouts in LayoutNG,
// move the following two functions back to the DCHECK_IS_ON() block and
// remove relevant branches and CHECK.
void AssertLaidOut() const {
#ifndef NDEBUG
......@@ -404,16 +399,9 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
ShowLayoutTreeForThis();
#endif
SECURITY_DCHECK(!NeedsLayout() || LayoutBlockedByDisplayLock());
if (!RuntimeEnabledFeatures::LayoutNGEnabled())
return;
CHECK(!NeedsLayout() || LayoutBlockedByDisplayLock()) << this;
}
void AssertSubtreeIsLaidOut() const {
#if !DCHECK_IS_ON()
if (!RuntimeEnabledFeatures::LayoutNGEnabled())
return;
#endif
for (const LayoutObject* layout_object = this; layout_object;
layout_object = layout_object->LayoutBlockedByDisplayLock()
? layout_object->NextInPreOrderAfterChildren()
......@@ -422,7 +410,6 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
}
}
#if DCHECK_IS_ON()
void AssertClearedPaintInvalidationFlags() const {
#ifndef NDEBUG
if (PaintInvalidationStateIsDirty() && !PrePaintBlockedByDisplayLock()) {
......@@ -441,7 +428,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
}
}
#endif // DCHECK_IS_ON()
#endif
// LayoutObject tree manipulation
//////////////////////////////////////////
......
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