Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / scale-and-scroll-iframe-window.html
blobfe64a206896a6fd6b4cddb7ba0952b2ea4a88f44
1 <html>
2 <head>
3 <style>
4 ::-webkit-scrollbar {
5 width: 0px;
6 height: 0px;
8 </style>
9 <script>
10 window.enablePixelTesting = true;
12 function scroll() {
13 window.scrollTo(0, 100);
14 var frame = document.getElementById('frame');
15 frame.contentWindow.scrollTo(100,100);
17 shouldBe("frame.contentDocument.scrollingElement.scrollTop", "100");
18 shouldBe("frame.contentDocument.scrollingElement.scrollLeft", "100");
19 shouldBe("frame.contentWindow.scrollX", "100");
20 shouldBe("frame.contentWindow.scrollY", "100");
23 function scaleWithEventSender() {
24 var scaleFactor = 0.5;
25 if (window.internals) {
26 internals.setPageScaleFactorLimits(scaleFactor, scaleFactor);
27 internals.setPageScaleFactor(scaleFactor);
31 function test() {
32 scaleWithEventSender();
33 scroll();
35 </script>
36 <script src="../../resources/js-test.js"></script>
37 </head>
38 <body onload="test();" style="width: 4000px; height: 4000px">
39 <div id="console"></div>
40 <iframe id="frame" style="width:400px; height: 400px; position: absolute; top: 100px;"></iframe>
42 <script>
43 var frame = document.getElementById('frame');
44 var doc = frame.contentDocument.open();
45 doc.write("<div style='left:0; top:0; width:100px; height:100px; position:absolute; background:yellow;'></div>");
46 doc.write("<div style='left:100px; top:0; width:100px; height:100px; position:absolute; background:green;'></div>");
47 doc.write("<div style='left:200px; top:0; width:100px; height:100px; position:absolute; background:blue;'></div>");
48 doc.write("<div style='left:300px; top:0; width:100px; height:100px; position:absolute; background:green;'></div>");
49 doc.write("<div style='left:400px; top:0; width:100px; height:100px; position:absolute; background:blue;'></div>");
51 doc.write("<div style='left:0; top:100px; width:100px; height:100px; position:absolute; background: green;'></div>");
52 doc.write("<div style='left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>");
53 doc.write("<div style='left:200px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>");
54 doc.write("<div style='left:300px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>");
55 doc.write("<div style='left:400px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>");
56 doc.close();
57 frame.contentDocument.body.style.width = "2000px";
58 frame.contentDocument.body.style.height = "2000px";
59 </script>
60 </body>
61 </html>