From 49bce4712447a73ae60268f34d067cdf88a070bb Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Sat, 2 May 2015 20:54:11 +0300 Subject: [PATCH] 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 Ref 85577a348a72ae765e0d7330b9e82985d23c94b7 --- src/core/ready.js | 8 ++++---- src/css/curCSS.js | 4 ++-- src/css/support.js | 4 ++-- src/event.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/ready.js b/src/core/ready.js index 10bebf648..2dfbc9180 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -68,8 +68,8 @@ jQuery.extend({ */ function detach() { if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); // Support: IE<9 } else { @@ -110,10 +110,10 @@ jQuery.ready.promise = function( obj ) { // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // 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 ); // Support: IE<9 // If IE event model is used diff --git a/src/css/curCSS.js b/src/css/curCSS.js index c1a0d2de1..271e665db 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -16,10 +16,10 @@ if ( window.getComputedStyle ) { // 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 ); }; curCSS = function( elem, name, computed ) { diff --git a/src/css/support.js b/src/css/support.js index ab36274d1..17848d535 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -107,7 +107,7 @@ define([ // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { - divStyle = window.getComputedStyle( div, null ); + divStyle = window.getComputedStyle( div ); pixelPositionVal = ( divStyle || {} ).top !== "1%"; boxSizingReliableVal = ( divStyle || { height: "4px" } ).height === "4px"; pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; @@ -128,7 +128,7 @@ define([ div.style.width = "1px"; reliableMarginRightVal = - !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); + !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); div.removeChild( contents ); } diff --git a/src/event.js b/src/event.js index a5b8d597d..43d36b270 100644 --- a/src/event.js +++ b/src/event.js @@ -677,7 +677,7 @@ jQuery.removeEvent = document.removeEventListener ? // This "if" is needed for plain objects if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); + elem.removeEventListener( type, handle ); } } : function( elem, type, handle ) { -- 2.39.5