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

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

Issue 247803003: Remove assumption that null containerForRepaint assumes RenderView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix zee nits Created 6 years, 8 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/rendering/RenderLayerScrollableArea.cpp ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 605b6b7788fead6ce250f8c8ccfd811a1c7fcd9e..7ea3bda9c5dcc0bad9e8f275f038e92ad329f7b2 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1334,11 +1334,10 @@ RenderLayerModelObject* RenderObject::containerForRepaint() const
if (!isRooted())
return 0;
- // FIXME: Repaint container should never be null when we're rooted. crbug.com/363699
RenderLayerModelObject* repaintContainer = 0;
- RenderView* v = view();
- if (v->usesCompositing()) {
+ RenderView* renderView = view();
+ if (renderView->usesCompositing()) {
// FIXME: CompositingState is not necessarily up to date for many callers of this function.
DisableCompositingQueryAsserts disabler;
@@ -1360,7 +1359,7 @@ RenderLayerModelObject* RenderObject::containerForRepaint() const
if (!repaintContainer || repaintContainer->flowThreadContainingBlock() != parentRenderFlowThread)
repaintContainer = parentRenderFlowThread;
}
- return repaintContainer;
+ return repaintContainer ? repaintContainer : renderView;
}
template<typename T> PassRefPtr<JSONValue> jsonObjectForRect(const T& rect)
@@ -1386,16 +1385,12 @@ void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo
if (r.isEmpty())
return;
+ ASSERT(isRooted());
+
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject::repaintUsingContainer()",
"object", this->debugName().ascii(),
"info", TracedValue::fromJSONValue(jsonObjectForRepaintInfo(r, invalidationReasonToString(invalidationReason))));
- // FIXME: Repaint container should never be null. crbug.com/363699
- if (!repaintContainer) {
- view()->repaintViewRectangle(r);
- return;
- }
-
// FIXME: Don't read compositing state here since we do this in the middle of recalc/layout.
DisableCompositingQueryAsserts disabler;
if (repaintContainer->compositingState() == PaintsIntoGroupedBacking) {
@@ -1465,7 +1460,7 @@ void RenderObject::repaint() const
// Until those states are fully fledged, I'll just disable the ASSERTS.
DisableCompositingQueryAsserts disabler;
RenderLayerModelObject* repaintContainer = containerForRepaint();
- repaintUsingContainer(repaintContainer ? repaintContainer : view(), pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), InvalidationRepaint);
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), InvalidationRepaint);
}
void RenderObject::repaintRectangle(const LayoutRect& r) const
@@ -1486,7 +1481,7 @@ void RenderObject::repaintRectangle(const LayoutRect& r) const
RenderLayerModelObject* repaintContainer = containerForRepaint();
computeRectForRepaint(repaintContainer, dirtyRect);
- repaintUsingContainer(repaintContainer ? repaintContainer : view(), pixelSnappedIntRect(dirtyRect), InvalidationRepaintRectangle);
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(dirtyRect), InvalidationRepaintRectangle);
}
IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
@@ -1593,9 +1588,7 @@ bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa
if (invalidationReason == InvalidationIncremental && (oldBounds.size().isZero() || newBounds.size().isZero()))
invalidationReason = InvalidationBoundsChange;
- // FIXME: Repaint container should never be null. crbug.com/363699
- if (!repaintContainer)
- repaintContainer = v;
+ ASSERT(repaintContainer);
if (invalidationReason != InvalidationIncremental) {
repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds), invalidationReason);
« no previous file with comments | « Source/core/rendering/RenderLayerScrollableArea.cpp ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698