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

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

Issue 2322343003: Add support for <basic-shape> to 'clip-path' on SVG elements (Closed)
Patch Set: Update SPv2 expectations 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/SVGLayoutTreeAsText.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
index c3cf3bd0595e2a4006d91017c895e799a78d9612..12c5a38e8e8e30fbd9ac252e5d9c363c32d80613 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
@@ -649,14 +649,18 @@ void writeResources(TextStream& ts, const LayoutObject& object, int indent)
ts << " " << masker->resourceBoundingBox(&object) << "\n";
}
}
- if (!svgStyle.clipperResource().isEmpty()) {
- if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutSVGResourceClipper>(object.document(), svgStyle.clipperResource())) {
- writeIndent(ts, indent);
- ts << " ";
- writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
- ts << " ";
- writeStandardPrefix(ts, *clipper, 0);
- ts << " " << clipper->resourceBoundingBox(object.objectBoundingBox()) << "\n";
+ if (ClipPathOperation* clipPathOperation = svgStyle.clipPath()) {
+ if (clipPathOperation->type() == ClipPathOperation::REFERENCE) {
+ const ReferenceClipPathOperation& clipPathReference = toReferenceClipPathOperation(*clipPathOperation);
+ AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(clipPathReference.url(), object.document());
+ if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutSVGResourceClipper>(object.document(), id)) {
+ writeIndent(ts, indent);
+ ts << " ";
+ writeNameAndQuotedValue(ts, "clipPath", id);
+ ts << " ";
+ writeStandardPrefix(ts, *clipper, 0);
+ ts << " " << clipper->resourceBoundingBox(object.objectBoundingBox()) << "\n";
+ }
}
}
if (style.hasFilter()) {

Powered by Google App Engine
This is Rietveld 408576698