[PAL] Unify PlatformUserPreferredLanguages.h with Language.h
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2017 23:11:21 +0000 (23:11 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Sep 2017 23:11:21 +0000 (23:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176561

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

* runtime/IntlObject.cpp:
(JSC::defaultLocale):

Source/WebCore:

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilitySVGElement.cpp:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* dom/Document.cpp:
* html/HTMLInputElement.cpp:
* html/HTMLMediaElement.cpp:
* html/shadow/MediaControlElements.cpp:
* html/track/TrackBase.cpp:
* page/CaptionUserPreferences.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/DOMWindow.cpp:
* page/Navigator.cpp:
* page/NavigatorBase.cpp:
* platform/graphics/FontGenericFamilies.cpp:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
* platform/network/HTTPParsers.cpp:
* platform/text/PlatformLocale.h:
* platform/text/cf/HyphenationCF.cpp:
* platform/text/mac/LocaleMac.mm:
* svg/SVGTests.cpp:
* testing/InternalSettings.cpp:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::userPreferredLanguages const):
(WebCore::Internals::setUserPreferredLanguages):

Source/WebKit:

* UIProcess/WebProcessPool.cpp:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::userPreferredLanguagesChanged const):

Source/WebKitLegacy/mac:

* Misc/WebNSUserDefaultsExtras.mm:

Source/WTF:

WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
couldn't get it because of the layering violation, so instead it erroneously called into
PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
right function and the PAL effort has one less file to move from WebCore/platform into PAL.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
(WTF::addLanguageChangeObserver):
(WTF::userPreferredLanguages):
* wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformUserPreferredLanguages.h: Removed.
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
(WTF::httpStyleLanguageCode):
(WTF::languagePreferencesDidChange):
(WTF::platformUserPreferredLanguages):
* wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
* wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.

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

50 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/IntlObject.cpp
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Language.cpp [moved from Source/WebCore/platform/Language.cpp with 92% similarity]
Source/WTF/wtf/Language.h [moved from Source/WebCore/platform/Language.h with 57% similarity]
Source/WTF/wtf/PlatformGTK.cmake
Source/WTF/wtf/PlatformJSCOnly.cmake
Source/WTF/wtf/PlatformMac.cmake
Source/WTF/wtf/PlatformUserPreferredLanguages.h [deleted file]
Source/WTF/wtf/PlatformWPE.cmake
Source/WTF/wtf/PlatformWin.cmake
Source/WTF/wtf/cf/LanguageCF.cpp [moved from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm with 65% similarity]
Source/WTF/wtf/unix/LanguageUnix.cpp [moved from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp with 90% similarity]
Source/WTF/wtf/win/LanguageWin.cpp [moved from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp with 93% similarity]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AccessibilitySVGElement.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/track/TrackBase.cpp
Source/WebCore/page/CaptionUserPreferences.cpp
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/NavigatorBase.cpp
Source/WebCore/platform/graphics/FontGenericFamilies.cpp
Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm
Source/WebCore/platform/network/HTTPParsers.cpp
Source/WebCore/platform/text/PlatformLocale.h
Source/WebCore/platform/text/cf/HyphenationCF.cpp
Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp
Source/WebCore/platform/text/mac/LocaleMac.mm
Source/WebCore/platform/text/win/LocaleWin.cpp
Source/WebCore/svg/SVGTests.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Misc/WebNSUserDefaultsExtras.mm

index d6e24f02df8335e0ecb4c6546d11ea874be6d29b..2426ab4b547e651743855b266dea6c9bd6fe9958 100644 (file)
@@ -1,3 +1,13 @@
+2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
+        https://bugs.webkit.org/show_bug.cgi?id=176561
+
+        Reviewed by Brent Fulgham.
+
+        * runtime/IntlObject.cpp:
+        (JSC::defaultLocale):
+
 2017-09-07  Joseph Pecoraro  <pecoraro@apple.com>
 
         Augmented Inspector: Provide a way to inspect a DOM Node (DOM.inspect)
index 9f174d6405c9f3a086b26356bdceebbcf0484085..25d21f2ee5ce3c7672316aaf6f7a035d6a21f981 100644 (file)
@@ -48,8 +48,8 @@
 #include <unicode/uloc.h>
 #include <unicode/unumsys.h>
 #include <wtf/Assertions.h>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PlatformUserPreferredLanguages.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace JSC {
@@ -576,16 +576,14 @@ String defaultLocale(ExecState& state)
     
     // WebCore's global objects will have their own ideas of how to determine the language. It may
     // be determined by WebCore-specific logic like some WK settings. Usually this will return the
-    // same thing as platformUserPreferredLanguages()[0].
+    // same thing as userPreferredLanguages()[0].
     if (auto defaultLanguage = state.jsCallee()->globalObject()->globalObjectMethodTable()->defaultLanguage) {
         String locale = defaultLanguage();
         if (!locale.isEmpty())
             return canonicalizeLanguageTag(locale);
     }
-    
-    // If WebCore isn't around to tell us how to get the language then fall back to our own way of
-    // doing it, which mostly follows what WebCore would have done.
-    Vector<String> languages = platformUserPreferredLanguages();
+
+    Vector<String> languages = userPreferredLanguages();
     if (!languages.isEmpty() && !languages[0].isEmpty())
         return canonicalizeLanguageTag(languages[0]);
     
index fa8b1adb396d497d1870fbf58b8be6dc30ecdeba..5d704e5033773e61ec2419fe15203778bbb6f0c1 100644 (file)
@@ -1,3 +1,35 @@
+2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
+        https://bugs.webkit.org/show_bug.cgi?id=176561
+
+        Reviewed by Brent Fulgham.
+
+        WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
+        That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
+        couldn't get it because of the layering violation, so instead it erroneously called into
+        PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
+        right function and the PAL effort has one less file to move from WebCore/platform into PAL.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
+        (WTF::addLanguageChangeObserver):
+        (WTF::userPreferredLanguages):
+        * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
+        * wtf/PlatformGTK.cmake:
+        * wtf/PlatformJSCOnly.cmake:
+        * wtf/PlatformMac.cmake:
+        * wtf/PlatformUserPreferredLanguages.h: Removed.
+        * wtf/PlatformWPE.cmake:
+        * wtf/PlatformWin.cmake:
+        * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
+        (WTF::httpStyleLanguageCode):
+        (WTF::languagePreferencesDidChange):
+        (WTF::platformUserPreferredLanguages):
+        * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
+        * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
+
 2017-09-06  Eric Carlson  <eric.carlson@apple.com>
 
         Require LoggingHelper overrides to provide identifier
index b0a1908badd902787ccb45e117aee1281b267bf5..129b98539668fefc60204b76a835e6476f886e1f 100644 (file)
                AD89B6B71E6415080090707F /* MemoryPressureHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD89B6B51E6415080090707F /* MemoryPressureHandler.cpp */; };
                AD89B6BA1E64150F0090707F /* MemoryPressureHandlerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = AD89B6B91E64150F0090707F /* MemoryPressureHandlerCocoa.mm */; };
                ADF2CE671E39F106006889DB /* MemoryFootprintCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADF2CE651E39F106006889DB /* MemoryFootprintCocoa.cpp */; };
+               C2BCFC401F61D13000C9222C /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2BCFC3E1F61D13000C9222C /* Language.cpp */; };
+               C2BCFC421F61D61600C9222C /* LanguageCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2BCFC411F61D61600C9222C /* LanguageCF.cpp */; };
                CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
                DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */; };
-               DCEE22031CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FF1CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm */; };
                E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; };
                E311FB171F0A568B003C08DE /* ThreadGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E311FB151F0A568B003C08DE /* ThreadGroup.cpp */; };
                E38C41251EB4E04C0042957D /* CPUTimeCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = E38C41241EB4E04C0042957D /* CPUTimeCocoa.mm */; };
                ADF2CE641E39F106006889DB /* MemoryFootprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryFootprint.h; sourceTree = "<group>"; };
                ADF2CE651E39F106006889DB /* MemoryFootprintCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFootprintCocoa.cpp; sourceTree = "<group>"; };
                B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
+               C2BCFC3E1F61D13000C9222C /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Language.cpp; sourceTree = "<group>"; };
+               C2BCFC3F1F61D13000C9222C /* Language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Language.h; sourceTree = "<group>"; };
+               C2BCFC411F61D61600C9222C /* LanguageCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageCF.cpp; sourceTree = "<group>"; };
                C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
                C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomDevice.cpp; sourceTree = "<group>"; };
                CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
                DCEE21FA1CEA7538000C2396 /* CFBundleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFBundleSPI.h; path = cf/CFBundleSPI.h; sourceTree = "<group>"; };
                DCEE21FC1CEA7551000C2396 /* BlockObjCExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockObjCExceptions.h; sourceTree = "<group>"; };
                DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockObjCExceptions.mm; sourceTree = "<group>"; };
-               DCEE21FE1CEA7551000C2396 /* PlatformUserPreferredLanguages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUserPreferredLanguages.h; sourceTree = "<group>"; };
-               DCEE21FF1CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUserPreferredLanguagesMac.mm; sourceTree = "<group>"; };
                DCEE22041CEB9869000C2396 /* BackwardsGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackwardsGraph.h; sourceTree = "<group>"; };
                DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
                E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicUtilities.cpp; sourceTree = "<group>"; };
                2CDED0F018115C3F004DBA70 /* cf */ = {
                        isa = PBXGroup;
                        children = (
+                               C2BCFC411F61D61600C9222C /* LanguageCF.cpp */,
                                2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */,
                                1AFDE647195201C300C48FFA /* TypeCastsCF.h */,
                        );
                                5182C22C1F2BC7E60059BA7C /* InstanceCounted.h */,
                                7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */,
                                7CDD7FF9186D2A54007433CD /* IteratorRange.h */,
+                               C2BCFC3E1F61D13000C9222C /* Language.cpp */,
+                               C2BCFC3F1F61D13000C9222C /* Language.h */,
                                539EB0621D55284200C82EF7 /* LEBDecoder.h */,
                                A70DA0831799F04D00529A9B /* ListDump.h */,
                                A8A472C1151A825A004123FF /* ListHashSet.h */,
                                0F824A651B7443A0002E345D /* ParkingLot.h */,
                                A876DBD7151816E500DADB95 /* Platform.h */,
                                E3200AB41E9A536D003B59D2 /* PlatformRegisters.h */,
-                               DCEE21FE1CEA7551000C2396 /* PlatformUserPreferredLanguages.h */,
-                               DCEE21FF1CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm */,
                                0FF860941BCCBD740045127F /* PointerComparison.h */,
                                0F9D335D165DBA73005AD387 /* PrintStream.cpp */,
                                0F9D335E165DBA73005AD387 /* PrintStream.h */,
                                515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */,
                                A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */,
                                E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */,
-                               0F0F526B1F421FF8004A452C /* StringMalloc.cpp in Sources */,
                                A8A47439151A825B004123FF /* CString.cpp in Sources */,
                                A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */,
                                A8A4739E151A825B004123FF /* DataLog.cpp in Sources */,
                                0F30BA901E78708E002CA847 /* GlobalVersion.cpp in Sources */,
                                2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */,
                                A8A473D8151A825B004123FF /* HashTable.cpp in Sources */,
+                               C2BCFC401F61D13000C9222C /* Language.cpp in Sources */,
+                               C2BCFC421F61D61600C9222C /* LanguageCF.cpp in Sources */,
                                0FE1646A1B6FFC9600400E7C /* Lock.cpp in Sources */,
                                0F60F32F1DFCBD1B00416D6C /* LockedPrintStream.cpp in Sources */,
                                53534F2A1EC0E10E00141B2F /* MachExceptions.defs in Sources */,
                                51F1752B1F3D486000C74950 /* PersistentCoders.cpp in Sources */,
                                51F1752C1F3D486000C74950 /* PersistentDecoder.cpp in Sources */,
                                51F1752D1F3D486000C74950 /* PersistentEncoder.cpp in Sources */,
-                               DCEE22031CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm in Sources */,
                                0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */,
                                143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */,
                                A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */,
                                A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */,
                                A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */,
                                A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */,
+                               0F0F526B1F421FF8004A452C /* StringMalloc.cpp in Sources */,
                                0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */,
                                93F1993E19D7958D00C2390B /* StringView.cpp in Sources */,
                                93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */,
index 3a6ce9e4edea998a53ea44e549c637570e756a72..dca38bbd774bc1ce40d608ed81d99576208f951e 100644 (file)
@@ -60,6 +60,7 @@ set(WTF_HEADERS
     IndexedContainerIterator.h
     IteratorAdaptors.h
     IteratorRange.h
+    Language.h
     ListHashSet.h
     Liveness.h
     Lock.h
@@ -229,6 +230,7 @@ set(WTF_SOURCES
     GlobalVersion.cpp
     GregorianDateTime.cpp
     HashTable.cpp
+    Language.cpp
     Lock.cpp
     LockedPrintStream.cpp
     MD5.cpp
similarity index 92%
rename from Source/WebCore/platform/Language.cpp
rename to Source/WTF/wtf/Language.cpp
index ec4b349246ac7e9e76006ae7b048304962fa8009..aa2e8c1003c1553c8eb2c395195c1c4781bf6f57 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2013, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2013, 2016, 2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,7 +28,6 @@
 
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PlatformUserPreferredLanguages.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/text/WTFString.h>
 
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
-namespace WebCore {
+namespace WTF {
 
 static StaticLock userPreferredLanguagesMutex;
 
-static void registerLanguageDidChangeCallbackIfNecessary()
-{
-    static std::once_flag once;
-    std::call_once(
-        once,
-        [] {
-            setPlatformUserPreferredLanguagesChangedCallback(languageDidChange);
-        });
-}
-
 typedef HashMap<void*, LanguageChangeObserverFunction> ObserverMap;
 static ObserverMap& observerMap()
 {
@@ -59,7 +48,6 @@ static ObserverMap& observerMap()
 
 void addLanguageChangeObserver(void* context, LanguageChangeObserverFunction customObserver)
 {
-    registerLanguageDidChangeCallbackIfNecessary();
     observerMap().set(context, customObserver);
 }
 
@@ -119,8 +107,7 @@ Vector<String> userPreferredLanguages()
         if (!override.isEmpty())
             return isolatedCopy(override);
     }
-    
-    registerLanguageDidChangeCallbackIfNecessary();
+
     return platformUserPreferredLanguages();
 }
 
similarity index 57%
rename from Source/WebCore/platform/Language.h
rename to Source/WTF/wtf/Language.h
index cd7e667a2711249895136273c9eac3cb408f176c..305b91899d4cdefe0baf00bcd0213fbbd7c8c42a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2006, 2010, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2010, 2013, 2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef Language_h
-#define Language_h
+#pragma once
 
 #include <wtf/Forward.h>
 #include <wtf/Vector.h>
 
-namespace WebCore {
+namespace WTF {
 
-WEBCORE_EXPORT String defaultLanguage(); // Thread-safe.
-WEBCORE_EXPORT Vector<String> userPreferredLanguages(); // Thread-safe, returns BCP 47 language tags.
-Vector<String> userPreferredLanguagesOverride();
-WEBCORE_EXPORT void overrideUserPreferredLanguages(const Vector<String>&);
-size_t indexOfBestMatchingLanguageInList(const String& language, const Vector<String>& languageList, bool& exactMatch);
+WTF_EXPORT String defaultLanguage(); // Thread-safe.
+WTF_EXPORT Vector<String> userPreferredLanguages(); // Thread-safe, returns BCP 47 language tags.
+WTF_EXPORT Vector<String> userPreferredLanguagesOverride();
+WTF_EXPORT void overrideUserPreferredLanguages(const Vector<String>&);
+WTF_EXPORT size_t indexOfBestMatchingLanguageInList(const String& language, const Vector<String>& languageList, bool& exactMatch);
+WTF_EXPORT Vector<String> platformUserPreferredLanguages();
+// Called from platform specific code when the user's preferred language(s) change.
+void languageDidChange();
 
 // The observer function will be called when system language changes.
 typedef void (*LanguageChangeObserverFunction)(void* context);
-WEBCORE_EXPORT void addLanguageChangeObserver(void* context, LanguageChangeObserverFunction);
-WEBCORE_EXPORT void removeLanguageChangeObserver(void* context);
-
-String displayNameForLanguageLocale(const String&);
+WTF_EXPORT void addLanguageChangeObserver(void* context, LanguageChangeObserverFunction);
+WTF_EXPORT void removeLanguageChangeObserver(void* context);
 
-// Called from platform specific code when the user's preferred language(s) change.
-WEBCORE_EXPORT void languageDidChange();
+WTF_EXPORT String displayNameForLanguageLocale(const String&);
 }
 
-#endif
+using WTF::defaultLanguage;
+using WTF::userPreferredLanguages;
+using WTF::userPreferredLanguagesOverride;
+using WTF::overrideUserPreferredLanguages;
+using WTF::indexOfBestMatchingLanguageInList;
+using WTF::platformUserPreferredLanguages;
+using WTF::addLanguageChangeObserver;
+using WTF::removeLanguageChangeObserver;
+using WTF::displayNameForLanguageLocale;
+
index cda5c29723d37add5b08cbbe861e346b9791cf57..da038a01fc30c3e4838fd376bc54a1e54c3be785 100644 (file)
@@ -12,8 +12,8 @@ list(APPEND WTF_SOURCES
     linux/MemoryPressureHandlerLinux.cpp
 
     unix/CPUTimeUnix.cpp
+    unix/LanguageUnix.cpp
 
-    PlatformUserPreferredLanguagesUnix.cpp
     UniStdExtras.cpp
 
     text/unix/TextBreakIteratorInternalICUUnix.cpp
index 44b2200bbb6f4f2a16a9947a440727aaf171d53f..3e77cc4a4829dbb765364ca01a40b9f8b64880a5 100644 (file)
@@ -1,5 +1,4 @@
 list(APPEND WTF_SOURCES
-    PlatformUserPreferredLanguagesUnix.cpp
 
     generic/MainThreadGeneric.cpp
     generic/WorkQueueGeneric.cpp
@@ -8,11 +7,13 @@ list(APPEND WTF_SOURCES
 if (WIN32)
     list(APPEND WTF_SOURCES
         win/CPUTimeWin.cpp
+        win/LanguageWin.cpp
         text/win/TextBreakIteratorInternalICUWin.cpp
     )
 else ()
     list(APPEND WTF_SOURCES
         unix/CPUTimeUnix.cpp
+        unix/LanguageUnix.cpp
         text/unix/TextBreakIteratorInternalICUUnix.cpp
     )
 endif ()
index b4b1daf3394579e2e8343a12e001243eb4d2989a..f071d2f0ebb0941aa7832f59a416809c25da2c41 100644 (file)
@@ -10,15 +10,15 @@ list(APPEND WTF_LIBRARIES
 list(APPEND WTF_SOURCES
     AutodrainedPoolMac.mm
     BlockObjCExceptions.mm
-    PlatformUserPreferredLanguagesMac.mm
     RunLoopTimerCF.cpp
     SchedulePairCF.cpp
     SchedulePairMac.mm
 
-    text/mac/TextBreakIteratorInternalICUMac.mm
-
+    cf/LanguageCF.cpp
     cf/RunLoopCF.cpp
 
+    text/mac/TextBreakIteratorInternalICUMac.mm
+
     cocoa/CPUTimeCocoa.mm
     cocoa/MemoryFootprintCocoa.cpp
     cocoa/MemoryPressureHandlerCocoa.mm
diff --git a/Source/WTF/wtf/PlatformUserPreferredLanguages.h b/Source/WTF/wtf/PlatformUserPreferredLanguages.h
deleted file mode 100644 (file)
index 93580fc..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2016 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 PlatformUserPreferredLanguages_h
-#define PlatformUserPreferredLanguages_h
-
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WTF {
-
-WTF_EXPORT_PRIVATE void setPlatformUserPreferredLanguagesChangedCallback(void (*)());
-
-// This is thread-safe.
-WTF_EXPORT_PRIVATE Vector<String> platformUserPreferredLanguages();
-
-} // namespace WTF
-
-using WTF::setPlatformUserPreferredLanguagesChangedCallback;
-using WTF::platformUserPreferredLanguages;
-
-#endif // PlatformUserPreferredLanguages_h
-
index 4f15b6dda9f4cff946273a26dea9854a526f6e1a..4b410e5fb72de590256e429b6c1bee273c84e684 100644 (file)
@@ -1,5 +1,4 @@
 list(APPEND WTF_SOURCES
-    PlatformUserPreferredLanguagesUnix.cpp
     UniStdExtras.cpp
 
     generic/MainThreadGeneric.cpp
@@ -16,6 +15,7 @@ list(APPEND WTF_SOURCES
     text/unix/TextBreakIteratorInternalICUUnix.cpp
 
     unix/CPUTimeUnix.cpp
+    unix/LanguageUnix.cpp
 )
 
 list(APPEND WTF_LIBRARIES
index 36bcec4b6633b25c39f14d78e1a55ecd43d48d22..5cfec077c4e531aeba6a1dd6336dbd928ab8f998 100644 (file)
@@ -3,11 +3,10 @@ list(APPEND WTF_HEADERS
 )
 
 list(APPEND WTF_SOURCES
-    PlatformUserPreferredLanguagesWin.cpp
-
     text/win/TextBreakIteratorInternalICUWin.cpp
 
     win/CPUTimeWin.cpp
+    win/LanguageWin.cpp
     win/MainThreadWin.cpp
     win/MemoryFootprintWin.cpp
     win/MemoryPressureHandlerWin.cpp
similarity index 65%
rename from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm
rename to Source/WTF/wtf/cf/LanguageCF.cpp
index 3ae71aefc36ae895a8afbe76a64c53c63096e440..ac203d17cf89a203b9facb1c1a8bab1b68409c5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2005, 2006, 2010, 2011, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2010, 2011, 2016, 2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "config.h"
-#import "PlatformUserPreferredLanguages.h"
+#include "config.h"
+#include "Language.h"
 
-#import "BlockObjCExceptions.h"
-#import <mutex>
-#import <unicode/uloc.h>
-#import <wtf/Assertions.h>
-#import <wtf/Lock.h>
-#import <wtf/NeverDestroyed.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/spi/cf/CFBundleSPI.h>
-#import <wtf/text/WTFString.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <mutex>
+#include <unicode/uloc.h>
+#include <wtf/Assertions.h>
+#include <wtf/Lock.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/spi/cf/CFBundleSPI.h>
+#include <wtf/text/WTFString.h>
 
 namespace WTF {
 
-static void (*callback)();
-
-void setPlatformUserPreferredLanguagesChangedCallback(void (*passedCallback)())
-{
-    callback = passedCallback;
-}
-
 static StaticLock preferredLanguagesMutex;
 
 static Vector<String>& preferredLanguages()
@@ -53,31 +46,7 @@ static Vector<String>& preferredLanguages()
     return languages;
 }
 
-}
-
-@interface WTFLanguageChangeObserver : NSObject
-@end
-
-@implementation WTFLanguageChangeObserver
-
-+ (void)languagePreferencesDidChange:(NSNotification *)notification
-{
-    UNUSED_PARAM(notification);
-
-    {
-        std::lock_guard<StaticLock> lock(WTF::preferredLanguagesMutex);
-        WTF::preferredLanguages().clear();
-    }
-    
-    if (WTF::callback)
-        WTF::callback();
-}
-
-@end
-
-namespace WTF {
-
-static String httpStyleLanguageCode(NSString *language)
+static String httpStyleLanguageCode(CFStringRef language)
 {
     SInt32 languageCode;
     SInt32 regionCode;
@@ -88,32 +57,42 @@ static String httpStyleLanguageCode(NSString *language)
     // 1. There is no reason why CFBundle localization names would be at all related to language names as used on the Web.
     // 2. Script Manager codes cannot represent all languages that are now supported by the platform, so the conversion is lossy.
     // 3. This should probably match what is sent by the network layer as Accept-Language, but currently, that's implemented separately.
-    CFBundleGetLocalizationInfoForLocalization((CFStringRef)language, &languageCode, &regionCode, &scriptCode, &stringEncoding);
+    CFBundleGetLocalizationInfoForLocalization(language, &languageCode, &regionCode, &scriptCode, &stringEncoding);
     RetainPtr<CFStringRef> preferredLanguageCode = adoptCF(CFBundleCopyLocalizationForLocalizationInfo(languageCode, regionCode, scriptCode, stringEncoding));
     if (preferredLanguageCode)
-        language = (NSString *)preferredLanguageCode.get();
+        language = preferredLanguageCode.get();
 
     // Turn a '_' into a '-' if it appears after a 2-letter language code
-    if ([language length] >= 3 && [language characterAtIndex:2] == '_') {
-        RetainPtr<NSMutableString> mutableLanguageCode = adoptNS([language mutableCopy]);
-        [mutableLanguageCode.get() replaceCharactersInRange:NSMakeRange(2, 1) withString:@"-"];
+    if (CFStringGetLength(language) >= 3 && CFStringGetCharacterAtIndex(language, 2) == '_') {
+        auto mutableLanguageCode = adoptCF(CFStringCreateMutableCopy(kCFAllocatorDefault, 0, language));
+        CFStringReplace(mutableLanguageCode.get(), CFRangeMake(2, 1), CFSTR("-"));
         return mutableLanguageCode.get();
     }
 
     return language;
 }
 
+#if PLATFORM(MAC)
+static void languagePreferencesDidChange(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef)
+{
+    {
+        std::lock_guard<StaticLock> lock(preferredLanguagesMutex);
+        preferredLanguages().clear();
+    }
+    
+    languageDidChange();
+}
+#endif
+
 Vector<String> platformUserPreferredLanguages()
 {
 #if PLATFORM(MAC)
     static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        [[NSDistributedNotificationCenter defaultCenter] addObserver:[WTFLanguageChangeObserver self] selector:@selector(languagePreferencesDidChange:) name:@"AppleLanguagePreferencesChangedNotification" object:nil];
+    dispatch_once(&onceToken, ^ {
+        CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), nullptr, &languagePreferencesDidChange, CFSTR("AppleLanguagePreferencesChangedNotification"), nullptr, CFNotificationSuspensionBehaviorCoalesce);
     });
 #endif
 
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
     std::lock_guard<StaticLock> lock(preferredLanguagesMutex);
     Vector<String>& userPreferredLanguages = preferredLanguages();
 
@@ -124,7 +103,7 @@ Vector<String> platformUserPreferredLanguages()
             userPreferredLanguages.append("en");
         else {
             for (CFIndex i = 0; i < languageCount; i++)
-                userPreferredLanguages.append(httpStyleLanguageCode((NSString *)CFArrayGetValueAtIndex(languages.get(), i)));
+                userPreferredLanguages.append(httpStyleLanguageCode(static_cast<CFStringRef>(CFArrayGetValueAtIndex(languages.get(), i))));
         }
     }
 
@@ -136,8 +115,6 @@ Vector<String> platformUserPreferredLanguages()
 
     return userPreferredLanguagesCopy;
 
-    END_BLOCK_OBJC_EXCEPTIONS;
-
     return Vector<String>();
 }
 
similarity index 90%
rename from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp
rename to Source/WTF/wtf/unix/LanguageUnix.cpp
index a1872d89a51b2b6d4847886f70771ce37662f387..e016fb2ae370b3181359b8aef393f3e57f52f353 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016, 2017 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "PlatformUserPreferredLanguages.h"
+#include "Language.h"
 
 #include <locale.h>
 #include <wtf/Vector.h>
@@ -27,8 +27,6 @@
 
 namespace WTF {
 
-void setPlatformUserPreferredLanguagesChangedCallback(void (*)()) { }
-
 // Using pango_language_get_default() here is not an option, because
 // it doesn't support changing the locale in runtime, so it returns
 // always the same value.
similarity index 93%
rename from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp
rename to Source/WTF/wtf/win/LanguageWin.cpp
index 79ad23c5439ce23320805b29d983212416763c6a..760109855003da0c2eb327996179b163d2983825 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2016 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007, 2016, 2017 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "PlatformUserPreferredLanguages.h"
+#include "Language.h"
 
 #include <mutex>
 #include <windows.h>
@@ -36,8 +36,6 @@ namespace WTF {
 
 static StaticLock platformLanguageMutex;
 
-void setPlatformUserPreferredLanguagesChangedCallback(void (*)()) { }
-
 static String localeInfo(LCTYPE localeType, const String& fallback)
 {
     LANGID langID = GetUserDefaultUILanguage();
index 9d903256c34196c8243eb1672579ade1ad53e76b..9ad1cc27bfdd67ab10b0ffbc5d92ffe4e7b90c54 100644 (file)
@@ -2275,7 +2275,6 @@ set(WebCore_SOURCES
     platform/FileStream.cpp
     platform/FileSystem.cpp
     platform/GenericTaskQueue.cpp
-    platform/Language.cpp
     platform/LayoutUnit.cpp
     platform/Length.cpp
     platform/LengthBox.cpp
index ec5f6fcd105c44bb1dbbd406fb850c90970f8d92..dfb53234bc2cd198b3515f2a22793408c806d9fe 100644 (file)
@@ -1,3 +1,40 @@
+2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
+        https://bugs.webkit.org/show_bug.cgi?id=176561
+
+        Reviewed by Brent Fulgham.
+
+        No new tests because there is no behavior change.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AccessibilitySVGElement.cpp:
+        * bindings/js/JSDOMWindowBase.cpp:
+        * bindings/js/JSWorkerGlobalScopeBase.cpp:
+        * dom/Document.cpp:
+        * html/HTMLInputElement.cpp:
+        * html/HTMLMediaElement.cpp:
+        * html/shadow/MediaControlElements.cpp:
+        * html/track/TrackBase.cpp:
+        * page/CaptionUserPreferences.cpp:
+        * page/CaptionUserPreferencesMediaAF.cpp:
+        * page/DOMWindow.cpp:
+        * page/Navigator.cpp:
+        * page/NavigatorBase.cpp:
+        * platform/graphics/FontGenericFamilies.cpp:
+        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
+        * platform/network/HTTPParsers.cpp:
+        * platform/text/PlatformLocale.h:
+        * platform/text/cf/HyphenationCF.cpp:
+        * platform/text/mac/LocaleMac.mm:
+        * svg/SVGTests.cpp:
+        * testing/InternalSettings.cpp:
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+        (WebCore::Internals::userPreferredLanguages const):
+        (WebCore::Internals::setUserPreferredLanguages):
+
 2017-09-06  Dean Jackson  <dino@apple.com>
 
         [WebGL] accelerated texImage2D for video doesn't respect flipY
index 8ac0c038575d3af891ebd5cef6fa1094a6622db7..32207b03bf00eaa01e74498f4da810fc4dd2885e 100644 (file)
                854FE7370A2297BE0058D7AD /* Traversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 854FE72D0A2297BE0058D7AD /* Traversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                854FE7380A2297BE0058D7AD /* TreeWalker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 854FE72E0A2297BE0058D7AD /* TreeWalker.cpp */; };
                854FE7390A2297BE0058D7AD /* TreeWalker.h in Headers */ = {isa = PBXBuildFile; fileRef = 854FE72F0A2297BE0058D7AD /* TreeWalker.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */ = {isa = PBXBuildFile; fileRef = 85EC9AF90A71A2C600EEEAED /* Language.h */; settings = {ATTRIBUTES = (Private, ); }; };
                861C2EA413FB4FDD00062ABB /* LoadTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861C2EA313FB4FDD00062ABB /* LoadTiming.cpp */; };
                862F129E18C1576F005C54AF /* CountedUserActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 862F129D18C1572C005C54AF /* CountedUserActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
                862F12A018C1DD02005C54AF /* HysteresisActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 862F129F18C1DCE4005C54AF /* HysteresisActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9391A991162746CB00297330 /* ScrollingCoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A990162746CB00297330 /* ScrollingCoordinatorMac.h */; };
                9391A99C1629D70000297330 /* ScrollingTreeScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9391A99A1629D6FF00297330 /* ScrollingTreeScrollingNode.cpp */; };
                9391A99D1629D70000297330 /* ScrollingTreeScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A6D5A99C1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D5A99A1629D6FF00297330 /* ScrollingTreeScrollingNodeDelegate.cpp */; };
-               A6D5A99D1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D5A99B1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9392146918A6D791000EE688 /* TextIteratorBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392146818A6D791000EE688 /* TextIteratorBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */; };
                9392F1420AD185F400691BD4 /* RenderCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F1410AD185F400691BD4 /* RenderCounter.h */; };
                A6148A7912E41E3B0044A784 /* JSHTMLKeygenElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A6148A7712E41E3B0044A784 /* JSHTMLKeygenElement.h */; };
                A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D169611346B49B000EB770 /* ShadowRoot.cpp */; };
                A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D169631346B4C1000EB770 /* ShadowRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A6D5A99C1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6D5A99A1629D6FF00297330 /* ScrollingTreeScrollingNodeDelegate.cpp */; };
+               A6D5A99D1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A6D5A99B1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A7151BD812F1558F005A0F64 /* TextCheckerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A7151BD712F1558F005A0F64 /* TextCheckerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A715E652134BBBEC00D8E713 /* ProgressShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */; };
                A715E653134BBBEC00D8E713 /* ProgressShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */; };
                E182568F0EF2B02D00933242 /* JSWorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E182568D0EF2B02D00933242 /* JSWorkerGlobalScope.cpp */; };
                E18256900EF2B02D00933242 /* JSWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = E182568E0EF2B02D00933242 /* JSWorkerGlobalScope.h */; };
                E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18258AB0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp */; };
-               E18772F1126E2629003DD586 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18772F0126E2629003DD586 /* Language.cpp */; };
                E18DF33518AAF12C00773E59 /* SerializedCryptoKeyWrap.h in Headers */ = {isa = PBXBuildFile; fileRef = E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E18DF33818AAF14D00773E59 /* SerializedCryptoKeyWrapMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E18DF33618AAF14D00773E59 /* SerializedCryptoKeyWrapMac.mm */; };
                E19727161820549E00592D51 /* CryptoKeyType.h in Headers */ = {isa = PBXBuildFile; fileRef = E19727151820549E00592D51 /* CryptoKeyType.h */; };
                7CBA5BA61F0B4BDE0034D745 /* JSDOMConvertWebGL.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConvertWebGL.cpp; sourceTree = "<group>"; };
                7CBBBCC41F560567005EFAAC /* DOMMatrix2DInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMMatrix2DInit.idl; sourceTree = "<group>"; };
                7CBBBCC61F560568005EFAAC /* DOMMatrix2DInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMMatrix2DInit.h; sourceTree = "<group>"; };
-               7CBBBCC81F5617C0005EFAAC /* JSDOMMatrix2DInit.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMMatrix2DInit.cpp; path = JSDOMMatrix2DInit.cpp; sourceTree = "<group>"; };
-               7CBBBCC91F5617C0005EFAAC /* JSDOMMatrix2DInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDOMMatrix2DInit.h; path = JSDOMMatrix2DInit.h; sourceTree = "<group>"; };
+               7CBBBCC81F5617C0005EFAAC /* JSDOMMatrix2DInit.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrix2DInit.cpp; sourceTree = "<group>"; };
+               7CBBBCC91F5617C0005EFAAC /* JSDOMMatrix2DInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSDOMMatrix2DInit.h; sourceTree = "<group>"; };
                7CC2DDF81EC9415A0027B774 /* NotificationPermission.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationPermission.h; sourceTree = "<group>"; };
                7CC2DDFA1EC9415A0027B774 /* NotificationPermission.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NotificationPermission.idl; sourceTree = "<group>"; };
                7CC2DDFE1EC95A440027B774 /* JSNotificationPermission.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotificationPermission.cpp; sourceTree = "<group>"; };
                85C56CAD0AA89FE000D95755 /* CSSUnknownRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSUnknownRule.idl; sourceTree = "<group>"; };
                85DF2F690AA3C74300AD64C5 /* HTMLCollection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLCollection.idl; sourceTree = "<group>"; };
                85DF2F920AA3C9B600AD64C5 /* HTMLOptionsCollection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLOptionsCollection.idl; sourceTree = "<group>"; };
-               85EC9AF90A71A2C600EEEAED /* Language.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Language.h; sourceTree = "<group>"; };
                861C2EA313FB4FDD00062ABB /* LoadTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadTiming.cpp; sourceTree = "<group>"; };
                862F129D18C1572C005C54AF /* CountedUserActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountedUserActivity.h; sourceTree = "<group>"; };
                862F129F18C1DCE4005C54AF /* HysteresisActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HysteresisActivity.h; sourceTree = "<group>"; };
                9391A990162746CB00297330 /* ScrollingCoordinatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingCoordinatorMac.h; sourceTree = "<group>"; };
                9391A99A1629D6FF00297330 /* ScrollingTreeScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeScrollingNode.cpp; sourceTree = "<group>"; };
                9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNode.h; sourceTree = "<group>"; };
-               A6D5A99A1629D6FF00297330 /* ScrollingTreeScrollingNodeDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeScrollingNodeDelegate.cpp; sourceTree = "<group>"; };
-               A6D5A99B1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNodeDelegate.h; sourceTree = "<group>"; };
                9392146818A6D791000EE688 /* TextIteratorBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIteratorBehavior.h; sourceTree = "<group>"; };
                9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSRuleListCustom.cpp; sourceTree = "<group>"; };
                9392F1410AD185F400691BD4 /* RenderCounter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderCounter.h; sourceTree = "<group>"; };
                A6148A7F12E41ED10044A784 /* HTMLKeygenElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLKeygenElement.idl; sourceTree = "<group>"; };
                A6D169611346B49B000EB770 /* ShadowRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowRoot.cpp; sourceTree = "<group>"; };
                A6D169631346B4C1000EB770 /* ShadowRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowRoot.h; sourceTree = "<group>"; };
+               A6D5A99A1629D6FF00297330 /* ScrollingTreeScrollingNodeDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeScrollingNodeDelegate.cpp; sourceTree = "<group>"; };
+               A6D5A99B1629D70000297330 /* ScrollingTreeScrollingNodeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNodeDelegate.h; sourceTree = "<group>"; };
                A7151BD712F1558F005A0F64 /* TextCheckerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerClient.h; sourceTree = "<group>"; };
                A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressShadowElement.cpp; sourceTree = "<group>"; };
                A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressShadowElement.h; sourceTree = "<group>"; };
                E182568D0EF2B02D00933242 /* JSWorkerGlobalScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerGlobalScope.cpp; sourceTree = "<group>"; };
                E182568E0EF2B02D00933242 /* JSWorkerGlobalScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerGlobalScope.h; sourceTree = "<group>"; };
                E18258AB0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerGlobalScopeCustom.cpp; sourceTree = "<group>"; };
-               E18772F0126E2629003DD586 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Language.cpp; sourceTree = "<group>"; };
                E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedCryptoKeyWrap.h; sourceTree = "<group>"; };
                E18DF33618AAF14D00773E59 /* SerializedCryptoKeyWrapMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedCryptoKeyWrapMac.mm; sourceTree = "<group>"; };
                E19727151820549E00592D51 /* CryptoKeyType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyType.h; sourceTree = "<group>"; };
                                0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */,
                                0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */,
                                0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */,
-                               1B94E409187F82E10045882C /* ScrollingTreeScrollingNodeDelegate.cpp */,
-                               1B94E40A187F82E10045882C /* ScrollingTreeScrollingNodeDelegate.h */,
                        );
                        path = ios;
                        sourceTree = "<group>";
                                862F129F18C1DCE4005C54AF /* HysteresisActivity.h */,
                                1AE00D57182DAC8D00087DD7 /* KeyedCoding.h */,
                                E15FF7D418C9553800FE4C87 /* KeypressCommand.h */,
-                               E18772F0126E2629003DD586 /* Language.cpp */,
-                               85EC9AF90A71A2C600EEEAED /* Language.h */,
                                A3D42A841F33BA3600A64B62 /* LayoutUnit.cpp */,
                                141DC0471648348F00371E5A /* LayoutUnit.h */,
                                BCE65BE80EACDF16007E4533 /* Length.cpp */,
                                84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */,
                                84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */,
                                84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
-                               517A535B1F588A4C00DCDC0A /* FetchBodyConsumer.h in Headers */,
                                4129C9971F59B963009D7403 /* FetchBodySource.h in Headers */,
                                41D129DB1F3D143800D15E47 /* FetchHeaders.h in Headers */,
                                416E6FE81BBD12DF000A6023 /* FetchInternalsBuiltins.h in Headers */,
-                               517A535A1F5889EF00DCDC0A /* FetchLoader.h in Headers */,
-                               517A53581F5889E800DCDC0A /* FetchLoaderClient.h in Headers */,
                                41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */,
                                7CE1914D1F2A9AFB00272F78 /* FetchReferrerPolicy.h in Headers */,
                                7CE1915A1F2A9B3400272F78 /* FetchRequestCache.h in Headers */,
                                E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */,
                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
                                A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
-                               85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */,
                                2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */,
                                2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
                                E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
                                2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
                                51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
                                51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
-                               517A535D1F5899FE00DCDC0A /* ServiceWorkerFetchResult.h in Headers */,
                                51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */,
                                51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */,
                                51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */,
                                BC5EBA100E823E4700B25965 /* KeyframeList.cpp in Sources */,
                                450CEBF015073BBE002BB149 /* LabelableElement.cpp in Sources */,
                                A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
-                               E18772F1126E2629003DD586 /* Language.cpp in Sources */,
                                2917B5611473496C0052C9D0 /* LayerFlushScheduler.cpp in Sources */,
                                2917B566147349950052C9D0 /* LayerFlushSchedulerMac.cpp in Sources */,
                                7AA3A69F194B59B6001CBD24 /* LayerPool.cpp in Sources */,
index 70756ffad7b3267c57908fe8455cca1b674c0501..2ebc226b759bdad3b543846abbd540ae88c46e2a 100644 (file)
@@ -31,7 +31,6 @@
 #include "AXObjectCache.h"
 #include "ElementIterator.h"
 #include "HTMLNames.h"
-#include "Language.h"
 #include "RenderIterator.h"
 #include "RenderText.h"
 #include "SVGAElement.h"
@@ -40,6 +39,7 @@
 #include "SVGTitleElement.h"
 #include "SVGUseElement.h"
 #include "XLinkNames.h"
+#include <wtf/Language.h>
 
 namespace WebCore {
 
index dccd28338e3e80fd3a48f38552a3ef2a03357a95..6ae5871c6fbb2da98fc5ea25fd8c1cf4e8e91d84 100644 (file)
@@ -36,7 +36,6 @@
 #include "JSDOMWindowCustom.h"
 #include "JSMainThreadExecState.h"
 #include "JSNode.h"
-#include "Language.h"
 #include "Logging.h"
 #include "Page.h"
 #include "RejectedPromiseTracker.h"
@@ -51,6 +50,7 @@
 #include <runtime/JSInternalPromise.h>
 #include <runtime/JSInternalPromiseDeferred.h>
 #include <runtime/Microtask.h>
+#include <wtf/Language.h>
 #include <wtf/MainThread.h>
 
 #if PLATFORM(IOS)
index 9e854a38c53e5089a3323000938fbc3e1a3f00d0..34a51a57087398f391ae677ccb7c8eca09c6fb46 100644 (file)
 #include "JSDedicatedWorkerGlobalScope.h"
 #include "JSDynamicDowncast.h"
 #include "JSWorkerGlobalScope.h"
-#include "Language.h"
 #include "WorkerGlobalScope.h"
 #include "WorkerThread.h"
 #include <runtime/JSCInlines.h>
 #include <runtime/JSCJSValueInlines.h>
 #include <runtime/Microtask.h>
+#include <wtf/Language.h>
 
 #if ENABLE(SERVICE_WORKER)
 #include "JSServiceWorkerGlobalScope.h"
index b91a5fa20b47b90e9e654aa41ec231d7a993193a..de2f3ba6ec6c7f3f16c394d494de0c130cf46a6d 100644 (file)
 #include "JSCustomElementInterface.h"
 #include "JSLazyEventListener.h"
 #include "KeyboardEvent.h"
-#include "Language.h"
 #include "LayoutDisallowedScope.h"
 #include "LoaderStrategy.h"
 #include "Logging.h"
 #include <inspector/ScriptCallStack.h>
 #include <pal/Logger.h>
 #include <wtf/CurrentTime.h>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/SetForScope.h>
 #include <wtf/SystemTracing.h>
index c08cf3370c2a31ad3033b9f618fa95d002306cc1..38b1254915fadcb29e4d53e4d2b2b6297d94ac6a 100644 (file)
@@ -49,7 +49,6 @@
 #include "HTMLParserIdioms.h"
 #include "IdTargetObserver.h"
 #include "KeyboardEvent.h"
-#include "Language.h"
 #include "LocalizedStrings.h"
 #include "MouseEvent.h"
 #include "PlatformMouseEvent.h"
@@ -59,6 +58,7 @@
 #include "SearchInputType.h"
 #include "Settings.h"
 #include "StyleResolver.h"
+#include <wtf/Language.h>
 #include <wtf/MathExtras.h>
 #include <wtf/Ref.h>
 
index df32fe4db4a91c694b45fcc785ea5f762005fcee..9e0a9a2fe87fa63ad352856380e8f3a6f4475638 100644 (file)
@@ -54,7 +54,6 @@
 #include "JSDOMError.h"
 #include "JSDOMPromiseDeferred.h"
 #include "JSHTMLMediaElement.h"
-#include "Language.h"
 #include "Logging.h"
 #include "MIMETypeRegistry.h"
 #include "MainFrame.h"
@@ -94,6 +93,7 @@
 #include <runtime/Uint8Array.h>
 #include <wtf/Algorithms.h>
 #include <wtf/CurrentTime.h>
+#include <wtf/Language.h>
 #include <wtf/MathExtras.h>
 #include <wtf/MemoryPressureHandler.h>
 #include <wtf/Ref.h>
index 543f61f9e87350d5786ddd66e4774e75354be616..64f2c1ae482e7ebc020c9bfacf9a71ba652b7d9c 100644 (file)
@@ -43,7 +43,6 @@
 #include "HTMLUListElement.h"
 #include "HTMLVideoElement.h"
 #include "ImageBuffer.h"
-#include "Language.h"
 #include "LocalizedStrings.h"
 #include "Logging.h"
 #include "MediaControls.h"
@@ -60,6 +59,7 @@
 #include "ShadowRoot.h"
 #include "TextTrackList.h"
 #include "VTTRegionList.h"
+#include <wtf/Language.h>
 
 namespace WebCore {
 
index 7ea4e056b3cbf42e4b2c71d50b348b6827a808dc..86819f57b2b92f75fb16d547e050feaa9605fed9 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "TrackBase.h"
 
-#include "Language.h"
+#include <wtf/Language.h>
 #include <wtf/text/StringBuilder.h>
 
 #if ENABLE(VIDEO_TRACK)
index 7d5ab1e1518959e45c44e68a29d2430637904236..bae0b3baace5980757aab6dd4f790aa0dc3e9209 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "AudioTrackList.h"
 #include "DOMWrapperWorld.h"
-#include "Language.h"
 #include "LocalizedStrings.h"
 #include "MediaSelectionOption.h"
 #include "Page.h"
@@ -44,6 +43,7 @@
 #include <heap/HeapInlines.h>
 #include <runtime/JSCellInlines.h>
 #include <runtime/StructureInlines.h>
+#include <wtf/Language.h>
 
 namespace WebCore {
 
index f0b8f7f27d0da969bb6d1430c04f870e567a3f6c..23d7e0bf4e7da6a020aa5e97d1af16c25b1f430f 100644 (file)
@@ -37,7 +37,6 @@
 #endif
 #include "FloatConversion.h"
 #include "HTMLMediaElement.h"
-#include "Language.h"
 #include "LocalizedStrings.h"
 #include "Logging.h"
 #include "MediaControlElements.h"
@@ -46,8 +45,8 @@
 #include "UserStyleSheetTypes.h"
 #include "VTTCue.h"
 #include <algorithm>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PlatformUserPreferredLanguages.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/SoftLinking.h>
 #include <wtf/text/CString.h>
index b239c8afe490083990c3b405ba747b9d9151eb07..cb163986c836b55d08e5d388ada899b031a93e3b 100644 (file)
@@ -66,7 +66,6 @@
 #include "History.h"
 #include "InspectorInstrumentation.h"
 #include "JSMainThreadExecState.h"
-#include "Language.h"
 #include "Location.h"
 #include "MainFrame.h"
 #include "MediaQueryList.h"
 #include <inspector/ScriptCallStackFactory.h>
 #include <memory>
 #include <wtf/CurrentTime.h>
+#include <wtf/Language.h>
 #include <wtf/MainThread.h>
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
index b6d558f75b1f80efa20ae115d4c31d9c63e215e4..41d0876cd5eef1eb05e54e38570a8f3e3c9f0259 100644 (file)
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "Geolocation.h"
-#include "Language.h"
 #include "Page.h"
 #include "PluginData.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
+#include <wtf/Language.h>
 #include <wtf/StdLibExtras.h>
 
 using namespace WTF;
index 97ff953a6f3bdfd096eaed6dc5bff892c4c72e95..222a8ef4c68f1b262afdf8122d8ac94cd8b823d7 100644 (file)
 #include "config.h"
 #include "NavigatorBase.h"
 
-#include "Language.h"
 #include "NetworkStateNotifier.h"
 #include "ServiceWorkerContainer.h"
 #include <mutex>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/NumberOfCores.h>
 #include <wtf/text/WTFString.h>
index 81d12009a3f519c07e91ccf0bbbe6f080e86063e..5ebab9c96d88e1dcccf2b6224346d1a4c2ce327c 100644 (file)
@@ -25,7 +25,8 @@
 
 #include "config.h"
 #include "FontGenericFamilies.h"
-#include "Language.h"
+
+#include <wtf/Language.h>
 
 namespace WebCore {
 
index 042e53017babe6efa5690251cf06cce0e3c744d8..a23d809d3a5ddfaf371162df1fcb60422b73dc78 100644 (file)
 
 #if ENABLE(VIDEO_TRACK)
 
-#import "Language.h"
 #import <AVFoundation/AVAsset.h>
 #import <AVFoundation/AVMediaSelectionGroup.h>
 #import <AVFoundation/AVPlayerItem.h>
 #import <objc/runtime.h>
+#import <wtf/Language.h>
 #import <wtf/SoftLinking.h>
 #import <wtf/text/WTFString.h>
 
index 64ae972dfcf92908600d9ac8a7fb7c75046136c8..5dc035dff5cd5549f21575a695ccd4cc5fca6faf 100644 (file)
@@ -34,8 +34,8 @@
 #include "HTTPParsers.h"
 
 #include "HTTPHeaderNames.h"
-#include "Language.h"
 #include <wtf/DateMath.h>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
index 91198f271575c7bffe12f36feb0254a33b40f0e6..a91fe83cb796f4e8c92571ab5b9fb516187011a5 100644 (file)
@@ -27,7 +27,7 @@
 #define PlatformLocale_h
 
 #include "DateComponents.h"
-#include "Language.h"
+#include <wtf/Language.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
index b4b0e51f4afd6ca3bcc8a0f8752d534cd8b96a63..1c70c413d8cc225004b17d7b2a669a737057f36d 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "Hyphenation.h"
 
-#include "Language.h"
+#include <wtf/Language.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/TinyLRUCache.h>
 #include <wtf/text/StringView.h>
@@ -53,7 +53,7 @@ public:
     {
         // CF hyphenation functions use locale (regional formats) language, which doesn't necessarily match primary UI language,
         // so we can't use default locale here. See <rdar://problem/14897664>.
-        RetainPtr<CFLocaleRef> locale = adoptCF(CFLocaleCreate(kCFAllocatorDefault, WebCore::defaultLanguage().createCFString().get()));
+        RetainPtr<CFLocaleRef> locale = adoptCF(CFLocaleCreate(kCFAllocatorDefault, defaultLanguage().createCFString().get()));
         return CFStringIsHyphenationAvailableForLocale(locale.get()) ? locale : nullptr;
     }
 
index 638f76c46cc6d812ee5e92ce3a55f373ef408d62..8cee2c96d88a3a75663d87c124f6ae66679b6a18 100644 (file)
@@ -22,9 +22,9 @@
 
 #if ENABLE(SPELLCHECK)
 
-#include <Language.h>
 #include <glib.h>
 #include <unicode/ubrk.h>
+#include <wtf/Language.h>
 #include <wtf/text/TextBreakIterator.h>
 
 namespace WebCore {
index d1559055e60e20876cedf8bc26cbd0fa778c3c89..0af179fa23316365b7c08c07294f83b94ad33af2 100644 (file)
 #include "config.h"
 #include "LocaleMac.h"
 
+#import "LocalizedStrings.h"
 #import <Foundation/NSDateFormatter.h>
 #import <Foundation/NSLocale.h>
-#include "Language.h"
-#include "LocalizedStrings.h"
-#include <wtf/DateMath.h>
-#include <wtf/RetainPtr.h>
+#import <wtf/DateMath.h>
+#import <wtf/Language.h>
+#import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
 #import "LocalizedDateCache.h"
index 6ce1bfa952b586066ca8148ae521e3d0d4a36721..d76a819891439e6b0b67bfd6f9d07c9e1f146351 100644 (file)
 
 #include "DateComponents.h"
 #include "DateTimeFormat.h"
-#include "Language.h"
 #include "LocalizedStrings.h"
 #include <limits>
 #include <windows.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/DateMath.h>
 #include <wtf/HashMap.h>
+#include <wtf/Language.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/StringHash.h>
 
index e44c334f16519b9ba70b2f0f0f49dcc035c9190e..834c0e3d98e8b2de5d980afafe7635f2437e1f0d 100644 (file)
 
 #include "DOMImplementation.h"
 #include "HTMLNames.h"
-#include "Language.h"
 #include "SVGElement.h"
 #include "SVGNames.h"
 #include "SVGStringList.h"
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
 
 #if ENABLE(MATHML)
index 93893bd5739c0dd21675901426cdff0b31ef88ea..4bf1d0e812168ed95f5a89f6355b331284191e4c 100644 (file)
@@ -31,7 +31,6 @@
 #include "Document.h"
 #include "FontCache.h"
 #include "FrameView.h"
-#include "Language.h"
 #include "LocaleToScriptMapping.h"
 #include "MainFrame.h"
 #include "Page.h"
@@ -41,6 +40,7 @@
 #include "Settings.h"
 #include "Supplementable.h"
 #include "TextRun.h"
+#include <wtf/Language.h>
 
 #if ENABLE(INPUT_TYPE_COLOR)
 #include "ColorChooser.h"
index 56f9915683a530d63a958fd6e919772065480628..87e38bfeacc76aaacd1a4702d83844eddaa29f96 100644 (file)
@@ -88,7 +88,6 @@
 #include "IntRect.h"
 #include "InternalSettings.h"
 #include "JSImageData.h"
-#include "Language.h"
 #include "LibWebRTCProvider.h"
 #include "MainFrame.h"
 #include "MallocStatistics.h"
 #include <inspector/InspectorValues.h>
 #include <runtime/JSCInlines.h>
 #include <runtime/JSCJSValue.h>
+#include <wtf/Language.h>
 #include <wtf/MemoryPressureHandler.h>
 #include <wtf/MonotonicTime.h>
 #include <wtf/text/StringBuffer.h>
@@ -419,7 +419,7 @@ void Internals::resetToConsistentState(Page& page)
     }
 
     WebCore::clearDefaultPortForProtocolMapForTesting();
-    WebCore::overrideUserPreferredLanguages(Vector<String>());
+    overrideUserPreferredLanguages(Vector<String>());
     WebCore::Settings::setUsesOverlayScrollbars(false);
     WebCore::Settings::setUsesMockScrollAnimator(false);
 #if ENABLE(VIDEO_TRACK)
@@ -1737,12 +1737,12 @@ ExceptionOr<int> Internals::lastSpellCheckProcessedSequence()
 
 Vector<String> Internals::userPreferredLanguages() const
 {
-    return WebCore::userPreferredLanguages();
+    return WTF::userPreferredLanguages();
 }
 
 void Internals::setUserPreferredLanguages(const Vector<String>& languages)
 {
-    WebCore::overrideUserPreferredLanguages(languages);
+    overrideUserPreferredLanguages(languages);
 }
 
 Vector<String> Internals::userPreferredAudioCharacteristics() const
index b256e8cf82e105f03492d3d5c342ed17f9232db2..c8418dfe89d8c4064c3eee9bfd6c21d7f2b188dd 100644 (file)
@@ -1,3 +1,14 @@
+2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
+        https://bugs.webkit.org/show_bug.cgi?id=176561
+
+        Reviewed by Brent Fulgham.
+
+        * UIProcess/WebProcessPool.cpp:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::userPreferredLanguagesChanged const):
+
 2017-09-07  Youenn Fablet  <youenn@apple.com>
 
         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
index 3a0b4f377eaafad5d4057da5eec6119add2fce8b..7301341e0133f6bff7e965a3307928e47e42bf8f 100644 (file)
 #include "WebsiteDataType.h"
 #include <JavaScriptCore/RemoteInspector.h>
 #include <WebCore/FileSystem.h>
-#include <WebCore/Language.h>
 #include <glib/gi18n-lib.h>
 #include <libintl.h>
 #include <memory>
 #include <wtf/HashMap.h>
+#include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -1256,7 +1256,7 @@ void webkit_web_context_set_preferred_languages(WebKitWebContext* context, const
         else
             languages.append(String::fromUTF8(languageList[i]).convertToASCIILowercase().replace("_", "-"));
     }
-    WebCore::overrideUserPreferredLanguages(languages);
+    overrideUserPreferredLanguages(languages);
 }
 
 /**
index 1bf1fbc01f77b1d5ea6630014726440653f47f80..ad2ad11ef56360c56eafce06482cc2ce072d73e5 100644 (file)
@@ -72,7 +72,6 @@
 #include "WebsiteDataStore.h"
 #include "WebsiteDataStoreParameters.h"
 #include <WebCore/ApplicationCacheStorage.h>
-#include <WebCore/Language.h>
 #include <WebCore/LinkHash.h>
 #include <WebCore/LogInitialization.h>
 #include <WebCore/ResourceRequest.h>
@@ -80,6 +79,7 @@
 #include <pal/SessionID.h>
 #include <runtime/JSCInlines.h>
 #include <wtf/CurrentTime.h>
+#include <wtf/Language.h>
 #include <wtf/MainThread.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/RunLoop.h>
index 48fdb0813c57ecc87c72e44c3d71d11b7362e37b..c732a1919e1c56d03ac4fd13201fa5dbdd1eb802 100644 (file)
@@ -32,7 +32,7 @@
 #include "WebCookieManagerProxy.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebProcessMessages.h"
-#include <WebCore/Language.h>
+#include <wtf/Language.h>
 
 namespace WebKit {
 
@@ -41,7 +41,7 @@ void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationPara
     supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
-    parameters.languages = WebCore::userPreferredLanguages();
+    parameters.languages = userPreferredLanguages();
 #if ENABLE(NETWORK_CACHE)
     parameters.shouldEnableNetworkCacheEfficacyLogging = false;
 #endif
index 0a4ef8bcc9da6aa29004986f8424e47304b7252e..7b6cd4f74d6167aeb10022d740c8f41afee95255 100644 (file)
@@ -91,7 +91,6 @@
 #include <WebCore/GlyphPage.h>
 #include <WebCore/HTMLMediaElement.h>
 #include <WebCore/JSDOMWindow.h>
-#include <WebCore/Language.h>
 #include <WebCore/MainFrame.h>
 #include <WebCore/MemoryCache.h>
 #include <WebCore/MemoryRelease.h>
 #include <unistd.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashCountedSet.h>
+#include <wtf/Language.h>
 #include <wtf/RunLoop.h>
 #include <wtf/text/StringHash.h>
 
@@ -495,7 +495,6 @@ void WebProcess::setShouldUseFontSmoothing(bool useFontSmoothing)
 void WebProcess::userPreferredLanguagesChanged(const Vector<String>& languages) const
 {
     overrideUserPreferredLanguages(languages);
-    languageDidChange();
 }
 
 void WebProcess::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
index 71deb396a2d20925eefd5cae4bbb20d2d33dc7db..568ffeffcc42255d242781e86ba5d8d71a868e61 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
+        https://bugs.webkit.org/show_bug.cgi?id=176561
+
+        Reviewed by Brent Fulgham.
+
+        * Misc/WebNSUserDefaultsExtras.mm:
+
 2017-09-07  Alex Christensen  <achristensen@webkit.org>
 
         Modernize Geolocation code
index 97c05943e29dba90a17730e13e5a8725e76fb3cd..8223584ab122ecc41b3ae51a129f42da308fad3e 100644 (file)
 
 #import "WebNSUserDefaultsExtras.h"
 
-#import <WebCore/Language.h>
+#import <wtf/Language.h>
 #import <wtf/text/WTFString.h>
 
-using namespace WebCore;
-
 @implementation NSUserDefaults (WebNSUserDefaultsExtras)
 
 + (NSString *)_webkit_preferredLanguageCode