Make sure that the defaultView exists before attempting to get at the computedStyle (makes it easier to hide items that don't have a view). Fixes #5619.
This commit is contained in:
parent
4e9fed3b16
commit
cf72fba64f
1 changed files with 7 additions and 1 deletions
|
@ -141,7 +141,13 @@ jQuery.extend({
|
|||
|
||||
name = name.replace( rupper, "-$1" ).toLowerCase();
|
||||
|
||||
var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
|
||||
var defaultView = elem.ownerDocument.defaultView;
|
||||
|
||||
if ( !defaultView ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var computedStyle = defaultView.getComputedStyle( elem, null );
|
||||
|
||||
if ( computedStyle ) {
|
||||
ret = computedStyle.getPropertyValue( name );
|
||||
|
|
Loading…
Reference in a new issue