Index: third_party/WebKit/Source/core/layout/LayoutView.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
index f1ecdfa63692fe8c7e2134668be174c57723f868..918fa9b335ae02445cced73853f6cf46af185453 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
@@ -475,15 +475,15 @@ void LayoutView::invalidatePaintForViewAndCompositedLayers() |
compositor()->fullyInvalidatePaint(); |
} |
-void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* invalidationState) const |
+bool LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* invalidationState, int flags) const |
{ |
- mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalidationState); |
+ return mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalidationState, flags); |
} |
-void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const PaintInvalidationState* state) const |
+bool LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const PaintInvalidationState* state, int flags) const |
{ |
if (document().printing()) |
- return; |
+ return true; |
if (style()->isFlippedBlocksWritingMode()) { |
// We have to flip by hand since the view's logical height has not been determined. We |
@@ -502,17 +502,22 @@ void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc |
ASSERT(ancestor); |
if (ancestor == this) |
- return; |
+ return true; |
Element* owner = document().ownerElement(); |
if (!owner) |
- return; |
+ return true; |
if (LayoutBox* obj = owner->layoutBox()) { |
if (!state || !state->viewClippingAndScrollOffsetDisabled()) { |
// Intersect the viewport with the paint invalidation rect. |
LayoutRect viewRectangle = viewRect(); |
- rect.intersect(viewRectangle); |
+ if (flags & EdgeInclusive) { |
+ if (!rect.inclusiveIntersect(viewRectangle)) |
+ return false; |
+ } else { |
+ rect.intersect(viewRectangle); |
chrishtr
2016/03/22 17:25:49
return false here if it's empty? Early out code?
|
+ } |
// Adjust for scroll offset of the view. |
rect.moveBy(-viewRectangle.location()); |
@@ -520,8 +525,10 @@ void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc |
// Adjust for frame border. |
rect.move(obj->contentBoxOffset()); |
- obj->mapToVisibleRectInAncestorSpace(ancestor, rect, 0); |
+ return obj->mapToVisibleRectInAncestorSpace(ancestor, rect, 0, flags); |
} |
+ |
+ return true; |
} |
void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConstrainedPosition viewportConstraint) const |