| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> | 4 <style> |
| 5 iframe { | 5 iframe { |
| 6 width: 200px; | 6 width: 200px; |
| 7 height: 300px; | 7 height: 300px; |
| 8 } | 8 } |
| 9 </style> | 9 </style> |
| 10 | 10 |
| 11 <h4>This test checks that requesting the viewport size in an iframe causes any p
ending layout to occur.</h4> | 11 <h4>This test checks that requesting the viewport size in an iframe causes any p
ending layout to occur.</h4> |
| 12 <iframe srcdoc="<!DOCTYPE html><style>html{height:100%}</style>"></iframe> | 12 <iframe srcdoc="<!DOCTYPE html><style>html{height:100%}</style>"></iframe> |
| 13 <script> | 13 <script> |
| 14 async_test(function(t) { | 14 async_test(function(t) { |
| 15 window.onload = t.step_func(function() { | 15 window.onload = t.step_func(function() { |
| 16 assert_equals(frames[0].window.visualViewport.clientWidth, 200, | 16 assert_equals(frames[0].window.view.width, 200, |
| 17 "Reading width of iframe viewport should match iframe width."); | 17 "Reading width of iframe viewport should match iframe width."); |
| 18 assert_equals(frames[0].window.visualViewport.clientHeight, 300, | 18 assert_equals(frames[0].window.view.height, 300, |
| 19 "Reading height of iframe viewport should match iframe height."); | 19 "Reading height of iframe viewport should match iframe height."); |
| 20 | 20 |
| 21 // Add overflow so scrollbars appear. | 21 // Add overflow so scrollbars appear. |
| 22 frames[0].window.document.body.style.width = "2000px"; | 22 frames[0].window.document.body.style.width = "2000px"; |
| 23 frames[0].window.document.body.style.height = "2000px"; | 23 frames[0].window.document.body.style.height = "2000px"; |
| 24 | 24 |
| 25 var viewportWidth = frames[0].window.visualViewport.clientWidth; | 25 var viewportWidth = frames[0].window.view.width; |
| 26 var viewportHeight = frames[0].window.visualViewport.clientHeight; | 26 var viewportHeight = frames[0].window.view.height; |
| 27 | 27 |
| 28 assert_equals(viewportWidth, frames[0].window.document.documentElement.cli
entWidth, | 28 assert_equals(viewportWidth, frames[0].window.document.documentElement.cli
entWidth, |
| 29 "Reading width of iframe viewport should cause a layout and exclude th
e new scrollbar."); | 29 "Reading width of iframe viewport should cause a layout and exclude th
e new scrollbar."); |
| 30 assert_equals(viewportHeight, frames[0].window.document.documentElement.cl
ientHeight, | 30 assert_equals(viewportHeight, frames[0].window.document.documentElement.cl
ientHeight, |
| 31 "Reading height of iframe viewport should cause a layout and exclude t
he new scrollbar."); | 31 "Reading height of iframe viewport should cause a layout and exclude t
he new scrollbar."); |
| 32 t.done(); | 32 t.done(); |
| 33 }); | 33 }); |
| 34 }); | 34 }); |
| 35 </script> | 35 </script> |
| OLD | NEW |