MCPcopy
hub / github.com/hokein/electron-sample-apps / curCSS

Function curCSS

camera/jquery.js:5522–5567  ·  view source on GitHub ↗
( elem, name, computed )

Source from the content-addressed store, hash-verified

5520
5521
5522function curCSS( elem, name, computed ) {
5523 var width, minWidth, maxWidth, ret,
5524 style = elem.style;
5525
5526 computed = computed || getStyles( elem );
5527
5528 // Support: IE9
5529 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
5530 if ( computed ) {
5531 ret = computed.getPropertyValue( name ) || computed[ name ];
5532 }
5533
5534 if ( computed ) {
5535
5536 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
5537 ret = jQuery.style( elem, name );
5538 }
5539
5540 // Support: iOS < 6
5541 // A tribute to the "awesome hack by Dean Edwards"
5542 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
5543 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
5544 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
5545
5546 // Remember the original values
5547 width = style.width;
5548 minWidth = style.minWidth;
5549 maxWidth = style.maxWidth;
5550
5551 // Put in the new values to get a computed value out
5552 style.minWidth = style.maxWidth = style.width = ret;
5553 ret = computed.width;
5554
5555 // Revert the changed values
5556 style.width = width;
5557 style.minWidth = minWidth;
5558 style.maxWidth = maxWidth;
5559 }
5560 }
5561
5562 return ret !== undefined ?
5563 // Support: IE
5564 // IE returns zIndex value as an integer.
5565 ret + "" :
5566 ret;
5567}
5568
5569
5570function addGetHookIf( conditionFn, hookFn ) {

Callers 6

getWidthOrHeightFunction · 0.85
jquery.jsFile · 0.85
jquery-1.7.2.jsFile · 0.85
getWidthOrHeightFunction · 0.85
jquery.jsFile · 0.85
getWidthOrHeightFunction · 0.85

Calls 1

getStylesFunction · 0.85

Tested by

no test coverage detected