| 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 shouldBe('internals.nonFastScrollableRects(document).length', '1'); | 18 shouldBe('internals.nonFastScrollableRects(document).length', '1'); |
| 19 frame.style.display = 'none'; | 19 frame.style.display = 'none'; |
| 20 document.body.offsetTop; // Force layout |
| 20 shouldBe('internals.nonFastScrollableRects(document).length', '0'); | 21 shouldBe('internals.nonFastScrollableRects(document).length', '0'); |
| 21 frame.style.display = ''; | 22 frame.style.display = ''; |
| 23 document.body.offsetTop; // Force layout |
| 22 shouldBe('internals.nonFastScrollableRects(document).length', '1'); | 24 shouldBe('internals.nonFastScrollableRects(document).length', '1'); |
| 23 } | 25 } |
| 24 } | 26 } |
| 25 </script> | 27 </script> |
| 26 | 28 |
| 27 <iframe id="scrollable-iframe" src="resources/subframe.html"></iframe> | 29 <iframe id="scrollable-iframe" src="resources/subframe.html"></iframe> |
| OLD | NEW |