@@ -109,11 +109,14 @@ test("height() with function args", function() {
109
109
test ( "innerWidth()" , function ( ) {
110
110
expect ( 8 ) ;
111
111
112
- equals ( jQuery ( window ) . innerWidth ( ) , null , "Test on window without margin option" ) ;
113
- equals ( jQuery ( window ) . innerWidth ( true ) , null , "Test on window with margin option" ) ;
112
+ var winWidth = jQuery ( window ) . width ( ) ,
113
+ docWidth = jQuery ( document ) . width ( ) ;
114
114
115
- equals ( jQuery ( document ) . innerWidth ( ) , null , "Test on document without margin option" ) ;
116
- equals ( jQuery ( document ) . innerWidth ( true ) , null , "Test on document with margin option" ) ;
115
+ equals ( jQuery ( window ) . innerWidth ( ) , winWidth , "Test on window without margin option" ) ;
116
+ equals ( jQuery ( window ) . innerWidth ( true ) , winWidth , "Test on window with margin option" ) ;
117
+
118
+ equals ( jQuery ( document ) . innerWidth ( ) , docWidth , "Test on document without margin option" ) ;
119
+ equals ( jQuery ( document ) . innerWidth ( true ) , docWidth , "Test on document with margin option" ) ;
117
120
118
121
var $div = jQuery ( "#nothiddendiv" ) ;
119
122
// set styles
@@ -144,11 +147,14 @@ test("innerWidth()", function() {
144
147
test ( "innerHeight()" , function ( ) {
145
148
expect ( 8 ) ;
146
149
147
- equals ( jQuery ( window ) . innerHeight ( ) , null , "Test on window without margin option" ) ;
148
- equals ( jQuery ( window ) . innerHeight ( true ) , null , "Test on window with margin option" ) ;
150
+ var winHeight = jQuery ( window ) . height ( ) ,
151
+ docHeight = jQuery ( document ) . height ( ) ;
152
+
153
+ equals ( jQuery ( window ) . innerHeight ( ) , winHeight , "Test on window without margin option" ) ;
154
+ equals ( jQuery ( window ) . innerHeight ( true ) , winHeight , "Test on window with margin option" ) ;
149
155
150
- equals ( jQuery ( document ) . innerHeight ( ) , null , "Test on document without margin option" ) ;
151
- equals ( jQuery ( document ) . innerHeight ( true ) , null , "Test on document with margin option" ) ;
156
+ equals ( jQuery ( document ) . innerHeight ( ) , docHeight , "Test on document without margin option" ) ;
157
+ equals ( jQuery ( document ) . innerHeight ( true ) , docHeight , "Test on document with margin option" ) ;
152
158
153
159
var $div = jQuery ( "#nothiddendiv" ) ;
154
160
// set styles
@@ -179,10 +185,13 @@ test("innerHeight()", function() {
179
185
test ( "outerWidth()" , function ( ) {
180
186
expect ( 11 ) ;
181
187
182
- equal ( jQuery ( window ) . outerWidth ( ) , null , "Test on window without margin option" ) ;
183
- equal ( jQuery ( window ) . outerWidth ( true ) , null , "Test on window with margin option" ) ;
184
- equal ( jQuery ( document ) . outerWidth ( ) , null , "Test on document without margin option" ) ;
185
- equal ( jQuery ( document ) . outerWidth ( true ) , null , "Test on document with margin option" ) ;
188
+ var winWidth = jQuery ( window ) . width ( ) ,
189
+ docWidth = jQuery ( document ) . width ( ) ;
190
+
191
+ equal ( jQuery ( window ) . outerWidth ( ) , winWidth , "Test on window without margin option" ) ;
192
+ equal ( jQuery ( window ) . outerWidth ( true ) , winWidth , "Test on window with margin option" ) ;
193
+ equal ( jQuery ( document ) . outerWidth ( ) , docWidth , "Test on document without margin option" ) ;
194
+ equal ( jQuery ( document ) . outerWidth ( true ) , docWidth , "Test on document with margin option" ) ;
186
195
187
196
var $div = jQuery ( "#nothiddendiv" ) ;
188
197
$div . css ( "width" , 30 ) ;
@@ -239,10 +248,14 @@ test("child of a hidden elem has accurate inner/outer/Width()/Height() see #944
239
248
test ( "outerHeight()" , function ( ) {
240
249
expect ( 11 ) ;
241
250
242
- equal ( jQuery ( window ) . outerHeight ( ) , null , "Test on window without margin option" ) ;
243
- equal ( jQuery ( window ) . outerHeight ( true ) , null , "Test on window with margin option" ) ;
244
- equal ( jQuery ( document ) . outerHeight ( ) , null , "Test on document without margin option" ) ;
245
- equal ( jQuery ( document ) . outerHeight ( true ) , null , "Test on document with margin option" ) ;
251
+ var winHeight = jQuery ( window ) . height ( ) ,
252
+ docHeight = jQuery ( document ) . height ( ) ;
253
+
254
+
255
+ equal ( jQuery ( window ) . outerHeight ( ) , winHeight , "Test on window without margin option" ) ;
256
+ equal ( jQuery ( window ) . outerHeight ( true ) , winHeight , "Test on window with margin option" ) ;
257
+ equal ( jQuery ( document ) . outerHeight ( ) , docHeight , "Test on document without margin option" ) ;
258
+ equal ( jQuery ( document ) . outerHeight ( true ) , docHeight , "Test on document with margin option" ) ;
246
259
247
260
var $div = jQuery ( "#nothiddendiv" ) ;
248
261
$div . css ( "height" , 30 ) ;
0 commit comments