Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: Source/core/frame/FrameView.cpp

Issue 275543003: Don't always fully repaint on viewport resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline 2 tests Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 4a029548d25878e215f1d82fba6370e7e44a112d..c737cd4d19664c00da85d4f74fa838b25afa3f92 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -894,7 +894,6 @@ void FrameView::layout(bool allowSubtree)
return;
}
- bool shouldDoFullLayout = false;
FontCachePurgePreventer fontCachePurgePreventer;
RenderLayer* layer;
{
@@ -920,8 +919,6 @@ void FrameView::layout(bool allowSubtree)
ScrollbarMode vMode;
calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode);
- shouldDoFullLayout = !inSubtreeLayout && (m_firstLayout || toRenderView(rootForThisLayout)->document().printing());
-
if (!inSubtreeLayout) {
// Now set our scrollbar state for the layout.
ScrollbarMode currentHMode = horizontalScrollbarMode();
@@ -930,6 +927,7 @@ void FrameView::layout(bool allowSubtree)
if (m_firstLayout) {
setScrollbarsSuppressed(true);
+ m_doFullRepaint = true;
m_firstLayout = false;
m_firstLayoutCallbackPending = true;
m_lastViewportSize = layoutSize(IncludeScrollbars);
@@ -952,25 +950,22 @@ 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();
}
+
+ // We need to set m_doFullRepaint before triggering layout as RenderObject::checkForRepaint
+ // checks the boolean to disable local repaints.
+ m_doFullRepaint |= renderView()->shouldDoFullRepaintForNextLayout();
}
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;
@@ -1935,7 +1930,7 @@ bool FrameView::needsLayout() const
void FrameView::setNeedsLayout()
{
if (RenderView* renderView = this->renderView())
- renderView->setNeedsLayoutAndFullRepaint();
+ renderView->setNeedsLayout();
}
bool FrameView::isTransparent() const
« no previous file with comments | « LayoutTests/platform/win/fast/repaint/overflow-scroll-body-appear-expected.txt ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698