From 779a42900be9c395394fd7b0c107db335e978ad9 Mon Sep 17 00:00:00 2001 From: Selim Gurun Date: Wed, 2 Mar 2016 17:18:20 -0800 Subject: [PATCH] Add more RELEASE_ASSERT(!needsLayout()) in FrameView::updateStyleAndLayoutIfNeededRecursive() This will help us to know if the failure of later RELEASE_ASSERT( !needsLayout()) is because the layout fails to clear the flag, or needsLayout is set after layout and before the later assert. BUG=590856,545039 R=leviw@chromium.org Review URL: https://codereview.chromium.org/1755893002 . (cherry picked from commit 69310abf196fb89368a61f9330677ef7c0a0bee4) Cr-Original-Commit-Position: refs/heads/master@{#378698} Cr-Commit-Position: refs/branch-heads/2661@{#53} Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081} --- third_party/WebKit/Source/core/frame/FrameView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index e94fd548f4922..cfdbf769ad43b 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp @@ -2641,6 +2641,8 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive() if (needsLayout()) layout(); + RELEASE_ASSERT(!needsLayout()); + // WebView plugins need to update regardless of whether the LayoutEmbeddedObject // that owns them needed layout. // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews. We @@ -2652,6 +2654,8 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive() toPluginView(child.get())->layoutIfNeeded(); } + RELEASE_ASSERT(!needsLayout()); + // FIXME: Calling layout() shouldn't trigger script execution or have any // observable effects on the frame tree but we're not quite there yet. WillBeHeapVector> frameViews; @@ -2665,6 +2669,8 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive() for (const auto& frameView : frameViews) frameView->updateStyleAndLayoutIfNeededRecursive(); + RELEASE_ASSERT(!needsLayout()); + // When SVG filters are invalidated using Document::scheduleSVGFilterLayerUpdateHack() they may trigger an // extra style recalc. See PaintLayer::filterNeedsPaintInvalidation(). if (m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()) {