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

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: more tests 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 f7fefe576aff17d0c7013f36525d5b7ed36552cc..1aaf72e8575d0b23b68bf015d02acdbd33ea5c0b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1638,28 +1638,28 @@ 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, VisibleRectFlags visibleRectFlags) const
{
+ // For any layout object that doesn't override this method (the main example is LayoutText),
+ // the rect is assumed to be in the coordinate space of the object's parent.
+
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, visibleRectFlags);
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, visibleRectFlags))
+ return false;
}
- parent->mapToVisibleRectInAncestorSpace(ancestor, rect, nullptr);
+ return parent->mapToVisibleRectInAncestorSpace(ancestor, rect, nullptr, visibleRectFlags);
}
+ return true;
}
void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*)
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698