Bug 1005552 - Stop binding marquee event handlers. r=bz, a=abillings
authorBobby Holley <bobbyholley@gmail.com>
Fri, 16 May 2014 10:56:41 -0700
changeset 192314 e09ccb39a409
parent 192313 e17059d22a5b
child 192315 7d6a74b90622
push id3566
push userryanvm@gmail.com
push date2014-05-20 13:28 +0000
treeherdermozilla-beta@7d6a74b90622 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, abillings
bugs1005552, 872772
milestone30.0
Bug 1005552 - Stop binding marquee event handlers. r=bz, a=abillings

These functions get invoked as event listeners, so we'll automatically get the
proper |this|. The reason for the existing shenanigans was to work around
bug 872772, which has now been fixed.
layout/style/xbl-marquee/xbl-marquee.xml
--- a/layout/style/xbl-marquee/xbl-marquee.xml
+++ b/layout/style/xbl-marquee/xbl-marquee.xml
@@ -259,18 +259,17 @@
             case "string":
               if (!aIgnoreNextCall) {
                 try {
                   // Work around bug 872772 by wrapping the cross-compartment-
                   // wrapped function in a function from this scope.
                   //
                   // NB: Make sure to wrap the constructor in parentheses to
                   // deal with the weird precedence of |new| in JS.
-                  var contentFn = new (XPCNativeWrapper.unwrap(window).Function)("event", aValue);
-                  this["_on" + aName] = function(e) { return contentFn.call(this, e); };
+                  this["_on" + aName] = new (XPCNativeWrapper.unwrap(window.Function))("event", aValue);
                 }
                 catch(e) {
                   return false;
                 }
                 this.addEventListener(aName, this["_on" + aName], false);
               }
               else {
                 this["_on" + aName] = aValue;