Shave 10 seconds off test runs with DevTools open

Chrome’s “async stack traces” feature makes addEventListener a little slower.  DOMBackend’s teardown listeners were causing unnecessary calls to addEventListener in jQuery.  Tell jQuery not to do that.
This commit is contained in:
David Greenspan
2014-07-01 13:59:41 -07:00
parent dfbbde4aa7
commit 88447c91af

View File

@@ -110,6 +110,12 @@ DOMBackend.Teardown = {
};
$jq.event.special[DOMBackend.Teardown._JQUERY_EVENT_NAME] = {
setup: function () {
// This "setup" callback is important even though it is empty!
// Without it, jQuery will call addEventListener, which is a
// performance hit, especially with Chrome's async stack trace
// feature enabled.
},
teardown: function() {
var elem = this;
var callbacks = elem[DOMBackend.Teardown._CB_PROP];