Index: third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html |
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html b/third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..52c71a2a31529967d518a7a5f2119448664e11b5 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/doc-write-to-iframe.html |
@@ -0,0 +1,34 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<style> |
+ html, body { height: 10000px; } |
+</style> |
+<h1>doc.write() to iframe should not cause scrolling of the parent</h1> |
+<script> |
+ var t = async_test('doc.write() to iframe should not cause ' + |
+ 'scrolling of the parent'); |
+ var isFirstTime = true; |
+ |
+ function doTest() { |
+ if (!isFirstTime) |
+ return; |
+ isFirstTime = false; |
+ |
+ requestAnimationFrame(t.step_func(function() { |
+ var iframe = document.getElementById('iframe'); |
+ var doc = iframe.contentWindow.document; |
+ doc.open(); |
+ doc.write("Hello"); |
+ doc.close(); |
+ |
+ assert_equals(scrollY, 0); |
+ t.done(); |
+ })); |
+ } |
+ |
+ if (!location.href.endsWith('#')) { |
+ location.href += '#'; |
+ } |
+</script> |
+<iframe id="iframe" onload="doTest()"></iframe> |