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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 420483002: Revert of Remove 2 calls to paintInvalidationForWholeRenderer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Better revert. Created 6 years, 5 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/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 830261ff0c84953cdac060807eb7142a42a32ace..bb40fb6bc7f95f0235531d85a078e378d59bc38e 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -142,7 +142,12 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
{
RenderStyle* oldStyle = style();
if (oldStyle) {
- if ((diff.needsRepaint() || diff.needsLayout()) && backgroundCanBleedToCanvas()) {
+ // The background of the root element or the body element could propagate up to
+ // the canvas. Just dirty the entire canvas when our style changes substantially.
+ if ((diff.needsRepaint() || diff.needsLayout()) && node()
+ && (isHTMLHtmlElement(*node()) || isHTMLBodyElement(*node()))) {
+ view()->paintInvalidationForWholeRenderer();
+
if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
view()->compositor()->setNeedsUpdateFixedBackground();
}
@@ -158,6 +163,10 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
if (isFloating() && !isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition())
removeFloatingOrPositionedChildFromBlockLists();
}
+ // FIXME: This branch runs when !oldStyle, which means that layout was never called
+ // so what's the point in invalidating the whole view that we never painted?
+ } else if (isBody()) {
+ view()->paintInvalidationForWholeRenderer();
}
RenderBoxModelObject::styleWillChange(diff, newStyle);
@@ -1952,13 +1961,6 @@ LayoutRect RenderBox::clippedOverflowRectForPaintInvalidation(const RenderLayerM
if (style()->visibility() != VISIBLE && enclosingLayer()->subtreeIsInvisible())
return LayoutRect();
- // If we have a background that could bleed into the canvas, just return
- // the viewport's rectangle. This works as only body and the document
- // element's renderer can bleed into the viewport so we are guaranteed
- // to be in the RenderView's coordinate space.
- if (style()->hasBackground() && backgroundCanBleedToCanvas())
- return view()->viewRect();
-
LayoutRect r = visualOverflowRect();
mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, false /*fixed*/, paintInvalidationState);
return r;
« no previous file with comments | « LayoutTests/platform/win/fast/repaint/positioned-document-element-expected.txt ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698