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

Function getStyles

dist-module/jquery.factory.module.js:5754–5768  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

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

Callers 3

curCSSFunction · 0.70
getWidthOrHeightFunction · 0.70
jQueryFactoryWrapperFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected