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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2174813003: Don't resolve non-local -webkit-clip-path references as local (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@svg-local-references
Patch Set: Created 4 years, 5 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/LayoutTests/css3/masking/clip-path-reference-nonexisting-existing-local-expected.html ('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/css/resolver/StyleBuilderConverter.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index c1c4a2e78d007f9fc3cb09b7f82f1a394809c696..78af36751b6155059bf5bb9684851698b3f1c25f 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -124,8 +124,13 @@ PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleResolv
return ShapeClipPathOperation::create(basicShapeForValue(state, value));
if (value.isURIValue()) {
SVGURLReferenceResolver resolver(toCSSURIValue(value).value(), state.document());
+ // If the reference is non-local, then the fragment will remain as a
+ // null string, which makes the element lookup fail.
+ AtomicString fragmentIdentifier;
+ if (resolver.isLocal())
+ fragmentIdentifier = resolver.fragmentIdentifier();
// TODO(fs): Doesn't work with forward or external SVG references (crbug.com/391604, crbug.com/109212, ...)
- return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), resolver.fragmentIdentifier());
+ return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), fragmentIdentifier);
}
DCHECK(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() == CSSValueNone);
return nullptr;
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/masking/clip-path-reference-nonexisting-existing-local-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698