Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/SVGResources.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp |
| index fe15b73088be99170e7c2d132b9826f235e06247..9a4ec11d64c7c57e713db7bca96cd940d397600f 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp |
| @@ -25,7 +25,7 @@ |
| #include "core/layout/svg/LayoutSVGResourceMarker.h" |
| #include "core/layout/svg/LayoutSVGResourceMasker.h" |
| #include "core/layout/svg/LayoutSVGResourcePaintServer.h" |
| -#include "core/style/SVGComputedStyle.h" |
| +#include "core/style/ComputedStyle.h" |
| #include "core/svg/SVGFilterElement.h" |
| #include "core/svg/SVGGradientElement.h" |
| #include "core/svg/SVGPatternElement.h" |
| @@ -203,7 +203,7 @@ static inline SVGResources& ensureResources(OwnPtr<SVGResources>& resources) |
| return *resources.get(); |
| } |
| -PassOwnPtr<SVGResources> SVGResources::buildResources(const LayoutObject* object, const SVGComputedStyle& style) |
| +PassOwnPtr<SVGResources> SVGResources::buildResources(const LayoutObject* object, const ComputedStyle& computedStyle) |
| { |
| ASSERT(object); |
| @@ -220,6 +220,8 @@ PassOwnPtr<SVGResources> SVGResources::buildResources(const LayoutObject* object |
| TreeScope& treeScope = element->treeScope(); |
| SVGDocumentExtensions& extensions = element->document().accessSVGExtensions(); |
| + const SVGComputedStyle& style = computedStyle.svgStyle(); |
| + |
| OwnPtr<SVGResources> resources; |
| if (clipperFilterMaskerTags().contains(tagName)) { |
| if (style.hasClipper()) { |
| @@ -228,10 +230,17 @@ PassOwnPtr<SVGResources> SVGResources::buildResources(const LayoutObject* object |
| registerPendingResource(extensions, id, element); |
| } |
| - if (style.hasFilter()) { |
| - AtomicString id = style.filterResource(); |
| - if (!ensureResources(resources).setFilter(getLayoutSVGResourceById<LayoutSVGResourceFilter>(treeScope, id))) |
| - registerPendingResource(extensions, id, element); |
| + if (computedStyle.hasFilter()) { |
|
fs
2016/05/23 12:29:53
I think LayoutSVGRoot should be left out of this -
Noel Gordon
2016/05/29 04:15:28
I stored the filter in SVGResources, and prevented
|
| + const FilterOperations& filterOperations = computedStyle.filter(); |
| + if (filterOperations.size() == 1) { |
| + const FilterOperation& filterOperation = *filterOperations.at(0); |
| + if (filterOperation.type() == FilterOperation::REFERENCE) { |
| + const auto& referenceFilterOperation = toReferenceFilterOperation(filterOperation); |
| + AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), element->document()); |
|
fs
2016/05/23 12:29:53
uNit: could use |treeScope| here (instead of eleme
Noel Gordon
2016/05/29 04:15:28
Yes, done.
fs
2016/05/30 11:58:52
Yes, you still need to check that the reference is
|
| + if (!ensureResources(resources).setFilter(getLayoutSVGResourceById<LayoutSVGResourceFilter>(treeScope, id))) |
| + registerPendingResource(extensions, id, element); |
| + } |
| + } |
| } |
| if (style.hasMasker()) { |