Title: [86806] trunk/Source
Revision
86806
Author
[email protected]
Date
2011-05-18 17:10:38 -0700 (Wed, 18 May 2011)

Log Message

WK2: VoiceOver cannot move focus into a web area programmatically
https://bugs.webkit.org/show_bug.cgi?id=60661

Reviewed by Maciej Stachowiak.

Source/WebCore: 

Accessibility code relies on the ability to bring focus to the containing widget view.
In WK2, that message needs to be propagated to the UI process.

* page/ChromeClient.h:
(WebCore::ChromeClient::makeFirstResponder):
* page/mac/ChromeMac.mm:
(WebCore::Chrome::focusNSView):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::setFocus):

Source/WebKit2: 

Add a makeFirstResponder method that will bring focus to the widget view within the UI
process.

* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::makeFirstResponder):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::makeFirstResponder):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::makeFirstResponder):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (86805 => 86806)


--- trunk/Source/WebCore/ChangeLog	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebCore/ChangeLog	2011-05-19 00:10:38 UTC (rev 86806)
@@ -1,3 +1,20 @@
+2011-05-18  Chris Fleizach  <[email protected]>
+
+        Reviewed by Maciej Stachowiak.
+
+        WK2: VoiceOver cannot move focus into a web area programmatically
+        https://bugs.webkit.org/show_bug.cgi?id=60661
+
+        Accessibility code relies on the ability to bring focus to the containing widget view.
+        In WK2, that message needs to be propagated to the UI process.
+
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::makeFirstResponder):
+        * page/mac/ChromeMac.mm:
+        (WebCore::Chrome::focusNSView):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::setFocus):
+
 2011-05-18  Alok Priyadarshi  <[email protected]> and Adrienne Walker  <[email protected]>
 
         Reviewed by James Robinson.

Modified: trunk/Source/WebCore/page/ChromeClient.h (86805 => 86806)


--- trunk/Source/WebCore/page/ChromeClient.h	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebCore/page/ChromeClient.h	2011-05-19 00:10:38 UTC (rev 86806)
@@ -286,7 +286,8 @@
 #if PLATFORM(MAC)
         virtual NSResponder *firstResponder() { return 0; }
         virtual void makeFirstResponder(NSResponder *) { }
-
+        // Focuses on the containing view associated with this page.
+        virtual void makeFirstResponder() { }
         virtual void willPopUpMenu(NSMenu *) { }
 #endif
 

Modified: trunk/Source/WebCore/page/mac/ChromeMac.mm (86805 => 86806)


--- trunk/Source/WebCore/page/mac/ChromeMac.mm	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebCore/page/mac/ChromeMac.mm	2011-05-19 00:10:38 UTC (rev 86806)
@@ -30,6 +30,12 @@
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
+    // Handle the WK2 case where there is no view passed in.
+    if (!view) {
+        client()->makeFirstResponder();
+        return;
+    }
+    
     NSResponder *firstResponder = client()->firstResponder();
     if (firstResponder == view)
         return;

Modified: trunk/Source/WebCore/platform/mac/WidgetMac.mm (86805 => 86806)


--- trunk/Source/WebCore/platform/mac/WidgetMac.mm	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebCore/platform/mac/WidgetMac.mm	2011-05-19 00:10:38 UTC (rev 86806)
@@ -103,9 +103,6 @@
 // FIXME: Should move this to Chrome; bad layering that this knows about Frame.
 void Widget::setFocus(bool focused)
 {
-    if (!platformWidget())
-        return;
-
     if (!focused)
         return;
 
@@ -115,6 +112,7 @@
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
  
+    // Call this even when there is no platformWidget(). WK2 will focus on the widget in the UIProcess.
     NSView *view = [platformWidget() _webcore_effectiveFirstResponder];
     if (Page* page = frame->page())
         page->chrome()->focusNSView(view);

Modified: trunk/Source/WebKit2/ChangeLog (86805 => 86806)


--- trunk/Source/WebKit2/ChangeLog	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/ChangeLog	2011-05-19 00:10:38 UTC (rev 86806)
@@ -1,3 +1,25 @@
+2011-05-18  Chris Fleizach  <[email protected]>
+
+        Reviewed by Maciej Stachowiak.
+
+        WK2: VoiceOver cannot move focus into a web area programmatically
+        https://bugs.webkit.org/show_bug.cgi?id=60661
+
+        Add a makeFirstResponder method that will bring focus to the widget view within the UI
+        process.
+
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::makeFirstResponder):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::makeFirstResponder):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::makeFirstResponder):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
 2011-05-18  Brady Eidson  <[email protected]>
 
         Reviewed by Anders Carlsson.

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2011-05-19 00:10:38 UTC (rev 86806)
@@ -94,6 +94,8 @@
     virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&);    
     virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
 
+    virtual void makeFirstResponder();
+    
     virtual CGContextRef containingWindowGraphicsContext();
 
     virtual void didChangeScrollbarsForMainFrame() const;

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2011-05-19 00:10:38 UTC (rev 86806)
@@ -164,6 +164,11 @@
     return [m_wkView _isFocused];
 }
 
+void PageClientImpl::makeFirstResponder()
+{
+     [[m_wkView window] makeFirstResponder:m_wkView];
+}
+    
 bool PageClientImpl::isViewVisible()
 {
     if (![m_wkView window])

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2011-05-19 00:10:38 UTC (rev 86806)
@@ -117,6 +117,7 @@
     virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) = 0;
     virtual void updateTextInputState(bool updateSecureInputState) = 0;
     virtual void resetTextInputState() = 0;
+    virtual void makeFirstResponder() = 0;
 #endif
 #if PLATFORM(WIN)
     virtual void compositionSelectionChanged(bool) = 0;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-05-19 00:10:38 UTC (rev 86806)
@@ -379,6 +379,7 @@
     void registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elemenToken, const CoreIPC::DataReference& windowToken);
     bool writeSelectionToPasteboard(const String& pasteboardName, const Vector<String>& pasteboardTypes);
     bool readSelectionFromPasteboard(const String& pasteboardName);
+    void makeFirstResponder();
 #endif
 
     void viewScaleFactorDidChange(double);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2011-05-19 00:10:38 UTC (rev 86806)
@@ -227,6 +227,8 @@
     Speak(WTF::String string)
     StopSpeaking()
 
+    MakeFirstResponder()
+
     # Spotlight
     SearchWithSpotlight(WTF::String string)
 #endif

Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (86805 => 86806)


--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm	2011-05-19 00:10:38 UTC (rev 86806)
@@ -326,6 +326,11 @@
     m_pageClient->accessibilityWebProcessTokenReceived(data);
 }    
     
+void WebPageProxy::makeFirstResponder()
+{
+    m_pageClient->makeFirstResponder();
+}
+    
 void WebPageProxy::registerUIProcessAccessibilityTokens(const CoreIPC::DataReference& elementToken, const CoreIPC::DataReference& windowToken)
 {
     if (!isValid())

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (86805 => 86806)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-05-19 00:10:38 UTC (rev 86806)
@@ -129,6 +129,13 @@
     m_page->send(Messages::WebPageProxy::SetFocus(false));
 }
 
+#if PLATFORM(MAC)
+void WebChromeClient::makeFirstResponder()
+{
+    m_page->send(Messages::WebPageProxy::MakeFirstResponder());
+}    
+#endif    
+
 bool WebChromeClient::canTakeFocus(FocusDirection)
 {
     notImplemented();

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (86805 => 86806)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2011-05-18 23:53:12 UTC (rev 86805)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2011-05-19 00:10:38 UTC (rev 86806)
@@ -214,6 +214,10 @@
     virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*);
 #endif
 
+#if PLATFORM(MAC)
+    virtual void makeFirstResponder();
+#endif
+    
     virtual void dispatchViewportDataDidChange(const WebCore::ViewportArguments&) const;
 
     virtual void didCompleteRubberBandForMainFrame(const WebCore::IntSize&) const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to