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

Function curCSS

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

Source from the content-addressed store, hash-verified

6569
6570
6571function curCSS( elem, name, computed ) {
6572 var width, minWidth, maxWidth, ret,
6573
6574 // Support: Firefox 51+
6575 // Retrieving style before computed somehow
6576 // fixes an issue with getting wrong values
6577 // on detached elements
6578 style = elem.style;
6579
6580 computed = computed || getStyles( elem );
6581
6582 // getPropertyValue is needed for:
6583 // .css('filter') (IE 9 only, #12537)
6584 // .css('--customProperty) (#3144)
6585 if ( computed ) {
6586 ret = computed.getPropertyValue( name ) || computed[ name ];
6587
6588 if ( ret === "" && !isAttached( elem ) ) {
6589 ret = jQuery.style( elem, name );
6590 }
6591
6592 // A tribute to the "awesome hack by Dean Edwards"
6593 // Android Browser returns percentage for some values,
6594 // but width seems to be reliably pixels.
6595 // This is against the CSSOM draft spec:
6596 // https://drafts.csswg.org/cssom/#resolved-values
6597 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
6598
6599 // Remember the original values
6600 width = style.width;
6601 minWidth = style.minWidth;
6602 maxWidth = style.maxWidth;
6603
6604 // Put in the new values to get a computed value out
6605 style.minWidth = style.maxWidth = style.width = ret;
6606 ret = computed.width;
6607
6608 // Revert the changed values
6609 style.width = width;
6610 style.minWidth = minWidth;
6611 style.maxWidth = maxWidth;
6612 }
6613 }
6614
6615 return ret !== undefined ?
6616
6617 // Support: IE <=9 - 11 only
6618 // IE returns zIndex value as an integer.
6619 ret + "" :
6620 ret;
6621}
6622
6623
6624function addGetHookIf( conditionFn, hookFn ) {

Callers 4

getWidthOrHeightFunction · 0.70
jquery-3.5.1.jsFile · 0.70
getWidthOrHeightFunction · 0.70
jquery-1.12.4.jsFile · 0.70

Calls 2

isAttachedFunction · 0.85
getStylesFunction · 0.70

Tested by

no test coverage detected