1 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=25381">bug
25381</a>:
2 jQuery animation crashing Safari.
</p>
3 <p>PASS if didn't crash.
</p>
4 <div style=
"position:fixed; top:0px; width:100px; background:red;">
5 <div id=
"i" style=
"position:fixed; display:none; top:0px; width:100px; height:100px; overflow:hidden; background:green;"><div>ABC
</div></div>
9 if (window
.testRunner
) {
10 testRunner
.dumpAsText();
11 testRunner
.waitUntilDone();
14 function swap( elem
, options
, callback
) {
16 // Remember the old values, and insert the new ones
17 for ( var name
in options
) {
18 old
[ name
] = elem
.style
[ name
];
19 elem
.style
[ name
] = options
[ name
];
22 callback
.call( elem
);
24 // Revert the old values
25 for ( var name
in options
) {
26 elem
.style
[ name
] = old
[ name
];
30 function forceLayout()
32 document
.body
.offsetTop
;
35 setTimeout(function() {
36 var elem
= document
.getElementById('i');
37 elem
.style
['display']='block';
39 var val
, props
= { position
: "absolute", visibility
: "hidden", display
:"block" };
41 val
= elem
.offsetHeight
;
43 swap( elem
, props
, getWH
);
46 elem
.style
['height']=2;
48 elem
.style
['height']=3;
50 elem
.style
['display']='none';
52 if (window
.testRunner
)
53 testRunner
.notifyDone();