dglazkov@chromium.org | c0e2d52 | 2009-04-23 22:33:25 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <title>Bug 25313 : Missing scrollbars in GMail</title> |
| 4 | <script> |
rniwa@webkit.org | 59a6acf | 2012-08-02 05:53:47 +0000 | [diff] [blame] | 5 | if (window.testRunner) |
| 6 | window.testRunner.dumpAsText(); |
dglazkov@chromium.org | c0e2d52 | 2009-04-23 22:33:25 +0000 | [diff] [blame] | 7 | |
| 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> |