Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html b/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a52d77c9256c0508c2de2308ad595eae141408f0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-iframe.html |
| @@ -0,0 +1,46 @@ |
| +<!DOCTYPE html> |
| +<style> |
| + body { |
| + height: 2000px; |
| + width: 2000px; |
| + } |
| + #frame { |
| + height: 500px; |
| + width: 200px; |
| + } |
| +</style> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<script> |
| + var scrollbarWidth = 15; |
| + var scrollbarHeight = 15; |
| + |
| + function frameViewport() { |
| + return frame.contentWindow.visualViewport; |
| + } |
| + |
| + async_test(function(t) { |
| + window.onload = t.step_func(function() { |
| + internals.setPageScaleFactor(2); |
| + |
| + // verify visualViewport dimensions on containing iframe. |
|
bokan
2016/06/22 18:29:08
Describe in the comment why the values are this wa
|
| + var frame = document.getElementById("frame"); |
| + frame.contentWindow.scrollTo(10, 15); |
| + assert_equals(frameViewport().clientWidth, 200 - scrollbarWidth); |
| + assert_equals(frameViewport().clientHeight, 500 - scrollbarHeight); |
| + assert_equals(frameViewport().scrollLeft, 0); |
| + assert_equals(frameViewport().scrollTop, 0); |
| + assert_equals(frameViewport().pageScale, 1); |
| + |
| + t.done(); |
| + }); |
| + }, 'Verify viewport dimensions for iframe.'); |
| +</script> |
| +<iframe id="frame" srcdoc=" |
| +<style> |
| + body { |
| + width: 2000px; |
| + height: 2000px; |
| + } |
| +</style> |
| +"></iframe> |