Skip to content

Commit bdce86d

Browse files
author
timmywil
committed
Move window/document test to dimensions for consistency
1 parent edb2286 commit bdce86d

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/css.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ jQuery.each(["height", "width"], function( i, name ) {
170170
get: function( elem, computed, extra ) {
171171
var val;
172172

173-
// Tests for window/document
174-
if ( !elem.style ) {
175-
return null;
176-
}
177-
178173
if ( computed ) {
179174
if ( elem.offsetWidth !== 0 ) {
180175
val = getWH( elem, name, extra );

src/dimensions.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
77

88
// innerHeight and innerWidth
99
jQuery.fn["inner" + name] = function() {
10-
var ret;
11-
return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, "padding" )) ) ?
12-
ret :
10+
var elem = this[0];
11+
return elem && elem.style ?
12+
parseFloat( jQuery.css( elem, type, "padding" ) ) :
1313
null;
1414
};
1515

1616
// outerHeight and outerWidth
1717
jQuery.fn["outer" + name] = function( margin ) {
18-
var ret;
19-
return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, margin ? "margin" : "border" )) ) ?
20-
ret :
18+
var elem = this[0];
19+
return elem && elem.style ?
20+
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
2121
null;
2222
};
2323

0 commit comments

Comments
 (0)