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

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

Issue 396073002: Remove 2 calls to paintInvalidationForWholeRenderer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined patch for landing 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 a1818843d5d13a12457fe054184675abffca7163..4bd4dc35083b7e0430dad50aa39cd448ca605f80 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -142,12 +142,7 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
{
RenderStyle* oldStyle = style();
if (oldStyle) {
- // 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 ((diff.needsRepaint() || diff.needsLayout()) && backgroundCanBleedToCanvas()) {
if (oldStyle->hasEntirelyFixedBackground() != newStyle.hasEntirelyFixedBackground())
view()->compositor()->setNeedsUpdateFixedBackground();
}
@@ -163,10 +158,6 @@ 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);
@@ -1961,6 +1952,13 @@ 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/linux/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