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

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

Issue 2279823002: Use LayoutSVGResourceClipper::resourceBoundingBox() in ClipPathClipper (Closed)
Patch Set: Rebase Created 4 years, 3 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/LayoutSVGResourceClipper.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
index 7a74cd77b9b53809b7c27d04914bf85e81cbe8c4..dc3f54006a73233e6d35ac059c0c64431ada37fa 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
@@ -264,22 +264,20 @@ bool LayoutSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin
return false;
}
-FloatRect LayoutSVGResourceClipper::resourceBoundingBox(const LayoutObject* object)
+FloatRect LayoutSVGResourceClipper::resourceBoundingBox(const FloatRect& referenceBox)
{
- // Resource was not layouted yet. Give back the boundingBox of the object.
+ // The resource has not been layouted yet. Return the reference box.
if (selfNeedsLayout())
- return object->objectBoundingBox();
+ return referenceBox;
if (m_localClipBounds.isEmpty())
calculateLocalClipBounds();
AffineTransform transform = toSVGClipPathElement(element())->calculateAnimatedLocalTransform();
if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
- FloatRect objectBoundingBox = object->objectBoundingBox();
- transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
- transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
+ transform.translate(referenceBox.x(), referenceBox.y());
+ transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
}
-
return transform.mapRect(m_localClipBounds);
}

Powered by Google App Engine
This is Rietveld 408576698