Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index 9eee49932edd4e058f125b34ea1196fc5e63875e..cd68405c161fee1c8dd5c682fe05351e6c963bf7 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -220,7 +220,6 @@ void FrameView::reset() |
m_contentIsOpaque = false; |
m_hasPendingLayout = false; |
m_layoutSubtreeRoot = 0; |
- m_doFullRepaint = false; |
m_layoutSchedulingEnabled = true; |
m_inPerformLayout = false; |
m_canRepaintDuringPerformLayout = false; |
@@ -894,7 +893,6 @@ void FrameView::layout(bool allowSubtree) |
return; |
} |
- bool shouldDoFullLayout = false; |
FontCachePurgePreventer fontCachePurgePreventer; |
RenderLayer* layer; |
{ |
@@ -920,14 +918,13 @@ void FrameView::layout(bool allowSubtree) |
ScrollbarMode vMode; |
calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); |
- shouldDoFullLayout = !inSubtreeLayout && (m_firstLayout || toRenderView(rootForThisLayout)->document().printing()); |
dsinclair
2014/05/20 17:37:39
What about the document().printing() case? I don't
Xianzhu
2014/05/20 18:32:21
The full repaint logic is moved into RenderView wh
|
- |
if (!inSubtreeLayout) { |
// Now set our scrollbar state for the layout. |
ScrollbarMode currentHMode = horizontalScrollbarMode(); |
ScrollbarMode currentVMode = verticalScrollbarMode(); |
if (m_firstLayout) { |
+ renderView()->setShouldDoFullRepaintAfterLayout(true); |
setScrollbarsSuppressed(true); |
m_firstLayout = false; |
@@ -952,25 +949,18 @@ void FrameView::layout(bool allowSubtree) |
m_size = LayoutSize(layoutSize().width(), layoutSize().height()); |
- if (oldSize != m_size) { |
- shouldDoFullLayout = true; |
- if (!m_firstLayout) { |
- RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0; |
- RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0; |
- if (bodyRenderer && bodyRenderer->stretchesToViewport()) |
- bodyRenderer->setChildNeedsLayout(); |
- else if (rootRenderer && rootRenderer->stretchesToViewport()) |
- rootRenderer->setChildNeedsLayout(); |
- } |
+ if (oldSize != m_size && !m_firstLayout) { |
+ RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0; |
+ RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0; |
+ if (bodyRenderer && bodyRenderer->stretchesToViewport()) |
+ bodyRenderer->setChildNeedsLayout(); |
+ else if (rootRenderer && rootRenderer->stretchesToViewport()) |
+ rootRenderer->setChildNeedsLayout(); |
} |
} |
layer = rootForThisLayout->enclosingLayer(); |
- // We need to set m_doFullRepaint before triggering layout as RenderObject::checkForRepaint |
- // checks the boolean to disable local repaints. |
- m_doFullRepaint |= shouldDoFullLayout; |
- |
performLayout(rootForThisLayout, inSubtreeLayout); |
m_layoutSubtreeRoot = 0; |
@@ -979,7 +969,7 @@ void FrameView::layout(bool allowSubtree) |
if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printing()) |
adjustViewSize(); |
- layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullRepaint)); |
+ layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, renderView()->shouldDoFullRepaintAfterLayout())); |
renderView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterLayout); |
m_layoutCount++; |
@@ -1008,15 +998,13 @@ void FrameView::layout(bool allowSubtree) |
if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
repaintTree(rootForThisLayout); |
- } else if (m_doFullRepaint) { |
+ } else if (renderView()->shouldDoFullRepaintAfterLayout()) { |
// FIXME: This isn't really right, since the RenderView doesn't fully encompass |
// the visibleContentRect(). It just happens to work out most of the time, |
// since first layouts and printing don't have you scrolled anywhere. |
renderView()->repaint(); |
} |
- m_doFullRepaint = false; |
- |
#ifndef NDEBUG |
// Post-layout assert that nobody was re-marked as needing layout during layout. |
document->renderer()->assertSubtreeIsLaidOut(); |