OLD | NEW |
---|---|
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 convertLengthOrAuto(state, *rect.bottom()), | 131 convertLengthOrAuto(state, *rect.bottom()), |
132 convertLengthOrAuto(state, *rect.left())); | 132 convertLengthOrAuto(state, *rect.left())); |
133 } | 133 } |
134 | 134 |
135 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath( | 135 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath( |
136 StyleResolverState& state, | 136 StyleResolverState& state, |
137 const CSSValue& value) { | 137 const CSSValue& value) { |
138 if (value.isBasicShapeValue()) | 138 if (value.isBasicShapeValue()) |
139 return ShapeClipPathOperation::create(basicShapeForValue(state, value)); | 139 return ShapeClipPathOperation::create(basicShapeForValue(state, value)); |
140 if (value.isURIValue()) { | 140 if (value.isURIValue()) { |
141 SVGURLReferenceResolver resolver(toCSSURIValue(value).value(), | 141 const CSSURIValue& urlValue = toCSSURIValue(value); |
142 state.document()); | 142 SVGElementProxy& elementProxy = |
143 // If the reference is non-local, then the fragment will remain as a | 143 state.elementStyleResources().cachedOrPendingFromValue(urlValue); |
144 // null string, which makes the element lookup fail. | |
145 AtomicString fragmentIdentifier; | |
146 if (resolver.isLocal()) | |
147 fragmentIdentifier = resolver.fragmentIdentifier(); | |
148 // TODO(fs): Doesn't work with forward or external SVG references | 144 // TODO(fs): Doesn't work with forward or external SVG references |
pdr.
2016/11/15 04:14:35
I think the new id tracking technology may fix thi
fs
2016/11/15 14:10:56
I think the bit about 'forward' should be fixed, b
| |
149 // (crbug.com/391604, crbug.com/109212, ...) | 145 // (crbug.com/391604, crbug.com/109212, ...) |
150 return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), | 146 return ReferenceClipPathOperation::create(urlValue.value(), elementProxy); |
151 fragmentIdentifier); | |
152 } | 147 } |
153 DCHECK(value.isIdentifierValue() && | 148 DCHECK(value.isIdentifierValue() && |
154 toCSSIdentifierValue(value).getValueID() == CSSValueNone); | 149 toCSSIdentifierValue(value).getValueID() == CSSValueNone); |
155 return nullptr; | 150 return nullptr; |
156 } | 151 } |
157 | 152 |
158 FilterOperations StyleBuilderConverter::convertFilterOperations( | 153 FilterOperations StyleBuilderConverter::convertFilterOperations( |
159 StyleResolverState& state, | 154 StyleResolverState& state, |
160 const CSSValue& value) { | 155 const CSSValue& value) { |
161 return FilterOperationResolver::createFilterOperations(state, value); | 156 return FilterOperationResolver::createFilterOperations(state, value); |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1296 // Instead of the actual zoom, use 1 to avoid potential rounding errors | 1291 // Instead of the actual zoom, use 1 to avoid potential rounding errors |
1297 Length length = primitiveValue.convertToLength( | 1292 Length length = primitiveValue.convertToLength( |
1298 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); | 1293 state.cssToLengthConversionData().copyWithAdjustedZoom(1)); |
1299 return *CSSPrimitiveValue::create(length, 1); | 1294 return *CSSPrimitiveValue::create(length, 1); |
1300 } | 1295 } |
1301 } | 1296 } |
1302 return value; | 1297 return value; |
1303 } | 1298 } |
1304 | 1299 |
1305 } // namespace blink | 1300 } // namespace blink |
OLD | NEW |