Unreviewed, rolling out r143536.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 23:50:20 +0000 (23:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2013 23:50:20 +0000 (23:50 +0000)
http://trac.webkit.org/changeset/143536
https://bugs.webkit.org/show_bug.cgi?id=110523

Causing a bunch of tests to fail on Windows, requires
rebaselining (Requested by rfong on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-21

Source/WebCore:

* config.h:
* page/Settings.cpp:
(WebCore):
(WebCore::Settings::setShouldPaintNativeControls):
* page/Settings.h:
(Settings):
(WebCore::Settings::shouldPaintNativeControls):
* platform/win/ScrollbarThemeWin.cpp:
(WebCore):
* rendering/RenderThemeWin.cpp:
(WebCore):

Source/WebKit/win:

* WebKitClassFactory.cpp:
(WebKitClassFactory::WebKitClassFactory):
* WebView.cpp:
(WebView::initWithFrame):
(WebView::notifyPreferencesChanged):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143658 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/config.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKitClassFactory.cpp
Source/WebKit/win/WebView.cpp

index 2ab6e5b..79467a8 100644 (file)
@@ -1,3 +1,24 @@
+2013-02-21  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r143536.
+        http://trac.webkit.org/changeset/143536
+        https://bugs.webkit.org/show_bug.cgi?id=110523
+
+        Causing a bunch of tests to fail on Windows, requires
+        rebaselining (Requested by rfong on #webkit).
+
+        * config.h:
+        * page/Settings.cpp:
+        (WebCore):
+        (WebCore::Settings::setShouldPaintNativeControls):
+        * page/Settings.h:
+        (Settings):
+        (WebCore::Settings::shouldPaintNativeControls):
+        * platform/win/ScrollbarThemeWin.cpp:
+        (WebCore):
+        * rendering/RenderThemeWin.cpp:
+        (WebCore):
+
 2013-02-21  Simon Fraser  <simon.fraser@apple.com>
 
         Don't make an overhang shadow layer when the WKView has a transparent background
index a31144e..df6ff92 100644 (file)
@@ -138,6 +138,10 @@ typedef float CGFloat;
 #endif
 #endif /* USE(CG) */
 
+#if PLATFORM(WIN) && USE(CG)
+#define WTF_USE_SAFARI_THEME 1
+#endif
+
 // CoreAnimation is available to IOS, Mac and Windows if using CG
 #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
 #define WTF_USE_CA 1
index be7f07a..a86b0bf 100644 (file)
@@ -88,6 +88,10 @@ double Settings::gDefaultMinDOMTimerInterval = 0.010; // 10 milliseconds
 double Settings::gDefaultDOMTimerAlignmentInterval = 0;
 double Settings::gHiddenPageDOMTimerAlignmentInterval = 1.0;
 
+#if USE(SAFARI_THEME)
+bool Settings::gShouldPaintNativeControls = true;
+#endif
+
 #if USE(AVFOUNDATION)
 bool Settings::gAVFoundationEnabled = false;
 #endif
@@ -482,6 +486,13 @@ FontRenderingMode Settings::fontRenderingMode() const
     return static_cast<FontRenderingMode>(m_fontRenderingMode);
 }
 
+#if USE(SAFARI_THEME)
+void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
+{
+    gShouldPaintNativeControls = shouldPaintNativeControls;
+}
+#endif
+
 void Settings::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled)
 {
     if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled)
index 4ae8ab9..25ad8d8 100644 (file)
@@ -233,6 +233,12 @@ namespace WebCore {
         bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; }
 #endif
 
+#if USE(SAFARI_THEME)
+        // Windows debugging pref (global) for switching between the Aqua look and a native windows look.
+        static void setShouldPaintNativeControls(bool);
+        static bool shouldPaintNativeControls() { return gShouldPaintNativeControls; }
+#endif
+
         static void setMockScrollbarsEnabled(bool flag);
         static bool mockScrollbarsEnabled();
 
@@ -331,6 +337,9 @@ namespace WebCore {
         static bool gMockScrollbarsEnabled;
         static bool gUsesOverlayScrollbars;
 
+#if USE(SAFARI_THEME)
+        static bool gShouldPaintNativeControls;
+#endif
 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
         static bool gShouldUseHighResolutionTimers;
 #endif
index 93a759b..ed49f2b 100644 (file)
@@ -86,11 +86,13 @@ static void checkAndInitScrollbarTheme()
         scrollbarTheme = OpenThemeData(0, L"Scrollbar");
 }
 
+#if !USE(SAFARI_THEME)
 ScrollbarTheme* ScrollbarTheme::nativeTheme()
 {
     static ScrollbarThemeWin winTheme;
     return &winTheme;
 }
+#endif
 
 ScrollbarThemeWin::ScrollbarThemeWin()
 {
index cb15ca8..6e9fe2d 100644 (file)
@@ -158,11 +158,13 @@ PassRefPtr<RenderTheme> RenderThemeWin::create()
     return adoptRef(new RenderThemeWin);
 }
 
+#if !USE(SAFARI_THEME)
 PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
 {
     static RenderTheme* winTheme = RenderThemeWin::create().leakRef();
     return winTheme;
 }
+#endif
 
 RenderThemeWin::RenderThemeWin()
     : m_buttonTheme(0)
index 72921ad..b94a4c6 100644 (file)
@@ -1,3 +1,18 @@
+2013-02-21  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r143536.
+        http://trac.webkit.org/changeset/143536
+        https://bugs.webkit.org/show_bug.cgi?id=110523
+
+        Causing a bunch of tests to fail on Windows, requires
+        rebaselining (Requested by rfong on #webkit).
+
+        * WebKitClassFactory.cpp:
+        (WebKitClassFactory::WebKitClassFactory):
+        * WebView.cpp:
+        (WebView::initWithFrame):
+        (WebView::notifyPreferencesChanged):
+
 2013-02-20  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. Remove references to SAFARI_THEME from Windows Solution.
index e302f01..aff2727 100644 (file)
 #include <wtf/MainThread.h>
 
 // WebKitClassFactory ---------------------------------------------------------
+#if USE(SAFARI_THEME)
+#ifdef DEBUG_ALL
+SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
+#else
+SOFT_LINK_LIBRARY(SafariTheme)
+#endif
+
+SOFT_LINK(SafariTheme, STInitialize, void, APIENTRY, (), ())
+#endif
 
 WebKitClassFactory::WebKitClassFactory(CLSID targetClass)
 : m_targetClass(targetClass)
 , m_refCount(0)
 {
+#if USE(SAFARI_THEME)
+    static bool didInitializeSafariTheme;
+    if (!didInitializeSafariTheme) {
+        if (SafariThemeLibrary())
+            STInitialize();
+        didInitializeSafariTheme = true;
+    }
+#endif
 
     JSC::initializeThreading();
     WTF::initializeMainThread();
index ec2a4b7..a2f9cad 100644 (file)
@@ -2666,6 +2666,12 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
         didOneTimeInitialization = true;
      }
 
+#if USE(SAFARI_THEME)
+    BOOL shouldPaintNativeControls;
+    if (SUCCEEDED(m_preferences->shouldPaintNativeControls(&shouldPaintNativeControls)))
+        Settings::setShouldPaintNativeControls(shouldPaintNativeControls);
+#endif
+
     BOOL useHighResolutionTimer;
     if (SUCCEEDED(m_preferences->shouldUseHighResolutionTimers(&useHighResolutionTimer)))
         Settings::setShouldUseHighResolutionTimers(useHighResolutionTimer);
@@ -4850,6 +4856,13 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings->setXSSAuditorEnabled(!!enabled);
 
+#if USE(SAFARI_THEME)
+    hr = prefsPrivate->shouldPaintNativeControls(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setShouldPaintNativeControls(!!enabled);
+#endif
+
     hr = prefsPrivate->shouldUseHighResolutionTimers(&enabled);
     if (FAILED(hr))
         return hr;