bug 1300129 - Ensure devtools get the right event listener data. r=mccr8, a=ritu
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 02 Sep 2016 23:19:56 +0300
changeset 348185 dd43153e25c9973926703925830a1499c65a7c41
parent 348184 249bd8812e3acca623030ad8633a9f6ec9087aaa
child 348186 e9ef4d944309651c3448f81628bfad3a2a8ca053
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, ritu
bugs1300129
milestone50.0a2
bug 1300129 - Ensure devtools get the right event listener data. r=mccr8, a=ritu
dom/events/EventListenerManager.cpp
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1536,19 +1536,19 @@ EventListenerManager::HasListeners()
 }
 
 nsresult
 EventListenerManager::GetListenerInfo(nsCOMArray<nsIEventListenerInfo>* aList)
 {
   nsCOMPtr<EventTarget> target = do_QueryInterface(mTarget);
   NS_ENSURE_STATE(target);
   aList->Clear();
-  uint32_t count = mListeners.Length();
-  for (uint32_t i = 0; i < count; ++i) {
-    const Listener& listener = mListeners.ElementAt(i);
+  nsAutoTObserverArray<Listener, 2>::ForwardIterator iter(mListeners);
+  while (iter.HasMore()) {
+    const Listener& listener = iter.GetNext();
     // If this is a script handler and we haven't yet
     // compiled the event handler itself go ahead and compile it
     if (listener.mListenerType == Listener::eJSEventListener &&
         listener.mHandlerIsString) {
       CompileEventHandlerInternal(const_cast<Listener*>(&listener), nullptr,
                                   nullptr);
     }
     nsAutoString eventType;