WebCore:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2007 22:21:55 +0000 (22:21 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2007 22:21:55 +0000 (22:21 +0000)
        Reviewed by Darin.

        WebCore part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content

        * page/FocusController.h: Added FocusDirection argument.
        * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus):
          Use FocusDirection argument instead of key modifiers to send direction to advanceFocus.
        * WebCore.exp: Updated symbol.

WebKit:

        Reviewed by Darin.

        WebKit part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content

        * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Pass in the FocusDirection.

win:

        Reviewed by Darin.

        WebKit/win part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content

        * WebView.cpp: Added setInitialFocus so the application can specify that its handing off focus to WebKit
          and so that it can specify the focus direction.
        * WebView.h: ditto.
        * Interfaces/IWebViewPrivate.idl: ditto.

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

WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/page/FocusController.cpp
WebCore/page/FocusController.h
WebKit/ChangeLog
WebKit/WebView/WebHTMLView.mm
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebViewPrivate.idl
WebKit/win/WebView.cpp
WebKit/win/WebView.h

index c8ad4cfb5947a8c72ac39e50c7e6f8b8af3d30d2..09f8713e829603985a7a2d6324be4de5424d884f 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-04  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        WebCore part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * page/FocusController.h: Added FocusDirection argument.
+        * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus):
+          Use FocusDirection argument instead of key modifiers to send direction to advanceFocus.
+        * WebCore.exp: Updated symbol.
+
 2007-10-04  Kevin Decker  <kdecker@apple.com>
 
         Reviewed by John.
index 1bc6b07aea7afe157d82cb094c4feda97f0ac1f1..2d42ccdec96421c26134cec9aff32da70078b604 100644 (file)
@@ -288,7 +288,7 @@ __ZN7WebCore15BackForwardListC1EPNS_4PageE
 __ZN7WebCore15BackForwardListD1Ev
 __ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv
 __ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
-__ZN7WebCore15FocusController15setInitialFocusEPNS_13KeyboardEventE
+__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
 __ZN7WebCore15FocusController18focusedOrMainFrameEv
 __ZN7WebCore15StringTruncator13rightTruncateERKNS_6StringEfRKNS_4FontEb
 __ZN7WebCore15StringTruncator14centerTruncateERKNS_6StringEfRKNS_4FontEb
index 4db5c2e71dd3244d4d908db6c7d1c7b7fae663d0..6916e7d87d17f02154da7acfbb3b7222fe0a776d 100644 (file)
@@ -110,9 +110,9 @@ static Node* deepFocusableNode(FocusDirection direction, Node* node, KeyboardEve
     return node;
 }
 
-bool FocusController::setInitialFocus(KeyboardEvent* event)
+bool FocusController::setInitialFocus(FocusDirection direction, KeyboardEvent* event)
 {
-    return advanceFocus((event && event->shiftKey()) ? FocusDirectionBackward : FocusDirectionForward, event, true);
+    return advanceFocus(direction, event, true);
 }
 
 bool FocusController::advanceFocus(KeyboardEvent* event)
index bde0045da43699aa1747f07bd9bc4eae322fcef9..dbd06f57c5a26050af1d5d0edf5fb540a7a0144b 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
         Frame* focusedFrame() const { return m_focusedFrame.get(); }
         Frame* focusedOrMainFrame();
 
-        bool setInitialFocus(KeyboardEvent*);
+        bool setInitialFocus(FocusDirection, KeyboardEvent*);
         bool advanceFocus(KeyboardEvent*);
         bool advanceFocus(FocusDirection, KeyboardEvent*, bool initialFocus = false);
         
index 1ca3c4e566ab8e2a0b71a8daf608d2c908f141aa..5e8c427e696391f4e5a3d7d7494a6ed967499aaf 100644 (file)
@@ -1,3 +1,11 @@
+2007-10-04  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        WebKit part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Pass in the FocusDirection.
+
 2007-10-04  Darin Adler  <darin@apple.com>
 
         * WebView/WebHTMLView.mm: (-[WebHTMLView _updateActiveState]):
index 8fddf6c0353316698cee0f06bc4bad07bf7b7912..41d24aa432438ef5a45ae7f15716cf09432d9fd2 100644 (file)
@@ -3265,7 +3265,8 @@ noPromisedData:
     page->focusController()->setFocusedFrame(frame);
     if (Document* document = frame->document())
         document->setFocusedNode(0);
-    page->focusController()->setInitialFocus(frame->eventHandler()->currentKeyboardEvent().get());
+    page->focusController()->setInitialFocus(direction == NSSelectingNext ? FocusDirectionForward : FocusDirectionBackward,
+                                             frame->eventHandler()->currentKeyboardEvent().get());
     return YES;
 }
 
index 9399bf6d5996f72163519d807237f506344422b8..163a825395c273c389a49f57329a40994e9dbeda 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-04  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        WebKit/win part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content
+
+        * WebView.cpp: Added setInitialFocus so the application can specify that its handing off focus to WebKit
+          and so that it can specify the focus direction.
+        * WebView.h: ditto.
+        * Interfaces/IWebViewPrivate.idl: ditto.
+
 2007-10-03  Ada Chan  <adachan@apple.com>
 
         <rdar://problem/5521230> Implement IWebIconDatabase::iconURLForURL in WebKit for windows
index 097abe0d8a473504d031dc7c94c8f05b092a905c..9533b7327c1d9a6c4608f89ad7b818841a0fd5de 100644 (file)
@@ -104,6 +104,7 @@ interface IWebViewPrivate : IUnknown
     HRESULT canHandleRequest([in] IWebURLRequest* request, [out, retval] BOOL* result);
 
     HRESULT clearFocusNode();
+    HRESULT setInitialFocus([in] BOOL forward);
 
     HRESULT setTabKeyCyclesThroughElements([in] BOOL cycles);
     HRESULT tabKeyCyclesThroughElements([out, retval] BOOL* result);
index 82ff640fbdfa30b7c99e3d74fda116b7d06fc5bb..46daddb8212b29e39a2cbc4679670a78e8f6eea6 100644 (file)
@@ -3674,6 +3674,17 @@ HRESULT STDMETHODCALLTYPE WebView::clearFocusNode()
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebView::setInitialFocus(
+    /* [in] */ BOOL forward)
+{
+    if (m_page && m_page->focusController()) {
+        Frame* frame = m_page->focusController()->focusedOrMainFrame();
+        frame->document()->setFocusedNode(0);
+        m_page->focusController()->setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
+    }
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebView::setTabKeyCyclesThroughElements( 
     /* [in] */ BOOL cycles)
 {
index 3a580cabc0981d394811b06525b3c1aaec604732..33d79db3d5be1659d7c0c4fd4e6447cca2bf2171 100644 (file)
@@ -595,6 +595,9 @@ public:
 
     virtual HRESULT STDMETHODCALLTYPE clearFocusNode();
 
+    virtual HRESULT STDMETHODCALLTYPE setInitialFocus(
+        /* [in] */ BOOL forward);
+    
     virtual HRESULT STDMETHODCALLTYPE setTabKeyCyclesThroughElements( 
         /* [in] */ BOOL cycles);