From d7c202ca3c33902d75cd9d2e485396401c5467d7 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 3 Jun 2021 12:03:32 -0700 Subject: [PATCH] browser(webkit): fix time formatting and mac compilation (#6875) --- browser_patches/webkit/BUILD_NUMBER | 4 +- browser_patches/webkit/patches/bootstrap.diff | 43 ++++++------------- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER index 77c0c8111f..1fdf9876c0 100644 --- a/browser_patches/webkit/BUILD_NUMBER +++ b/browser_patches/webkit/BUILD_NUMBER @@ -1,2 +1,2 @@ -1491 -Changed: yurys@chromium.org Wed 02 Jun 2021 03:34:29 PM PDT +1492 +Changed: yurys@chromium.org Thu 03 Jun 2021 11:45:44 AM PDT diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index 4e4ba789fe..b016d3090a 100644 --- a/browser_patches/webkit/patches/bootstrap.diff +++ b/browser_patches/webkit/patches/bootstrap.diff @@ -1654,40 +1654,23 @@ index 638612413466efc87b737e8a81042ed07ca12703..6f9e518ff0bfa2a6228675d25b6b785f }, { diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp -index 2decf8a83c80e80ca8677f4c787bf79c6c2995fa..ff28030fe3227af688d9cc0e405d12a4a387e107 100644 +index 2decf8a83c80e80ca8677f4c787bf79c6c2995fa..9010384a32f7c2ab69a8fb20eb19cd566fd9f434 100644 --- a/Source/JavaScriptCore/runtime/DateConversion.cpp +++ b/Source/JavaScriptCore/runtime/DateConversion.cpp -@@ -97,18 +97,24 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as +@@ -97,6 +97,9 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as appendNumber<2>(builder, offset / 60); appendNumber<2>(builder, offset % 60); --#if OS(WINDOWS) -- TIME_ZONE_INFORMATION timeZoneInformation; -- GetTimeZoneInformation(&timeZoneInformation); -- const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName; -- String timeZoneName(winTimeZoneName); -+ String timeZoneName; + if (!WTF::timeZoneDisplayNameForAutomation().isEmpty()) { -+ timeZoneName = WTF::timeZoneDisplayNameForAutomation(); ++ builder.append(" (", WTF::timeZoneDisplayNameForAutomation(), ')'); + } else { -+ #if OS(WINDOWS) -+ TIME_ZONE_INFORMATION timeZoneInformation; -+ GetTimeZoneInformation(&timeZoneInformation); -+ const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName; -+ timeZoneName = String(winTimeZoneName); - #else -- struct tm gtm = t; -- char timeZoneName[70]; -- strftime(timeZoneName, sizeof(timeZoneName), "%Z", >m); -+ struct tm gtm = t; -+ char tzName[70]; -+ strftime(tzName, sizeof(tzName), "%Z", >m); -+ timeZoneName = String(tzName); + #if OS(WINDOWS) + TIME_ZONE_INFORMATION timeZoneInformation; + GetTimeZoneInformation(&timeZoneInformation); +@@ -109,6 +112,7 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as #endif -- if (timeZoneName[0]) -- builder.append(" (", timeZoneName, ')'); -+ if (!timeZoneName.isEmpty()) -+ builder.append(" (", timeZoneName, ')'); + if (timeZoneName[0]) + builder.append(" (", timeZoneName, ')'); + } } } @@ -14160,7 +14143,7 @@ index 0000000000000000000000000000000000000000..d0e11ed81a6257c011df23d5870da740 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..6e510ec9b7625a3298e71ad24a33ad018cc55eb0 +index 0000000000000000000000000000000000000000..a99ca36604fadf1514e7c5211251e57e525a2eee --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp @@ -0,0 +1,921 @@ @@ -14740,14 +14723,14 @@ index 0000000000000000000000000000000000000000..6e510ec9b7625a3298e71ad24a33ad01 + return; + auto origins = JSON::ArrayOf::create(); + for (const auto& originData : data) { -+ auto items = JSON::ArrayOf::create(); ++ auto items = JSON::ArrayOf::create(); + for (const auto& entry : originData.second) { -+ items->addItem(Protocol::Playwright::NameValue::create() ++ items->addItem(Inspector::Protocol::Playwright::NameValue::create() + .setName(entry.key) + .setValue(entry.value) + .release()); + } -+ origins->addItem(Protocol::Playwright::OriginStorage::create() ++ origins->addItem(Inspector::Protocol::Playwright::OriginStorage::create() + .setOrigin(originData.first.toString()) + .setItems(WTFMove(items)) + .release());