| Index: Source/core/rendering/RenderView.cpp | 
| diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp | 
| index 36d94d166d776b9016f2d0e3d75fad37219f426e..6e112b1c61d185e05feb92df109ae4ccaf743e36 100644 | 
| --- a/Source/core/rendering/RenderView.cpp | 
| +++ b/Source/core/rendering/RenderView.cpp | 
| @@ -294,10 +294,6 @@ void RenderView::mapLocalToContainer(const RenderLayerModelObject* paintInvalida | 
| return; | 
| } | 
| } | 
| - | 
| -    // If a container was specified, and was not 0 or the RenderView, | 
| -    // then we should have found it by now. | 
| -    ASSERT_ARG(paintInvalidationContainer, !paintInvalidationContainer); | 
| } | 
|  | 
| const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 
| @@ -436,11 +432,14 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval | 
| { | 
| ASSERT(!needsLayout()); | 
|  | 
| -    // We specifically need to issue paint invalidations for the viewRect since other renderers | 
| +    // We specifically need to repaint the viewRect since other renderers | 
| // short-circuit on full-paint invalidation. | 
| -    if (doingFullPaintInvalidation() && !viewRect().isEmpty()) | 
| -        invalidatePaintForRectangle(viewRect()); | 
| - | 
| +    LayoutRect dirtyRect = viewRect(); | 
| +    if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { | 
| +        const RenderLayerModelObject* paintInvalidationContainer = &paintInvalidationState.paintInvalidationContainer(); | 
| +        mapRectToPaintInvalidationBacking(paintInvalidationContainer, dirtyRect, IsNotFixedPosition, &paintInvalidationState); | 
| +        invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, InvalidationFull); | 
| +    } | 
| RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); | 
| } | 
|  | 
| @@ -451,24 +450,12 @@ void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation | 
| if (document().printing() || !m_frameView) | 
| return; | 
|  | 
| -    // We always just invalidate the root view, since we could be an iframe that is clipped out | 
| -    // or even invisible. | 
| -    HTMLFrameOwnerElement* owner = document().ownerElement(); | 
| +    ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->ownerRenderer()); | 
| + | 
| if (layer()->compositingState() == PaintsIntoOwnBacking) { | 
| layer()->paintInvalidator().setBackingNeedsPaintInvalidationInRect(paintInvalidationRect); | 
| -    } else if (!owner) { | 
| +    } else { | 
| m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(paintInvalidationRect)); | 
| -    } else if (RenderBox* obj = owner->renderBox()) { | 
| -        // Intersect the viewport with the paint invalidation rect. | 
| -        LayoutRect viewRectangle = viewRect(); | 
| -        LayoutRect rectToInvalidate = intersection(paintInvalidationRect, viewRectangle); | 
| - | 
| -        // Adjust for scroll offset of the view. | 
| -        rectToInvalidate.moveBy(-viewRectangle.location()); | 
| - | 
| -        // Adjust for frame border. | 
| -        rectToInvalidate.moveBy(obj->contentBoxRect().location()); | 
| -        obj->invalidatePaintRectangle(rectToInvalidate); | 
| } | 
| } | 
|  | 
| @@ -483,12 +470,8 @@ void RenderView::invalidatePaintForViewAndCompositedLayers() | 
| compositor()->fullyInvalidatePaint(); | 
| } | 
|  | 
| -void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const PaintInvalidationState*) const | 
| +void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const PaintInvalidationState* state) const | 
| { | 
| -    // If a container was specified, and was not 0 or the RenderView, | 
| -    // then we should have found it by now. | 
| -    ASSERT_ARG(paintInvalidationContainer, !paintInvalidationContainer || paintInvalidationContainer == this); | 
| - | 
| if (document().printing()) | 
| return; | 
|  | 
| @@ -513,8 +496,30 @@ void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* | 
| // Apply our transform if we have one (because of full page zooming). | 
| if (!paintInvalidationContainer && layer() && layer()->transform()) | 
| rect = layer()->transform()->mapRect(rect); | 
| + | 
| +    ASSERT(paintInvalidationContainer); | 
| +    if (paintInvalidationContainer == this) | 
| +        return; | 
| + | 
| +    Element* owner = document().ownerElement(); | 
| +    if (!owner) | 
| +        return; | 
| + | 
| +    if (RenderBox* obj = owner->renderBox()) { | 
| +        // Intersect the viewport with the paint invalidation rect. | 
| +        LayoutRect viewRectangle = viewRect(); | 
| +        rect.intersect(viewRectangle); | 
| + | 
| +        // Adjust for scroll offset of the view. | 
| +        rect.moveBy(-viewRectangle.location()); | 
| + | 
| +        // Adjust for frame border. | 
| +        rect.moveBy(obj->contentBoxRect().location()); | 
| +        obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, IsNotFixedPosition, 0); | 
| +    } | 
| } | 
|  | 
| + | 
| void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const | 
| { | 
| rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); | 
|  |