Index: Source/core/rendering/RenderView.cpp |
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp |
index 2beeea11ee7261838a72bb2cf995f77944d25141..035817f404140ec0a98d3f76cc6988a36a6a0287 100644 |
--- a/Source/core/rendering/RenderView.cpp |
+++ b/Source/core/rendering/RenderView.cpp |
@@ -442,6 +442,29 @@ void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval |
RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); |
} |
+LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidationRectPtr) const |
+{ |
+ LayoutRect paintInvalidationRect = |
+ paintInvalidationRectPtr ? *paintInvalidationRectPtr : viewRect(); |
+ Element* owner = document().ownerElement(); |
+ if (document().printing() || !m_frameView |
+ || layer()->compositingState() == PaintsIntoOwnBacking || !owner) |
+ return paintInvalidationRect; |
+ 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()); |
+ return rectToInvalidate; |
+ } |
+ return paintInvalidationRect; |
+} |
+ |
void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidationRect) const |
{ |
ASSERT(!paintInvalidationRect.isEmpty()); |