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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 convertLengthOrAuto(state, *rect.bottom()), 117 convertLengthOrAuto(state, *rect.bottom()),
118 convertLengthOrAuto(state, *rect.left())); 118 convertLengthOrAuto(state, *rect.left()));
119 } 119 }
120 120
121 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleResolv erState& state, const CSSValue& value) 121 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleResolv erState& state, const CSSValue& value)
122 { 122 {
123 if (value.isBasicShapeValue()) 123 if (value.isBasicShapeValue())
124 return ShapeClipPathOperation::create(basicShapeForValue(state, value)); 124 return ShapeClipPathOperation::create(basicShapeForValue(state, value));
125 if (value.isURIValue()) { 125 if (value.isURIValue()) {
126 SVGURLReferenceResolver resolver(toCSSURIValue(value).value(), state.doc ument()); 126 SVGURLReferenceResolver resolver(toCSSURIValue(value).value(), state.doc ument());
127 // If the reference is non-local, then the fragment will remain as a
128 // null string, which makes the element lookup fail.
129 AtomicString fragmentIdentifier;
130 if (resolver.isLocal())
131 fragmentIdentifier = resolver.fragmentIdentifier();
127 // TODO(fs): Doesn't work with forward or external SVG references (crbug .com/391604, crbug.com/109212, ...) 132 // TODO(fs): Doesn't work with forward or external SVG references (crbug .com/391604, crbug.com/109212, ...)
128 return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), resolver.fragmentIdentifier()); 133 return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), fragmentIdentifier);
129 } 134 }
130 DCHECK(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); 135 DCHECK(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone);
131 return nullptr; 136 return nullptr;
132 } 137 }
133 138
134 FilterOperations StyleBuilderConverter::convertFilterOperations(StyleResolverSta te& state, const CSSValue& value) 139 FilterOperations StyleBuilderConverter::convertFilterOperations(StyleResolverSta te& state, const CSSValue& value)
135 { 140 {
136 return FilterOperationResolver::createFilterOperations(state, value); 141 return FilterOperationResolver::createFilterOperations(state, value);
137 } 142 }
138 143
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1078
1074 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) 1079 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value)
1075 { 1080 {
1076 if (value.isPathValue()) 1081 if (value.isPathValue())
1077 return toCSSPathValue(value).stylePath(); 1082 return toCSSPathValue(value).stylePath();
1078 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); 1083 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone);
1079 return nullptr; 1084 return nullptr;
1080 } 1085 }
1081 1086
1082 } // namespace blink 1087 } // namespace blink
OLDNEW
« 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