File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 307
307
var position = element . getStyle ( 'position' ) ,
308
308
width = element . getStyle ( 'width' ) ;
309
309
310
+ if ( width === "0px" || width === null ) {
311
+ // Opera won't report the true width of the element through
312
+ // `getComputedStyle` if it's hidden. If we got a nonsensical value,
313
+ // we need to show the element and try again.
314
+ element . style . display = 'block' ;
315
+ width = element . getStyle ( 'width' ) ;
316
+ }
317
+
310
318
// Preserve the context in case we get a percentage value.
311
319
var context = ( position === 'fixed' ) ? document . viewport :
312
320
element . parentNode ;
Original file line number Diff line number Diff line change @@ -39,14 +39,14 @@ new Test.Unit.Runner({
39
39
'test layout on elements with display: none and exact width' : function ( ) {
40
40
var layout = $ ( 'box2' ) . getLayout ( ) ;
41
41
42
- this . assert ( ! isDisplayed ( $ ( 'box3 ' ) ) , 'box should be hidden' ) ;
42
+ this . assert ( ! isDisplayed ( $ ( 'box2 ' ) ) , 'box should be hidden' ) ;
43
43
44
44
this . assertEqual ( 500 , layout . get ( 'width' ) , 'width' ) ;
45
45
this . assertEqual ( 3 , layout . get ( 'border-right' ) , 'border-right' ) ;
46
46
this . assertEqual ( 10 , layout . get ( 'padding-bottom' ) , 'padding-bottom' ) ;
47
47
this . assertEqual ( 526 , layout . get ( 'border-box-width' ) , 'border-box-width' ) ;
48
48
49
- this . assert ( ! isDisplayed ( $ ( 'box3 ' ) ) , 'box should still be hidden' ) ;
49
+ this . assert ( ! isDisplayed ( $ ( 'box2 ' ) ) , 'box should still be hidden' ) ;
50
50
} ,
51
51
52
52
'test layout on elements with negative margins' : function ( ) {
You can’t perform that action at this time.
0 commit comments