MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / curCSS

Function curCSS

libs/jquery-3.5.1/jquery-2.2.4.js:5795–5842  ·  view source on GitHub ↗
( elem, name, computed )

Source from the content-addressed store, hash-verified

5793
5794
5795function curCSS( elem, name, computed ) {
5796 var width, minWidth, maxWidth, ret,
5797 style = elem.style;
5798
5799 computed = computed || getStyles( elem );
5800 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
5801
5802 // Support: Opera 12.1x only
5803 // Fall back to style even without computed
5804 // computed is undefined for elems on document fragments
5805 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
5806 ret = jQuery.style( elem, name );
5807 }
5808
5809 // Support: IE9
5810 // getPropertyValue is only needed for .css('filter') (#12537)
5811 if ( computed ) {
5812
5813 // A tribute to the "awesome hack by Dean Edwards"
5814 // Android Browser returns percentage for some values,
5815 // but width seems to be reliably pixels.
5816 // This is against the CSSOM draft spec:
5817 // http://dev.w3.org/csswg/cssom/#resolved-values
5818 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5819
5820 // Remember the original values
5821 width = style.width;
5822 minWidth = style.minWidth;
5823 maxWidth = style.maxWidth;
5824
5825 // Put in the new values to get a computed value out
5826 style.minWidth = style.maxWidth = style.width = ret;
5827 ret = computed.width;
5828
5829 // Revert the changed values
5830 style.width = width;
5831 style.minWidth = minWidth;
5832 style.maxWidth = maxWidth;
5833 }
5834 }
5835
5836 return ret !== undefined ?
5837
5838 // Support: IE9-11+
5839 // IE returns zIndex value as an integer.
5840 ret + "" :
5841 ret;
5842}
5843
5844
5845function addGetHookIf( conditionFn, hookFn ) {

Callers 2

getWidthOrHeightFunction · 0.70
jquery-2.2.4.jsFile · 0.70

Calls 1

getStylesFunction · 0.70

Tested by

no test coverage detected