Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=586662 |
michael@0 | 5 | --> |
michael@0 | 6 | |
michael@0 | 7 | <head> |
michael@0 | 8 | <title>Test for Bug 586662</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 12 | </head> |
michael@0 | 13 | |
michael@0 | 14 | <body> |
michael@0 | 15 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=586662">Mozilla Bug 586662</a> |
michael@0 | 16 | <p id="display"><textarea onkeypress="this.style.overflow = 'hidden'"></textarea></p> |
michael@0 | 17 | <div id="content" style="display: none"> |
michael@0 | 18 | </div> |
michael@0 | 19 | |
michael@0 | 20 | <pre id="test"> |
michael@0 | 21 | <script type="application/javascript"> |
michael@0 | 22 | |
michael@0 | 23 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 24 | SimpleTest.waitForFocus(function() { |
michael@0 | 25 | var t = document.querySelector("textarea"); |
michael@0 | 26 | t.focus(); |
michael@0 | 27 | synthesizeKey("a", {}); |
michael@0 | 28 | is(getComputedStyle(t, null).overflow, "hidden", "The event handler should be executed"); |
michael@0 | 29 | is(t.value, "a", "The key entry should result in a character being added to the field"); |
michael@0 | 30 | |
michael@0 | 31 | var win = window.open("file_bug586662.html", "_blank", |
michael@0 | 32 | "width=600,height=600,scrollbars=yes"); |
michael@0 | 33 | SimpleTest.waitForFocus(function() { |
michael@0 | 34 | // Make sure that focusing the textarea will cause the page to scroll |
michael@0 | 35 | var ed = win.document.getElementById("editor"); |
michael@0 | 36 | ed.focus(); |
michael@0 | 37 | setTimeout(function() { |
michael@0 | 38 | isnot(win.scrollY, 0, "Page is scrolled down"); |
michael@0 | 39 | // Scroll back up |
michael@0 | 40 | win.scrollTo(0, 0); |
michael@0 | 41 | setTimeout(function() { |
michael@0 | 42 | is(win.scrollY, 0, "Page is scrolled back up"); |
michael@0 | 43 | // Make sure that typing something into the textarea will cause the |
michael@0 | 44 | // page to scroll down |
michael@0 | 45 | synthesizeKey("a", {}, win); |
michael@0 | 46 | setTimeout(function() { |
michael@0 | 47 | isnot(win.scrollY, 0, "Page is scrolled down again"); |
michael@0 | 48 | |
michael@0 | 49 | win.close(); |
michael@0 | 50 | SimpleTest.finish(); |
michael@0 | 51 | }, 0); |
michael@0 | 52 | }, 0); |
michael@0 | 53 | }, 0); |
michael@0 | 54 | }, win); |
michael@0 | 55 | }); |
michael@0 | 56 | |
michael@0 | 57 | </script> |
michael@0 | 58 | </pre> |
michael@0 | 59 | </body> |
michael@0 | 60 | </html> |