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

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

Issue 1817693002: Support edge-inclusive intersections in mapToVisibleRectInAncestorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-idle-callback
Patch Set: Added IntersectionType flag and unit test for LayoutRect::inclusiveIntersect. 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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 051799571158e80164251832a3a2a3e5358c8d66..269b22a45933520f10936083113eee4ae2f42a8d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1637,28 +1637,25 @@ LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox
return LayoutRect();
}
-void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
+bool LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState, int flags) const
{
if (ancestor == this)
- return;
+ return true;
- if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ancestor)) {
- paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect);
- return;
- }
+ if (paintInvalidationState && paintInvalidationState->canMapToAncestor(ancestor))
+ return paintInvalidationState->mapObjectRectToAncestor(*this, ancestor, rect, flags);
if (LayoutObject* parent = this->parent()) {
if (parent->hasOverflowClip()) {
LayoutBox* parentBox = toLayoutBox(parent);
parentBox->mapScrollingContentsRectToBoxSpace(rect);
- if (parent != ancestor)
- parentBox->applyOverflowClip(rect);
- if (rect.isEmpty())
- return;
+ if (parent != ancestor && !parentBox->applyOverflowClip(rect, flags))
+ return false;
}
- parent->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidationState);
+ return parent->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidationState, flags);
}
+ return true;
}
void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*)

Powered by Google App Engine
This is Rietveld 408576698