Title: [260554] trunk
Revision
260554
Author
[email protected]
Date
2020-04-22 21:34:31 -0700 (Wed, 22 Apr 2020)

Log Message

[Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
https://bugs.webkit.org/show_bug.cgi?id=210845

Reviewed by Anders Carlsson.

.:

* Source/cmake/OptionsCommon.cmake: Move ICU-configuring macros to Platform.h.
* Source/cmake/OptionsJSCOnly.cmake: Ditto.
* Source/cmake/OptionsMac.cmake: Ditto.

Source/_javascript_Core:

* Configurations/Base.xcconfig: Move ICU-configuring macros to Platform.h.

Source/WebCore:

* Configurations/WebCore.xcconfig: Move ICU-configuring macros to Platform.h.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.

* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
Remove deprecated U_EA_COUNT.

Source/WebKit:

* Configurations/BaseTarget.xcconfig: Move ICU-configuring macros to Platform.h.

* Platform/unix/EnvironmentUtilities.h: Removed unneeded includes.
This sidesteps a problem with Apple's internal InstallAPI tool that happens
if StringView.h is included and Platform.h is not included first.

* UIProcess/API/cpp/WKRetainPtr.h: Removed unneeded includes, and used
#pragma once.

* UIProcess/Cocoa/PreferenceObserver.h: Moved most things out of the header,
since they don't need to be there.
* UIProcess/Cocoa/PreferenceObserver.mm: Moved them here including using a
class extension for the data member of WKPreferenceObserver.

* UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h:
Removed unneeded WTF prefix.

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig: Move ICU-configuring macros to Platform.h.

Source/WTF:

* Configurations/Base.xcconfig: Move ICU-configuring macros to Platform.h.

* wtf/Platform.h: Set macros here. The file says not to put things like this in it,
but in practice this is the right place to put something that we need set consistently
for all the WebKit projects.
- U_HIDE_DEPRECATED_API, to make sure we don't use it by accident.
- U_SHOW_CPLUSPLUS_API=0, to make sure we don't use it by accident.
- UCHAR_TYPE=char16_t when compiling C++, which is the default on most platforms,
  but not the default in Apple's internal SDK.
- U_DISABLE_RENAMING when building on Apple platforms, important so we can link
  to an older version of ICU and still load with a newer version.

* wtf/URL.cpp:
(WTF::URL::hostAndPort const): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.

* wtf/URLHelpers.cpp: Rework to not use deprecated USCRIPT_CODE_LIMIT.
(WTF::URLHelpers::whiteListIDNScript): Added overloads.
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList): Use an array of
UScriptCode instead of an array of strings.
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList): Updated for the above.

* wtf/cocoa/NSURLExtras.mm:
(WTF::decodePercentEscapes): Use createCFString instead of converting to NString
and then typecasting.
(WTF::URLByTruncatingOneCharacterBeforeComponent): Updated to use a constexpr
instead of a macro.
(WTF::dataForURLComponentType): Ditto.
(WTF::URLByRemovingComponentAndSubsequentCharacter): Ditto.
(WTF::originalURLData): Ditto.

Tools:

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.
* TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
(TestWebKitAPI::TEST): Ditto.
* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(TestWebKitAPI::TEST): Ditto.
* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST): Ditto.

* TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
Add an include needed since EvironmentUtilities.h now includes less.

Modified Paths

Diff

Modified: trunk/ChangeLog (260553 => 260554)


--- trunk/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,14 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Source/cmake/OptionsCommon.cmake: Move ICU-configuring macros to Platform.h.
+        * Source/cmake/OptionsJSCOnly.cmake: Ditto.
+        * Source/cmake/OptionsMac.cmake: Ditto.
+
 2020-04-22  Don Olmstead  <[email protected]>
 
         [CMake] Use WEBKIT_EXECUTABLE in WebKitTestRunner

Modified: trunk/Source/_javascript_Core/ChangeLog (260553 => 260554)


--- trunk/Source/_javascript_Core/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,12 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/Base.xcconfig: Move ICU-configuring macros to Platform.h.
+
 2020-04-22  Yusuke Suzuki  <[email protected]>
 
         [JSC] branchIfBigInt32 can use BigInt32Mask and remove branchIfNumber filter

Modified: trunk/Source/_javascript_Core/Configurations/Base.xcconfig (260553 => 260554)


--- trunk/Source/_javascript_Core/Configurations/Base.xcconfig	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/_javascript_Core/Configurations/Base.xcconfig	2020-04-23 04:34:31 UTC (rev 260554)
@@ -68,7 +68,7 @@
 GCC_NO_COMMON_BLOCKS = YES;
 GCC_OBJC_CALL_CXX_CDTORS = YES;
 GCC_PRECOMPILE_PREFIX_HEADER = YES;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) U_HIDE_DEPRECATED_API U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 $(inherited);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) $(inherited);
 GCC_STRICT_ALIASING = YES;
 GCC_THREADSAFE_STATICS = NO;
 GCC_TREAT_WARNINGS_AS_ERRORS = YES;

Modified: trunk/Source/WTF/ChangeLog (260553 => 260554)


--- trunk/Source/WTF/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,41 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/Base.xcconfig: Move ICU-configuring macros to Platform.h.
+
+        * wtf/Platform.h: Set macros here. The file says not to put things like this in it,
+        but in practice this is the right place to put something that we need set consistently
+        for all the WebKit projects.
+        - U_HIDE_DEPRECATED_API, to make sure we don't use it by accident.
+        - U_SHOW_CPLUSPLUS_API=0, to make sure we don't use it by accident.
+        - UCHAR_TYPE=char16_t when compiling C++, which is the default on most platforms,
+          but not the default in Apple's internal SDK.
+        - U_DISABLE_RENAMING when building on Apple platforms, important so we can link
+          to an older version of ICU and still load with a newer version.
+
+        * wtf/URL.cpp:
+        (WTF::URL::hostAndPort const): Get rid of an obsolete cast to unsigned to work
+        around uint16_t not being treated as a number by makeString.
+
+        * wtf/URLHelpers.cpp: Rework to not use deprecated USCRIPT_CODE_LIMIT.
+        (WTF::URLHelpers::whiteListIDNScript): Added overloads.
+        (WTF::URLHelpers::initializeDefaultIDNScriptWhiteList): Use an array of
+        UScriptCode instead of an array of strings.
+        (WTF::URLHelpers::allCharactersInIDNScriptWhiteList): Updated for the above.
+
+        * wtf/cocoa/NSURLExtras.mm:
+        (WTF::decodePercentEscapes): Use createCFString instead of converting to NString
+        and then typecasting.
+        (WTF::URLByTruncatingOneCharacterBeforeComponent): Updated to use a constexpr
+        instead of a macro.
+        (WTF::dataForURLComponentType): Ditto.
+        (WTF::URLByRemovingComponentAndSubsequentCharacter): Ditto.
+        (WTF::originalURLData): Ditto.
+
 2020-04-22  Claudio Saavedra  <[email protected]>
 
         [GTK4] Several fixes to GdkEvent APIs for GTK4

Modified: trunk/Source/WTF/Configurations/Base.xcconfig (260553 => 260554)


--- trunk/Source/WTF/Configurations/Base.xcconfig	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/Configurations/Base.xcconfig	2020-04-23 04:34:31 UTC (rev 260554)
@@ -69,7 +69,7 @@
 GCC_NO_COMMON_BLOCKS = YES;
 GCC_OBJC_CALL_CXX_CDTORS = YES;
 GCC_PRECOMPILE_PREFIX_HEADER = YES;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 $(inherited);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(inherited);
 GCC_STRICT_ALIASING = YES;
 GCC_THREADSAFE_STATICS = NO;
 GCC_TREAT_WARNINGS_AS_ERRORS = YES;

Modified: trunk/Source/WTF/wtf/Platform.h (260553 => 260554)


--- trunk/Source/WTF/wtf/Platform.h	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/wtf/Platform.h	2020-04-23 04:34:31 UTC (rev 260554)
@@ -107,6 +107,17 @@
 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
 #endif
 
+/* FIXME: This does not belong in Platform.h and should instead be included in another mechanism (compiler option, prefix header, config.h, etc) */
+/* ICU configuration. Some of these match ICU defaults on some platforms, but we would like them consistently set everywhere we build WebKit. */
+#define U_HIDE_DEPRECATED_API 1
+#define U_SHOW_CPLUSPLUS_API 0
+#ifdef __cplusplus
+#define UCHAR_TYPE char16_t
+#endif
+#if PLATFORM(COCOA)
+#define U_DISABLE_RENAMING 1
+#endif
+
 #if COMPILER(MSVC)
 #undef __STDC_FORMAT_MACROS
 #define __STDC_FORMAT_MACROS

Modified: trunk/Source/WTF/wtf/URL.cpp (260553 => 260554)


--- trunk/Source/WTF/wtf/URL.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/wtf/URL.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -149,7 +149,7 @@
 String URL::hostAndPort() const
 {
     if (auto port = this->port())
-        return makeString(host(), ':', static_cast<unsigned>(port.value()));
+        return makeString(host(), ':', port.value());
     return host().toString();
 }
 

Modified: trunk/Source/WTF/wtf/URLHelpers.cpp (260553 => 260554)


--- trunk/Source/WTF/wtf/URLHelpers.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/wtf/URLHelpers.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -42,15 +42,23 @@
 
 // Needs to be big enough to hold an IDN-encoded name.
 // For host names bigger than this, we won't do IDN encoding, which is almost certainly OK.
-const unsigned hostNameBufferLength = 2048;
-const unsigned urlBytesBufferLength = 2048;
+constexpr unsigned hostNameBufferLength = 2048;
+constexpr unsigned urlBytesBufferLength = 2048;
 
-static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32];
+// This needs to be higher than the UScriptCode for any of the scripts on the IDN whitelist.
+// At one point we used USCRIPT_CODE_LIMIT from ICU, but there are two reasons not to use it.
+// 1) ICU considers it deprecated, so by setting U_HIDE_DEPRECATED we can't see it.
+// 2) No good reason to limit ourselves to scripts that existed in the ICU headers when
+//    WebKit was compiled.
+// This is only really important for platforms that load an external ICU whitelist.
+// Not important for the compiled-in one.
+constexpr auto scriptCodeLimit = static_cast<UScriptCode>(256);
 
+static uint32_t IDNScriptWhiteList[(scriptCodeLimit + 31) / 32];
+
 #if !PLATFORM(COCOA)
 
-// Cocoa has an implementation that uses a whitelist in /Library or ~/Library,
-// if it exists.
+// Cocoa has an implementation that uses a whitelist in /Library or ~/Library, if it exists.
 void loadIDNScriptWhiteList()
 {
     static std::once_flag flag;
@@ -256,10 +264,9 @@
     }
 }
 
-void whiteListIDNScript(const char* scriptName)
+static void whiteListIDNScript(int32_t script)
 {
-    int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, scriptName);
-    if (script >= 0 && script < USCRIPT_CODE_LIMIT) {
+    if (script >= 0 && script < scriptCodeLimit) {
         size_t index = script / 32;
         uint32_t mask = 1 << (script % 32);
         IDNScriptWhiteList[index] |= mask;
@@ -266,32 +273,42 @@
     }
 }
 
+static void whiteListIDNScript(UScriptCode script)
+{
+    whiteListIDNScript(static_cast<int32_t>(script));
+}
+
+void whiteListIDNScript(const char* scriptName)
+{
+    whiteListIDNScript(u_getPropertyValueEnum(UCHAR_SCRIPT, scriptName));
+}
+
 void initializeDefaultIDNScriptWhiteList()
 {
-    const char* defaultIDNScriptWhiteList[20] = {
-        "Common",
-        "Inherited",
-        "Arabic",
-        "Armenian",
-        "Bopomofo",
-        "Canadian_Aboriginal",
-        "Devanagari",
-        "Deseret",
-        "Gujarati",
-        "Gurmukhi",
-        "Hangul",
-        "Han",
-        "Hebrew",
-        "Hiragana",
-        "Katakana_Or_Hiragana",
-        "Katakana",
-        "Latin",
-        "Tamil",
-        "Thai",
-        "Yi",
+    constexpr UScriptCode defaultIDNScriptWhiteList[] = {
+        USCRIPT_COMMON,
+        USCRIPT_INHERITED,
+        USCRIPT_ARABIC,
+        USCRIPT_ARMENIAN,
+        USCRIPT_BOPOMOFO,
+        USCRIPT_CANADIAN_ABORIGINAL,
+        USCRIPT_DEVANAGARI,
+        USCRIPT_DESERET,
+        USCRIPT_GUJARATI,
+        USCRIPT_GURMUKHI,
+        USCRIPT_HANGUL,
+        USCRIPT_HAN,
+        USCRIPT_HEBREW,
+        USCRIPT_HIRAGANA,
+        USCRIPT_KATAKANA_OR_HIRAGANA,
+        USCRIPT_KATAKANA,
+        USCRIPT_LATIN,
+        USCRIPT_TAMIL,
+        USCRIPT_THAI,
+        USCRIPT_YI,
     };
-    for (const char* scriptName : defaultIDNScriptWhiteList)
-        whiteListIDNScript(scriptName);
+    for (auto script : defaultIDNScriptWhiteList)
+        whiteListIDNScript(script);
 }
 
 static bool allCharactersInIDNScriptWhiteList(const UChar* buffer, int32_t length)
@@ -312,7 +329,7 @@
             LOG_ERROR("got negative number for script code from ICU: %d", script);
             return false;
         }
-        if (script >= USCRIPT_CODE_LIMIT)
+        if (script >= scriptCodeLimit)
             return false;
 
         size_t index = script / 32;

Modified: trunk/Source/WTF/wtf/cocoa/NSURLExtras.mm (260553 => 260554)


--- trunk/Source/WTF/wtf/cocoa/NSURLExtras.mm	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WTF/wtf/cocoa/NSURLExtras.mm	2020-04-23 04:34:31 UTC (rev 260554)
@@ -36,12 +36,12 @@
 #import <wtf/Vector.h>
 #import <wtf/cf/CFURLExtras.h>
 
-#define URL_BYTES_BUFFER_LENGTH 2048
-
 namespace WTF {
 
 using namespace URLHelpers;
 
+constexpr unsigned urlBytesBufferLength = 2048;
+
 static BOOL readIDNScriptWhiteListFile(NSString *filename)
 {
     if (!filename)
@@ -94,13 +94,10 @@
     
 static String decodePercentEscapes(const String& string)
 {
-    NSString *substring = (NSString *)string;
-    substring = CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapes(nullptr, (CFStringRef)substring, CFSTR("")));
-
+    NSString *substring = CFBridgingRelease(CFURLCreateStringByReplacingPercentEscapes(nullptr, string.createCFString().get(), CFSTR("")));
     if (!substring)
         return string;
-
-    return (String)substring;
+    return substring;
 }
 
 NSString *decodeHostName(NSString *string)
@@ -135,7 +132,7 @@
     if (fragRg.location == kCFNotFound)
         return URL;
 
-    Vector<UInt8, URL_BYTES_BUFFER_LENGTH> urlBytes(URL_BYTES_BUFFER_LENGTH);
+    Vector<UInt8, urlBytesBufferLength> urlBytes(urlBytesBufferLength);
     CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, urlBytes.data(), urlBytes.size());
     if (numBytes == -1) {
         numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0);
@@ -269,7 +266,7 @@
 
 NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType)
 {
-    Vector<UInt8, URL_BYTES_BUFFER_LENGTH> allBytesBuffer(URL_BYTES_BUFFER_LENGTH);
+    Vector<UInt8, urlBytesBufferLength> allBytesBuffer(urlBytesBufferLength);
     CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, allBytesBuffer.data(), allBytesBuffer.size());
     if (bytesFilled == -1) {
         CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0);
@@ -325,7 +322,7 @@
     // Remove one subsequent character.
     range.length++;
 
-    Vector<UInt8, URL_BYTES_BUFFER_LENGTH> buffer(URL_BYTES_BUFFER_LENGTH);
+    Vector<UInt8, urlBytesBufferLength> buffer(urlBytesBufferLength);
     CFIndex numBytes = CFURLGetBytes((__bridge CFURLRef)URL, buffer.data(), buffer.size());
     if (numBytes == -1) {
         numBytes = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0);
@@ -355,8 +352,8 @@
 
 NSData *originalURLData(NSURL *URL)
 {
-    UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH);
-    CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, URL_BYTES_BUFFER_LENGTH);
+    UInt8 *buffer = (UInt8 *)malloc(urlBytesBufferLength);
+    CFIndex bytesFilled = CFURLGetBytes((__bridge CFURLRef)URL, buffer, urlBytesBufferLength);
     if (bytesFilled == -1) {
         CFIndex bytesToAllocate = CFURLGetBytes((__bridge CFURLRef)URL, nullptr, 0);
         buffer = (UInt8 *)realloc(buffer, bytesToAllocate);

Modified: trunk/Source/WebCore/ChangeLog (260553 => 260554)


--- trunk/Source/WebCore/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebCore/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,20 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/WebCore.xcconfig: Move ICU-configuring macros to Platform.h.
+
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect): Get rid of an obsolete cast to unsigned to work
+        around uint16_t not being treated as a number by makeString.
+
+        * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
+        (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
+        Remove deprecated U_EA_COUNT.
+
 2020-04-22  Andres Gonzalez  <[email protected]>
 
         Add logging to core accessibility.

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (260553 => 260554)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2020-04-23 04:34:31 UTC (rev 260554)
@@ -27,7 +27,7 @@
 #include "WebKitTargetConditionals.xcconfig"
 
 GCC_PREFIX_HEADER = WebCorePrefix.h;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) BUILDING_WEBKIT U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 GL_SILENCE_DEPRECATION=1 GLES_SILENCE_DEPRECATION=1 $(inherited);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) BUILDING_WEBKIT GL_SILENCE_DEPRECATION=1 GLES_SILENCE_DEPRECATION=1 $(inherited);
 
 WK_PRIVATE_FRAMEWORKS_DIR = $(WK_PRIVATE_FRAMEWORKS_DIR_$(USE_INTERNAL_SDK));
 WK_PRIVATE_FRAMEWORKS_DIR_[sdk=iphone*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/$(WK_TARGET_IOS_VERSION_MAJOR);

Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (260553 => 260554)


--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -257,7 +257,7 @@
     if (!portAllowed(m_url)) {
         String message;
         if (m_url.port())
-            message = makeString("WebSocket port ", static_cast<unsigned>(m_url.port().value()), " blocked");
+            message = makeString("WebSocket port ", m_url.port().value(), " blocked");
         else
             message = "WebSocket without port blocked"_s;
         context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, message);

Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp (260553 => 260554)


--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -162,9 +162,6 @@
         case U_EA_FULLWIDTH:
         case U_EA_WIDE:
             return 0;
-        case U_EA_COUNT:
-            ASSERT_NOT_REACHED();
-            break;
         }
         ASSERT_NOT_REACHED();
         break;

Modified: trunk/Source/WebKit/ChangeLog (260553 => 260554)


--- trunk/Source/WebKit/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,27 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/BaseTarget.xcconfig: Move ICU-configuring macros to Platform.h.
+
+        * Platform/unix/EnvironmentUtilities.h: Removed unneeded includes.
+        This sidesteps a problem with Apple's internal InstallAPI tool that happens
+        if StringView.h is included and Platform.h is not included first.
+
+        * UIProcess/API/cpp/WKRetainPtr.h: Removed unneeded includes, and used
+        #pragma once.
+
+        * UIProcess/Cocoa/PreferenceObserver.h: Moved most things out of the header,
+        since they don't need to be there.
+        * UIProcess/Cocoa/PreferenceObserver.mm: Moved them here including using a
+        class extension for the data member of WKPreferenceObserver.
+
+        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h:
+        Removed unneeded WTF prefix.
+
 2020-04-22  Nikos Mouchtaris  <[email protected]>
 
         Soft link QuickLookThumbnailing framework

Modified: trunk/Source/WebKit/Configurations/BaseTarget.xcconfig (260553 => 260554)


--- trunk/Source/WebKit/Configurations/BaseTarget.xcconfig	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/Configurations/BaseTarget.xcconfig	2020-04-23 04:34:31 UTC (rev 260554)
@@ -36,7 +36,7 @@
 SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks;
 
 GCC_PREFIX_HEADER = WebKit2Prefix.h;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) $(WK_CORE_PREDICTION_DEFINES) U_HIDE_DEPRECATED_API U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 FRAMEWORK_NAME=WebKit;
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) $(WK_CORE_PREDICTION_DEFINES) FRAMEWORK_NAME=WebKit;
 WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions $(SDKROOT)/usr/local/include/WebKitAdditions;
 LIBWEBRTC_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/webrtc $(SDKROOT)/usr/local/include/webrtc;
 

Modified: trunk/Source/WebKit/Platform/unix/EnvironmentUtilities.h (260553 => 260554)


--- trunk/Source/WebKit/Platform/unix/EnvironmentUtilities.h	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/Platform/unix/EnvironmentUtilities.h	2020-04-23 04:34:31 UTC (rev 260554)
@@ -27,8 +27,7 @@
 #pragma once
 
 #include "WKDeclarationSpecifiers.h"
-#include <wtf/text/StringView.h>
-#include <wtf/text/WTFString.h>
+#include <wtf/Forward.h>
 
 namespace WebKit {
 

Modified: trunk/Source/WebKit/UIProcess/API/cpp/WKRetainPtr.h (260553 => 260554)


--- trunk/Source/WebKit/UIProcess/API/cpp/WKRetainPtr.h	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/UIProcess/API/cpp/WKRetainPtr.h	2020-04-23 04:34:31 UTC (rev 260554)
@@ -23,15 +23,11 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WKRetainPtr_h
-#define WKRetainPtr_h
+#pragma once
 
 #include <WebKit/WKType.h>
 #include <algorithm>
-#include <wtf/GetPtr.h>
-#include <wtf/HashFunctions.h>
 #include <wtf/HashTraits.h>
-#include <wtf/RefPtr.h>
 
 namespace WebKit {
 
@@ -263,7 +259,10 @@
 
 namespace WTF {
 
-template <typename T> struct IsSmartPtr<WKRetainPtr<T>> {
+template<typename> struct IsSmartPtr;
+template<typename> struct DefaultHash;
+
+template<typename T> struct IsSmartPtr<WKRetainPtr<T>> {
     WTF_INTERNAL static const bool value = true;
 };
 
@@ -280,5 +279,3 @@
 };
 
 } // namespace WTF
-
-#endif // WKRetainPtr_h

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.h (260553 => 260554)


--- trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.h	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.h	2020-04-23 04:34:31 UTC (rev 260554)
@@ -23,25 +23,8 @@
 * THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#import <wtf/RetainPtr.h>
-#import <wtf/Vector.h>
-
-@class WKPreferenceObserver;
-
 __attribute__((visibility("default")))
-@interface WKUserDefaults : NSUserDefaults {
-@private
-    NSString *m_suiteName;
-@public
-    WKPreferenceObserver *m_observer;
-}
-@end
-
-__attribute__((visibility("default")))
-@interface WKPreferenceObserver : NSObject {
-@private
-    Vector<RetainPtr<WKUserDefaults>> m_userDefaults;
-}
+@interface WKPreferenceObserver : NSObject
 + (id)sharedInstance;
 - (void)preferenceDidChange:(NSString *)domain key:(NSString *)key encodedValue:(NSString *)encodedValue;
 @end

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm (260553 => 260554)


--- trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-04-23 04:34:31 UTC (rev 260554)
@@ -29,6 +29,20 @@
 #import "WebProcessPool.h"
 #import <pal/spi/cocoa/NSUserDefaultsSPI.h>
 
+@interface WKUserDefaults : NSUserDefaults {
+@private
+    NSString *m_suiteName;
+@public
+    WKPreferenceObserver *m_observer;
+}
+@end
+
+@interface WKPreferenceObserver () {
+@private
+    Vector<RetainPtr<WKUserDefaults>> m_userDefaults;
+}
+@end
+
 @implementation WKUserDefaults
 
 - (void)_notifyObserversOfChangeFromValuesForKeys:(NSDictionary<NSString *, id> *)oldValues toValuesForKeys:(NSDictionary<NSString *, id> *)newValues

Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h (260553 => 260554)


--- trunk/Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/FullscreenTouchSecheuristicParameters.h	2020-04-23 04:34:31 UTC (rev 260554)
@@ -31,8 +31,8 @@
 namespace WebKit {
 
 struct FullscreenTouchSecheuristicParameters {
-    WTF::Seconds rampUpSpeed;
-    WTF::Seconds rampDownSpeed;
+    Seconds rampUpSpeed;
+    Seconds rampDownSpeed;
     double xWeight;
     double yWeight;
     double gamma;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (260553 => 260554)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,5 +1,14 @@
 2020-04-22  Darin Adler  <[email protected]>
 
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * Configurations/WebKitLegacy.xcconfig: Move ICU-configuring macros to Platform.h.
+
+2020-04-22  Darin Adler  <[email protected]>
+
         [Cocoa] REGRESSION (r260485): Crash in Legacy WebKit createMenu item function (reproducible under Asan)
         https://bugs.webkit.org/show_bug.cgi?id=210888
 

Modified: trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig (260553 => 260554)


--- trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig	2020-04-23 04:34:31 UTC (rev 260554)
@@ -49,7 +49,7 @@
 OTHER_CPLUSPLUSFLAGS = $(inherited) $(OTHER_CFLAGS_COCOA_TOUCH);
 
 GCC_PREFIX_HEADER = mac/WebKitPrefix.h;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) BUILDING_WEBKIT U_HIDE_DEPRECATED_API U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 FRAMEWORK_NAME=WebKitLegacy $(inherited);
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) BUILDING_WEBKIT FRAMEWORK_NAME=WebKitLegacy $(inherited);
 
 WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions $(SDKROOT)/usr/local/include/WebKitAdditions;
 LIBWEBRTC_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/webrtc $(SDKROOT)/usr/local/include/webrtc;

Modified: trunk/Source/cmake/OptionsCommon.cmake (260553 => 260554)


--- trunk/Source/cmake/OptionsCommon.cmake	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/cmake/OptionsCommon.cmake	2020-04-23 04:34:31 UTC (rev 260554)
@@ -180,5 +180,3 @@
 if (HAVE_INT128_VALUE)
   SET_AND_EXPOSE_TO_BUILD(HAVE_INT128_T INT128_VALUE)
 endif ()
-
-add_definitions(-DU_SHOW_CPLUSPLUS_API=0)

Modified: trunk/Source/cmake/OptionsJSCOnly.cmake (260553 => 260554)


--- trunk/Source/cmake/OptionsJSCOnly.cmake	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/cmake/OptionsJSCOnly.cmake	2020-04-23 04:34:31 UTC (rev 260554)
@@ -95,7 +95,4 @@
     SET_AND_EXPOSE_TO_BUILD(WTF_DEFAULT_EVENT_LOOP 0)
 endif ()
 
-if (APPLE)
-    add_definitions(-DU_DISABLE_RENAMING=1)
-endif ()
 find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc)

Modified: trunk/Source/cmake/OptionsMac.cmake (260553 => 260554)


--- trunk/Source/cmake/OptionsMac.cmake	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Source/cmake/OptionsMac.cmake	2020-04-23 04:34:31 UTC (rev 260554)
@@ -119,5 +119,4 @@
 set(WebCore_LIBRARY_TYPE SHARED)
 set(WebCoreTestSupport_LIBRARY_TYPE SHARED)
 
-add_definitions(-DU_DISABLE_RENAMING=1)
 find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc)

Modified: trunk/Tools/ChangeLog (260553 => 260554)


--- trunk/Tools/ChangeLog	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/ChangeLog	2020-04-23 04:34:31 UTC (rev 260554)
@@ -1,3 +1,23 @@
+2020-04-22  Darin Adler  <[email protected]>
+
+        [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
+        https://bugs.webkit.org/show_bug.cgi?id=210845
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
+        (TestWebKitAPI::TEST): Get rid of an obsolete cast to unsigned to work
+        around uint16_t not being treated as a number by makeString.
+        * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+        (TestWebKitAPI::TEST): Ditto.
+        * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
+        (TestWebKitAPI::TEST): Ditto.
+        * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+        (TestWebKitAPI::TEST): Ditto.
+
+        * TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
+        Add an include needed since EvironmentUtilities.h now includes less.
+
 2020-04-22  Saam Barati  <[email protected]>
 
         DumpRenderTree should have the JIT entitlement on Mac

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp (260553 => 260554)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -83,11 +83,7 @@
     EXPECT_STREQ("hello 0 world", makeString("hello ", 0u , " world").utf8().data());
 
     EXPECT_STREQ("hello 42 world", makeString("hello ", static_cast<unsigned char>(42) , " world").utf8().data());
-    // FIXME: Remove this if statement once we have UChar as char16_t in all configurations.
-    if constexpr (std::is_same_v<UChar, uint16_t>)
-        EXPECT_STREQ("hello * world", makeString("hello ", static_cast<unsigned short>(42) , " world").utf8().data());
-    else
-        EXPECT_STREQ("hello 42 world", makeString("hello ", static_cast<unsigned short>(42) , " world").utf8().data());
+    EXPECT_STREQ("hello 42 world", makeString("hello ", static_cast<unsigned short>(42) , " world").utf8().data());
     EXPECT_STREQ("hello 4 world", makeString("hello ", sizeof(int) , " world").utf8().data()); // size_t
     EXPECT_STREQ("hello 4 world", makeString("hello ", offsetof(S, i) , " world").utf8().data()); // size_t
     EXPECT_STREQ("hello 3235839742 world", makeString("hello ", static_cast<size_t>(0xc0defefe), " world").utf8().data());

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp (260553 => 260554)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp	2020-04-23 04:34:31 UTC (rev 260554)
@@ -28,6 +28,7 @@
 #include "Test.h"
 
 #include <WebKit/EnvironmentUtilities.h>
+#include <wtf/text/WTFString.h>
 
 namespace TestWebKitAPI {
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (260553 => 260554)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm	2020-04-23 04:34:31 UTC (rev 260554)
@@ -310,7 +310,7 @@
         { "/", { "hello" } }
     }, HTTPServer::Protocol::HttpsWithLegacyTLS);
     HTTPServer mixedContentServer({
-        { "/", { {{ "Content-Type", "text/html" }}, makeString("<img src=''></img>") } },
+        { "/", { {{ "Content-Type", "text/html" }}, makeString("<img src=''></img>") } },
     }, HTTPServer::Protocol::Https);
 
     auto [webView, delegate] = webViewWithNavigationDelegate();
@@ -344,7 +344,7 @@
     }, HTTPServer::Protocol::HttpsWithLegacyTLS);
 
     HTTPServer modernTLSServer({
-        { "/", { makeString("<script>fetch('https://127.0.0.1:", static_cast<unsigned>(legacyTLSServer.port()), "/',{mode:'no-cors'})</script>") } },
+        { "/", { makeString("<script>fetch('https://127.0.0.1:", legacyTLSServer.port(), "/',{mode:'no-cors'})</script>") } },
         { "/pageWithoutSubresource", { "hello" }}
     }, HTTPServer::Protocol::Https);
     
@@ -378,7 +378,7 @@
         { "/", { "hello" } }
     });
     HTTPServer mixedContentServer({
-        { "/", { {{ "Content-Type", "text/html" }}, makeString("<img src=''></img>") } },
+        { "/", { {{ "Content-Type", "text/html" }}, makeString("<img src=''></img>") } },
     }, HTTPServer::Protocol::Https);
 
     auto [webView, delegate] = webViewWithNavigationDelegate();

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm (260553 => 260554)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm	2020-04-23 04:34:31 UTC (rev 260554)
@@ -2551,7 +2551,7 @@
     auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]);
     configureSOAuthorizationWebView(webView.get(), delegate.get());
 
-    auto origin = makeString("http://127.0.0.1:", static_cast<unsigned>(server.port()));
+    auto origin = makeString("http://127.0.0.1:", server.port());
     [webView _loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:(id)origin]] shouldOpenExternalURLs:NO];
     [webView waitForMessage:(id)origin];
     [webView waitForMessage:@"SOAuthorizationDidStart"];

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm (260553 => 260554)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm	2020-04-23 04:05:27 UTC (rev 260553)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm	2020-04-23 04:34:31 UTC (rev 260554)
@@ -688,7 +688,7 @@
     auto delegate = adoptNS([[TestWebAuthenticationPanelUIDelegate alloc] init]);
     [webView setUIDelegate:delegate.get()];
 
-    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:(id)makeString("http://localhost:", static_cast<unsigned>(server.port()))]]];
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:(id)makeString("http://localhost:", server.port())]]];
     Util::run(&webAuthenticationPanelRan);
     [webView evaluateJavaScript:@"theFrame.parentNode.removeChild(theFrame)" completionHandler:nil];
     Util::run(&webAuthenticationPanelFailed);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to