]> source.dussan.org Git - jquery.git/commitdiff
Core:CSS:Event: simplification of native method signatures
authorOleg Gaidarenko <markelog@gmail.com>
Mon, 27 Apr 2015 06:49:12 +0000 (09:49 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Sun, 3 May 2015 10:56:32 +0000 (13:56 +0300)
* Remove third argument from "addEventListener"

* Remove third argument from "removeEventListener"

* Remove second argument from "getComputedStyle"

Ref gh-2047

src/core/ready.js
src/css/support.js
src/css/var/getStyles.js
src/event.js

index cc812e6ac0a168fcacb30d410c8279c749354e96..c9ffdd749e41680b5f22fab2bd1e124090ebbc67 100644 (file)
@@ -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 );
index e6dba391f896b7ad5ef1fad6792901c69f64a42a..522406943cb8d0121bcf0b0a323f73a4970121fc 100644 (file)
@@ -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 );
index 413acd04a89734cb6aa976dddb907a7c0762cdc4..0d1d51af627f0229d78744d2e735415eff6711f1 100644 (file)
@@ -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 );
        };
 });
index 0aa37ec6e5160c63a3b320304e79da93f5a049fe..1a721a95945eff80bc889c031c2d3b40db2b8baa 100644 (file)
@@ -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 );
        }
 };