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
+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.
__ZN7WebCore15BackForwardListD1Ev
__ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv
__ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
-__ZN7WebCore15FocusController15setInitialFocusEPNS_13KeyboardEventE
+__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
__ZN7WebCore15FocusController18focusedOrMainFrameEv
__ZN7WebCore15StringTruncator13rightTruncateERKNS_6StringEfRKNS_4FontEb
__ZN7WebCore15StringTruncator14centerTruncateERKNS_6StringEfRKNS_4FontEb
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)
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);
+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]):
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;
}
+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
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);
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)
{
virtual HRESULT STDMETHODCALLTYPE clearFocusNode();
+ virtual HRESULT STDMETHODCALLTYPE setInitialFocus(
+ /* [in] */ BOOL forward);
+
virtual HRESULT STDMETHODCALLTYPE setTabKeyCyclesThroughElements(
/* [in] */ BOOL cycles);