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

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

Issue 204813002: Optimize layout/repaint on FrameView resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep FrameView::m_doFullRepaint Created 6 years, 9 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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 95f79cbc724c033eeb430f97c5e0db39788b65c4..50d650980e1332482f835e7d77dacf887179f1bf 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -942,7 +942,11 @@ void FrameView::layout(bool allowSubtree)
m_size = LayoutSize(layoutSize().width(), layoutSize().height());
if (oldSize != m_size) {
- shouldDoFullLayout = true;
+ if (!renderView()->needsResizeLayoutOnly()
+ || (renderView()->style()->isHorizontalWritingMode()
+ ? (oldSize.width() != m_size.width()) : (oldSize.height() != m_size.height())))
+ shouldDoFullLayout = true;
+
if (!m_firstLayout) {
RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0;
RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0;
@@ -1746,7 +1750,7 @@ void FrameView::repaintContentRectangle(const IntRect& r)
void FrameView::contentsResized()
{
ScrollView::contentsResized();
- setNeedsLayout();
+ setNeedsResizeLayout();
}
void FrameView::scrollbarExistenceDidChange()
@@ -1888,6 +1892,16 @@ void FrameView::setNeedsLayout()
renderView->setNeedsLayout();
}
+void FrameView::setNeedsResizeLayout()
+{
+ if (RenderView* renderView = this->renderView()) {
+ if (m_firstLayout || m_frame->document()->printing())
+ renderView->setNeedsLayout();
+ else
+ renderView->setNeedsResizeLayout();
+ }
+}
+
bool FrameView::isTransparent() const
{
return m_isTransparent;
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698