| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <title>Bug 25313 : Missing scrollbars in GMail</title> | 3 <title>Bug 25313 : Missing scrollbars in GMail</title> |
| 4 <script> | 4 <script> |
| 5 if (window.testRunner) | 5 if (window.testRunner) { |
| 6 window.testRunner.dumpAsText(); | 6 window.testRunner.dumpAsText(); |
| 7 window.testRunner.waitUntilDone(); |
| 8 } |
| 7 | 9 |
| 8 function inject() | 10 function inject() |
| 9 { | 11 { |
| 10 var content = '<html><head><style>' + | 12 var content = '<html><head><style>' + |
| 11 'html,body { margin: 0; overflow: hidden; height: 100%; widt
h: 100% } ' + | 13 'html,body { margin: 0; overflow: hidden; height: 100%; widt
h: 100% } ' + |
| 12 'html.scroll { overflow-x: auto; overflow-y: scroll; } ' + | 14 'html.scroll { overflow-x: auto; overflow-y: scroll; } ' + |
| 13 '</style><body><div id="offender" style="height: 900px;"></d
iv></body></html>'; | 15 '</style><body><div id="offender" style="height: 900px;"></d
iv></body></html>'; |
| 14 var injectee = document.getElementById("injectee"); | 16 var injectee = document.getElementById("injectee"); |
| 15 var doc = injectee.contentDocument; | 17 var doc = injectee.contentDocument; |
| 16 // inject an iframe | 18 // inject an iframe |
| 17 doc.open(); | 19 doc.open(); |
| 18 doc.write(content); | 20 doc.write(content); |
| 19 doc.close(); | 21 doc.close(); |
| 20 doc.getElementsByTagName("html")[0].className = "scroll"; | 22 doc.getElementsByTagName("html")[0].className = "scroll"; |
| 21 // tickle FrameView::updateScrollbars() | 23 // tickle FrameView::updateScrollbars() |
| 22 doc.getElementById("offender").scrollIntoView(false); | 24 doc.getElementById("offender").scrollIntoView(false); |
| 23 // trigger resize | 25 // trigger resize |
| 24 injectee.style.width = "400px"; | 26 injectee.style.width = "400px"; |
| 25 // measure to see if there is a scrollbar. Pass if there is. | 27 // 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"; | 28 document.getElementById("test").innerHTML = doc.body.offsetWidth
< 400 ? "TEST PASSED" : "TEST FAILED"; |
| 29 if (window.testRunner) { |
| 30 window.testRunner.notifyDone(); |
| 31 } |
| 27 } | 32 } |
| 28 </script> | 33 </script> |
| 29 </head> | 34 </head> |
| 30 <body> | 35 <body> |
| 31 <p> | 36 <p> |
| 32 Tests <kbd>FrameView</kbd>'s behavior when only one of the scrollbar
s is made <kbd>ScrollbarAlwaysOn</kbd> dynamically. | 37 Tests <kbd>FrameView</kbd>'s behavior when only one of the scrollbar
s is made <kbd>ScrollbarAlwaysOn</kbd> dynamically. |
| 33 The correct behavior is not to remove this scrollbar, which is what
this test checks for. | 38 The correct behavior is not to remove this scrollbar, which is what
this test checks for. |
| 34 </p> | 39 </p> |
| 35 <div id="test"> | 40 <div id="test"> |
| 36 <iframe style="height:100%" id="injectee" onload="inject()"> | 41 <iframe style="height:100%" id="injectee" onload="inject()"> |
| 37 </div> | 42 </div> |
| 38 </body> | 43 </body> |
| 39 </html> | 44 </html> |
| OLD | NEW |