[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 11:47:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 977f5067b6f87dad4efb8b4ecaf05f6476ddc02f
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Aug 7 00:34:39 2010 +0000

    WebKitTestRunner needs to be able to set the font smoothing type
    https://bugs.webkit.org/show_bug.cgi?id=43406
    
    Reviewed by Adam Roben.
    
    WebKit2:
    
    * Shared/FontSmoothingLevel.h: Added.
    (WebKit::):
    
    * Shared/WebPreferencesStore.cpp:
    (WebKit::WebPreferencesStore::WebPreferencesStore):
    Initialize fontSmoothingLevel.
    (WebKit::WebPreferencesStore::swap):
    Copy fontSmoothingLevel.
    
    * Shared/WebPreferencesStore.h:
    (WebKit::WebPreferencesStore::encode):
    Encode fontSmoothingLevel.
    (WebKit::WebPreferencesStore::decode):
    Decode it.
    
    * UIProcess/API/C/WKPreferencesPrivate.cpp: Added.
    (WKPreferencesSetFontSmoothingLevel):
    Get the font smoothing level from the WKFontSmoothingLevel, and call
    WebPreferences::setFontSmoothingLevel().
    (WKPreferencesGetFontSmoothingLevel):
    Get the font smoothing level from WebPreferences, and translate it to a
    WKFontSmoothingLevel.
    
    * UIProcess/API/C/WKPreferencesPrivate.h: Added.
    Declare the font smoothing levels, and declare functions to get and set
    the level.
    
    * UIProcess/WebPreferences.cpp:
    (WebKit::WebPreferences::setFontSmoothingLevel):
    Set fontSmoothingLevel and call update().
    (WebKit::WebPreferences::fontSmoothingLevel):
    Return the level.
    
    * UIProcess/WebPreferences.h:
    Declare getter and setter for fontSmoothingLevel.
    
    * WebKit2.xcodeproj/project.pbxproj:
    Add new files to project.
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::preferencesDidChange):
    Call platformPreferencesDidChange().
    
    * WebProcess/WebPage/WebPage.h:
    Declare platformPreferencesDidChange().
    
    * WebProcess/WebPage/mac/WebPageMac.mm:
    (WebKit::WebPage::platformPreferencesDidChange):
    Stubbed.
    
    * WebProcess/WebPage/qt/WebPageQt.cpp:
    (WebKit::WebPage::platformPreferencesDidChange):
    Stubbed.
    
    * WebProcess/WebPage/win/WebPageWin.cpp:
    (WebKit::WebPage::platformPreferencesDidChange):
    On CG platforms, call wkSetFontSmoothingLevel(). This matches the code
    in old WebKit's WebPreferences. Set the font rendering mode to either
    normal (CG) or alternative (GDI) based on the font smoothing level. This
    matches what was done in old WebKit's WebView.
    
    * win/WebKit2.vcproj:
    Add FontSmoothingLevel.h and WKPreferencesPrivate.{h,cpp} to project.
    
    * win/WebKit2Generated.make:
    Copy WKPreferencesPrivate.h.
    
    WebKitTools:
    
    * WebKitTestRunner/TestInvocation.cpp:
    (WTR::TestInvocation::resetPreferencesToConsistentValues):
    Set the font smoothing level to
    kWKFontSmoothingLevelNoSubpixelAntiAliasing to match DRT.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64888 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index cd7ffda..0267014 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,77 @@
+2010-08-05  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        WebKitTestRunner needs to be able to set the font smoothing type
+        https://bugs.webkit.org/show_bug.cgi?id=43406
+
+        Reviewed by Adam Roben.
+
+        * Shared/FontSmoothingLevel.h: Added.
+        (WebKit::):
+
+        * Shared/WebPreferencesStore.cpp:
+        (WebKit::WebPreferencesStore::WebPreferencesStore):
+        Initialize fontSmoothingLevel.
+        (WebKit::WebPreferencesStore::swap):
+        Copy fontSmoothingLevel.
+
+        * Shared/WebPreferencesStore.h:
+        (WebKit::WebPreferencesStore::encode):
+        Encode fontSmoothingLevel.
+        (WebKit::WebPreferencesStore::decode):
+        Decode it.
+
+        * UIProcess/API/C/WKPreferencesPrivate.cpp: Added.
+        (WKPreferencesSetFontSmoothingLevel):
+        Get the font smoothing level from the WKFontSmoothingLevel, and call
+        WebPreferences::setFontSmoothingLevel().
+        (WKPreferencesGetFontSmoothingLevel):
+        Get the font smoothing level from WebPreferences, and translate it to a
+        WKFontSmoothingLevel.
+
+        * UIProcess/API/C/WKPreferencesPrivate.h: Added.
+        Declare the font smoothing levels, and declare functions to get and set
+        the level.
+
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::WebPreferences::setFontSmoothingLevel):
+        Set fontSmoothingLevel and call update().
+        (WebKit::WebPreferences::fontSmoothingLevel):
+        Return the level.
+
+        * UIProcess/WebPreferences.h:
+        Declare getter and setter for fontSmoothingLevel.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files to project.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::preferencesDidChange):
+        Call platformPreferencesDidChange().
+
+        * WebProcess/WebPage/WebPage.h:
+        Declare platformPreferencesDidChange().
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::platformPreferencesDidChange):
+        Stubbed.
+
+        * WebProcess/WebPage/qt/WebPageQt.cpp:
+        (WebKit::WebPage::platformPreferencesDidChange):
+        Stubbed.
+
+        * WebProcess/WebPage/win/WebPageWin.cpp:
+        (WebKit::WebPage::platformPreferencesDidChange):
+        On CG platforms, call wkSetFontSmoothingLevel(). This matches the code
+        in old WebKit's WebPreferences. Set the font rendering mode to either
+        normal (CG) or alternative (GDI) based on the font smoothing level. This
+        matches what was done in old WebKit's WebView.
+
+        * win/WebKit2.vcproj:
+        Add FontSmoothingLevel.h and WKPreferencesPrivate.{h,cpp} to project.
+
+        * win/WebKit2Generated.make:
+        Copy WKPreferencesPrivate.h.
+
 2010-08-06  Anders Carlsson  <andersca at apple.com>
 
         Build fixes.
diff --git a/WebKit2/Shared/FontSmoothingLevel.h b/WebKit2/Shared/FontSmoothingLevel.h
new file mode 100644
index 0000000..75decd6
--- /dev/null
+++ b/WebKit2/Shared/FontSmoothingLevel.h
@@ -0,0 +1,43 @@
+/*
+ * 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. ``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
+ * 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 FontSmoothingLevel_h
+#define FontSmoothingLevel_h
+
+namespace WebKit {
+
+enum FontSmoothingLevel {
+    FontSmoothingLevelNoSubpixelAntiAliasing = 0,
+    FontSmoothingLevelLight = 1,
+    FontSmoothingLevelMedium = 2,
+    FontSmoothingLevelStrong = 3,
+#if PLATFORM(WIN)
+    FontSmoothingLevelWindows = 4,
+#endif
+};
+
+} // namespace WebKit
+
+#endif // FontSmoothingLevel_h
diff --git a/WebKit2/Shared/WebPreferencesStore.cpp b/WebKit2/Shared/WebPreferencesStore.cpp
index 776e3fa..ec19f4a 100644
--- a/WebKit2/Shared/WebPreferencesStore.cpp
+++ b/WebKit2/Shared/WebPreferencesStore.cpp
@@ -25,6 +25,8 @@
 
 #include "WebPreferencesStore.h"
 
+#include "FontSmoothingLevel.h"
+
 namespace WebKit {
 
 WebPreferencesStore::WebPreferencesStore()
@@ -33,6 +35,7 @@ WebPreferencesStore::WebPreferencesStore()
     , pluginsEnabled(true)
     , offlineWebApplicationCacheEnabled(false)
     , localStorageEnabled(true)
+    , fontSmoothingLevel(FontSmoothingLevelMedium)
     , minimumFontSize(1)
     , minimumLogicalFontSize(9)
     , defaultFontSize(16)
@@ -53,6 +56,7 @@ WebPreferencesStore::WebPreferencesStore(const WebPreferencesStore& other)
     pluginsEnabled = other.pluginsEnabled;
     offlineWebApplicationCacheEnabled = other.offlineWebApplicationCacheEnabled;
     localStorageEnabled = other.localStorageEnabled;
+    fontSmoothingLevel = other.fontSmoothingLevel;
     minimumFontSize = other.minimumFontSize;
     minimumLogicalFontSize = other.minimumLogicalFontSize;
     defaultFontSize = other.defaultFontSize;
@@ -80,6 +84,7 @@ void WebPreferencesStore::swap(WebPreferencesStore& other)
     std::swap(pluginsEnabled, other.pluginsEnabled);
     std::swap(offlineWebApplicationCacheEnabled, other.offlineWebApplicationCacheEnabled);
     std::swap(localStorageEnabled, other.localStorageEnabled);
+    std::swap(fontSmoothingLevel, other.fontSmoothingLevel);
     std::swap(minimumFontSize, other.minimumFontSize);
     std::swap(minimumLogicalFontSize, other.minimumLogicalFontSize);
     std::swap(defaultFontSize, other.defaultFontSize);
diff --git a/WebKit2/Shared/WebPreferencesStore.h b/WebKit2/Shared/WebPreferencesStore.h
index f0215f9..fc3a42d 100644
--- a/WebKit2/Shared/WebPreferencesStore.h
+++ b/WebKit2/Shared/WebPreferencesStore.h
@@ -46,6 +46,7 @@ struct WebPreferencesStore {
         encoder->encode(pluginsEnabled);
         encoder->encode(offlineWebApplicationCacheEnabled);
         encoder->encode(localStorageEnabled);
+        encoder->encode(fontSmoothingLevel);
         encoder->encode(minimumFontSize);
         encoder->encode(minimumLogicalFontSize);
         encoder->encode(defaultFontSize);
@@ -70,6 +71,8 @@ struct WebPreferencesStore {
             return false;
         if (!decoder->decode(s.localStorageEnabled))
             return false;
+        if (!decoder->decode(s.fontSmoothingLevel))
+            return false;
         if (!decoder->decode(s.minimumFontSize))
             return false;
         if (!decoder->decode(s.minimumLogicalFontSize))
@@ -99,6 +102,8 @@ struct WebPreferencesStore {
     bool offlineWebApplicationCacheEnabled;
     bool localStorageEnabled;
 
+    uint32_t fontSmoothingLevel;
+
     uint32_t minimumFontSize;
     uint32_t minimumLogicalFontSize;
     uint32_t defaultFontSize;
diff --git a/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp
new file mode 100644
index 0000000..157059d
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.cpp
@@ -0,0 +1,85 @@
+/*
+ * 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 "WKPreferencesPrivate.h"
+
+#include "FontSmoothingLevel.h"
+#include "WKAPICast.h"
+#include "WKPreferences.h"
+#include "WebPreferences.h"
+
+using namespace WebKit;
+
+void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef, WKFontSmoothingLevel wkLevel)
+{
+    FontSmoothingLevel level;
+    switch (wkLevel) {
+        case kWKFontSmoothingLevelNoSubpixelAntiAliasing:
+            level = FontSmoothingLevelNoSubpixelAntiAliasing;
+            break;
+        case kWKFontSmoothingLevelLight:
+            level = FontSmoothingLevelLight;
+            break;
+        case kWKFontSmoothingLevelMedium:
+            level = FontSmoothingLevelMedium;
+            break;
+        case kWKFontSmoothingLevelStrong:
+            level = FontSmoothingLevelStrong;
+            break;
+#if PLATFORM(WIN)
+        case kWKFontSmoothingLevelWindows:
+            level = FontSmoothingLevelWindows;
+            break;
+#endif
+        default:
+            ASSERT_NOT_REACHED();
+            level = FontSmoothingLevelMedium;
+            break;
+    }
+    toWK(preferencesRef)->setFontSmoothingLevel(level);
+}
+
+WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)
+{
+    FontSmoothingLevel level = toWK(preferencesRef)->fontSmoothingLevel();
+    switch (level) {
+        case FontSmoothingLevelNoSubpixelAntiAliasing:
+            return kWKFontSmoothingLevelNoSubpixelAntiAliasing;
+        case FontSmoothingLevelLight:
+            return kWKFontSmoothingLevelLight;
+        case FontSmoothingLevelMedium:
+            return kWKFontSmoothingLevelMedium;
+        case FontSmoothingLevelStrong:
+            return kWKFontSmoothingLevelStrong;
+#if PLATFORM(WIN)
+        case FontSmoothingLevelWindows:
+            return kWKFontSmoothingLevelWindows;
+#endif
+    }
+
+    ASSERT_NOT_REACHED();
+    return kWKFontSmoothingLevelMedium;
+}
+
diff --git a/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
new file mode 100644
index 0000000..067783b
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
@@ -0,0 +1,55 @@
+/*
+ * 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 WKPreferencesPrivate_h
+#define WKPreferencesPrivate_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum WKFontSmoothingLevel {
+    kWKFontSmoothingLevelNoSubpixelAntiAliasing = 0,
+    kWKFontSmoothingLevelLight = 1,
+    kWKFontSmoothingLevelMedium = 2,
+    kWKFontSmoothingLevelStrong = 3,
+#if PLATFORM(WIN)
+    kWKFontSmoothingLevelWindows = 4,
+#endif
+};
+typedef enum WKFontSmoothingLevel WKFontSmoothingLevel;
+
+// Defaults to kWKFontSmoothingLevelMedium.
+WK_EXPORT void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef, WKFontSmoothingLevel);
+WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKPreferencesPrivate_h */
+
diff --git a/WebKit2/UIProcess/WebPreferences.cpp b/WebKit2/UIProcess/WebPreferences.cpp
index ac49dfe..c93c253 100644
--- a/WebKit2/UIProcess/WebPreferences.cpp
+++ b/WebKit2/UIProcess/WebPreferences.cpp
@@ -108,4 +108,16 @@ bool WebPreferences::localStorageEnabled() const
     return m_store.localStorageEnabled;
 }
 
+void WebPreferences::setFontSmoothingLevel(FontSmoothingLevel level)
+{
+    m_store.fontSmoothingLevel = level;
+    update();
+}
+
+FontSmoothingLevel WebPreferences::fontSmoothingLevel() const
+{
+    return static_cast<FontSmoothingLevel>(m_store.fontSmoothingLevel);
+}
+
 } // namespace WebKit
+
diff --git a/WebKit2/UIProcess/WebPreferences.h b/WebKit2/UIProcess/WebPreferences.h
index a8070c6..ec2914c 100644
--- a/WebKit2/UIProcess/WebPreferences.h
+++ b/WebKit2/UIProcess/WebPreferences.h
@@ -27,6 +27,7 @@
 #define WebPreferences_h
 
 #include "APIObject.h"
+#include "FontSmoothingLevel.h"
 #include "WebPreferencesStore.h"
 #include <wtf/HashSet.h>
 #include <wtf/PassRefPtr.h>
@@ -69,6 +70,9 @@ public:
     void setLocalStorageEnabled(bool);
     bool localStorageEnabled() const;
 
+    void setFontSmoothingLevel(FontSmoothingLevel);
+    FontSmoothingLevel fontSmoothingLevel() const;
+
 private:
     WebPreferences();
     WebPreferences(WebPreferences*);
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 85b8bae..89676c8 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -99,6 +99,8 @@
 		516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; };
 		5DAD729C116FF86200EE5396 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
 		6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; };
+		762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */; };
 		8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
 		8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
 		BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F5115837A300E0AE2A /* RunLoopMac.mm */; };
@@ -426,6 +428,9 @@
 		5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; };
 		5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
 		6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb; path = WebProcess/com.apple.WebProcess.sb; sourceTree = "<group>"; };
+		762B7481120BBA0100819339 /* FontSmoothingLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingLevel.h; sourceTree = "<group>"; };
+		762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
+		762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPreferencesPrivate.cpp; sourceTree = "<group>"; };
 		8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		8DC2EF5B0486A6940098B216 /* WebKit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		BC0092F5115837A300E0AE2A /* RunLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RunLoopMac.mm; sourceTree = "<group>"; };
@@ -822,6 +827,7 @@
 				0FB659A51208B9EE0044816C /* DrawingAreaBase.cpp */,
 				0FB659221208B4DB0044816C /* DrawingAreaBase.h */,
 				1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
+				762B7481120BBA0100819339 /* FontSmoothingLevel.h */,
 				BC64696D11DBE603006455B0 /* ImmutableArray.cpp */,
 				BC64696E11DBE603006455B0 /* ImmutableArray.h */,
 				BCC57161115ADB42001CCAF9 /* NotImplemented.h */,
@@ -1054,6 +1060,8 @@
 				BC177464118B9FF4007D9E9A /* WKPagePrivate.h */,
 				BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */,
 				BCD597CE112B56AC00EC8C23 /* WKPreferences.h */,
+				762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */,
+				762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */,
 				BC20EBAF116EEB0800094A50 /* WKString.cpp */,
 				BC20EBAE116EEB0800094A50 /* WKString.h */,
 				BCDB85811200EC57007254BE /* WKType.cpp */,
@@ -1399,6 +1407,7 @@
 				BCEE98CD1133174C006BCC24 /* WKPageNamespace.h in Headers */,
 				BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */,
 				BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */,
+				762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */,
 				BC8A501511765F5600757573 /* WKRetainPtr.h in Headers */,
 				BC20EBB0116EEB0800094A50 /* WKString.h in Headers */,
 				BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */,
@@ -1621,6 +1630,7 @@
 				BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */,
 				BCEE98CC1133174C006BCC24 /* WKPageNamespace.cpp in Sources */,
 				BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */,
+				762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */,
 				BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */,
 				BC20EC07116EF7FF00094A50 /* WKStringCF.cpp in Sources */,
 				BC20EBB5116EEF7A00094A50 /* WKURL.cpp in Sources */,
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 34ba2db..6f7c17c 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -453,6 +453,8 @@ void WebPage::preferencesDidChange(const WebPreferencesStore& store)
     m_page->settings()->setLoadsImagesAutomatically(store.loadsImagesAutomatically);
     m_page->settings()->setOfflineWebApplicationCacheEnabled(store.offlineWebApplicationCacheEnabled);
     m_page->settings()->setLocalStorageEnabled(store.localStorageEnabled);
+
+    platformPreferencesDidChange(store);
 }
 
 bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 54303f4..23f32c2 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -148,6 +148,7 @@ private:
     void runJavaScriptInMainFrame(const WebCore::String&, uint64_t callbackID);
     void getRenderTreeExternalRepresentation(uint64_t callbackID);
     void preferencesDidChange(const WebPreferencesStore&);
+    void platformPreferencesDidChange(const WebPreferencesStore&);
     void didReceivePolicyDecision(WebFrame*, uint64_t listenerID, WebCore::PolicyAction policyAction);
     
     WebCore::Page* m_page;
diff --git a/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index 52a2183..6093664 100644
--- a/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -174,4 +174,8 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt)
     return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
 }
 
+void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
+{
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
index 68e5b6e..2aac565 100644
--- a/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
+++ b/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
@@ -200,5 +200,9 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt)
     int mapKey = modifiers << 16 | evt->charCode();
     return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
 }
-    
+
+void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
+{
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp b/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
index 19cbd27..960e9bd 100644
--- a/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
+++ b/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
@@ -25,11 +25,14 @@
 
 #include "WebPage.h"
 
+#include "FontSmoothingLevel.h"
+#include "WebPreferencesStore.h"
 #include <WebCore/FontRenderingMode.h>
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/Page.h>
 #include <WebCore/PlatformKeyboardEvent.h>
 #include <WebCore/Settings.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
 #include <WinUser.h>
 
 using namespace WebCore;
@@ -161,4 +164,16 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt)
     return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
 }
 
+void WebPage::platformPreferencesDidChange(const WebPreferencesStore& store)
+{
+#if PLATFORM(CG)
+    FontSmoothingLevel adjustedLevel = static_cast<FontSmoothingLevel>(store.fontSmoothingLevel);
+    if (adjustedLevel == FontSmoothingLevelWindows)
+        adjustedLevel = FontSmoothingLevelMedium;
+    wkSetFontSmoothingLevel(adjustedLevel);
+#endif
+
+    m_page->settings()->setFontRenderingMode(store.fontSmoothingLevel == FontSmoothingLevelWindows ? AlternateRenderingMode : NormalRenderingMode);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 5aaf06a..10957e6 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -405,6 +405,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Shared\FontSmoothingLevel.h"
+				>
+			</File>
+			<File
 				RelativePath="..\Shared\ImmutableArray.cpp"
 				>
 			</File>
@@ -1263,6 +1267,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\WKPreferencesPrivate.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\WKPreferencesPrivate.h"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKString.cpp"
 						>
 					</File>
diff --git a/WebKit2/win/WebKit2Generated.make b/WebKit2/win/WebKit2Generated.make
index 8e7201c..66b66b7 100644
--- a/WebKit2/win/WebKit2Generated.make
+++ b/WebKit2/win/WebKit2Generated.make
@@ -16,6 +16,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKPage.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKPageNamespace.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKPreferences.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\WKPreferencesPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKString.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKType.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKURL.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f6ecf4a..8d61bb7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-05  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        WebKitTestRunner needs to be able to set the font smoothing type
+        https://bugs.webkit.org/show_bug.cgi?id=43406
+
+        Reviewed by Adam Roben.
+
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::resetPreferencesToConsistentValues):
+        Set the font smoothing level to
+        kWKFontSmoothingLevelNoSubpixelAntiAliasing to match DRT.
+
 2010-08-06  Jon Honeycutt  <jhoneycutt at apple.com>
 
         Fix a missed variable rename.
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index e65ca8d..9a0f0aa 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -29,6 +29,7 @@
 #include "StringFunctions.h"
 #include "TestController.h"
 #include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPreferencesPrivate.h>
 #include <WebKit2/WKRetainPtr.h>
 #include <wtf/RetainPtr.h>
 
@@ -70,6 +71,7 @@ void TestInvocation::resetPreferencesToConsistentValues()
 {
     WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context());
     WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
+    WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing);
 }
 
 void TestInvocation::invoke()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list