MCPcopy Create free account
hub / github.com/components/jquery / getStyles

Function getStyles

jquery.js:5763–5777  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

5761var rcustomProp = /^--/;
5762
5763function getStyles( elem ) {
5764
5765 // Support: IE <=11+ (trac-14150)
5766 // In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
5767 // break. Using `elem.ownerDocument.defaultView` avoids the issue.
5768 var view = elem.ownerDocument.defaultView;
5769
5770 // `document.implementation.createHTMLDocument( "" )` has a `null` `defaultView`
5771 // property; check `defaultView` truthiness to fallback to window in such a case.
5772 if ( !view ) {
5773 view = window;
5774 }
5775
5776 return view.getComputedStyle( elem );
5777}
5778
5779// A method for quickly swapping in/out CSS properties to get correct calculations.
5780function swap( elem, options, callback ) {

Callers 3

curCSSFunction · 0.70
getWidthOrHeightFunction · 0.70
jquery.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected