diff options
Diffstat (limited to 'js/vendor/jquery/src/css')
-rw-r--r-- | js/vendor/jquery/src/css/addGetHookIf.js | 8 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/adjustCSS.js | 65 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/curCSS.js | 24 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/defaultDisplay.js | 30 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/hiddenVisibleSelectors.js | 15 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/showHide.js | 48 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/support.js | 147 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/cssExpand.js | 4 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/getStyles.js | 13 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/isHidden.js | 9 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/rmargin.js | 6 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/rnumnonpx.js | 4 | ||||
-rw-r--r-- | js/vendor/jquery/src/css/var/swap.js (renamed from js/vendor/jquery/src/css/swap.js) | 10 |
13 files changed, 265 insertions, 118 deletions
diff --git a/js/vendor/jquery/src/css/addGetHookIf.js b/js/vendor/jquery/src/css/addGetHookIf.js index e12f3598d..9cd21f683 100644 --- a/js/vendor/jquery/src/css/addGetHookIf.js +++ b/js/vendor/jquery/src/css/addGetHookIf.js @@ -1,10 +1,12 @@ -define(function() { +define( function() { function addGetHookIf( conditionFn, hookFn ) { + // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { + // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; @@ -12,11 +14,11 @@ function addGetHookIf( conditionFn, hookFn ) { } // Hook needed; redefine it so that the support test is not executed again. - return (this.get = hookFn).apply( this, arguments ); + return ( this.get = hookFn ).apply( this, arguments ); } }; } return addGetHookIf; -}); +} ); diff --git a/js/vendor/jquery/src/css/adjustCSS.js b/js/vendor/jquery/src/css/adjustCSS.js new file mode 100644 index 000000000..48fcfec05 --- /dev/null +++ b/js/vendor/jquery/src/css/adjustCSS.js @@ -0,0 +1,65 @@ +define( [ + "../core", + "../var/rcssNum" +], function( jQuery, rcssNum ) { + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + +return adjustCSS; +} ); diff --git a/js/vendor/jquery/src/css/curCSS.js b/js/vendor/jquery/src/css/curCSS.js index 90e508cb8..be643ab54 100644 --- a/js/vendor/jquery/src/css/curCSS.js +++ b/js/vendor/jquery/src/css/curCSS.js @@ -1,10 +1,11 @@ -define([ +define( [ "../core", "./var/rnumnonpx", "./var/rmargin", "./var/getStyles", - "../selector" // contains -], function( jQuery, rnumnonpx, rmargin, getStyles ) { + "./support", + "../selector" // Get jQuery.contains +], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, @@ -16,19 +17,17 @@ function curCSS( elem, name, computed ) { // getPropertyValue is only needed for .css('filter') (#12537) if ( computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; - } - - if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } - // Support: iOS < 6 // A tribute to the "awesome hack by Dean Edwards" - // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // http://dev.w3.org/csswg/cssom/#resolved-values + if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; @@ -47,11 +46,12 @@ function curCSS( elem, name, computed ) { } return ret !== undefined ? - // Support: IE + + // Support: IE9-11+ // IE returns zIndex value as an integer. ret + "" : ret; } return curCSS; -}); +} ); diff --git a/js/vendor/jquery/src/css/defaultDisplay.js b/js/vendor/jquery/src/css/defaultDisplay.js index 046ae91b9..b1fb5774d 100644 --- a/js/vendor/jquery/src/css/defaultDisplay.js +++ b/js/vendor/jquery/src/css/defaultDisplay.js @@ -1,27 +1,29 @@ -define([ +define( [ "../core", + "../var/document", "../manipulation" // appendTo -], function( jQuery ) { +], function( jQuery, document ) { var iframe, - elemdisplay = {}; + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ + // Called only from within defaultDisplay function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optimization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); + display = jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element @@ -45,7 +47,8 @@ function defaultDisplay( nodeName ) { if ( display === "none" || !display ) { // Use the already-created iframe if possible - iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); + iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) + .appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = iframe[ 0 ].contentDocument; @@ -66,5 +69,4 @@ function defaultDisplay( nodeName ) { } return defaultDisplay; - -}); +} ); diff --git a/js/vendor/jquery/src/css/hiddenVisibleSelectors.js b/js/vendor/jquery/src/css/hiddenVisibleSelectors.js index c7f1c7ee7..cf0955d3e 100644 --- a/js/vendor/jquery/src/css/hiddenVisibleSelectors.js +++ b/js/vendor/jquery/src/css/hiddenVisibleSelectors.js @@ -1,15 +1,18 @@ -define([ +define( [ "../core", "../selector" ], function( jQuery ) { jQuery.expr.filters.hidden = function( elem ) { - // Support: Opera <= 12.12 - // Opera reports offsetWidths and offsetHeights less than zero on some elements - return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; + return !jQuery.expr.filters.visible( elem ); }; jQuery.expr.filters.visible = function( elem ) { - return !jQuery.expr.filters.hidden( elem ); + + // Support: Opera <= 12.12 + // Opera reports offsetWidths and offsetHeights less than zero on some elements + // Use OR instead of AND as the element is not visible if either is true + // See tickets #10406 and #13132 + return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0; }; -}); +} ); diff --git a/js/vendor/jquery/src/css/showHide.js b/js/vendor/jquery/src/css/showHide.js new file mode 100644 index 000000000..35e15bde8 --- /dev/null +++ b/js/vendor/jquery/src/css/showHide.js @@ -0,0 +1,48 @@ +define( [ + "../data/var/dataPriv" +], function( dataPriv ) { + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + if ( display === "none" ) { + + // Restore a pre-hide() value if we have one + values[ index ] = dataPriv.get( elem, "display" ) || ""; + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember the value we're replacing + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +return showHide; + +} ); diff --git a/js/vendor/jquery/src/css/support.js b/js/vendor/jquery/src/css/support.js index b9eaf1402..7e6e51334 100644 --- a/js/vendor/jquery/src/css/support.js +++ b/js/vendor/jquery/src/css/support.js @@ -1,14 +1,16 @@ -define([ +define( [ "../core", + "../var/document", + "../var/documentElement", "../var/support" -], function( jQuery, support ) { +], function( jQuery, document, documentElement, support ) { -(function() { - var pixelPositionVal, boxSizingReliableVal, - docElem = document.documentElement, +( function() { + var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); + // Finish early in limited (non-browser) environments if ( !div.style ) { return; } @@ -19,78 +21,101 @@ define([ div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; - container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + - "position:absolute"; + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + + "padding:0;margin-top:1px;position:absolute"; container.appendChild( div ); // Executing both pixelPosition & boxSizingReliable tests require only one layout // so they're executed at the same time to save the second computation. - function computePixelPositionAndBoxSizingReliable() { + function computeStyleTests() { div.style.cssText = + // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing - "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + - "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + - "border:1px;padding:1px;width:4px;position:absolute"; + "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + + "position:relative;display:block;" + + "margin:auto;border:1px;padding:1px;" + + "top:1%;width:50%"; div.innerHTML = ""; - docElem.appendChild( container ); + documentElement.appendChild( container ); - var divStyle = window.getComputedStyle( div, null ); + var divStyle = window.getComputedStyle( div ); pixelPositionVal = divStyle.top !== "1%"; + reliableMarginLeftVal = divStyle.marginLeft === "2px"; boxSizingReliableVal = divStyle.width === "4px"; - docElem.removeChild( container ); + // Support: Android 4.0 - 4.3 only + // Some styles come back with percentage values, even though they shouldn't + div.style.marginRight = "50%"; + pixelMarginRightVal = divStyle.marginRight === "4px"; + + documentElement.removeChild( container ); } - // Support: node.js jsdom - // Don't assume that getComputedStyle is a property of the global object - if ( window.getComputedStyle ) { - jQuery.extend( support, { - pixelPosition: function() { - - // This test is executed only once but we still do memoizing - // since we can use the boxSizingReliable pre-computing. - // No need to check if the test was already performed, though. - computePixelPositionAndBoxSizingReliable(); - return pixelPositionVal; - }, - boxSizingReliable: function() { - if ( boxSizingReliableVal == null ) { - computePixelPositionAndBoxSizingReliable(); - } - return boxSizingReliableVal; - }, - reliableMarginRight: function() { + jQuery.extend( support, { + pixelPosition: function() { + + // This test is executed only once but we still do memoizing + // since we can use the boxSizingReliable pre-computing. + // No need to check if the test was already performed, though. + computeStyleTests(); + return pixelPositionVal; + }, + boxSizingReliable: function() { + if ( boxSizingReliableVal == null ) { + computeStyleTests(); + } + return boxSizingReliableVal; + }, + pixelMarginRight: function() { + + // Support: Android 4.0-4.3 + // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal + // since that compresses better and they're computed together anyway. + if ( boxSizingReliableVal == null ) { + computeStyleTests(); + } + return pixelMarginRightVal; + }, + reliableMarginLeft: function() { - // Support: Android 2.3 - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - // This support function is only executed once so no memoizing is needed. - var ret, - marginDiv = div.appendChild( document.createElement( "div" ) ); - - // Reset CSS: box-sizing; display; margin; border; padding - marginDiv.style.cssText = div.style.cssText = - // Support: Firefox<29, Android 2.3 - // Vendor-prefix box-sizing - "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + - "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - docElem.appendChild( container ); - - ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); - - docElem.removeChild( container ); - div.removeChild( marginDiv ); - - return ret; + // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 + if ( boxSizingReliableVal == null ) { + computeStyleTests(); } - }); - } -})(); + return reliableMarginLeftVal; + }, + reliableMarginRight: function() { + + // Support: Android 2.3 + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. (#3333) + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // This support function is only executed once so no memoizing is needed. + var ret, + marginDiv = div.appendChild( document.createElement( "div" ) ); + + // Reset CSS: box-sizing; display; margin; border; padding + marginDiv.style.cssText = div.style.cssText = + + // Support: Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;box-sizing:content-box;" + + "display:block;margin:0;border:0;padding:0"; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + documentElement.appendChild( container ); + + ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight ); + + documentElement.removeChild( container ); + div.removeChild( marginDiv ); + + return ret; + } + } ); +} )(); return support; -}); +} ); diff --git a/js/vendor/jquery/src/css/var/cssExpand.js b/js/vendor/jquery/src/css/var/cssExpand.js index 91e90a88a..9f8194dc8 100644 --- a/js/vendor/jquery/src/css/var/cssExpand.js +++ b/js/vendor/jquery/src/css/var/cssExpand.js @@ -1,3 +1,3 @@ -define(function() { +define( function() { return [ "Top", "Right", "Bottom", "Left" ]; -}); +} ); diff --git a/js/vendor/jquery/src/css/var/getStyles.js b/js/vendor/jquery/src/css/var/getStyles.js index 413acd04a..1fa915d58 100644 --- a/js/vendor/jquery/src/css/var/getStyles.js +++ b/js/vendor/jquery/src/css/var/getStyles.js @@ -1,12 +1,15 @@ -define(function() { +define( function() { return function( elem ) { + // Support: IE<=11+, Firefox<=30+ (#15098, #14150) // 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 ); + var view = elem.ownerDocument.defaultView; + + if ( !view.opener ) { + view = window; } - return window.getComputedStyle( elem, null ); + return view.getComputedStyle( elem ); }; -}); +} ); diff --git a/js/vendor/jquery/src/css/var/isHidden.js b/js/vendor/jquery/src/css/var/isHidden.js index 15ab81a97..7997efff1 100644 --- a/js/vendor/jquery/src/css/var/isHidden.js +++ b/js/vendor/jquery/src/css/var/isHidden.js @@ -1,13 +1,16 @@ -define([ +define( [ "../../core", "../../selector" + // css is assumed ], function( jQuery ) { return function( elem, el ) { + // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); }; -}); +} ); diff --git a/js/vendor/jquery/src/css/var/rmargin.js b/js/vendor/jquery/src/css/var/rmargin.js index da0438db6..9be221243 100644 --- a/js/vendor/jquery/src/css/var/rmargin.js +++ b/js/vendor/jquery/src/css/var/rmargin.js @@ -1,3 +1,3 @@ -define(function() { - return (/^margin/); -}); +define( function() { + return ( /^margin/ ); +} ); diff --git a/js/vendor/jquery/src/css/var/rnumnonpx.js b/js/vendor/jquery/src/css/var/rnumnonpx.js index c93be2850..ed13f0b98 100644 --- a/js/vendor/jquery/src/css/var/rnumnonpx.js +++ b/js/vendor/jquery/src/css/var/rnumnonpx.js @@ -1,5 +1,5 @@ -define([ +define( [ "../../var/pnum" ], function( pnum ) { return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); -}); +} ); diff --git a/js/vendor/jquery/src/css/swap.js b/js/vendor/jquery/src/css/var/swap.js index ce1643531..b6d3b679f 100644 --- a/js/vendor/jquery/src/css/swap.js +++ b/js/vendor/jquery/src/css/var/swap.js @@ -1,9 +1,7 @@ -define([ - "../core" -], function( jQuery ) { +define( function() { // A method for quickly swapping in/out CSS properties to get correct calculations. -jQuery.swap = function( elem, options, callback, args ) { +return function( elem, options, callback, args ) { var ret, name, old = {}; @@ -23,6 +21,4 @@ jQuery.swap = function( elem, options, callback, args ) { return ret; }; -return jQuery.swap; - -}); +} ); |