diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /WebCore/manual-tests/arrow-key-events.html | |
parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebCore/manual-tests/arrow-key-events.html')
-rw-r--r-- | WebCore/manual-tests/arrow-key-events.html | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/WebCore/manual-tests/arrow-key-events.html b/WebCore/manual-tests/arrow-key-events.html deleted file mode 100644 index 81231f1..0000000 --- a/WebCore/manual-tests/arrow-key-events.html +++ /dev/null @@ -1,93 +0,0 @@ -<body> -<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=3387">bug 3387</a>: -Redundant keydown, keypress, keyup events sent for arrow keys.</p> - -<p>Try pressing arrow keys, PgUp/PgDown/Home/End, Esc, or function keys. -The test passes if the box below doesn't turn red.<p> - -<div id="result" style="width:100px; height:100px; background-color:blue;"></div> - -<script> - - var console_messages = document.createElement("ol"); - document.body.appendChild(console_messages); - - window.onkeydown = registerWindow; - window.onkeypress = registerWindow; - window.onkeyup = registerWindow; - - document.onkeydown = registerDocument; - document.onkeypress = registerDocument; - document.onkeyup = registerDocument; - - document.body.onkeydown = registerBody; - document.body.onkeypress = registerBody; - document.body.onkeyup = registerBody; - - document.documentElement.onkeydown = registerDocumentElement; - document.documentElement.onkeypress = registerDocumentElement; - document.documentElement.onkeyup = registerDocumentElement; - - var bodyKeyDownCount = 0; - var documentElementKeyDownCount = 0; - var windowKeyDownCount = 0; - var documentKeyDownCount = 0; - - function log(message) - { - var item = document.createElement("li"); - item.appendChild(document.createTextNode(message)); - item.style.fontSize = '8px'; - console_messages.appendChild(item); - } - - function registerBody(e) - { - if ((e.type == "keydown" && ++bodyKeyDownCount != 1) - || (e.type == "keyup" && --bodyKeyDownCount != 0)) - document.getElementById("result").style.backgroundColor = "red"; - - if (!e) - e = window.event; - log("body: " + e.type); - return true; - } - - function registerDocumentElement(e) - { - if ((e.type == "keydown" && ++documentElementKeyDownCount != 1) - || (e.type == "keyup" && --documentElementKeyDownCount != 0)) - document.getElementById("result").style.backgroundColor = "red"; - - if (!e) - e = window.event; - log(" documentElement: " + e.type); - return true; - } - - function registerDocument(e) - { - if ((e.type == "keydown" && ++documentKeyDownCount != 1) - || (e.type == "keyup" && --documentKeyDownCount != 0)) - document.getElementById("result").style.backgroundColor = "red"; - - if (!e) - e = window.event; - log(" document: " + e.type); - return true; - } - - function registerWindow(e) - { - if ((e.type == "keydown" && ++windowKeyDownCount != 1) - || (e.type == "keyup" && --windowKeyDownCount != 0)) - document.getElementById("result").style.backgroundColor = "red"; - - if (!e) - e = window.event; - log(" window: " + e.type); - return true; - } - -</script> -</body> |