MCPcopy Index your code
hub / github.com/perkeep/perkeep / curCSS

Function curCSS

app/publisher/jquery.js:5794–5841  ·  view source on GitHub ↗
( elem, name, computed )

Source from the content-addressed store, hash-verified

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

Callers 2

getWidthOrHeightFunction · 0.85
jquery.jsFile · 0.85

Calls 3

getStylesFunction · 0.85
containsMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected