| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>This tests frame flattening when async frame scrolling is enabled</title> |
| <meta charset="utf-8"/> |
| <script src="../../../../../resources/testharness.js"></script> |
| <script src="../../../../../resources/testharnessreport.js"></script> |
| <script> |
| if (window.internals) { |
| window.internals.settings.setFrameFlattening("FullyEnabled"); |
| window.internals.settings.setAsyncFrameScrollingEnabled(true); |
| } |
| |
| setup({explicit_done: true}); |
| function isUnflatten(id) { |
| var iframe = document.getElementById(id); |
| var iframeBox = iframe.getBoundingClientRect(); |
| var innerDivBox = iframe.contentDocument.body.firstElementChild.getBoundingClientRect(); |
| return iframeBox.width < innerDivBox.width && iframeBox.height < innerDivBox.height; |
| } |
| function start() { |
| test(function() { assert_true(isUnflatten("iframe_simple")); }, "simple iframe"); |
| test(function() { assert_true(isUnflatten("iframe_fullscreen")); }, "fullscreen iframe"); |
| done(); |
| } |
| </script> |
| </head> |
| <body onload="start()"> |
| <iframe id="iframe_simple" style="background: blue; width: 50px; height: 50px;" scrolling="yes" srcdoc="<div style='width: 1000px; height: 1000px;'></div>"></iframe> |
| <iframe id="iframe_fullscreen" style="background: cyan; position: absolute; width: 100vw; height: 100vh;" scrolling="yes" srcdoc="<div style='width: 1000px; height: 1000px;'></div>"></iframe> |
| </body> |
| </html> |