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