Permalink
Browse files

Core:CSS:Event: simplification of native method signatures

* Remove third argument from "addEventListener"

* Remove third argument from "removeEventListener"

* Remove second argument from "getComputedStyle"

Ref gh-2047
  • Loading branch information...
markelog committed Apr 27, 2015
1 parent a117dd0 commit 85577a348a72ae765e0d7330b9e82985d23c94b7
Showing with 11 additions and 10 deletions.
  1. +4 −4 src/core/ready.js
  2. +2 −2 src/css/support.js
  3. +2 −2 src/css/var/getStyles.js
  4. +3 −2 src/event.js
View
@@ -63,8 +63,8 @@ jQuery.extend({
* The ready event handler and self cleanup method
*/
function completed() {
- document.removeEventListener( "DOMContentLoaded", completed, false );
- window.removeEventListener( "load", completed, false );
+ document.removeEventListener( "DOMContentLoaded", completed );
+ window.removeEventListener( "load", completed );
jQuery.ready();
}
@@ -85,10 +85,10 @@ jQuery.ready.promise = function( obj ) {
} else {
// Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed, false );
+ document.addEventListener( "DOMContentLoaded", completed );
// A fallback to window.onload, that will always work
- window.addEventListener( "load", completed, false );
+ window.addEventListener( "load", completed );
}
}
return readyList.promise( obj );
View
@@ -39,7 +39,7 @@ define([
div.innerHTML = "";
documentElement.appendChild( container );
- var divStyle = window.getComputedStyle( div, null );
+ var divStyle = window.getComputedStyle( div );
pixelPositionVal = divStyle.top !== "1%";
boxSizingReliableVal = divStyle.height === "4px";
pixelMarginRightVal = divStyle.marginRight === "4px";
@@ -90,7 +90,7 @@ define([
div.style.width = "1px";
documentElement.appendChild( container );
- ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
+ ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
documentElement.removeChild( container );
div.removeChild( marginDiv );
View
@@ -4,9 +4,9 @@ define(function() {
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
if ( elem.ownerDocument.defaultView.opener ) {
- return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ return elem.ownerDocument.defaultView.getComputedStyle( elem );
}
- return window.getComputedStyle( elem, null );
+ return window.getComputedStyle( elem );
};
});
View
@@ -123,7 +123,7 @@ jQuery.event = {
special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
+ elem.addEventListener( type, eventHandle );
}
}
}
@@ -631,9 +631,10 @@ jQuery.event = {
};
jQuery.removeEvent = function( elem, type, handle ) {
+
// This "if" is needed for plain objects
if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
+ elem.removeEventListener( type, handle );
}
};

0 comments on commit 85577a3

Please sign in to comment.