| Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| index fe8395d9c685a788366f03faa7439430b2ec6fff..d03b93b53fe1738e41f619eb46a1454e02b114c8 100644
|
| --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| @@ -74,9 +74,9 @@ inline SVGUseElement::SVGUseElement(Document& document)
|
|
|
| SVGUseElement* SVGUseElement::create(Document& document)
|
| {
|
| - // Always build a user agent #shadow-root for SVGUseElement.
|
| + // Always build a closed #shadow-root for SVGUseElement.
|
| SVGUseElement* use = new SVGUseElement(document);
|
| - use->ensureUserAgentShadowRoot();
|
| + use->ensureShadow().addShadowRoot(*use, ShadowRootType::Open);
|
| return use;
|
| }
|
|
|
| @@ -302,7 +302,7 @@ void SVGUseElement::clearShadowTree()
|
| clearInstanceRoot();
|
|
|
| // FIXME: We should try to optimize this, to at least allow partial reclones.
|
| - if (ShadowRoot* shadowTreeRootElement = userAgentShadowRoot())
|
| + if (ShadowRoot* shadowTreeRootElement = openShadowRoot())
|
| shadowTreeRootElement->removeChildren(OmitSubtreeModifiedEvent);
|
|
|
| removeAllOutgoingReferences();
|
| @@ -437,7 +437,7 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target)
|
| // Clone the target subtree into the shadow tree, not handling <use> and <symbol> yet.
|
| Element* instanceRoot = createInstanceTree(target);
|
| m_targetElementInstance = toSVGElement(instanceRoot);
|
| - ShadowRoot* shadowTreeRootElement = userAgentShadowRoot();
|
| + ShadowRoot* shadowTreeRootElement = openShadowRoot();
|
| shadowTreeRootElement->appendChild(instanceRoot);
|
|
|
| addReferencesToFirstDegreeNestedUseElements(target);
|
| @@ -506,7 +506,7 @@ void SVGUseElement::toClipPath(Path& path) const
|
|
|
| SVGGraphicsElement* SVGUseElement::visibleTargetGraphicsElementForClipping() const
|
| {
|
| - Node* n = userAgentShadowRoot()->firstChild();
|
| + Node* n = openShadowRoot()->firstChild();
|
| if (!n || !n->isSVGElement())
|
| return nullptr;
|
|
|
| @@ -550,7 +550,7 @@ void SVGUseElement::addReferencesToFirstDegreeNestedUseElements(SVGElement& targ
|
|
|
| void SVGUseElement::cloneNonMarkupEventListeners()
|
| {
|
| - for (SVGElement& element : Traversal<SVGElement>::descendantsOf(*userAgentShadowRoot())) {
|
| + for (SVGElement& element : Traversal<SVGElement>::descendantsOf(*openShadowRoot())) {
|
| if (EventTargetData* data = element.correspondingElement()->eventTargetData())
|
| data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(&element);
|
| }
|
| @@ -604,7 +604,7 @@ bool SVGUseElement::expandUseElementsInShadowTree()
|
| // contains <use> tags, we'd miss them. So once we're done with setting up the
|
| // actual shadow tree (after the special case modification for svg/symbol) we have
|
| // to walk it completely and expand all <use> elements.
|
| - ShadowRoot* shadowRoot = userAgentShadowRoot();
|
| + ShadowRoot* shadowRoot = openShadowRoot();
|
| for (SVGUseElement* use = Traversal<SVGUseElement>::firstWithin(*shadowRoot); use; ) {
|
| ASSERT(!use->resourceIsStillLoading());
|
|
|
| @@ -742,7 +742,7 @@ bool SVGUseElement::resourceIsValid() const
|
|
|
| bool SVGUseElement::instanceTreeIsLoading() const
|
| {
|
| - for (const SVGUseElement& useElement : Traversal<SVGUseElement>::descendantsOf(*userAgentShadowRoot())) {
|
| + for (const SVGUseElement& useElement : Traversal<SVGUseElement>::descendantsOf(*openShadowRoot())) {
|
| if (useElement.resourceIsStillLoading())
|
| return true;
|
| }
|
|
|