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

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

Issue 1987943002: [wip] unprefix filter Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/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..d463d341a1f7bb30915e7f08fd152bd37f0c9214 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()) {
+ 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(), treeScope);
+ if (!ensureResources(resources).setFilter(getLayoutSVGResourceById<LayoutSVGResourceFilter>(treeScope, id)))
+ registerPendingResource(extensions, id, element);
+ }
+ }
}
if (style.hasMasker()) {

Powered by Google App Engine
This is Rietveld 408576698