| 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 0c0d7c0bd3c5401c8e7e1d59916f6e39e5420b8d..2d62599715dd4a8b8b2e414497c51f6c929c8b51 100644
|
| --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
| @@ -441,8 +441,10 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target) {
|
|
|
| addReferencesToFirstDegreeNestedUseElements(target);
|
|
|
| - if (instanceTreeIsLoading())
|
| + if (instanceTreeIsLoading()) {
|
| + cloneNonMarkupEventListeners();
|
| return;
|
| + }
|
|
|
| // Assure shadow tree building was successful.
|
| DCHECK(m_targetElementInstance);
|
| @@ -462,6 +464,8 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target) {
|
| m_targetElementInstance = toSVGElementOrDie(shadowRoot.firstChild());
|
| DCHECK_EQ(m_targetElementInstance->parentNode(), shadowRoot);
|
|
|
| + cloneNonMarkupEventListeners();
|
| +
|
| // Update relative length information.
|
| updateRelativeLengthsInformation();
|
| }
|
| @@ -535,6 +539,17 @@ void SVGUseElement::addReferencesToFirstDegreeNestedUseElements(
|
| addReferenceTo(useElement);
|
| }
|
|
|
| +void SVGUseElement::cloneNonMarkupEventListeners() {
|
| + for (SVGElement& element :
|
| + Traversal<SVGElement>::descendantsOf(useShadowRoot())) {
|
| + if (EventTargetData* data =
|
| + element.correspondingElement()->eventTargetData()) {
|
| + data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(
|
| + &element);
|
| + }
|
| + }
|
| +}
|
| +
|
| bool SVGUseElement::hasCycleUseReferencing(const SVGUseElement& use,
|
| const ContainerNode& targetInstance,
|
| SVGElement*& newTarget) const {
|
|
|