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

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Dec 22 14:50:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0b91744f90a419e8ddeaee312f7334f35ead4252
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 21 23:50:59 2010 +0000

    <rdar://problem/8423766> Cursor does not become "busy" when a page is
    loading with WebKit2
    
    Reviewed by Sam Weinig.
    
    * UIProcess/API/C/win/WKViewPrivate.cpp: Added.
    (WKViewSetOverrideCursor):
    Call the WebView's setOverrideCursor().
    
    * UIProcess/API/C/win/WKViewPrivate.h: Added.
    Declare WKViewSetOVerrideCursor().
    
    * UIProcess/win/WebView.cpp:
    (WebKit::WebView::WebView):
    Initialize new member vars to 0.
    (WebKit::WebView::updateNativeCursor):
    If there is an override cursor, and the last cursor set from the web
    process was the arrow cursor, use the override cursor. Otherwise, use
    the cursor from the web process.
    (WebKit::WebView::setCursor):
    Record the web process's cursor, and call updateNativeCursor().
    (WebKit::WebView::setOverrideCursor):
    Record the override cursor, and call updateNativeCursor().
    
    * UIProcess/win/WebView.h:
    Declare setOverrideCursor() and updateNativeCursor(). Add members to
    hold the last cursor set from the web process and the override cursor.
    
    * win/WebKit2.vcproj:
    Add new files to project.
    
    * win/WebKit2Generated.make:
    Copy WKViewPrivate.h with other headers.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 12dc802..44f88e8 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,39 @@
+2010-10-20  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        <rdar://problem/8423766> Cursor does not become "busy" when a page is
+        loading with WebKit2
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/C/win/WKViewPrivate.cpp: Added.
+        (WKViewSetOverrideCursor):
+        Call the WebView's setOverrideCursor().
+
+        * UIProcess/API/C/win/WKViewPrivate.h: Added.
+        Declare WKViewSetOVerrideCursor().
+
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::WebView):
+        Initialize new member vars to 0.
+        (WebKit::WebView::updateNativeCursor):
+        If there is an override cursor, and the last cursor set from the web
+        process was the arrow cursor, use the override cursor. Otherwise, use
+        the cursor from the web process.
+        (WebKit::WebView::setCursor):
+        Record the web process's cursor, and call updateNativeCursor().
+        (WebKit::WebView::setOverrideCursor):
+        Record the override cursor, and call updateNativeCursor().
+
+        * UIProcess/win/WebView.h:
+        Declare setOverrideCursor() and updateNativeCursor(). Add members to
+        hold the last cursor set from the web process and the override cursor.
+
+        * win/WebKit2.vcproj:
+        Add new files to project.
+
+        * win/WebKit2Generated.make:
+        Copy WKViewPrivate.h with other headers.
+
 2010-10-21  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKit2/UIProcess/API/C/win/WKViewPrivate.cpp b/WebKit2/UIProcess/API/C/win/WKViewPrivate.cpp
new file mode 100644
index 0000000..00c3595
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKViewPrivate.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKViewPrivate.h"
+
+#include "WKAPICast.h"
+#include "WebView.h"
+
+using namespace WebKit;
+
+void WKViewSetOverrideCursor(WKViewRef viewRef, HCURSOR overrideCursor)
+{
+    toImpl(viewRef)->setOverrideCursor(overrideCursor);
+}
diff --git a/WebKit2/UIProcess/API/C/win/WKViewPrivate.h b/WebKit2/UIProcess/API/C/win/WKViewPrivate.h
new file mode 100644
index 0000000..5f89fd4
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKViewPrivate.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKViewPrivate_h
+#define WKViewPrivate_h
+
+#include <WebKit2/WKBase.h>
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKViewSetOverrideCursor(WKViewRef viewRef, HCURSOR overrideCursor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKViewPrivate_h */
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index dbf8b2c..922a904 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -184,6 +184,8 @@ WebView::WebView(RECT rect, WebPageNamespace* pageNamespace, HWND parentWindow)
     , m_topLevelParentWindow(0)
     , m_toolTipWindow(0)
     , m_lastCursorSet(0)
+    , m_webCoreCursor(0)
+    , m_overrideCursor(0)
     , m_trackingMouseLeave(false)
     , m_isBeingDestroyed(false)
 {
@@ -567,14 +569,30 @@ void WebView::toolTipChanged(const String&, const String& newToolTip)
     ::SendMessage(m_toolTipWindow, TTM_ACTIVATE, !newToolTip.isEmpty(), 0);
 }
 
+void WebView::updateNativeCursor()
+{
+    // We only show the override cursor if the default (arrow) cursor is showing.
+    static HCURSOR arrowCursor = ::LoadCursor(0, IDC_ARROW);
+    if (m_overrideCursor && m_webCoreCursor == arrowCursor)
+        m_lastCursorSet = m_overrideCursor;
+    else
+        m_lastCursorSet = m_webCoreCursor;
+
+    ::SetCursor(m_lastCursorSet);
+}
+
 void WebView::setCursor(const WebCore::Cursor& cursor)
 {
-    HCURSOR platformCursor = cursor.platformCursor()->nativeCursor();
-    if (!platformCursor)
+    if (!cursor.platformCursor()->nativeCursor())
         return;
+    m_webCoreCursor = cursor.platformCursor()->nativeCursor();
+    updateNativeCursor();
+}
 
-    m_lastCursorSet = platformCursor;
-    ::SetCursor(platformCursor);
+void WebView::setOverrideCursor(HCURSOR overrideCursor)
+{
+    m_overrideCursor = overrideCursor;
+    updateNativeCursor();
 }
 
 void WebView::setViewportArguments(const WebCore::ViewportArguments&)
diff --git a/WebKit2/UIProcess/win/WebView.h b/WebKit2/UIProcess/win/WebView.h
index 89ac830..f426984 100644
--- a/WebKit2/UIProcess/win/WebView.h
+++ b/WebKit2/UIProcess/win/WebView.h
@@ -52,6 +52,7 @@ public:
     HWND window() const { return m_window; }
     void setParentWindow(HWND);
     void windowAncestryDidChange();
+    void setOverrideCursor(HCURSOR overrideCursor);
 
     WebPageProxy* page() const { return m_page.get(); }
 
@@ -88,6 +89,8 @@ private:
 
     void close();
 
+    void updateNativeCursor();
+
     // PageClient
     virtual void processDidExit();
     virtual void processDidRevive();
@@ -120,6 +123,8 @@ private:
     HWND m_toolTipWindow;
 
     HCURSOR m_lastCursorSet;
+    HCURSOR m_webCoreCursor;
+    HCURSOR m_overrideCursor;
 
     bool m_trackingMouseLeave;
     bool m_isBeingDestroyed;
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 13a26ea..f179ef6 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1877,6 +1877,14 @@
 							RelativePath="..\UIProcess\API\C\win\WKView.h"
 							>
 						</File>
+						<File
+							RelativePath="..\UIProcess\API\C\win\WKViewPrivate.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\UIProcess\API\C\win\WKViewPrivate.h"
+							>
+						</File>
 					</Filter>
 				</Filter>
 				<Filter
diff --git a/WebKit2/win/WebKit2Generated.make b/WebKit2/win/WebKit2Generated.make
index 0e5453a..10fa5d5 100644
--- a/WebKit2/win/WebKit2Generated.make
+++ b/WebKit2/win/WebKit2Generated.make
@@ -43,6 +43,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKPreferencesPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\win\WKContextPrivateWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\win\WKView.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\win\WKViewPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\cpp\WKRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundle.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleFrame.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list