Changeset 64888 in webkit
- Timestamp:
- Aug 6, 2010 5:34:39 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64879 r64888 1 2010-08-05 Jon Honeycutt <jhoneycutt@apple.com> 2 3 WebKitTestRunner needs to be able to set the font smoothing type 4 https://bugs.webkit.org/show_bug.cgi?id=43406 5 6 Reviewed by Adam Roben. 7 8 * Shared/FontSmoothingLevel.h: Added. 9 (WebKit::): 10 11 * Shared/WebPreferencesStore.cpp: 12 (WebKit::WebPreferencesStore::WebPreferencesStore): 13 Initialize fontSmoothingLevel. 14 (WebKit::WebPreferencesStore::swap): 15 Copy fontSmoothingLevel. 16 17 * Shared/WebPreferencesStore.h: 18 (WebKit::WebPreferencesStore::encode): 19 Encode fontSmoothingLevel. 20 (WebKit::WebPreferencesStore::decode): 21 Decode it. 22 23 * UIProcess/API/C/WKPreferencesPrivate.cpp: Added. 24 (WKPreferencesSetFontSmoothingLevel): 25 Get the font smoothing level from the WKFontSmoothingLevel, and call 26 WebPreferences::setFontSmoothingLevel(). 27 (WKPreferencesGetFontSmoothingLevel): 28 Get the font smoothing level from WebPreferences, and translate it to a 29 WKFontSmoothingLevel. 30 31 * UIProcess/API/C/WKPreferencesPrivate.h: Added. 32 Declare the font smoothing levels, and declare functions to get and set 33 the level. 34 35 * UIProcess/WebPreferences.cpp: 36 (WebKit::WebPreferences::setFontSmoothingLevel): 37 Set fontSmoothingLevel and call update(). 38 (WebKit::WebPreferences::fontSmoothingLevel): 39 Return the level. 40 41 * UIProcess/WebPreferences.h: 42 Declare getter and setter for fontSmoothingLevel. 43 44 * WebKit2.xcodeproj/project.pbxproj: 45 Add new files to project. 46 47 * WebProcess/WebPage/WebPage.cpp: 48 (WebKit::WebPage::preferencesDidChange): 49 Call platformPreferencesDidChange(). 50 51 * WebProcess/WebPage/WebPage.h: 52 Declare platformPreferencesDidChange(). 53 54 * WebProcess/WebPage/mac/WebPageMac.mm: 55 (WebKit::WebPage::platformPreferencesDidChange): 56 Stubbed. 57 58 * WebProcess/WebPage/qt/WebPageQt.cpp: 59 (WebKit::WebPage::platformPreferencesDidChange): 60 Stubbed. 61 62 * WebProcess/WebPage/win/WebPageWin.cpp: 63 (WebKit::WebPage::platformPreferencesDidChange): 64 On CG platforms, call wkSetFontSmoothingLevel(). This matches the code 65 in old WebKit's WebPreferences. Set the font rendering mode to either 66 normal (CG) or alternative (GDI) based on the font smoothing level. This 67 matches what was done in old WebKit's WebView. 68 69 * win/WebKit2.vcproj: 70 Add FontSmoothingLevel.h and WKPreferencesPrivate.{h,cpp} to project. 71 72 * win/WebKit2Generated.make: 73 Copy WKPreferencesPrivate.h. 74 1 75 2010-08-06 Anders Carlsson <andersca@apple.com> 2 76 -
trunk/WebKit2/Shared/WebPreferencesStore.cpp
r64661 r64888 26 26 #include "WebPreferencesStore.h" 27 27 28 #include "FontSmoothingLevel.h" 29 28 30 namespace WebKit { 29 31 … … 34 36 , offlineWebApplicationCacheEnabled(false) 35 37 , localStorageEnabled(true) 38 , fontSmoothingLevel(FontSmoothingLevelMedium) 36 39 , minimumFontSize(1) 37 40 , minimumLogicalFontSize(9) … … 54 57 offlineWebApplicationCacheEnabled = other.offlineWebApplicationCacheEnabled; 55 58 localStorageEnabled = other.localStorageEnabled; 59 fontSmoothingLevel = other.fontSmoothingLevel; 56 60 minimumFontSize = other.minimumFontSize; 57 61 minimumLogicalFontSize = other.minimumLogicalFontSize; … … 81 85 std::swap(offlineWebApplicationCacheEnabled, other.offlineWebApplicationCacheEnabled); 82 86 std::swap(localStorageEnabled, other.localStorageEnabled); 87 std::swap(fontSmoothingLevel, other.fontSmoothingLevel); 83 88 std::swap(minimumFontSize, other.minimumFontSize); 84 89 std::swap(minimumLogicalFontSize, other.minimumLogicalFontSize); -
trunk/WebKit2/Shared/WebPreferencesStore.h
r64877 r64888 47 47 encoder->encode(offlineWebApplicationCacheEnabled); 48 48 encoder->encode(localStorageEnabled); 49 encoder->encode(fontSmoothingLevel); 49 50 encoder->encode(minimumFontSize); 50 51 encoder->encode(minimumLogicalFontSize); … … 70 71 return false; 71 72 if (!decoder->decode(s.localStorageEnabled)) 73 return false; 74 if (!decoder->decode(s.fontSmoothingLevel)) 72 75 return false; 73 76 if (!decoder->decode(s.minimumFontSize)) … … 100 103 bool localStorageEnabled; 101 104 105 uint32_t fontSmoothingLevel; 106 102 107 uint32_t minimumFontSize; 103 108 uint32_t minimumLogicalFontSize; -
trunk/WebKit2/UIProcess/WebPreferences.cpp
r63682 r64888 109 109 } 110 110 111 void WebPreferences::setFontSmoothingLevel(FontSmoothingLevel level) 112 { 113 m_store.fontSmoothingLevel = level; 114 update(); 115 } 116 117 FontSmoothingLevel WebPreferences::fontSmoothingLevel() const 118 { 119 return static_cast<FontSmoothingLevel>(m_store.fontSmoothingLevel); 120 } 121 111 122 } // namespace WebKit 123 -
trunk/WebKit2/UIProcess/WebPreferences.h
r64386 r64888 28 28 29 29 #include "APIObject.h" 30 #include "FontSmoothingLevel.h" 30 31 #include "WebPreferencesStore.h" 31 32 #include <wtf/HashSet.h> … … 70 71 bool localStorageEnabled() const; 71 72 73 void setFontSmoothingLevel(FontSmoothingLevel); 74 FontSmoothingLevel fontSmoothingLevel() const; 75 72 76 private: 73 77 WebPreferences(); -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r64867 r64888 100 100 5DAD729C116FF86200EE5396 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 101 101 6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; }; 102 762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 103 762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */; }; 102 104 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 103 105 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; … … 427 429 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; 428 430 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb; path = WebProcess/com.apple.WebProcess.sb; sourceTree = "<group>"; }; 431 762B7481120BBA0100819339 /* FontSmoothingLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingLevel.h; sourceTree = "<group>"; }; 432 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; }; 433 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPreferencesPrivate.cpp; sourceTree = "<group>"; }; 429 434 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 430 435 8DC2EF5B0486A6940098B216 /* WebKit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; … … 823 828 0FB659221208B4DB0044816C /* DrawingAreaBase.h */, 824 829 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */, 830 762B7481120BBA0100819339 /* FontSmoothingLevel.h */, 825 831 BC64696D11DBE603006455B0 /* ImmutableArray.cpp */, 826 832 BC64696E11DBE603006455B0 /* ImmutableArray.h */, … … 1055 1061 BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */, 1056 1062 BCD597CE112B56AC00EC8C23 /* WKPreferences.h */, 1063 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */, 1064 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */, 1057 1065 BC20EBAF116EEB0800094A50 /* WKString.cpp */, 1058 1066 BC20EBAE116EEB0800094A50 /* WKString.h */, … … 1400 1408 BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */, 1401 1409 BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */, 1410 762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */, 1402 1411 BC8A501511765F5600757573 /* WKRetainPtr.h in Headers */, 1403 1412 BC20EBB0116EEB0800094A50 /* WKString.h in Headers */, … … 1622 1631 BCEE98CC1133174C006BCC24 /* WKPageNamespace.cpp in Sources */, 1623 1632 BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */, 1633 762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */, 1624 1634 BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */, 1625 1635 BC20EC07116EF7FF00094A50 /* WKStringCF.cpp in Sources */, -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r64877 r64888 454 454 m_page->settings()->setOfflineWebApplicationCacheEnabled(store.offlineWebApplicationCacheEnabled); 455 455 m_page->settings()->setLocalStorageEnabled(store.localStorageEnabled); 456 457 platformPreferencesDidChange(store); 456 458 } 457 459 -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r64877 r64888 149 149 void getRenderTreeExternalRepresentation(uint64_t callbackID); 150 150 void preferencesDidChange(const WebPreferencesStore&); 151 void platformPreferencesDidChange(const WebPreferencesStore&); 151 152 void didReceivePolicyDecision(WebFrame*, uint64_t listenerID, WebCore::PolicyAction policyAction); 152 153 -
trunk/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r64086 r64888 175 175 } 176 176 177 void WebPage::platformPreferencesDidChange(const WebPreferencesStore&) 178 { 179 } 180 177 181 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
r62639 r64888 201 201 return mapKey ? keyPressCommandsMap->get(mapKey) : 0; 202 202 } 203 203 204 void WebPage::platformPreferencesDidChange(const WebPreferencesStore&) 205 { 206 } 207 204 208 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
r57707 r64888 26 26 #include "WebPage.h" 27 27 28 #include "FontSmoothingLevel.h" 29 #include "WebPreferencesStore.h" 28 30 #include <WebCore/FontRenderingMode.h> 29 31 #include <WebCore/KeyboardEvent.h> … … 31 33 #include <WebCore/PlatformKeyboardEvent.h> 32 34 #include <WebCore/Settings.h> 35 #include <WebKitSystemInterface/WebKitSystemInterface.h> 33 36 #include <WinUser.h> 34 37 … … 162 165 } 163 166 167 void WebPage::platformPreferencesDidChange(const WebPreferencesStore& store) 168 { 169 #if PLATFORM(CG) 170 FontSmoothingLevel adjustedLevel = static_cast<FontSmoothingLevel>(store.fontSmoothingLevel); 171 if (adjustedLevel == FontSmoothingLevelWindows) 172 adjustedLevel = FontSmoothingLevelMedium; 173 wkSetFontSmoothingLevel(adjustedLevel); 174 #endif 175 176 m_page->settings()->setFontRenderingMode(store.fontSmoothingLevel == FontSmoothingLevelWindows ? AlternateRenderingMode : NormalRenderingMode); 177 } 178 164 179 } // namespace WebKit -
trunk/WebKit2/win/WebKit2.vcproj
r64862 r64888 406 406 </File> 407 407 <File 408 RelativePath="..\Shared\FontSmoothingLevel.h" 409 > 410 </File> 411 <File 408 412 RelativePath="..\Shared\ImmutableArray.cpp" 409 413 > … … 1261 1265 <File 1262 1266 RelativePath="..\UIProcess\API\C\WKPreferences.h" 1267 > 1268 </File> 1269 <File 1270 RelativePath="..\UIProcess\API\C\WKPreferencesPrivate.cpp" 1271 > 1272 </File> 1273 <File 1274 RelativePath="..\UIProcess\API\C\WKPreferencesPrivate.h" 1263 1275 > 1264 1276 </File> -
trunk/WebKit2/win/WebKit2Generated.make
r64788 r64888 17 17 xcopy /y /d "..\UIProcess\API\C\WKPageNamespace.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 18 18 xcopy /y /d "..\UIProcess\API\C\WKPreferences.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 19 xcopy /y /d "..\UIProcess\API\C\WKPreferencesPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 19 20 xcopy /y /d "..\UIProcess\API\C\WKString.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 20 21 xcopy /y /d "..\UIProcess\API\C\WKType.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" -
trunk/WebKitTools/ChangeLog
r64878 r64888 1 2010-08-05 Jon Honeycutt <jhoneycutt@apple.com> 2 3 WebKitTestRunner needs to be able to set the font smoothing type 4 https://bugs.webkit.org/show_bug.cgi?id=43406 5 6 Reviewed by Adam Roben. 7 8 * WebKitTestRunner/TestInvocation.cpp: 9 (WTR::TestInvocation::resetPreferencesToConsistentValues): 10 Set the font smoothing level to 11 kWKFontSmoothingLevelNoSubpixelAntiAliasing to match DRT. 12 1 13 2010-08-06 Jon Honeycutt <jhoneycutt@apple.com> 2 14 -
trunk/WebKitTools/WebKitTestRunner/TestInvocation.cpp
r64576 r64888 30 30 #include "TestController.h" 31 31 #include <WebKit2/WKContextPrivate.h> 32 #include <WebKit2/WKPreferencesPrivate.h> 32 33 #include <WebKit2/WKRetainPtr.h> 33 34 #include <wtf/RetainPtr.h> … … 71 72 WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context()); 72 73 WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true); 74 WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing); 73 75 } 74 76
Note: See TracChangeset
for help on using the changeset viewer.