hclam@chromium.org | ecd7a05 | 2011-09-22 13:30:59 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <style> |
| 4 | ::-webkit-scrollbar { |
| 5 | width: 0px; |
| 6 | height: 0px; |
| 7 | } |
| 8 | </style> |
| 9 | <script> |
| 10 | window.enablePixelTesting = true; |
| 11 | |
| 12 | function scroll() { |
| 13 | window.scrollTo(0, 100); |
| 14 | var frame = document.getElementById('frame'); |
| 15 | frame.contentDocument.body.scrollTop = 100; |
| 16 | frame.contentDocument.body.scrollLeft = 100; |
| 17 | |
| 18 | shouldBe("frame.contentDocument.body.scrollTop", "100"); |
| 19 | shouldBe("frame.contentDocument.body.scrollLeft", "100"); |
| 20 | shouldBe("frame.contentWindow.scrollX", "100"); |
| 21 | shouldBe("frame.contentWindow.scrollY", "100"); |
| 22 | } |
| 23 | |
| 24 | function scaleWithEventSender() { |
| 25 | var scaleFactor = 0.5; |
| 26 | var scaleOffset = 0; |
fsamuel@chromium.org | dddd2d4 | 2012-01-05 18:16:46 +0000 | [diff] [blame] | 27 | if (window.internals) { |
morrita@google.com | 61860a4 | 2012-01-25 19:04:10 +0000 | [diff] [blame] | 28 | window.internals.settings.setPageScaleFactor(scaleFactor, scaleOffset, scaleOffset); |
hclam@chromium.org | ecd7a05 | 2011-09-22 13:30:59 +0000 | [diff] [blame] | 29 | } |
| 30 | } |
| 31 | |
| 32 | function test() { |
| 33 | scaleWithEventSender(); |
| 34 | scroll(); |
| 35 | } |
| 36 | </script> |
| 37 | <script src="../js/resources/js-test-pre.js"></script> |
| 38 | </head> |
| 39 | <body onload="test();" style="height: 2000px"> |
| 40 | <iframe id="frame" style="width:400px; height: 400px; position: absolute; top: 100px;"></iframe> |
| 41 | <div id="console"></div> |
| 42 | |
| 43 | <script> |
| 44 | var frame = document.getElementById('frame'); |
| 45 | var doc = frame.contentDocument.open(); |
| 46 | doc.write("<div style='left:0; top:0; width:100px; height:100px; position:absolute; background:yellow;'></div>"); |
| 47 | doc.write("<div style='left:100px; top:0; width:100px; height:100px; position:absolute; background:green;'></div>"); |
| 48 | doc.write("<div style='left:200px; top:0; width:100px; height:100px; position:absolute; background:blue;'></div>"); |
| 49 | doc.write("<div style='left:300px; top:0; width:100px; height:100px; position:absolute; background:green;'></div>"); |
| 50 | doc.write("<div style='left:400px; top:0; width:100px; height:100px; position:absolute; background:blue;'></div>"); |
| 51 | |
| 52 | doc.write("<div style='left:0; top:100px; width:100px; height:100px; position:absolute; background: green;'></div>"); |
| 53 | doc.write("<div style='left:100px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>"); |
| 54 | doc.write("<div style='left:200px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>"); |
| 55 | doc.write("<div style='left:300px; top:100px; width:100px; height:100px; position:absolute; background:blue;'></div>"); |
| 56 | doc.write("<div style='left:400px; top:100px; width:100px; height:100px; position:absolute; background:green;'></div>"); |
| 57 | doc.close(); |
| 58 | frame.contentDocument.body.style.width = "2000px"; |
| 59 | frame.contentDocument.body.style.height = "2000px"; |
| 60 | </script> |
| 61 | </body> |
| 62 | </html> |