From e93da8b04da86773247aadb1cbb1912e4f4526b2 Mon Sep 17 00:00:00 2001 From: Priyansh Date: Tue, 22 Dec 2020 17:49:59 +0530 Subject: Rewriting Project --- node_modules/jquery/src/css/curCSS.js | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 node_modules/jquery/src/css/curCSS.js (limited to 'node_modules/jquery/src/css/curCSS.js') diff --git a/node_modules/jquery/src/css/curCSS.js b/node_modules/jquery/src/css/curCSS.js new file mode 100644 index 0000000..98a594a --- /dev/null +++ b/node_modules/jquery/src/css/curCSS.js @@ -0,0 +1,65 @@ +define( [ + "../core", + "../core/isAttached", + "./var/rboxStyle", + "./var/rnumnonpx", + "./var/getStyles", + "./support" +], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, support ) { + +"use strict"; + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + +return curCSS; +} ); -- cgit v1.2.3