Skip to content

Commit

Permalink
Add more RELEASE_ASSERT(!needsLayout()) in FrameView::updateStyleAndL…
Browse files Browse the repository at this point in the history
…ayoutIfNeededRecursive()

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
[email protected]

Review URL: https://codereview.chromium.org/1755893002 .

(cherry picked from commit 69310ab)

Cr-Original-Commit-Position: refs/heads/master@{#378698}
Cr-Commit-Position: refs/branch-heads/2661@{crosswalk-project#53}
Cr-Branched-From: ef6f6ae-refs/heads/master@{#378081}
  • Loading branch information
Selim Gurun committed Mar 3, 2016
1 parent 0c8ce49 commit 779a429
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions third_party/WebKit/Source/core/frame/FrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<RefPtrWillBeMember<FrameView>> frameViews;
Expand All @@ -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()) {
Expand Down

0 comments on commit 779a429

Please sign in to comment.