Reviewed by Geoff.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Oct 2006 17:38:34 +0000 (17:38 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Oct 2006 17:38:34 +0000 (17:38 +0000)
        <rdar://problem/4775213> REGRESSION: Can't from tab from last link on the page to URL address field
        <rdar://problem/4783926> REGRESSION: Typing tab key enters no text

        The problem is that EventTargetNode::defaultEventHandler() calls event->setDefaultHandled() regardless
        of whether frame->view()->advanceFocus() actually changed the focus.

        Trivial fix is to preventDefault() only if advanceFocus() returns true.

        * No test is possible because DumpRenderTree sets the WebView preference to
        tab to links, and that preference cannot be changed dynamically after
        the webview is initialized. Also, the "tab from last link" is not testable
        because DumpRenderTree uses the WebView for the whole window, so tabs can't
        shift focus out of the WebView regardless.

        * dom/EventTargetNode.cpp:
        (WebCore::EventTargetNode::defaultEventHandler):

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

WebCore/ChangeLog
WebCore/dom/EventTargetNode.cpp

index 2508f1bce404dd2817482bb5c40eab282bd3b0d7..39327f65dce6cf5ba48a5fca32a1438cfe89ef94 100644 (file)
@@ -1,3 +1,24 @@
+2006-10-14  David Harrison  <harrison@apple.com>
+
+        Reviewed by Geoff.
+
+        <rdar://problem/4775213> REGRESSION: Can't from tab from last link on the page to URL address field
+        <rdar://problem/4783926> REGRESSION: Typing tab key enters no text
+
+        The problem is that EventTargetNode::defaultEventHandler() calls event->setDefaultHandled() regardless
+        of whether frame->view()->advanceFocus() actually changed the focus.
+
+        Trivial fix is to preventDefault() only if advanceFocus() returns true.
+
+        * No test is possible because DumpRenderTree sets the WebView preference to
+        tab to links, and that preference cannot be changed dynamically after
+        the webview is initialized. Also, the "tab from last link" is not testable
+        because DumpRenderTree uses the WebView for the whole window, so tabs can't
+        shift focus out of the WebView regardless.
+
+        * dom/EventTargetNode.cpp:
+        (WebCore::EventTargetNode::defaultEventHandler):
+
 2006-10-14  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Mitz.
index 6df0c9073c8b7420f2e62f1b52751463bfeb0537..d1cf7951f198d492f00111e5629e7e643bf68e4e 100644 (file)
@@ -528,9 +528,8 @@ void EventTargetNode::defaultEventHandler(Event* event)
         KeyboardEvent* keyEvent = static_cast<KeyboardEvent*>(event);
         if (keyEvent->keyIdentifier() == "U+000009") {
             Frame* frame = document()->frame();
-            if (frame && frame->view())
-                frame->view()->advanceFocus(!keyEvent->shiftKey());
-            event->setDefaultHandled();
+            if (frame && frame->view() && frame->view()->advanceFocus(!keyEvent->shiftKey()))
+                event->setDefaultHandled();
         }
     }
 }