Changeset 172172 in webkit
- Timestamp:
- Aug 6, 2014 1:25:00 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r172165 r172172 1 2014-08-06 Alexey Proskuryakov <ap@apple.com> 2 3 REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language 4 https://bugs.webkit.org/show_bug.cgi?id=135667 5 <rdar://problem/17862892> 6 7 Reviewed by Anders Carlsson. 8 9 Moved a function that computes default encoding from WebKit to WebCore, so that 10 it could be shared with WebKit2. 11 12 * WebCore.exp.in: 13 * platform/ios/WebCoreSystemInterfaceIOS.mm: 14 * platform/mac/WebCoreSystemInterface.h: 15 * platform/mac/WebCoreSystemInterface.mm: 16 * platform/text/TextEncodingRegistry.cpp: 17 (WebCore::defaultTextEncodingNameForSystemLanguage): 18 * platform/text/TextEncodingRegistry.h: 19 1 20 2014-08-06 Andreas Kling <akling@apple.com> 2 21 -
trunk/Source/WebCore/WebCore.exp.in
r171964 r172172 1076 1076 __ZN7WebCore3URLC1ERKS0_RKN3WTF6StringE 1077 1077 __ZN7WebCore3macERKNS_23AuthenticationChallengeE 1078 __ZN7WebCore40defaultTextEncodingNameForSystemLanguageEv 1078 1079 __ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeEf 1079 1080 __ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURL18CFURLComponentType … … 2105 2106 _wkGetNSURLResponseLastModifiedDate 2106 2107 _wkGetUserToBaseCTM 2108 _wkGetWebDefaultCFStringEncoding 2107 2109 _wkHTTPCookies 2108 2110 _wkHTTPCookiesForURL -
trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm
r167609 r172172 77 77 void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef); 78 78 CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*); 79 CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void); 79 80 80 81 #if USE(CFNETWORK) -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h
r170295 r172172 153 153 extern NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*); 154 154 extern CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*); 155 extern CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void); 155 156 #if !PLATFORM(IOS) 156 157 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled); -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
r170295 r172172 39 39 NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*); 40 40 CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*); 41 CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void); 41 42 NSString* (*wkCreateURLPasteboardFlavorTypeName)(void); 42 43 NSString* (*wkCreateURLNPasteboardFlavorTypeName)(void); -
trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp
r165848 r172172 43 43 #include <wtf/StringExtras.h> 44 44 45 #if PLATFORM(COCOA) 46 #include "WebCoreSystemInterface.h" 47 #endif 48 45 49 #if PLATFORM(MAC) 46 50 #include "TextCodecMac.h" … … 351 355 } 352 356 357 #if PLATFORM(COCOA) 358 String defaultTextEncodingNameForSystemLanguage() 359 { 360 String systemEncodingName = CFStringConvertEncodingToIANACharSetName(wkGetWebDefaultCFStringEncoding()); 361 362 // CFStringConvertEncodingToIANACharSetName() returns cp949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-949. 363 // ICU uses this name for a different encoding, so we need to change the name to a value that actually gives us windows-949. 364 // In addition, this value must match what is used in Safari, see <rdar://problem/5579292>. 365 // On some OS versions, the result is CP949 (uppercase). 366 if (equalIgnoringCase(systemEncodingName, "cp949")) 367 systemEncodingName = "ks_c_5601-1987"; 368 return systemEncodingName; 369 } 370 #endif 371 353 372 #ifndef NDEBUG 354 373 void dumpTextEncodingNameMap() -
trunk/Source/WebCore/platform/text/TextEncodingRegistry.h
r165676 r172172 49 49 bool shouldShowBackslashAsCurrencySymbolIn(const char* canonicalEncodingName); 50 50 51 #if PLATFORM(COCOA) 52 String defaultTextEncodingNameForSystemLanguage(); 53 #endif 54 51 55 #ifndef NDEBUG 52 56 void dumpTextEncodingNameMap(); -
trunk/Source/WebKit/mac/ChangeLog
r172048 r172172 1 2014-08-06 Alexey Proskuryakov <ap@apple.com> 2 3 REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language 4 https://bugs.webkit.org/show_bug.cgi?id=135667 5 <rdar://problem/17862892> 6 7 Reviewed by Anders Carlsson. 8 9 * WebView/WebPreferences.mm: (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): 10 Moved implementation to WebCore, so that it can be shared with WebKit2. 11 12 * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): 13 We now use WKGetWebDefaultCFStringEncoding in WebCore, so it needs to be initialized. 14 1 15 2014-08-05 Peyton Randolph <prandolph@apple.com> 2 16 -
trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
r170299 r172172 81 81 INIT(GetMIMETypeForExtension); 82 82 INIT(GetNSURLResponseLastModifiedDate); 83 INIT(GetWebDefaultCFStringEncoding); 83 84 #if !PLATFORM(IOS) 84 85 INIT(SignedPublicKeyAndChallengeString); -
trunk/Source/WebKit/mac/WebView/WebPreferences.mm
r171673 r172172 45 45 #import <WebCore/NetworkStorageSession.h> 46 46 #import <WebCore/ResourceHandle.h> 47 #import <WebCore/TextEncodingRegistry.h> 47 48 #import <runtime/InitializeThreading.h> 48 49 #import <wtf/MainThread.h> … … 1716 1717 + (void)_setInitialDefaultTextEncodingToSystemEncoding 1717 1718 { 1718 NSString *systemEncodingName = (NSString *)CFStringConvertEncodingToIANACharSetName([self _systemCFStringEncoding]);1719 1720 // CFStringConvertEncodingToIANACharSetName() returns cp949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-949.1721 // ICU uses this name for a different encoding, so we need to change the name to a value that actually gives us windows-949.1722 // In addition, this value must match what is used in Safari, see <rdar://problem/5579292>.1723 // On some OS versions, the result is CP949 (uppercase).1724 if ([systemEncodingName _webkit_isCaseInsensitiveEqualToString:@"cp949"])1725 systemEncodingName = @"ks_c_5601-1987";1726 1719 [[NSUserDefaults standardUserDefaults] registerDefaults: 1727 [NSDictionary dictionaryWithObject: systemEncodingNameforKey:WebKitDefaultTextEncodingNamePreferenceKey]];1720 [NSDictionary dictionaryWithObject:defaultTextEncodingNameForSystemLanguage() forKey:WebKitDefaultTextEncodingNamePreferenceKey]]; 1728 1721 } 1729 1722 -
trunk/Source/WebKit2/ChangeLog
r172147 r172172 1 2014-08-06 Alexey Proskuryakov <ap@apple.com> 2 3 REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language 4 https://bugs.webkit.org/show_bug.cgi?id=135667 5 <rdar://problem/17862892> 6 7 Reviewed by Anders Carlsson. 8 9 * Shared/WebPreferencesDefinitions.h: Compute the actual proper default, don't 10 hardcode it to ISO-8859-1 hoping that someone else will correct it later. 11 12 * Shared/WebPreferencesStore.cpp: Added an include for WebPreferencesDefinitions.h 13 macro expansion to compile. 14 15 * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): 16 Added a FIXME. 17 18 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 19 We now use WKGetWebDefaultCFStringEncoding in WebCore, so it needs to be initialized. 20 1 21 2014-08-06 Adrian Perez de Castro <aperez@igalia.com> 2 22 -
trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h
r171001 r172172 276 276 #define FOR_EACH_WEBKIT_STRING_PREFERENCE(macro) \ 277 277 FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \ 278 macro(DefaultTextEncodingName, defaultTextEncodingName, String, String, "ISO-8859-1") \278 macro(DefaultTextEncodingName, defaultTextEncodingName, String, String, defaultTextEncodingNameForSystemLanguage()) \ 279 279 macro(FTPDirectoryTemplatePath, ftpDirectoryTemplatePath, String, String, "") \ 280 280 \ -
trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp
r170253 r172172 31 31 #include "WebPreferencesKeys.h" 32 32 #include <WebCore/Settings.h> 33 #include <WebCore/TextEncodingRegistry.h> 33 34 #include <wtf/NeverDestroyed.h> 34 35 … … 36 37 #import <WebKitSystemInterfaceIOS.h> 37 38 #endif 39 40 using namespace WebCore; 38 41 39 42 namespace WebKit { -
trunk/Source/WebKit2/UIProcess/WebPreferences.cpp
r171928 r172172 46 46 { 47 47 RefPtr<WebPreferences> preferences = adoptRef(new WebPreferences(identifier, keyPrefix, globalDebugKeyPrefix)); 48 // FIXME: The registerDefault...ValueForKey machinery is unnecessarily heavyweight and complicated. 49 // We can just compute different defaults for modern and legacy APIs in WebPreferencesDefinitions.h macros. 48 50 preferences->registerDefaultBoolValueForKey(WebPreferencesKey::javaEnabledKey(), true); 49 51 preferences->registerDefaultBoolValueForKey(WebPreferencesKey::javaEnabledForLocalFilesKey(), true); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
r170300 r172172 81 81 #endif 82 82 INIT(GetUserToBaseCTM); 83 INIT(GetWebDefaultCFStringEncoding); 83 84 INIT(CGContextIsPDFContext); 84 85 #if !PLATFORM(IOS)
Note: See TracChangeset
for help on using the changeset viewer.