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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp

Issue 1852183002: Don't apply svg viewport clip when mapping a LayoutSVGRoot's own rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CORE_EXPORT LayoutSVGRoot Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
index 83fe10cc449558e1f07cffeb49d95b341db00594..646a3f4c2311e295d8193b64d956084229ca0688 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
@@ -124,6 +124,17 @@ bool SVGLayoutSupport::mapToVisualRectInAncestorSpace(const LayoutObject& object
AffineTransform rootBorderBoxTransform;
const LayoutSVGRoot& svgRoot = computeTransformToSVGRoot(object, rootBorderBoxTransform);
resultRect = transformPaintInvalidationRect(object, rootBorderBoxTransform, localPaintInvalidationRect);
+
+ // Apply initial viewport clip.
+ if (svgRoot.shouldApplyViewportClip()) {
+ LayoutRect clipRect(svgRoot.pixelSnappedBorderBoxRect());
+ if (visualRectFlags & EdgeInclusive) {
+ if (!resultRect.inclusiveIntersect(clipRect))
+ return false;
+ } else {
+ resultRect.intersect(clipRect);
+ }
+ }
return svgRoot.mapToVisualRectInAncestorSpace(ancestor, resultRect, visualRectFlags);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698