From 14eba98c8f189c2e6a36e640bedce2ce6db34493 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Tue, 22 Dec 2015 18:51:04 +0300 Subject: [PATCH] Build: code style fixes after all those reverts --- src/ajax/load.js | 1 + src/core.js | 1 + src/core/init.js | 4 +- src/css.js | 3 +- src/css/defaultDisplay.js | 7 +- src/data.js | 9 +- src/deferred.js | 30 +- src/effects.js | 11 +- src/event/alias.js | 4 +- src/manipulation.js | 4 +- src/wrap.js | 15 +- test/data/badjson.js | 2 +- test/data/testinit.js | 2 + test/unit/ajax.js | 14 +- test/unit/attributes.js | 6 +- test/unit/callbacks.js | 2 +- test/unit/core.js | 50 +- test/unit/css.js | 165 +++-- test/unit/data.js | 52 +- test/unit/deferred.js | 239 ++++--- test/unit/deprecated.js | 7 +- test/unit/dimensions.js | 20 +- test/unit/effects.js | 1261 +++++++++++++++++++------------------ test/unit/event.js | 9 +- test/unit/manipulation.js | 11 +- test/unit/offset.js | 22 +- test/unit/ready.js | 49 +- test/unit/selector.js | 28 +- test/unit/serialize.js | 12 +- test/unit/support.js | 2 +- 30 files changed, 1037 insertions(+), 1005 deletions(-) diff --git a/src/ajax/load.js b/src/ajax/load.js index 4ba370e21..7863d7cc2 100644 --- a/src/ajax/load.js +++ b/src/ajax/load.js @@ -5,6 +5,7 @@ define( [ "../traversing", "../manipulation", "../selector", + // Optional event/alias dependency "../event/alias" ], function( jQuery ) { diff --git a/src/core.js b/src/core.js index 5f4e4d9dc..60291a5f0 100644 --- a/src/core.js +++ b/src/core.js @@ -290,6 +290,7 @@ jQuery.extend( { // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox diff --git a/src/core/init.js b/src/core/init.js index 425c1954a..6225d15e4 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -79,7 +79,7 @@ var rootjQuery, // Inject the element directly into the jQuery object this.length = 1; - this[0] = elem; + this[ 0 ] = elem; } this.context = document; @@ -99,7 +99,7 @@ var rootjQuery, // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { - this.context = this[0] = selector; + this.context = this[ 0 ] = selector; this.length = 1; return this; diff --git a/src/css.js b/src/css.js index 802ae8a31..504192307 100644 --- a/src/css.js +++ b/src/css.js @@ -82,6 +82,7 @@ function showHide( elements, show ) { values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { + // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { @@ -92,7 +93,7 @@ function showHide( elements, show ) { // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); + values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); } } else { hidden = isHidden( elem ); diff --git a/src/css/defaultDisplay.js b/src/css/defaultDisplay.js index b1fa7dae5..2ec5d8a7a 100644 --- a/src/css/defaultDisplay.js +++ b/src/css/defaultDisplay.js @@ -1,4 +1,4 @@ -define([ +define( [ "../core", "../var/document", "../manipulation" // appendTo @@ -18,6 +18,7 @@ var iframe, * @param {String} name nodeName of the element * @param {Object} doc Document object */ + // Called only from within defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), @@ -46,7 +47,7 @@ function defaultDisplay( nodeName ) { if ( display === "none" || !display ) { // Use the already-created iframe if possible - iframe = (iframe || jQuery( "