| <html> |
| <head> |
| <title>Bug 25313 : Missing scrollbars in GMail</title> |
| <script> |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| |
| function inject() |
| { |
| var content = '<html><head><style>' + |
| 'html,body { margin: 0; overflow: hidden; height: 100%; width: 100% } ' + |
| 'html.scroll { overflow-x: auto; overflow-y: scroll; } ' + |
| '</style><body><div id="offender" style="height: 900px;"></div></body></html>'; |
| var injectee = document.getElementById("injectee"); |
| var doc = injectee.contentDocument; |
| // inject an iframe |
| doc.open(); |
| doc.write(content); |
| doc.close(); |
| doc.getElementsByTagName("html")[0].className = "scroll"; |
| // tickle ScrollView::updateScrollbars() |
| doc.getElementById("offender").scrollIntoView(false); |
| // trigger resize |
| injectee.style.width = "400px"; |
| // measure to see if there is a scrollbar. Pass if there is. |
| document.getElementById("test").innerHTML = doc.body.offsetWidth < 400 ? "TEST PASSED" : "TEST FAILED"; |
| } |
| </script> |
| </head> |
| <body> |
| <p> |
| Tests <kbd>ScrollView</kbd>'s behavior when only one of the scrollbars is made <kbd>ScrollbarAlwaysOn</kbd> dynamically. |
| The correct behavior is not to remove this scrollbar, which is what this test checks for. |
| </p> |
| <div id="test"> |
| <iframe style="height:100%" id="injectee" onload="inject()"> |
| </div> |
| </body> |
| </html> |