MCPcopy Index your code
hub / github.com/jquery/jquery / getStyles

Function getStyles

dist-module/jquery.module.js:5749–5763  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

5747var rcustomProp = /^--/;
5748
5749function getStyles( elem ) {
5750
5751 // Support: IE <=11+ (trac-14150)
5752 // In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
5753 // break. Using `elem.ownerDocument.defaultView` avoids the issue.
5754 var view = elem.ownerDocument.defaultView;
5755
5756 // `document.implementation.createHTMLDocument( "" )` has a `null` `defaultView`
5757 // property; check `defaultView` truthiness to fallback to window in such a case.
5758 if ( !view ) {
5759 view = window;
5760 }
5761
5762 return view.getComputedStyle( elem );
5763}
5764
5765// A method for quickly swapping in/out CSS properties to get correct calculations.
5766function swap( elem, options, callback ) {

Callers 3

curCSSFunction · 0.70
getWidthOrHeightFunction · 0.70
jQueryFactoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected