Ensure that the correct initial focusable area is focused when tabbing
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jan 2011 17:02:05 +0000 (17:02 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jan 2011 17:02:05 +0000 (17:02 +0000)
and shift-tabbing into the WKView.

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]): Use the keyViewSelectionDirection to set
the initial focus.

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

WebKit2/ChangeLog
WebKit2/UIProcess/API/mac/WKView.mm

index ebf77fde0093ce71a674da8ce76b910acfecf62a..c87f2c340e5627724fc8dce5099a01cb7c0253a5 100644 (file)
@@ -1,3 +1,14 @@
+2011-01-03  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Ensure that the correct initial focusable area is focused when tabbing
+        and shift-tabbing into the WKView.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView becomeFirstResponder]): Use the keyViewSelectionDirection to set
+        the initial focus.
+
 2011-01-02  Dan Bernstein  <mitz@apple.com>
 
         Rubber-stamped by Simon Fraser.
@@ -14,7 +25,7 @@
         WebKit 2 does not build on 64bits with a recent GCC
         https://bugs.webkit.org/show_bug.cgi?id=51754
 
-        Change the argument coding for DatabaseDetails to use explicitely the 64 bits type.
+        Change the argument coding for DatabaseDetails to use explicitly the 64 bits type.
 
         * Shared/OriginAndDatabases.h:
         * Shared/WebCoreArgumentCoders.h:
index b09951d503f04181c4010e8be2293c9bed0c2a66..02b7c67ada0a588f323abe3384cd7beb5f7d7481 100644 (file)
@@ -208,7 +208,13 @@ typedef HashMap<String, ValidationVector> ValidationMap;
 
 - (BOOL)becomeFirstResponder
 {
+    NSSelectionDirection direction = [[self window] keyViewSelectionDirection];
+
     _data->_page->setFocused(true);
+
+    if (direction != NSDirectSelection)
+        _data->_page->setInitialFocus(direction == NSSelectingNext);
+
     return YES;
 }