[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 12:01:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 10cb2f5b85d266ab13a76d5a599f2c7afdf6ac2c
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 12 22:03:00 2010 +0000

    WebKitTestRunner needs to run tests without using native controls
    https://bugs.webkit.org/show_bug.cgi?id=43772
    
    Reviewed by Sam Weinig.
    
    WebKit2:
    
    * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
    (WebProcessMessage::):
    Add a new message.
    
    * UIProcess/API/C/win/WKContextPrivateWin.h: Added.
    Declare WKContextSetShouldPaintNativeControls().
    
    * UIProcess/API/C/win/WKContextWin.cpp: Added.
    (WKContextSetShouldPaintNativeControls):
    Call the WebContext's setShouldPaintNativeControls().
    
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::WebContext):
    Initialize m_shouldPaintNativeControls.
    (WebKit::WebContext::ensureWebProcess):
    If we created a web process, call platformSetUpWebProcess().
    
    * UIProcess/WebContext.h:
    Declare new functions and a member to store whether we should paint
    native controls.
    
    * UIProcess/mac/WebContextMac.mm:
    (WebKit::WebContext::platformSetUpWebProcess):
    Stubbed.
    
    * UIProcess/win/WebContextWin.cpp:
    (WebKit::WebContext::setShouldPaintNativeControls):
    Set m_shouldPaintNativeControls. If we have a valid web process, send a
    SetShouldPaintNativeControls message.
    (WebKit::WebContext::platformSetUpWebProcess):
    Send a SetShouldPaintNativeControls message.
    
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::didReceiveMessage):
    If this is a SetShouldPaintNativeControls message, decode the argument,
    and call Settings::setShouldPaintNativeControls().
    
    * win/WebKit2.vcproj:
    Add WKContextPrivateWin.h and WKContextWin.cpp to project.
    
    * win/WebKit2Generated.make:
    Copy WKContextPrivateWin.h.
    
    WebKitTools:
    
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::initialize):
    Call platformInitializeContext().
    
    * WebKitTestRunner/TestController.h:
    Declare platformInitializeContext().
    
    * WebKitTestRunner/mac/TestControllerMac.mm:
    (WTR::TestController::platformInitializeContext):
    Stubbed.
    
    * WebKitTestRunner/win/TestControllerWin.cpp:
    (WTR::TestController::platformInitializeContext):
    Call WKContextSetShouldPaintNativeControls() to disable native control
    drawing.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2014bf4..f0d6dde 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,53 @@
+2010-08-12  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        WebKitTestRunner needs to run tests without using native controls
+        https://bugs.webkit.org/show_bug.cgi?id=43772
+
+        Reviewed by Sam Weinig.
+
+        * Shared/CoreIPCSupport/WebProcessMessageKinds.h:
+        (WebProcessMessage::):
+        Add a new message.
+
+        * UIProcess/API/C/win/WKContextPrivateWin.h: Added.
+        Declare WKContextSetShouldPaintNativeControls().
+
+        * UIProcess/API/C/win/WKContextWin.cpp: Added.
+        (WKContextSetShouldPaintNativeControls):
+        Call the WebContext's setShouldPaintNativeControls().
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        Initialize m_shouldPaintNativeControls.
+        (WebKit::WebContext::ensureWebProcess):
+        If we created a web process, call platformSetUpWebProcess().
+
+        * UIProcess/WebContext.h:
+        Declare new functions and a member to store whether we should paint
+        native controls.
+
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformSetUpWebProcess):
+        Stubbed.
+
+        * UIProcess/win/WebContextWin.cpp:
+        (WebKit::WebContext::setShouldPaintNativeControls):
+        Set m_shouldPaintNativeControls. If we have a valid web process, send a
+        SetShouldPaintNativeControls message.
+        (WebKit::WebContext::platformSetUpWebProcess):
+        Send a SetShouldPaintNativeControls message.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage):
+        If this is a SetShouldPaintNativeControls message, decode the argument,
+        and call Settings::setShouldPaintNativeControls().
+
+        * win/WebKit2.vcproj:
+        Add WKContextPrivateWin.h and WKContextWin.cpp to project.
+
+        * win/WebKit2Generated.make:
+        Copy WKContextPrivateWin.h.
+
 2010-08-11  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Gavin Barraclough.
diff --git a/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h b/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
index 4919c72..d50ccfe 100644
--- a/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
+++ b/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
@@ -43,7 +43,10 @@ enum Kind {
     Create,
     RegisterURLSchemeAsEmptyDocument,
 #if PLATFORM(MAC)
-    SetupAcceleratedCompositingPort
+    SetupAcceleratedCompositingPort,
+#endif
+#if PLATFORM(WIN)
+    SetShouldPaintNativeControls,
 #endif
 };
 
diff --git a/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h b/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h
new file mode 100644
index 0000000..c8a9c34
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKContextPrivateWin.h
@@ -0,0 +1,47 @@
+/*
+ * 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 WKContextPrivateWin_h
+#define WKContextPrivateWin_h
+
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKContext.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Defaults to true.
+WK_EXPORT void WKContextSetShouldPaintNativeControls(WKContextRef, bool);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKContextPrivateWin_h */
diff --git a/WebKit2/UIProcess/API/C/win/WKContextWin.cpp b/WebKit2/UIProcess/API/C/win/WKContextWin.cpp
new file mode 100644
index 0000000..65f0611
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/win/WKContextWin.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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 "WKContext.h"
+#include "WKContextPrivateWin.h"
+
+#include "WKAPICast.h"
+#include "WebContext.h"
+
+using namespace WebKit;
+
+void WKContextSetShouldPaintNativeControls(WKContextRef contextRef, bool b)
+{
+    toWK(contextRef)->setShouldPaintNativeControls(b);
+}
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 2d34026..a007041 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -196,6 +196,9 @@ WebContext::WebContext(ProcessModel processModel, const WTF::String& injectedBun
     : m_processModel(processModel)
     , m_injectedBundlePath(injectedBundlePath)
     , m_visitedLinkProvider(this)
+#if PLATFORM(WIN)
+    , m_shouldPaintNativeControls(true)
+#endif
 {
     RunLoop::initializeMainRunLoop();
 
@@ -243,6 +246,8 @@ void WebContext::ensureWebProcess()
 
     for (HashSet<String>::iterator it = m_schemesToRegisterAsEmptyDocument.begin(), end = m_schemesToRegisterAsEmptyDocument.end(); it != end; ++it)
         m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(*it));
+
+    platformSetUpWebProcess();
 }
 
 void WebContext::processDidFinishLaunching(WebProcessProxy* process)
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 429dd1c..71a00ab 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -106,6 +106,10 @@ public:
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+#if PLATFORM(WIN)
+    void setShouldPaintNativeControls(bool);
+#endif
+
 private:
     WebContext(ProcessModel, const WTF::String& injectedBundlePath);
 
@@ -113,6 +117,7 @@ private:
 
     void ensureWebProcess();
     bool hasValidProcess() const { return m_process && m_process->isValid(); }
+    void platformSetUpWebProcess();
 
     ProcessModel m_processModel;
     
@@ -131,6 +136,10 @@ private:
     VisitedLinkProvider m_visitedLinkProvider;
         
     HashSet<WTF::String> m_schemesToRegisterAsEmptyDocument;
+
+#if PLATFORM(WIN)
+    bool m_shouldPaintNativeControls;
+#endif
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/mac/WebContextMac.mm b/WebKit2/UIProcess/mac/WebContextMac.mm
index 3c5bdd6..b0b7c43 100644
--- a/WebKit2/UIProcess/mac/WebContextMac.mm
+++ b/WebKit2/UIProcess/mac/WebContextMac.mm
@@ -59,5 +59,9 @@ String WebContext::applicationCacheDirectory()
     return [cacheDir stringByAppendingPathComponent:appName];
 }
 
+void WebContext::platformSetUpWebProcess()
+{
+}
+
 } // namespace WebKit
 
diff --git a/WebKit2/UIProcess/win/WebContextWin.cpp b/WebKit2/UIProcess/win/WebContextWin.cpp
index cb83fb0..f813190 100644
--- a/WebKit2/UIProcess/win/WebContextWin.cpp
+++ b/WebKit2/UIProcess/win/WebContextWin.cpp
@@ -25,6 +25,7 @@
 
 #include "WebContext.h"
 
+#include "WebProcessMessageKinds.h"
 #include <WebCore/FileSystem.h>
 
 using namespace WebCore;
@@ -36,5 +37,20 @@ String WebContext::applicationCacheDirectory()
     return localUserSpecificStorageDirectory();
 }
 
+void WebContext::setShouldPaintNativeControls(bool b)
+{
+    m_shouldPaintNativeControls = b;
+
+    if (!hasValidProcess())
+        return;
+
+    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
+}
+
+void WebContext::platformSetUpWebProcess()
+{
+    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
+}
+
 } // namespace WebKit
 
diff --git a/WebKit2/WebProcess/WebProcess.cpp b/WebKit2/WebProcess/WebProcess.cpp
index cc4528c..61a27ac 100644
--- a/WebKit2/WebProcess/WebProcess.cpp
+++ b/WebKit2/WebProcess/WebProcess.cpp
@@ -39,6 +39,7 @@
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/SchemeRegistry.h>
+#include <WebCore/Settings.h>
 #include <wtf/PassRefPtr.h>
 
 #if PLATFORM(MAC)
@@ -288,6 +289,17 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
                 return;
             }
 #endif
+#if PLATFORM(WIN)
+            case WebProcessMessage::SetShouldPaintNativeControls: {
+                bool b;
+                if (!arguments->decode(b))
+                    return;
+#if USE(SAFARI_THEME)
+                Settings::setShouldPaintNativeControls(b);
+#endif
+                return;
+            }
+#endif
         }
     }
 
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 10957e6..0154339 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1199,6 +1199,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\win\WKContextPrivateWin.h"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\win\WKContextWin.cpp"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKData.cpp"
 						>
 					</File>
diff --git a/WebKit2/win/WebKit2Generated.make b/WebKit2/win/WebKit2Generated.make
index 66b66b7..86a80e8 100644
--- a/WebKit2/win/WebKit2Generated.make
+++ b/WebKit2/win/WebKit2Generated.make
@@ -22,6 +22,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKURL.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\cf\WKStringCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\cf\WKURLCF.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\win\WKContextPrivateWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\cpp\WKRetainPtr.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\win\WKBaseWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\win\WKView.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 391239e..0053c5e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,26 @@
+2010-08-12  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        WebKitTestRunner needs to run tests without using native controls
+        https://bugs.webkit.org/show_bug.cgi?id=43772
+
+        Reviewed by Sam Weinig.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+        Call platformInitializeContext().
+
+        * WebKitTestRunner/TestController.h:
+        Declare platformInitializeContext().
+
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformInitializeContext):
+        Stubbed.
+
+        * WebKitTestRunner/win/TestControllerWin.cpp:
+        (WTR::TestController::platformInitializeContext):
+        Call WKContextSetShouldPaintNativeControls() to disable native control
+        drawing.
+
 2010-08-12  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 5ebb434..17d1160 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -123,6 +123,7 @@ void TestController::initialize(int argc, const char* argv[])
     initializeTestPluginDirectory();
 
     m_context.adopt(WKContextCreateWithInjectedBundlePath(injectedBundlePath()));
+    platformInitializeContext();
 
     WKContextInjectedBundleClient injectedBundleClient = {
         0,
@@ -132,7 +133,7 @@ void TestController::initialize(int argc, const char* argv[])
     WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
 
     _WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
-    
+
     m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get()));
     m_mainWebView = adoptPtr(new PlatformWebView(m_pageNamespace.get()));
 
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 8b39045..5f6d99d 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -64,6 +64,7 @@ private:
     void runTest(const char* pathOrURL);
 
     void platformInitialize();
+    void platformInitializeContext();
     void initializeInjectedBundlePath();
     void initializeTestPluginDirectory();
 
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index 6367491..dbe35e2 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -51,4 +51,8 @@ void TestController::runUntil(bool& done)
         [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
 }
 
+void TestController::platformInitializeContext()
+{
+}
+
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index a9c55e4..a3cc53a 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -29,6 +29,7 @@
 #include <io.h>
 #include <shlwapi.h>
 #include <string>
+#include <WebKit2/WKContextPrivateWin.h>
 #include <WebKit2/WKStringCF.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/Vector.h>
@@ -125,4 +126,10 @@ void TestController::runUntil(bool& done)
     }
 }
 
+void TestController::platformInitializeContext()
+{
+    // FIXME: Make DRT pass with Windows native controls. <http://webkit.org/b/25592>
+    WKContextSetShouldPaintNativeControls(m_context.get(), false);
+}
+
 } // namespace WTR

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list