Skip to content

Commit 85577a3

Browse files
committed
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
1 parent a117dd0 commit 85577a3

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/core/ready.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jQuery.extend({
6363
* The ready event handler and self cleanup method
6464
*/
6565
function completed() {
66-
document.removeEventListener( "DOMContentLoaded", completed, false );
67-
window.removeEventListener( "load", completed, false );
66+
document.removeEventListener( "DOMContentLoaded", completed );
67+
window.removeEventListener( "load", completed );
6868
jQuery.ready();
6969
}
7070

@@ -85,10 +85,10 @@ jQuery.ready.promise = function( obj ) {
8585
} else {
8686

8787
// Use the handy event callback
88-
document.addEventListener( "DOMContentLoaded", completed, false );
88+
document.addEventListener( "DOMContentLoaded", completed );
8989

9090
// A fallback to window.onload, that will always work
91-
window.addEventListener( "load", completed, false );
91+
window.addEventListener( "load", completed );
9292
}
9393
}
9494
return readyList.promise( obj );

src/css/support.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ define([
3939
div.innerHTML = "";
4040
documentElement.appendChild( container );
4141

42-
var divStyle = window.getComputedStyle( div, null );
42+
var divStyle = window.getComputedStyle( div );
4343
pixelPositionVal = divStyle.top !== "1%";
4444
boxSizingReliableVal = divStyle.height === "4px";
4545
pixelMarginRightVal = divStyle.marginRight === "4px";
@@ -90,7 +90,7 @@ define([
9090
div.style.width = "1px";
9191
documentElement.appendChild( container );
9292

93-
ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
93+
ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
9494

9595
documentElement.removeChild( container );
9696
div.removeChild( marginDiv );

src/css/var/getStyles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ define(function() {
44
// IE throws on elements created in popups
55
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
66
if ( elem.ownerDocument.defaultView.opener ) {
7-
return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
7+
return elem.ownerDocument.defaultView.getComputedStyle( elem );
88
}
99

10-
return window.getComputedStyle( elem, null );
10+
return window.getComputedStyle( elem );
1111
};
1212
});

src/event.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jQuery.event = {
123123
special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
124124

125125
if ( elem.addEventListener ) {
126-
elem.addEventListener( type, eventHandle, false );
126+
elem.addEventListener( type, eventHandle );
127127
}
128128
}
129129
}
@@ -631,9 +631,10 @@ jQuery.event = {
631631
};
632632

633633
jQuery.removeEvent = function( elem, type, handle ) {
634+
634635
// This "if" is needed for plain objects
635636
if ( elem.removeEventListener ) {
636-
elem.removeEventListener( type, handle, false );
637+
elem.removeEventListener( type, handle );
637638
}
638639
};
639640

0 commit comments

Comments
 (0)