Commit 49bce471 authored by Oleg Gaidarenko's avatar Oleg Gaidarenko

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
parent 4632e558
...@@ -68,8 +68,8 @@ jQuery.extend({ ...@@ -68,8 +68,8 @@ jQuery.extend({
*/ */
function detach() { function detach() {
if ( document.addEventListener ) { if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false ); document.removeEventListener( "DOMContentLoaded", completed );
window.removeEventListener( "load", completed, false ); window.removeEventListener( "load", completed );
// Support: IE<9 // Support: IE<9
} else { } else {
...@@ -110,10 +110,10 @@ jQuery.ready.promise = function( obj ) { ...@@ -110,10 +110,10 @@ jQuery.ready.promise = function( obj ) {
// Standards-based browsers support DOMContentLoaded // Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) { } else if ( document.addEventListener ) {
// Use the handy event callback // Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false ); document.addEventListener( "DOMContentLoaded", completed );
// A fallback to window.onload, that will always work // A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false ); window.addEventListener( "load", completed );
// Support: IE<9 // Support: IE<9
// If IE event model is used // If IE event model is used
......
...@@ -16,10 +16,10 @@ if ( window.getComputedStyle ) { ...@@ -16,10 +16,10 @@ if ( window.getComputedStyle ) {
// IE throws on elements created in popups // IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle" // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
if ( elem.ownerDocument.defaultView.opener ) { 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 ) { curCSS = function( elem, name, computed ) {
......
...@@ -107,7 +107,7 @@ define([ ...@@ -107,7 +107,7 @@ define([
// Check for getComputedStyle so that this code is not run in IE<9. // Check for getComputedStyle so that this code is not run in IE<9.
if ( window.getComputedStyle ) { if ( window.getComputedStyle ) {
divStyle = window.getComputedStyle( div, null ); divStyle = window.getComputedStyle( div );
pixelPositionVal = ( divStyle || {} ).top !== "1%"; pixelPositionVal = ( divStyle || {} ).top !== "1%";
boxSizingReliableVal = ( divStyle || { height: "4px" } ).height === "4px"; boxSizingReliableVal = ( divStyle || { height: "4px" } ).height === "4px";
pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
...@@ -128,7 +128,7 @@ define([ ...@@ -128,7 +128,7 @@ define([
div.style.width = "1px"; div.style.width = "1px";
reliableMarginRightVal = reliableMarginRightVal =
!parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
div.removeChild( contents ); div.removeChild( contents );
} }
......
...@@ -677,7 +677,7 @@ jQuery.removeEvent = document.removeEventListener ? ...@@ -677,7 +677,7 @@ jQuery.removeEvent = document.removeEventListener ?
// This "if" is needed for plain objects // This "if" is needed for plain objects
if ( elem.removeEventListener ) { if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false ); elem.removeEventListener( type, handle );
} }
} : } :
function( elem, type, handle ) { function( elem, type, handle ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment