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