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

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2186823002: Do not call an event listener on a cloned node in svg <use>'s UA shadow tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite Created 4 years, 5 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/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..c8a31ffc6b6fb0985d4c0af31856dc2716b35632 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -442,10 +442,8 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target)
addReferencesToFirstDegreeNestedUseElements(target);
- if (instanceTreeIsLoading()) {
- cloneNonMarkupEventListeners();
+ if (instanceTreeIsLoading())
return;
- }
// Assure shadow tree building was successful.
ASSERT(m_targetElementInstance);
@@ -464,8 +462,6 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement& target)
m_targetElementInstance = toSVGElement(shadowTreeRootElement->firstChild());
ASSERT(m_targetElementInstance->parentNode() == shadowTreeRootElement);
- cloneNonMarkupEventListeners();
-
// Update relative length information.
updateRelativeLengthsInformation();
}
@@ -548,14 +544,6 @@ void SVGUseElement::addReferencesToFirstDegreeNestedUseElements(SVGElement& targ
addReferenceTo(useElement);
}
-void SVGUseElement::cloneNonMarkupEventListeners()
-{
- for (SVGElement& element : Traversal<SVGElement>::descendantsOf(*userAgentShadowRoot())) {
- if (EventTargetData* data = element.correspondingElement()->eventTargetData())
- data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(&element);
pdr. 2016/07/30 04:02:42 With cloneNonMarkupEventListeners gone we can remo
hayato 2016/08/01 03:44:10 Good point! Done.
- }
-}
-
bool SVGUseElement::hasCycleUseReferencing(const SVGUseElement& use, const ContainerNode& targetInstance, SVGElement*& newTarget) const
{
Element* targetElement = targetElementFromIRIString(use.hrefString(), use.treeScope());

Powered by Google App Engine
This is Rietveld 408576698