From 9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 28 Sep 2016 16:39:37 +0300 Subject: Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3 Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev --- Source/WebCore/page/FrameView.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/page/FrameView.cpp') diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index e1dd28906..4bae77613 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -2649,7 +2649,9 @@ void FrameView::scheduleRelayoutOfSubtree(RenderElement& newRelayoutRoot) ASSERT(!renderView.documentBeingDestroyed()); ASSERT(frame().view() == this); - if (renderView.needsLayout()) { + // When m_layoutRoot is already set, ignore the renderView's needsLayout bit + // since we need to resolve the conflict between the m_layoutRoot and newRelayoutRoot layouts. + if (renderView.needsLayout() && !m_layoutRoot) { m_layoutRoot = &newRelayoutRoot; convertSubtreeLayoutToFullLayout(); return; @@ -2657,7 +2659,7 @@ void FrameView::scheduleRelayoutOfSubtree(RenderElement& newRelayoutRoot) if (!layoutPending() && m_layoutSchedulingEnabled) { std::chrono::milliseconds delay = renderView.document().minimumLayoutDelay(); - ASSERT(!newRelayoutRoot.container() || !newRelayoutRoot.container()->needsLayout()); + ASSERT(!newRelayoutRoot.container() || is(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout()); m_layoutRoot = &newRelayoutRoot; InspectorInstrumentation::didInvalidateLayout(frame()); m_delayedLayout = delay.count(); @@ -2678,7 +2680,7 @@ void FrameView::scheduleRelayoutOfSubtree(RenderElement& newRelayoutRoot) if (isObjectAncestorContainerOf(m_layoutRoot, &newRelayoutRoot)) { // Keep the current root. newRelayoutRoot.markContainingBlocksForLayout(ScheduleRelayout::No, m_layoutRoot); - ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); + ASSERT(!m_layoutRoot->container() || is(m_layoutRoot->container()) || !m_layoutRoot->container()->needsLayout()); return; } @@ -2686,7 +2688,7 @@ void FrameView::scheduleRelayoutOfSubtree(RenderElement& newRelayoutRoot) // Re-root at newRelayoutRoot. m_layoutRoot->markContainingBlocksForLayout(ScheduleRelayout::No, &newRelayoutRoot); m_layoutRoot = &newRelayoutRoot; - ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); + ASSERT(!m_layoutRoot->container() || is(m_layoutRoot->container()) || !m_layoutRoot->container()->needsLayout()); InspectorInstrumentation::didInvalidateLayout(frame()); return; } -- cgit v1.2.1