[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

adachan at apple.com adachan at apple.com
Wed Dec 22 18:47:06 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 80df449394b63032f06dacc2316124dfb727af3d
Author: adachan at apple.com <adachan at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 17 22:43:49 2010 +0000

            Reviewed by Anders Carlsson.
    
            Implement WKView::setInitialFocus().
            https://bugs.webkit.org/show_bug.cgi?id=51274
    
            * UIProcess/API/C/win/WKView.cpp:
            (WKViewSetInitialFocus):
            * UIProcess/API/C/win/WKView.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::setInitialFocus): Send message to the Web Process to set
            initial focus.
            * UIProcess/WebPageProxy.h:
            * UIProcess/win/WebView.cpp:
            (WebKit::WebView::setInitialFocus):
            * UIProcess/win/WebView.h:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::setInitialFocus): Set the focused node to null initially.  Then
            ask FocusController to set the initial focus based on the focus direction.
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in: Add a new message for SetInitialFocus.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 458fad1..a02f404 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-17  Ada Chan  <adachan at apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Implement WKView::setInitialFocus().
+        https://bugs.webkit.org/show_bug.cgi?id=51274
+
+        * UIProcess/API/C/win/WKView.cpp:
+        (WKViewSetInitialFocus):
+        * UIProcess/API/C/win/WKView.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setInitialFocus): Send message to the Web Process to set
+        initial focus.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::setInitialFocus):
+        * UIProcess/win/WebView.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setInitialFocus): Set the focused node to null initially.  Then
+        ask FocusController to set the initial focus based on the focus direction.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in: Add a new message for SetInitialFocus.
+
 2010-12-17  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/API/C/win/WKView.cpp b/WebKit2/UIProcess/API/C/win/WKView.cpp
index 290b755..612661e 100644
--- a/WebKit2/UIProcess/API/C/win/WKView.cpp
+++ b/WebKit2/UIProcess/API/C/win/WKView.cpp
@@ -65,3 +65,8 @@ void WKViewSetIsInWindow(WKViewRef viewRef, bool isInWindow)
 {
     toImpl(viewRef)->setIsInWindow(isInWindow);
 }
+
+void WKViewSetInitialFocus(WKViewRef viewRef, bool forward)
+{
+    toImpl(viewRef)->setInitialFocus(forward);
+}
diff --git a/WebKit2/UIProcess/API/C/win/WKView.h b/WebKit2/UIProcess/API/C/win/WKView.h
index b9791ec..f4226cd 100644
--- a/WebKit2/UIProcess/API/C/win/WKView.h
+++ b/WebKit2/UIProcess/API/C/win/WKView.h
@@ -44,6 +44,7 @@ WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);
 WK_EXPORT void WKViewSetParentWindow(WKViewRef view, HWND parentWindow);
 WK_EXPORT void WKViewWindowAncestryDidChange(WKViewRef view);
 WK_EXPORT void WKViewSetIsInWindow(WKViewRef view, bool isInWindow);
+WK_EXPORT void WKViewSetInitialFocus(WKViewRef view, bool forward);
 
 #ifdef __cplusplus
 }
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 54ecd25..77b03b9 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -433,6 +433,13 @@ void WebPageProxy::setFocused(bool isFocused)
     process()->send(Messages::WebPage::SetFocused(isFocused), m_pageID);
 }
 
+void WebPageProxy::setInitialFocus(bool forward)
+{
+    if (!isValid())
+        return;
+    process()->send(Messages::WebPage::SetInitialFocus(forward), m_pageID);
+}
+
 void WebPageProxy::setActive(bool active)
 {
     if (!isValid())
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 4514bee..c80004f 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -165,6 +165,7 @@ public:
     void setDrawsTransparentBackground(bool);
 
     void setFocused(bool);
+    void setInitialFocus(bool);
     void setActive(bool);
     void setIsInWindow(bool);
     void setWindowResizerSize(const WebCore::IntSize&);
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index 6c5c31d..384a1d4 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -628,6 +628,11 @@ void WebView::setOverrideCursor(HCURSOR overrideCursor)
     updateNativeCursor();
 }
 
+void WebView::setInitialFocus(bool forward)
+{
+    m_page->setInitialFocus(forward);
+}
+
 void WebView::setViewportArguments(const WebCore::ViewportArguments&)
 {
 }
diff --git a/WebKit2/UIProcess/win/WebView.h b/WebKit2/UIProcess/win/WebView.h
index ffe9e64..05a7e94 100644
--- a/WebKit2/UIProcess/win/WebView.h
+++ b/WebKit2/UIProcess/win/WebView.h
@@ -53,6 +53,7 @@ public:
     void windowAncestryDidChange();
     void setIsInWindow(bool);
     void setOverrideCursor(HCURSOR overrideCursor);
+    void setInitialFocus(bool forward);
 
     WebPageProxy* page() const { return m_page.get(); }
 
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 22754c1..74f6f54 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -827,6 +827,16 @@ void WebPage::setFocused(bool isFocused)
     m_page->focusController()->setFocused(isFocused);
 }
 
+void WebPage::setInitialFocus(bool forward)
+{
+    if (!m_page || !m_page->focusController())
+        return;
+
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    frame->document()->setFocusedNode(0);
+    m_page->focusController()->setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, 0);
+}
+
 void WebPage::setWindowResizerSize(const IntSize& windowResizerSize)
 {
     if (m_windowResizerSize == windowResizerSize)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index d921930..6c4d94b 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -292,6 +292,7 @@ private:
     void goToBackForwardItem(uint64_t);
     void setActive(bool);
     void setFocused(bool);
+    void setInitialFocus(bool);
     void setWindowResizerSize(const WebCore::IntSize&);
     void setIsInWindow(bool);
     void mouseEvent(const WebMouseEvent&);
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index e7cea12..6643948 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -23,6 +23,7 @@
 messages -> WebPage {
     SetActive(bool active)
     SetFocused(bool focused)
+    SetInitialFocus(bool forward)
     SetIsInWindow(bool isInWindow)
 
     SetDrawsBackground(bool drawsBackground)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list