OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
3 | 3 |
4 <style> | 4 <style> |
5 iframe { | 5 iframe { |
6 height: 100px; | 6 height: 100px; |
7 width: 100px; | 7 width: 100px; |
8 } | 8 } |
9 </style> | 9 </style> |
10 | 10 |
11 <script> | 11 <script> |
12 description('This test makes sure hiding and showing a scrollable iframe ' + | 12 description('This test makes sure hiding and showing a scrollable iframe ' + |
13 'correctly updates the set of non-fast scrollable rects.'); | 13 'correctly updates the set of non-fast scrollable rects.'); |
14 | 14 |
15 onload = function() { | 15 onload = function() { |
16 if (window.internals) { | 16 if (window.internals) { |
17 var frame = document.getElementById('scrollable-iframe'); | 17 var frame = document.getElementById('scrollable-iframe'); |
| 18 document.body.offsetTop; // Force layout |
18 shouldBe('internals.nonFastScrollableRects(document).length', '1'); | 19 shouldBe('internals.nonFastScrollableRects(document).length', '1'); |
19 frame.style.display = 'none'; | 20 frame.style.display = 'none'; |
20 document.body.offsetTop; // Force layout | 21 document.body.offsetTop; // Force layout |
21 shouldBe('internals.nonFastScrollableRects(document).length', '0'); | 22 shouldBe('internals.nonFastScrollableRects(document).length', '0'); |
22 frame.style.display = ''; | 23 frame.style.display = ''; |
23 document.body.offsetTop; // Force layout | 24 document.body.offsetTop; // Force layout |
24 shouldBe('internals.nonFastScrollableRects(document).length', '1'); | 25 shouldBe('internals.nonFastScrollableRects(document).length', '1'); |
25 } | 26 } |
26 } | 27 } |
27 </script> | 28 </script> |
28 | 29 |
29 <iframe id="scrollable-iframe" src="resources/subframe.html"></iframe> | 30 <iframe id="scrollable-iframe" src="resources/subframe.html"></iframe> |
OLD | NEW |