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

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

Issue 1942723004: Change EventTarget callback APIs for add/RemoveEventListenerInternal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win32 signed/unsigned issue 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/svg/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index 984539f47bcc5bd9cb86ce58dddaacd2e0207bfc..ab7d6b36fea69a2a117483698a8580ca0fdf87a8 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -731,39 +731,36 @@ static inline void collectInstancesForSVGElement(SVGElement* element, HeapHashSe
instances = element->instancesForElement();
}
-bool SVGElement::addEventListenerInternal(const AtomicString& eventType, EventListener* listener, const EventListenerOptions& options)
+void SVGElement::addedEventListener(const AtomicString& eventType, RegisteredEventListener& registeredListener)
{
// Add event listener to regular DOM element
- if (!Node::addEventListenerInternal(eventType, listener, options))
- return false;
+ Node::addedEventListener(eventType, registeredListener);
// Add event listener to all shadow tree DOM element instances
HeapHashSet<WeakMember<SVGElement>> instances;
collectInstancesForSVGElement(this, instances);
+ EventListenerOptions options = registeredListener.options();
+ EventListener* listener = registeredListener.listener();
for (SVGElement* element : instances) {
bool result = element->Node::addEventListenerInternal(eventType, listener, options);
ASSERT_UNUSED(result, result);
}
-
- return true;
}
-bool SVGElement::removeEventListenerInternal(const AtomicString& eventType, EventListener* listener, const EventListenerOptions& options)
+void SVGElement::removedEventListener(const AtomicString& eventType, const RegisteredEventListener& registeredListener)
{
- // Remove event listener from regular DOM element
- if (!Node::removeEventListenerInternal(eventType, listener, options))
- return false;
+ Node::removedEventListener(eventType, registeredListener);
// Remove event listener from all shadow tree DOM element instances
HeapHashSet<WeakMember<SVGElement>> instances;
collectInstancesForSVGElement(this, instances);
+ EventListenerOptions options = registeredListener.options();
+ const EventListener* listener = registeredListener.listener();
for (SVGElement* shadowTreeElement : instances) {
ASSERT(shadowTreeElement);
shadowTreeElement->Node::removeEventListenerInternal(eventType, listener, options);
}
-
- return true;
}
static bool hasLoadListener(Element* element)
@@ -776,7 +773,7 @@ static bool hasLoadListener(Element* element)
if (!entry)
continue;
for (size_t i = 0; i < entry->size(); ++i) {
- if (entry->at(i).useCapture)
+ if (entry->at(i).capture())
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698