blob: 179c23379cbb8f2a4c631e4a4e6f56293a39d9a6 [file] [log] [blame]
dglazkov@chromium.orgc0e2d522009-04-23 22:33:25 +00001<html>
2 <head>
3 <title>Bug 25313 : Missing scrollbars in GMail</title>
4 <script>
rniwa@webkit.org59a6acf2012-08-02 05:53:47 +00005 if (window.testRunner)
6 window.testRunner.dumpAsText();
dglazkov@chromium.orgc0e2d522009-04-23 22:33:25 +00007
8 function inject()
9 {
10 var content = '<html><head><style>' +
11 'html,body { margin: 0; overflow: hidden; height: 100%; width: 100% } ' +
12 'html.scroll { overflow-x: auto; overflow-y: scroll; } ' +
13 '</style><body><div id="offender" style="height: 900px;"></div></body></html>';
14 var injectee = document.getElementById("injectee");
15 var doc = injectee.contentDocument;
16 // inject an iframe
17 doc.open();
18 doc.write(content);
19 doc.close();
20 doc.getElementsByTagName("html")[0].className = "scroll";
21 // tickle ScrollView::updateScrollbars()
22 doc.getElementById("offender").scrollIntoView(false);
23 // trigger resize
24 injectee.style.width = "400px";
25 // measure to see if there is a scrollbar. Pass if there is.
26 document.getElementById("test").innerHTML = doc.body.offsetWidth < 400 ? "TEST PASSED" : "TEST FAILED";
27 }
28 </script>
29 </head>
30 <body>
31 <p>
32 Tests <kbd>ScrollView</kbd>'s behavior when only one of the scrollbars is made <kbd>ScrollbarAlwaysOn</kbd> dynamically.
33 The correct behavior is not to remove this scrollbar, which is what this test checks for.
34 </p>
35 <div id="test">
36 <iframe style="height:100%" id="injectee" onload="inject()">
37 </div>
38 </body>
39</html>