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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1817693002: Support edge-inclusive intersections in mapToVisibleRectInAncestorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: Rebase onto origin/master Created 4 years, 9 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: 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 2e243242c277b07bfecacaeefadd0c68c8622202..8214c94d1ecbb8499a695e6bebffe47c7b5d04dd 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -475,16 +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, VisibleRectFlags visibleRectFlags) const
{
- mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalidationState);
+ return mapToVisibleRectInAncestorSpace(ancestor, rect, IsNotFixedPosition, invalidationState, visibleRectFlags);
}
-void LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint,
- const PaintInvalidationState* paintInvalidationState) const
+bool LayoutView::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, ViewportConstrainedPosition viewportConstraint, const PaintInvalidationState* paintInvalidationState, VisibleRectFlags visibleRectFlags) const
{
if (document().printing())
- return;
+ return true;
// TODO(chrishtr): fix PaintInvalidationState offsets for LayoutViews.
@@ -505,17 +504,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 (!paintInvalidationState || !paintInvalidationState->viewClippingAndScrollOffsetDisabled()) {
// Intersect the viewport with the paint invalidation rect.
LayoutRect viewRectangle = viewRect();
- rect.intersect(viewRectangle);
+ if (visibleRectFlags & EdgeInclusive) {
+ if (!rect.inclusiveIntersect(viewRectangle))
+ return false;
+ } else {
+ rect.intersect(viewRectangle);
+ }
// Adjust for scroll offset of the view.
rect.moveBy(-viewRectangle.location());
@@ -523,8 +527,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, visibleRectFlags);
}
+
+ return true;
}
void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConstrainedPosition viewportConstraint) const

Powered by Google App Engine
This is Rietveld 408576698