Patch by Joost de Valk <webkit@joostdevalk.nl>
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jun 2005 17:52:16 +0000 (17:52 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jun 2005 17:52:16 +0000 (17:52 +0000)
- http://bugzilla.opendarwin.org/show_bug.cgi?id=3732
Testcase for accesskeys that will run with run-webkit-tests.

        Reviewed by Darin.

        Test cases added:
        * layout-tests/fast/forms/access-key-expected.txt: Added.
        * layout-tests/fast/forms/access-key.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9522 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/fast/forms/access-key-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/access-key.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23

diff --git a/LayoutTests/fast/forms/access-key-expected.txt b/LayoutTests/fast/forms/access-key-expected.txt
new file mode 100644 (file)
index 0000000..3f47680
--- /dev/null
@@ -0,0 +1,20 @@
+This test checks to see if accesskey attributes works on the specified elements.
+
+If this test passes you should see 1 - 9 and a, b and c clicked or focussed.
+
+     
+
+   
+1 button clicked
+2 input type button focussed
+3 input type checkbox focussed
+4 input type text focussed
+5 input type submit clicked
+6 input type reset clicked
+7 link clicked
+8 input type associated to legend focussed
+9 input type associated to label around input focussed
+a input type associated to label closed before input focussed
+b area 1 clicked
+c area 2 clicked
+
diff --git a/LayoutTests/fast/forms/access-key.html b/LayoutTests/fast/forms/access-key.html
new file mode 100644 (file)
index 0000000..ecb399d
--- /dev/null
@@ -0,0 +1,55 @@
+<html>
+<head>
+<script>
+function log(message)
+{
+    var item = document.createElement("li");
+    item.appendChild(document.createTextNode(message));
+    document.getElementById("console").appendChild(item);
+}
+function pressKey(key)
+{
+    var event = document.createEvent("KeyboardEvent");
+    event.initKeyboardEvent("keydown", true, true, document.defaultView, key, 0, true, false, false, false, false);
+    document.dispatchEvent(event);
+}
+function test()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+       for(i = 1; i <= 9; i++) {
+               pressKey(i);
+       }
+       pressKey("a");
+       pressKey("b");
+       pressKey("c");
+       pressKey("d");
+}
+</script>
+</head>
+<body onload="test()">
+<p>This test checks to see if accesskey attributes works on the specified elements.</p>
+<p>If this test passes you should see 1 - 9 and a, b and c clicked or focussed.</p>
+<hr>
+<p>
+<button accesskey="1" onclick="log('1 button clicked')"></button>
+<input type="button" value="Click me!" accesskey="2" onfocus="log('2 input type button focussed')"/>
+<input type="checkbox" accesskey="3" onfocus="log('3 input type checkbox focussed')"/>
+<input type="text" accesskey="4" onfocus="log('4 input type text focussed')"/>
+<input type="submit" accesskey="5" onfocus="log('5 input type submit clicked')"/>
+<input type="reset" accesskey="6" onfocus="log('6 input type reset clicked')"/>
+<a href="#" accesskey="7" onclick="log('7 link clicked')"></a>
+<fieldset><legend accesskey="8"></legend><input type="text" onfocus="log('8 input type associated to legend focussed')"/></fieldset>
+<label accesskey="9" for="test1"><input type="text" id="test1" onfocus="log('9 input type associated to label around input focussed')"/></label>
+<label accesskey="a" for="test2"></label><input type="text" id="test2" onfocus="log('a input type associated to label closed before input focussed')"/>
+<map name="mymap">
+       <area accesskey="b" shape="rect" coords="0,0,5,10" alt="" href="#" onclick="log('b area 1 clicked')">
+       <area accesskey="c" shape="rect" coords="6,0,10,10" alt="" href="#" onclick="log('c area 2 clicked')">
+</map>
+<img usemap="#mymap" alt="pic" src="#" height="10" width="10"/>
+</p>
+<hr>
+<ol id="console"></ol>
+</body>
+</html>
index 2cf8d0681124449b42424e4204cf3b4fa8bcc80d..199e1d665be46b96247d72c656e24bcb7dc62255 100644 (file)
@@ -1,3 +1,16 @@
+2005-06-29  Geoffrey Garen  <ggaren@apple.com>
+
+       Patch by Joost de Valk <webkit@joostdevalk.nl>
+
+       - http://bugzilla.opendarwin.org/show_bug.cgi?id=3732
+       Testcase for accesskeys that will run with run-webkit-tests.
+
+        Reviewed by Darin.
+
+        Test cases added: 
+        * layout-tests/fast/forms/access-key-expected.txt: Added.
+        * layout-tests/fast/forms/access-key.html: Added.
+
 2005-06-29  Justin Garcia  <justin.garcia@apple.com>
 
         Patch by Anders Carlsson  <andersca@mac.com>