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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.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/svg/LayoutSVGRoot.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
index 3380513a74a27304b088a1eb25d50dd26dc5031a..5f3a18518421c41949a1ecba958c1b99b9a7a178 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -348,20 +348,26 @@ LayoutRect LayoutSVGRoot::clippedOverflowRectForPaintInvalidation(const LayoutBo
// Compute the paint invalidation rect in the parent coordinate space.
LayoutRect rect(enclosingIntRect(paintInvalidationRect));
- LayoutReplaced::mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState);
+ LayoutReplaced::mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState, false);
return rect;
}
-void LayoutSVGRoot::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
+bool LayoutSVGRoot::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState, int flags) const
{
// Note that we don't apply the border-box transform here - it's assumed
// that whoever called us has done that already.
// Apply initial viewport clip
- if (shouldApplyViewportClip())
- rect.intersect(LayoutRect(pixelSnappedBorderBoxRect()));
+ if (shouldApplyViewportClip()) {
+ if (flags & EdgeInclusive) {
+ if (!rect.inclusiveIntersect(LayoutRect(pixelSnappedBorderBoxRect())))
+ return false;
+ } else {
+ rect.intersect(LayoutRect(pixelSnappedBorderBoxRect()));
chrishtr 2016/03/22 17:25:49 early out?
szager1 2016/03/22 19:42:24 I'm hesitant to do that, because the call to Layou
+ }
+ }
- LayoutReplaced::mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidationState);
+ return LayoutReplaced::mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidationState, flags);
}
// This method expects local CSS box coordinates.

Powered by Google App Engine
This is Rietveld 408576698