4 https://bugzilla.mozilla.org/show_bug.cgi?id=586662
8 <title>Test for Bug
586662</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
15 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=586662">Mozilla Bug
586662</a>
16 <p id=
"display"><textarea onkeypress=
"this.style.overflow = 'hidden'"></textarea></p>
17 <div id=
"content" style=
"display: none">
21 <script type=
"application/javascript">
23 SimpleTest.waitForExplicitFinish();
24 SimpleTest.waitForFocus(function() {
25 var t = document.querySelector(
"textarea");
28 is(getComputedStyle(t, null).overflow,
"hidden",
"The event handler should be executed");
29 is(t.value,
"a",
"The key entry should result in a character being added to the field");
31 var win = window.open(
"file_bug586662.html",
"_blank",
32 "width=600,height=600,scrollbars=yes");
33 SimpleTest.waitForFocus(function() {
34 // Make sure that focusing the textarea will cause the page to scroll
35 var ed = win.document.getElementById(
"editor");
37 setTimeout(function() {
38 isnot(win.scrollY,
0,
"Page is scrolled down");
41 setTimeout(function() {
42 is(win.scrollY,
0,
"Page is scrolled back up");
43 // Make sure that typing something into the textarea will cause the
44 // page to scroll down
45 synthesizeKey(
"a", {}, win);
46 requestAnimationFrame(function() {
47 requestAnimationFrame(function() {
48 isnot(win.scrollY,
0,
"Page is scrolled down again");