Bug 1396693 - Make nsIEventListenerChange::changedListenerNames noscript. r=smaug.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 05 Sep 2017 11:52:54 +1000
changeset 428774 5616f7dc81a947955bb8391def67a37ce9ea123a
parent 428773 cae86ca80e62e087ca43604b0686e69836928ca7
child 428775 43cf87ac46c7c81e73541c7687726406806a584e
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1396693
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1396693 - Make nsIEventListenerChange::changedListenerNames noscript. r=smaug. This is required for deCOMtamination. The patch removes the only script use of this attribute, which is a low-importance one in a test.
dom/events/nsIEventListenerService.idl
dom/events/test/test_bug524674.xul
--- a/dom/events/nsIEventListenerService.idl
+++ b/dom/events/nsIEventListenerService.idl
@@ -12,17 +12,17 @@ interface nsIArray;
 /**
  * Contains an event target along with an array of nsIAtom in form "oneventname"
  * representing changed event listener names.
  */
 [scriptable, uuid(07222b02-da12-4cf4-b2f7-761da007a8d8)]
 interface nsIEventListenerChange : nsISupports
 {
   readonly attribute nsIDOMEventTarget target;
-  readonly attribute nsIArray changedListenerNames;
+  [noscript] readonly attribute nsIArray changedListenerNames;
 };
 
 [scriptable, function, uuid(aa7c95f6-d3b5-44b3-9597-1d9f19b9c5f2)]
 interface nsIListenerChangeListener : nsISupports
 {
   void listenersChanged(in nsIArray aEventListenerChanges);
 };
 
--- a/dom/events/test/test_bug524674.xul
+++ b/dom/events/test/test_bug524674.xul
@@ -103,32 +103,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     var i = 0;
     while (eventChanges.hasMoreElements() && i < expectedEventChanges.length) {
       var current;
       try {
         current = eventChanges.getNext().QueryInterface(Ci.nsIEventListenerChange);
         var expected = expectedEventChanges[i];
 
         if (current.target == expected.target) {
-          // expected.target.listeners should be a subset of
-          // current.changedListenerNames if all expected listener changes were
-          // sent. We may get random other event listener changes here too, not
-          // just the one from the test.
           is(current.target, expected.target, current.target + " = " + expected.target);
-
-          var eNames = current.changedListenerNames.enumerate();
-          var listeners = [];
-          while (eNames.hasMoreElements()) {
-            var listenerName = eNames.getNext().QueryInterface(Ci.nsIAtom).toString();
-            listeners.push(listenerName);
-          }
-          var matchAll = expected.listeners.every(function(val)
-                                                { return listeners.indexOf(val) >= 0; });
-          if (!matchAll)
-            return;
           ++i;
         }
       } catch(ex) {
         continue;
       }
     }
     if (expectedEventChanges.length != i) {
       return;