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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 2634613002: Revert of Remove obsolete code that invalidates document element on LayoutView resize (Closed)
Patch Set: - Created 3 years, 11 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: third_party/WebKit/Source/core/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 58d135e0820017f49fba35f06d685b3e183cb77b..a5f630b1d29245abf836a4dcb8aaaa4108ca7e8c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -247,6 +247,8 @@ void LayoutView::layout() {
SubtreeLayoutScope layoutScope(*this);
+ LayoutRect oldLayoutOverflowRect = layoutOverflowRect();
+
// Use calcWidth/Height to get the new width/height, since this will take the
// full page zoom factor into account.
bool relayoutChildren =
@@ -281,6 +283,17 @@ void LayoutView::layout() {
layoutContent();
+ if (layoutOverflowRect() != oldLayoutOverflowRect) {
+ // The document element paints the viewport background, so we need to
+ // invalidate it when layout overflow changes.
+ // FIXME: Improve viewport background styling/invalidation/painting.
+ // crbug.com/475115
+ if (Element* documentElement = document().documentElement()) {
+ if (LayoutObject* rootObject = documentElement->layoutObject())
+ rootObject->setShouldDoFullPaintInvalidation();
+ }
+ }
+
#if ENABLE(ASSERT)
checkLayoutState();
#endif

Powered by Google App Engine
This is Rietveld 408576698