LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Feb 2007 15:43:42 +0000 (15:43 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Feb 2007 15:43:42 +0000 (15:43 +0000)
        Reviewed by Mitz.

        - test for http://bugs.webkit.org/show_bug.cgi?id=10990
          REGRESSION: Pressing a pop-up's access key doesn't focus it
          <rdar://problem/4823138>

        * fast/forms/select-accesskey-expected.checksum: Added.
        * fast/forms/select-accesskey-expected.png: Added.
        * fast/forms/select-accesskey-expected.txt: Added.
        * fast/forms/select-accesskey.html: Added.

WebCore:

        Reviewed by Mitz.

        - fix for http://bugs.webkit.org/show_bug.cgi?id=10990
          REGRESSION: Pressing a pop-up's access key doesn't focus it
          <rdar://problem/4823138>

        Focus the select element too in accessKeyAction.

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::accessKeyAction):

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/select-accesskey-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/select-accesskey-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/select-accesskey-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select-accesskey.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp

index 744e1976fe0129bc5a0e1086a4d17b5ced61522b..9765badad3136f06549901d0d86377f110e3e0d8 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-19  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Mitz.
+        
+        - test for http://bugs.webkit.org/show_bug.cgi?id=10990
+          REGRESSION: Pressing a pop-up's access key doesn't focus it
+          <rdar://problem/4823138>
+
+        * fast/forms/select-accesskey-expected.checksum: Added.
+        * fast/forms/select-accesskey-expected.png: Added.
+        * fast/forms/select-accesskey-expected.txt: Added.
+        * fast/forms/select-accesskey.html: Added.
+
 2007-02-18  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Adele.
diff --git a/LayoutTests/fast/forms/select-accesskey-expected.checksum b/LayoutTests/fast/forms/select-accesskey-expected.checksum
new file mode 100644 (file)
index 0000000..ecaf6ad
--- /dev/null
@@ -0,0 +1 @@
+6a5e7544ce5908f9148276e1617d2516
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/select-accesskey-expected.png b/LayoutTests/fast/forms/select-accesskey-expected.png
new file mode 100644 (file)
index 0000000..0003a9b
Binary files /dev/null and b/LayoutTests/fast/forms/select-accesskey-expected.png differ
diff --git a/LayoutTests/fast/forms/select-accesskey-expected.txt b/LayoutTests/fast/forms/select-accesskey-expected.txt
new file mode 100644 (file)
index 0000000..8c357f3
--- /dev/null
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x22
+        RenderMenuList {SELECT} at (2,2) size 54x18 [bgcolor=#FFFFFF]
+          RenderBlock (anonymous) at (8,2) size 23x13
+            RenderText at (0,0) size 23x13
+              text run at (0,0) width 23: "blaa"
+        RenderText {#text} at (58,1) size 486x18
+          text run at (58,1) width 486: " Press ctrl-a to activate the select. Works as layout test too using eventSender."
+      RenderBlock {DIV} at (0,22) size 784x72
+        RenderBlock (anonymous) at (0,0) size 784x18
+          RenderText {#text} at (0,0) size 76x18
+            text run at (0,0) width 76: "focus event:"
+        RenderBlock {DIV} at (0,18) size 784x18
+          RenderText {#text} at (0,0) size 51x18
+            text run at (0,0) width 51: "PASS 1"
+        RenderBlock (anonymous) at (0,36) size 784x18
+          RenderText {#text} at (0,0) size 72x18
+            text run at (0,0) width 72: "click event:"
+        RenderBlock {DIV} at (0,54) size 784x18
+          RenderText {#text} at (0,0) size 51x18
+            text run at (0,0) width 51: "PASS 2"
diff --git a/LayoutTests/fast/forms/select-accesskey.html b/LayoutTests/fast/forms/select-accesskey.html
new file mode 100644 (file)
index 0000000..a4074cd
--- /dev/null
@@ -0,0 +1,22 @@
+<select accesskey='a' onfocus='document.getElementById("res1").innerHTML="PASS 1";' onclick='document.getElementById("res2").innerHTML="PASS 2";'>
+<option>blaa
+<option>jee
+</select>
+Press ctrl-a to activate the select. Works as layout test too using eventSender.
+
+<div>
+focus event:
+<div id=res1>
+FAIL
+</div>
+click event:
+<div id=res2>
+FAIL
+</div>
+<script>
+    if (window.eventSender) {
+        var mod = [];
+        mod[0]='ctrlKey';
+        eventSender.keyDown('a', mod);
+    }
+</script>
index 65dd097918493869343e9fe7093586863018fa76..dc88da32e17f009c560975175456a6355234c0ee 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-19  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Mitz.
+
+        - fix for http://bugs.webkit.org/show_bug.cgi?id=10990
+          REGRESSION: Pressing a pop-up's access key doesn't focus it
+          <rdar://problem/4823138>
+          
+        Focus the select element too in accessKeyAction.
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::accessKeyAction):
+
 2007-02-18  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Hyatt.
index 47a706e928415787d397ec61933fe6b205fb5644..39c7602d5eca24214a142f6ec2a23a5c2cc514eb 100644 (file)
@@ -939,7 +939,7 @@ int HTMLSelectElement::previousSelectableListIndex(int startIndex)
 
 void HTMLSelectElement::accessKeyAction(bool sendToAnyElement)
 {
-    // send the mouse button events iff the caller specified sendToAnyElement
+    focus();
     dispatchSimulatedClick(0, sendToAnyElement);
 }