| 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 c668bdb303d1786d862fbcabd860dc5b1eda9035..b451c0eee02131e4165ed7c7ff1cc7d8187982ac 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
|
| @@ -183,10 +183,10 @@ static inline LayoutSVGResourcePaintServer* paintingResourceFromSVGPaint(TreeSco
|
| return toLayoutSVGResourcePaintServer(container);
|
| }
|
|
|
| -static inline void registerPendingResource(SVGDocumentExtensions& extensions, const AtomicString& id, SVGElement* element)
|
| +static inline void registerPendingResource(SVGTreeScopeResources& treeScopeResources, const AtomicString& id, SVGElement* element)
|
| {
|
| ASSERT(element);
|
| - extensions.addPendingResource(id, element);
|
| + treeScopeResources.addPendingResource(id, element);
|
| }
|
|
|
| bool SVGResources::hasResourceData() const
|
| @@ -220,8 +220,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| ASSERT(!tagName.isNull());
|
|
|
| TreeScope& treeScope = element->treeScope();
|
| - SVGDocumentExtensions& extensions = element->document().accessSVGExtensions();
|
| -
|
| + SVGTreeScopeResources& treeScopeResources = element->treeScope().accessSVGTreeScopedResources();
|
| const SVGComputedStyle& style = computedStyle.svgStyle();
|
|
|
| std::unique_ptr<SVGResources> resources;
|
| @@ -229,7 +228,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| if (style.hasClipper()) {
|
| AtomicString id = style.clipperResource();
|
| if (!ensureResources(resources).setClipper(getLayoutSVGResourceById<LayoutSVGResourceClipper>(treeScope, id)))
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
|
|
| if (computedStyle.hasFilter() && !object->isSVGRoot()) {
|
| @@ -240,7 +239,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| const auto& referenceFilterOperation = toReferenceFilterOperation(filterOperation);
|
| AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), treeScope);
|
| if (!ensureResources(resources).setFilter(getLayoutSVGResourceById<LayoutSVGResourceFilter>(treeScope, id)))
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
| }
|
| }
|
| @@ -248,22 +247,22 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| if (style.hasMasker()) {
|
| AtomicString id = style.maskerResource();
|
| if (!ensureResources(resources).setMasker(getLayoutSVGResourceById<LayoutSVGResourceMasker>(treeScope, id)))
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
| }
|
|
|
| if (style.hasMarkers() && supportsMarkers(*element)) {
|
| const AtomicString& markerStartId = style.markerStartResource();
|
| if (!ensureResources(resources).setMarkerStart(getLayoutSVGResourceById<LayoutSVGResourceMarker>(treeScope, markerStartId)))
|
| - registerPendingResource(extensions, markerStartId, element);
|
| + registerPendingResource(treeScopeResources, markerStartId, element);
|
|
|
| const AtomicString& markerMidId = style.markerMidResource();
|
| if (!ensureResources(resources).setMarkerMid(getLayoutSVGResourceById<LayoutSVGResourceMarker>(treeScope, markerMidId)))
|
| - registerPendingResource(extensions, markerMidId, element);
|
| + registerPendingResource(treeScopeResources, markerMidId, element);
|
|
|
| const AtomicString& markerEndId = style.markerEndResource();
|
| if (!ensureResources(resources).setMarkerEnd(getLayoutSVGResourceById<LayoutSVGResourceMarker>(treeScope, style.markerEndResource())))
|
| - registerPendingResource(extensions, markerEndId, element);
|
| + registerPendingResource(treeScopeResources, markerEndId, element);
|
| }
|
|
|
| if (fillAndStrokeTags().contains(tagName)) {
|
| @@ -272,7 +271,7 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| AtomicString id;
|
| LayoutSVGResourcePaintServer* resource = paintingResourceFromSVGPaint(treeScope, style.fillPaintType(), style.fillPaintUri(), id, hasPendingResource);
|
| if (!ensureResources(resources).setFill(resource) && hasPendingResource)
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
|
|
| if (style.hasStroke()) {
|
| @@ -280,14 +279,14 @@ std::unique_ptr<SVGResources> SVGResources::buildResources(const LayoutObject* o
|
| AtomicString id;
|
| LayoutSVGResourcePaintServer* resource = paintingResourceFromSVGPaint(treeScope, style.strokePaintType(), style.strokePaintUri(), id, hasPendingResource);
|
| if (!ensureResources(resources).setStroke(resource) && hasPendingResource)
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
| }
|
|
|
| if (chainableResourceTags().contains(tagName)) {
|
| AtomicString id = targetReferenceFromResource(*element);
|
| if (!ensureResources(resources).setLinkedResource(getLayoutSVGResourceContainerById(treeScope, id)))
|
| - registerPendingResource(extensions, id, element);
|
| + registerPendingResource(treeScopeResources, id, element);
|
| }
|
|
|
| return (!resources || !resources->hasResourceData()) ? nullptr : std::move(resources);
|
|
|