File webkit2gtk3-icu52.patch of Package webkit2gtk3.30069
diff -urp webkitgtk-2.39.90.icu60/Source/cmake/OptionsGTK.cmake webkitgtk-2.39.90.icu52/Source/cmake/OptionsGTK.cmake
--- webkitgtk-2.39.90.icu60/Source/cmake/OptionsGTK.cmake 2023-02-24 12:24:59.170702503 -0600
+++ webkitgtk-2.39.90.icu52/Source/cmake/OptionsGTK.cmake 2023-02-24 12:26:46.819270860 -0600
@@ -18,7 +18,7 @@ find_package(Fontconfig 2.8.0 REQUIRED)
find_package(Freetype 2.4.2 REQUIRED)
find_package(LibGcrypt 1.6.0 REQUIRED)
find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU)
-find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc)
+find_package(ICU 52.1 REQUIRED COMPONENTS data i18n uc)
find_package(JPEG REQUIRED)
find_package(LibEpoxy 1.4.0 REQUIRED)
find_package(LibXml2 2.8.0 REQUIRED)
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/Heap.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/Heap.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/Heap.cpp 2023-02-26 13:20:04.312391474 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/Heap.cpp 2023-02-26 13:19:39.516260549 -0600
@@ -335,11 +335,8 @@ Heap::Heap(VM& vm, HeapType heapType)
, intlCollatorHeapCellType(IsoHeapCellType::Args<IntlCollator>())
, intlDateTimeFormatHeapCellType(IsoHeapCellType::Args<IntlDateTimeFormat>())
, intlDisplayNamesHeapCellType(IsoHeapCellType::Args<IntlDisplayNames>())
- , intlListFormatHeapCellType(IsoHeapCellType::Args<IntlListFormat>())
- , intlLocaleHeapCellType(IsoHeapCellType::Args<IntlLocale>())
, intlNumberFormatHeapCellType(IsoHeapCellType::Args<IntlNumberFormat>())
, intlPluralRulesHeapCellType(IsoHeapCellType::Args<IntlPluralRules>())
- , intlRelativeTimeFormatHeapCellType(IsoHeapCellType::Args<IntlRelativeTimeFormat>())
, intlSegmentIteratorHeapCellType(IsoHeapCellType::Args<IntlSegmentIterator>())
, intlSegmenterHeapCellType(IsoHeapCellType::Args<IntlSegmenter>())
, intlSegmentsHeapCellType(IsoHeapCellType::Args<IntlSegments>())
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/Heap.h webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/Heap.h
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/Heap.h 2023-02-26 13:21:09.776737110 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/Heap.h 2023-02-26 13:22:12.409067751 -0600
@@ -221,11 +221,8 @@ class Heap;
v(intlCollatorSpace, intlCollatorHeapCellType, IntlCollator) \
v(intlDateTimeFormatSpace, intlDateTimeFormatHeapCellType, IntlDateTimeFormat) \
v(intlDisplayNamesSpace, intlDisplayNamesHeapCellType, IntlDisplayNames) \
- v(intlListFormatSpace, intlListFormatHeapCellType, IntlListFormat) \
- v(intlLocaleSpace, intlLocaleHeapCellType, IntlLocale) \
v(intlNumberFormatSpace, intlNumberFormatHeapCellType, IntlNumberFormat) \
v(intlPluralRulesSpace, intlPluralRulesHeapCellType, IntlPluralRules) \
- v(intlRelativeTimeFormatSpace, intlRelativeTimeFormatHeapCellType, IntlRelativeTimeFormat) \
v(intlSegmentIteratorSpace, intlSegmentIteratorHeapCellType, IntlSegmentIterator) \
v(intlSegmenterSpace, intlSegmenterHeapCellType, IntlSegmenter) \
v(intlSegmentsSpace, intlSegmentsHeapCellType, IntlSegments) \
@@ -957,11 +954,8 @@ public:
IsoHeapCellType intlCollatorHeapCellType;
IsoHeapCellType intlDateTimeFormatHeapCellType;
IsoHeapCellType intlDisplayNamesHeapCellType;
- IsoHeapCellType intlListFormatHeapCellType;
- IsoHeapCellType intlLocaleHeapCellType;
IsoHeapCellType intlNumberFormatHeapCellType;
IsoHeapCellType intlPluralRulesHeapCellType;
- IsoHeapCellType intlRelativeTimeFormatHeapCellType;
IsoHeapCellType intlSegmentIteratorHeapCellType;
IsoHeapCellType intlSegmenterHeapCellType;
IsoHeapCellType intlSegmentsHeapCellType;
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/HeapSubspaceTypes.h webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/HeapSubspaceTypes.h
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/heap/HeapSubspaceTypes.h 2023-02-26 13:17:02.679432409 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/heap/HeapSubspaceTypes.h 2023-02-26 13:18:42.875961467 -0600
@@ -40,11 +40,8 @@
#include "IntlCollator.h"
#include "IntlDateTimeFormat.h"
#include "IntlDisplayNames.h"
-#include "IntlListFormat.h"
-#include "IntlLocale.h"
#include "IntlNumberFormat.h"
#include "IntlPluralRules.h"
-#include "IntlRelativeTimeFormat.h"
#include "IntlSegmentIterator.h"
#include "IntlSegmenter.h"
#include "IntlSegments.h"
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlCollator.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlCollator.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlCollator.cpp 2023-02-20 03:22:05.953692400 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlCollator.cpp 2023-02-24 12:26:46.819270860 -0600
@@ -97,8 +97,16 @@ Vector<String> IntlCollator::sortLocaleD
String collation(pointer, length);
if (collation == "standard"_s || collation == "search"_s)
continue;
- if (auto mapped = mapICUCollationKeywordToBCP47(collation))
- keyLocaleData.append(WTFMove(mapped.value()));
+
+ // Map keyword values to BCP 47 equivalents.
+ if (collation == "dictionary"_s)
+ keyLocaleData.append("dict"_s);
+ else if (collation == "gb2312han"_s)
+ keyLocaleData.append("gb2312"_s);
+ else if (collation == "phonebook"_s)
+ keyLocaleData.append("phonebk"_s);
+ else if (collation == "traditional"_s)
+ keyLocaleData.append("trad"_s);
else
keyLocaleData.append(WTFMove(collation));
}
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp 2023-02-20 03:22:05.953692400 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -166,11 +166,12 @@ Vector<String> IntlDateTimeFormat::local
ASSERT(U_SUCCESS(status));
String calendar = String(availableName, nameLength);
keyLocaleData.append(calendar);
- // Adding "islamicc" candidate for backward compatibility.
- if (calendar == "islamic-civil"_s)
+ if (calendar == "gregorian"_s)
+ keyLocaleData.append("gregory"_s);
+ else if (calendar == "islamic-civil"_s)
keyLocaleData.append("islamicc"_s);
- if (auto mapped = mapICUCalendarKeywordToBCP47(calendar))
- keyLocaleData.append(WTFMove(mapped.value()));
+ else if (calendar == "ethiopic-amete-alem"_s)
+ keyLocaleData.append("ethioaa"_s);
}
uenum_close(calendars);
break;
@@ -648,13 +649,13 @@ void IntlDateTimeFormat::initializeDateT
return;
}
- {
- String calendar = resolved.extensions[static_cast<unsigned>(RelevantExtensionKey::Ca)];
- if (auto mapped = mapICUCalendarKeywordToBCP47(calendar))
- m_calendar = WTFMove(mapped.value());
- else
- m_calendar = WTFMove(calendar);
- }
+ m_calendar = resolved.extensions[static_cast<unsigned>(RelevantExtensionKey::Ca)];
+ if (m_calendar == "gregorian"_s)
+ m_calendar = "gregory"_s;
+ else if (m_calendar == "islamicc"_s)
+ m_calendar = "islamic-civil"_s;
+ else if (m_calendar == "ethioaa"_s)
+ m_calendar = "ethiopic-amete-alem"_s;
hourCycle = parseHourCycle(resolved.extensions[static_cast<unsigned>(RelevantExtensionKey::Hc)]);
m_numberingSystem = resolved.extensions[static_cast<unsigned>(RelevantExtensionKey::Nu)];
@@ -1315,6 +1316,7 @@ JSValue IntlDateTimeFormat::format(JSGlo
return jsString(vm, String(WTFMove(result)));
}
+#if HAVE(ICU_U_DATE_INTERVAL_FORMAT_FORMAT_RANGE_TO_PARTS)
static ASCIILiteral partTypeString(UDateFormatField field)
{
switch (field) {
@@ -1443,6 +1445,7 @@ JSValue IntlDateTimeFormat::formatToPart
return parts;
}
+#endif
UDateIntervalFormat* IntlDateTimeFormat::createDateIntervalFormatIfNecessary(JSGlobalObject* globalObject)
{
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp 2023-02-20 03:22:05.953692400 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -40,7 +40,6 @@ namespace JSC {
static JSC_DECLARE_CUSTOM_GETTER(intlDateTimeFormatPrototypeGetterFormat);
static JSC_DECLARE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncFormatRange);
static JSC_DECLARE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncFormatRangeToParts);
-static JSC_DECLARE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncFormatToParts);
static JSC_DECLARE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncResolvedOptions);
static JSC_DECLARE_HOST_FUNCTION(intlDateTimeFormatFuncFormatDateTime);
@@ -56,7 +55,6 @@ const ClassInfo IntlDateTimeFormatProtot
@begin dateTimeFormatPrototypeTable
format intlDateTimeFormatPrototypeGetterFormat DontEnum|ReadOnly|CustomAccessor
formatRange intlDateTimeFormatPrototypeFuncFormatRange DontEnum|Function 2
- formatToParts intlDateTimeFormatPrototypeFuncFormatToParts DontEnum|Function 1
resolvedOptions intlDateTimeFormatPrototypeFuncResolvedOptions DontEnum|Function 0
@end
*/
@@ -158,26 +156,6 @@ JSC_DEFINE_CUSTOM_GETTER(intlDateTimeFor
return JSValue::encode(boundFormat);
}
-JSC_DEFINE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncFormatToParts, (JSGlobalObject* globalObject, CallFrame* callFrame))
-{
- VM& vm = globalObject->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- // 15.4 Intl.DateTimeFormat.prototype.formatToParts (ECMA-402 4.0)
- // https://tc39.github.io/ecma402/#sec-Intl.DateTimeFormat.prototype.formatToParts
-
- // Do not use unwrapForOldFunctions.
- auto* dateTimeFormat = jsDynamicCast<IntlDateTimeFormat*>(callFrame->thisValue());
- if (UNLIKELY(!dateTimeFormat))
- return JSValue::encode(throwTypeError(globalObject, scope, "Intl.DateTimeFormat.prototype.formatToParts called on value that's not a DateTimeFormat"_s));
-
- JSValue date = callFrame->argument(0);
- double value = IntlDateTimeFormat::handleDateTimeValue(globalObject, date);
- RETURN_IF_EXCEPTION(scope, { });
-
- RELEASE_AND_RETURN(scope, JSValue::encode(dateTimeFormat->formatToParts(globalObject, value)));
-}
-
// http://tc39.es/proposal-intl-DateTimeFormat-formatRange/#sec-intl.datetimeformat.prototype.formatRange
JSC_DEFINE_HOST_FUNCTION(intlDateTimeFormatPrototypeFuncFormatRange, (JSGlobalObject* globalObject, CallFrame* callFrame))
{
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp 2023-02-24 12:24:59.170702503 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -118,15 +118,6 @@ void IntlDisplayNames::initializeDisplay
// preferable in Intl.DisplayNames. We use UDISPCTX_CAPITALIZATION_FOR_STANDALONE because it makes standalone date format better (fr "Juillet 2008" in ICU test suites),
// and DisplayNames will support date formats too.
UDISPCTX_CAPITALIZATION_FOR_STANDALONE,
-
- // Narrow becomes UDISPCTX_LENGTH_SHORT. But in currency case, we handle differently instead of using ULocaleDisplayNames.
- m_style == Style::Long ? UDISPCTX_LENGTH_FULL : UDISPCTX_LENGTH_SHORT,
-
- // Always disable ICU SUBSTITUTE since it does not match against what the spec defines. ICU has some special substitute rules, for example, language "en-AA"
- // returns "English (AA)" (while AA country code is not defined), but we would like to return either input value or undefined, so we do not want to have ICU substitute rules.
- // Note that this is effective after ICU 65.
- // https://github.com/unicode-org/icu/commit/53dd621e3a5cff3b78b557c405f1b1d6f125b468
- UDISPCTX_NO_SUBSTITUTE,
};
m_localeCString = m_locale.utf8();
m_displayNames = std::unique_ptr<ULocaleDisplayNames, ULocaleDisplayNamesDeleter>(uldn_openForContext(m_localeCString.data(), contexts, std::size(contexts), &status));
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp 2023-02-20 03:22:05.957692400 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -1469,6 +1469,7 @@ void IntlNumberFormat::setBoundFormat(VM
m_boundFormat.set(vm, this, format);
}
+#if 0
void IntlNumberFormat::formatToPartsInternal(JSGlobalObject* globalObject, Style style, bool sign, IntlMathematicalValue::NumberType numberType, const String& formatted, IntlFieldIterator& iterator, JSArray* parts, JSString* sourceType, JSString* unit)
{
VM& vm = globalObject->vm();
@@ -1565,7 +1566,6 @@ JSValue IntlNumberFormat::formatToParts(
return parts;
}
-#if HAVE(ICU_U_NUMBER_FORMATTER)
JSValue IntlNumberFormat::formatToParts(JSGlobalObject* globalObject, IntlMathematicalValue&& value, JSString* sourceType) const
{
VM& vm = globalObject->vm();
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormatInlines.h webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormatInlines.h
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormatInlines.h 2023-02-20 03:22:05.961692300 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormatInlines.h 2023-02-24 12:26:46.823270881 -0600
@@ -200,6 +200,7 @@ void appendNumberFormatDigitOptionsToSke
}
}
+#if 0
class IntlFieldIterator {
public:
WTF_MAKE_NONCOPYABLE(IntlFieldIterator);
@@ -217,6 +218,7 @@ public:
private:
UFieldPositionIterator& m_iterator;
};
+#endif
// https://tc39.es/ecma402/#sec-unwrapnumberformat
inline IntlNumberFormat* IntlNumberFormat::unwrapForOldFunctions(JSGlobalObject* globalObject, JSValue thisValue)
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp 2023-02-20 03:22:05.961692300 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -35,7 +35,6 @@
namespace JSC {
static JSC_DECLARE_CUSTOM_GETTER(intlNumberFormatPrototypeGetterFormat);
-static JSC_DECLARE_HOST_FUNCTION(intlNumberFormatPrototypeFuncFormatToParts);
static JSC_DECLARE_HOST_FUNCTION(intlNumberFormatPrototypeFuncResolvedOptions);
static JSC_DECLARE_HOST_FUNCTION(intlNumberFormatFuncFormat);
@@ -58,7 +57,6 @@ const ClassInfo IntlNumberFormatPrototyp
/* Source for IntlNumberFormatPrototype.lut.h
@begin numberFormatPrototypeTable
format intlNumberFormatPrototypeGetterFormat DontEnum|ReadOnly|CustomAccessor
- formatToParts intlNumberFormatPrototypeFuncFormatToParts DontEnum|Function 1
resolvedOptions intlNumberFormatPrototypeFuncResolvedOptions DontEnum|Function 0
@end
*/
@@ -171,6 +169,7 @@ JSC_DEFINE_HOST_FUNCTION(intlNumberForma
}
#endif
+#if 0
JSC_DEFINE_HOST_FUNCTION(intlNumberFormatPrototypeFuncFormatToParts, (JSGlobalObject* globalObject, CallFrame* callFrame))
{
VM& vm = globalObject->vm();
@@ -199,6 +198,7 @@ JSC_DEFINE_HOST_FUNCTION(intlNumberForma
RELEASE_AND_RETURN(scope, JSValue::encode(numberFormat->formatToParts(globalObject, value)));
#endif
}
+#endif
#if HAVE(ICU_U_NUMBER_RANGE_FORMATTER_FORMAT_RANGE_TO_PARTS)
JSC_DEFINE_HOST_FUNCTION(intlNumberFormatPrototypeFuncFormatRangeToParts, (JSGlobalObject* globalObject, CallFrame* callFrame))
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlObject.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlObject.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlObject.cpp 2023-02-24 12:24:59.170702503 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlObject.cpp 2023-02-24 12:26:46.823270881 -0600
@@ -39,10 +39,8 @@
#include "IntlDisplayNames.h"
#include "IntlDisplayNamesConstructor.h"
#include "IntlDisplayNamesPrototype.h"
-#include "IntlListFormat.h"
#include "IntlListFormatConstructor.h"
#include "IntlListFormatPrototype.h"
-#include "IntlLocale.h"
#include "IntlLocaleConstructor.h"
#include "IntlLocalePrototype.h"
#include "IntlNumberFormatConstructor.h"
@@ -61,7 +59,6 @@
#include <unicode/ucal.h>
#include <unicode/ucol.h>
#include <unicode/ucurr.h>
-#include <unicode/ufieldpositer.h>
#include <unicode/uloc.h>
#include <unicode/unumsys.h>
#include <wtf/Assertions.h>
@@ -100,6 +97,7 @@ static JSValue createDisplayNamesConstru
return IntlDisplayNamesConstructor::create(vm, IntlDisplayNamesConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlDisplayNamesPrototype*>(globalObject->displayNamesStructure()->storedPrototypeObject()));
}
+#if 0
static JSValue createListFormatConstructor(VM& vm, JSObject* object)
{
IntlObject* intlObject = jsCast<IntlObject*>(object);
@@ -113,6 +111,7 @@ static JSValue createLocaleConstructor(V
JSGlobalObject* globalObject = intlObject->globalObject();
return IntlLocaleConstructor::create(vm, IntlLocaleConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlLocalePrototype*>(globalObject->localeStructure()->storedPrototypeObject()));
}
+#endif
static JSValue createNumberFormatConstructor(VM&, JSObject* object)
{
@@ -128,12 +127,14 @@ static JSValue createPluralRulesConstruc
return IntlPluralRulesConstructor::create(vm, IntlPluralRulesConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlPluralRulesPrototype*>(globalObject->pluralRulesStructure()->storedPrototypeObject()));
}
+#if 0
static JSValue createRelativeTimeFormatConstructor(VM& vm, JSObject* object)
{
IntlObject* intlObject = jsCast<IntlObject*>(object);
JSGlobalObject* globalObject = intlObject->globalObject();
return IntlRelativeTimeFormatConstructor::create(vm, IntlRelativeTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlRelativeTimeFormatPrototype*>(globalObject->relativeTimeFormatStructure()->storedPrototypeObject()));
}
+#endif
static JSValue createSegmenterConstructor(VM& vm, JSObject* object)
{
@@ -155,10 +156,8 @@ namespace JSC {
Collator createCollatorConstructor DontEnum|PropertyCallback
DateTimeFormat createDateTimeFormatConstructor DontEnum|PropertyCallback
DisplayNames createDisplayNamesConstructor DontEnum|PropertyCallback
- Locale createLocaleConstructor DontEnum|PropertyCallback
NumberFormat createNumberFormatConstructor DontEnum|PropertyCallback
PluralRules createPluralRulesConstructor DontEnum|PropertyCallback
- RelativeTimeFormat createRelativeTimeFormatConstructor DontEnum|PropertyCallback
Segmenter createSegmenterConstructor DontEnum|PropertyCallback
@end
*/
@@ -171,11 +170,13 @@ struct MatcherResult {
const ClassInfo IntlObject::s_info = { "Intl"_s, &Base::s_info, &intlObjectTable, nullptr, CREATE_METHOD_TABLE(IntlObject) };
+#if 0
void UFieldPositionIteratorDeleter::operator()(UFieldPositionIterator* iterator) const
{
if (iterator)
ufieldpositer_close(iterator);
}
+#endif
const MeasureUnit simpleUnits[45] = {
{ "area"_s, "acre"_s },
@@ -247,7 +248,7 @@ void IntlObject::finishCreation(VM& vm,
putDirectWithoutTransition(vm, vm.propertyNames->DurationFormat, createDurationFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));
putDirectWithoutTransition(vm, vm.propertyNames->ListFormat, createListFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));
#else
- UNUSED_PARAM(&createListFormatConstructor);
+ //UNUSED_PARAM(&createListFormatConstructor);
#endif
}
@@ -739,7 +740,7 @@ Vector<String> canonicalizeLocaleList(JS
return seen;
JSObject* localesObject;
- if (locales.isString() || locales.inherits<IntlLocale>()) {
+ if (locales.isString()) {
JSArray* localesArray = JSArray::tryCreate(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous));
if (!localesArray) {
throwOutOfMemoryError(globalObject, scope);
@@ -776,15 +777,11 @@ Vector<String> canonicalizeLocaleList(JS
}
String tag;
- if (kValue.inherits<IntlLocale>())
- tag = jsCast<IntlLocale*>(kValue)->toString();
- else {
- JSString* string = kValue.toString(globalObject);
- RETURN_IF_EXCEPTION(scope, Vector<String>());
+ JSString* string = kValue.toString(globalObject);
+ RETURN_IF_EXCEPTION(scope, Vector<String>());
- tag = string->value(globalObject);
- RETURN_IF_EXCEPTION(scope, Vector<String>());
- }
+ tag = string->value(globalObject);
+ RETURN_IF_EXCEPTION(scope, Vector<String>());
if (isStructurallyValidLanguageTag(tag)) {
ASSERT(tag.isAllASCII());
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlObject.h webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlObject.h
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlObject.h 2023-02-24 12:24:59.170702503 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlObject.h 2023-02-24 12:26:46.827270902 -0600
@@ -160,6 +160,7 @@ bool isWellFormedCurrencyCode(StringView
std::optional<Vector<char, 32>> canonicalizeLocaleIDWithoutNullTerminator(const char* localeID);
+#if 0
struct UFieldPositionIteratorDeleter {
void operator()(UFieldPositionIterator*) const;
};
@@ -175,5 +176,6 @@ inline CalendarID utcTimeZoneID()
return utcTimeZoneIDSlow();
return value;
}
+#endif
} // namespace JSC
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlPluralRules.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlPluralRules.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/IntlPluralRules.cpp 2023-02-20 03:22:05.961692300 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/IntlPluralRules.cpp 2023-02-24 12:26:46.827270902 -0600
@@ -212,6 +212,7 @@ JSObject* IntlPluralRules::resolvedOptio
break;
}
+#if 0
JSArray* categories = JSArray::tryCreate(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous), 0);
if (UNLIKELY(!categories)) {
throwOutOfMemoryError(globalObject, scope);
@@ -231,6 +232,7 @@ JSObject* IntlPluralRules::resolvedOptio
RETURN_IF_EXCEPTION(scope, { });
}
options->putDirect(vm, Identifier::fromString(vm, "pluralCategories"_s), categories);
+#endif
options->putDirect(vm, vm.propertyNames->roundingMode, jsNontrivialString(vm, IntlNumberFormat::roundingPriorityString(m_roundingType)));
return options;
@@ -262,10 +264,33 @@ JSValue IntlPluralRules::select(JSGlobal
return throwTypeError(globalObject, scope, "failed to select plural value"_s);
return jsString(vm, String(WTFMove(buffer)));
#else
+#if 0
Vector<UChar, 8> result(8);
auto length = uplrules_selectWithFormat(m_pluralRules.get(), value, m_numberFormat.get(), result.data(), result.size(), &status);
if (U_FAILURE(status))
return throwTypeError(globalObject, scope, "failed to select plural value"_s);
+#else
+ Vector<UChar, 32> buffer(32);
+ auto length = unum_formatDouble(m_numberFormat.get(), value, buffer.data(), buffer.size(), nullptr, &status);
+ if (status == U_BUFFER_OVERFLOW_ERROR) {
+ buffer.grow(length);
+ status = U_ZERO_ERROR;
+ unum_formatDouble(m_numberFormat.get(), value, buffer.data(), length, nullptr, &status);
+ }
+ if (U_FAILURE(status))
+ return throwTypeError(globalObject, scope, "failed to select plural value"_s);
+
+ double formatted = unum_parseDouble(m_numberFormat.get(), buffer.data(), length, nullptr, &status);
+ if (U_FAILURE(status))
+ return throwTypeError(globalObject, scope, "failed to select plural value"_s);
+
+ // Can only be 'zero', 'one', 'two', 'few', 'many' or 'other'
+ status = U_ZERO_ERROR;
+ Vector<UChar, 8> result(8);
+ length = uplrules_select(m_pluralRules.get(), formatted, result.data(), result.size(), &status);
+ if (U_FAILURE(status))
+ return throwTypeError(globalObject, scope, "failed to select plural value"_s);
+#endif
return jsString(vm, String(result.data(), length));
#endif
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSDateMath.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSDateMath.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSDateMath.cpp 2023-02-20 03:22:05.977692600 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSDateMath.cpp 2023-02-24 12:26:46.827270902 -0600
@@ -475,12 +475,8 @@ void DateCache::timeZoneCacheSlow()
ucal_setGregorianChange(cache->m_calendar.get(), minECMAScriptTime, &status); // Ignore "unsupported" error.
m_timeZoneCache = std::unique_ptr<OpaqueICUTimeZone, OpaqueICUTimeZoneDeleter>(cache);
#else
- if (!timeZoneID.isEmpty()) {
- m_timeZoneCache = std::unique_ptr<OpaqueICUTimeZone, OpaqueICUTimeZoneDeleter>(toOpaqueICUTimeZone(icu::TimeZone::createTimeZone(icu::UnicodeString(timeZoneID.data(), timeZoneID.size()))));
- return;
- }
// Do not use icu::TimeZone::createDefault. ICU internally has a cache for timezone and createDefault returns this cached value.
- m_timeZoneCache = std::unique_ptr<OpaqueICUTimeZone, OpaqueICUTimeZoneDeleter>(toOpaqueICUTimeZone(icu::TimeZone::detectHostTimeZone()));
+ m_timeZoneCache = std::unique_ptr<OpaqueICUTimeZone, OpaqueICUTimeZoneDeleter>(toOpaqueICUTimeZone(icu::TimeZone::createDefault()));
#endif
}
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSGlobalObject.cpp webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSGlobalObject.cpp 2023-02-24 12:24:59.170702503 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSGlobalObject.cpp 2023-02-24 12:26:46.827270902 -0600
@@ -83,18 +83,12 @@
#include "IntlDateTimeFormatPrototype.h"
#include "IntlDisplayNames.h"
#include "IntlDisplayNamesPrototype.h"
-#include "IntlListFormat.h"
-#include "IntlListFormatPrototype.h"
-#include "IntlLocale.h"
-#include "IntlLocalePrototype.h"
#include "IntlNumberFormat.h"
#include "IntlNumberFormatConstructor.h"
#include "IntlNumberFormatPrototype.h"
#include "IntlObject.h"
#include "IntlPluralRules.h"
#include "IntlPluralRulesPrototype.h"
-#include "IntlRelativeTimeFormat.h"
-#include "IntlRelativeTimeFormatPrototype.h"
#include "IntlSegmentIterator.h"
#include "IntlSegmentIteratorPrototype.h"
#include "IntlSegmenter.h"
@@ -1279,30 +1273,12 @@ capitalName ## Constructor* lowerName ##
IntlDisplayNamesPrototype* displayNamesPrototype = IntlDisplayNamesPrototype::create(init.vm, IntlDisplayNamesPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype()));
init.set(IntlDisplayNames::createStructure(init.vm, globalObject, displayNamesPrototype));
});
- m_listFormatStructure.initLater(
- [] (const Initializer<Structure>& init) {
- JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(init.owner);
- IntlListFormatPrototype* listFormatPrototype = IntlListFormatPrototype::create(init.vm, IntlListFormatPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype()));
- init.set(IntlListFormat::createStructure(init.vm, globalObject, listFormatPrototype));
- });
- m_localeStructure.initLater(
- [] (const Initializer<Structure>& init) {
- JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(init.owner);
- IntlLocalePrototype* localePrototype = IntlLocalePrototype::create(init.vm, IntlLocalePrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype()));
- init.set(IntlLocale::createStructure(init.vm, globalObject, localePrototype));
- });
m_pluralRulesStructure.initLater(
[] (const Initializer<Structure>& init) {
JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(init.owner);
IntlPluralRulesPrototype* pluralRulesPrototype = IntlPluralRulesPrototype::create(init.vm, globalObject, IntlPluralRulesPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype()));
init.set(IntlPluralRules::createStructure(init.vm, globalObject, pluralRulesPrototype));
});
- m_relativeTimeFormatStructure.initLater(
- [] (const Initializer<Structure>& init) {
- JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(init.owner);
- IntlRelativeTimeFormatPrototype* relativeTimeFormatPrototype = IntlRelativeTimeFormatPrototype::create(init.vm, IntlRelativeTimeFormatPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype()));
- init.set(IntlRelativeTimeFormat::createStructure(init.vm, globalObject, relativeTimeFormatPrototype));
- });
m_segmentIteratorStructure.initLater(
[] (const Initializer<Structure>& init) {
JSGlobalObject* globalObject = jsCast<JSGlobalObject*>(init.owner);
@@ -2388,10 +2364,7 @@ void JSGlobalObject::visitChildrenImpl(J
thisObject->m_defaultCollator.visit(visitor);
thisObject->m_collatorStructure.visit(visitor);
thisObject->m_displayNamesStructure.visit(visitor);
- thisObject->m_listFormatStructure.visit(visitor);
- thisObject->m_localeStructure.visit(visitor);
thisObject->m_pluralRulesStructure.visit(visitor);
- thisObject->m_relativeTimeFormatStructure.visit(visitor);
thisObject->m_segmentIteratorStructure.visit(visitor);
thisObject->m_segmenterStructure.visit(visitor);
thisObject->m_segmentsStructure.visit(visitor);
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSGlobalObject.h webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSGlobalObject.h
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/runtime/JSGlobalObject.h 2023-02-24 12:24:59.174702524 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/runtime/JSGlobalObject.h 2023-02-24 12:26:46.827270902 -0600
@@ -341,10 +341,7 @@ public:
LazyProperty<JSGlobalObject, IntlCollator> m_defaultCollator;
LazyProperty<JSGlobalObject, Structure> m_collatorStructure;
LazyProperty<JSGlobalObject, Structure> m_displayNamesStructure;
- LazyProperty<JSGlobalObject, Structure> m_listFormatStructure;
- LazyProperty<JSGlobalObject, Structure> m_localeStructure;
LazyProperty<JSGlobalObject, Structure> m_pluralRulesStructure;
- LazyProperty<JSGlobalObject, Structure> m_relativeTimeFormatStructure;
LazyProperty<JSGlobalObject, Structure> m_segmentIteratorStructure;
LazyProperty<JSGlobalObject, Structure> m_segmenterStructure;
LazyProperty<JSGlobalObject, Structure> m_segmentsStructure;
@@ -1032,11 +1029,8 @@ public:
Structure* collatorStructure() { return m_collatorStructure.get(this); }
Structure* dateTimeFormatStructure() { return m_dateTimeFormatStructure.get(this); }
Structure* displayNamesStructure() { return m_displayNamesStructure.get(this); }
- Structure* listFormatStructure() { return m_listFormatStructure.get(this); }
Structure* numberFormatStructure() { return m_numberFormatStructure.get(this); }
- Structure* localeStructure() { return m_localeStructure.get(this); }
Structure* pluralRulesStructure() { return m_pluralRulesStructure.get(this); }
- Structure* relativeTimeFormatStructure() { return m_relativeTimeFormatStructure.get(this); }
Structure* segmentIteratorStructure() { return m_segmentIteratorStructure.get(this); }
Structure* segmenterStructure() { return m_segmenterStructure.get(this); }
Structure* segmentsStructure() { return m_segmentsStructure.get(this); }
diff -urp webkitgtk-2.39.90.icu60/Source/JavaScriptCore/Sources.txt webkitgtk-2.39.90.icu52/Source/JavaScriptCore/Sources.txt
--- webkitgtk-2.39.90.icu60/Source/JavaScriptCore/Sources.txt 2023-02-24 12:24:59.174702524 -0600
+++ webkitgtk-2.39.90.icu52/Source/JavaScriptCore/Sources.txt 2023-02-24 12:26:46.827270902 -0600
@@ -853,12 +853,6 @@ runtime/IntlDateTimeFormatPrototype.cpp
runtime/IntlDisplayNames.cpp
runtime/IntlDisplayNamesConstructor.cpp
runtime/IntlDisplayNamesPrototype.cpp
-runtime/IntlListFormat.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect in this file.
-runtime/IntlListFormatConstructor.cpp
-runtime/IntlListFormatPrototype.cpp
-runtime/IntlLocale.cpp
-runtime/IntlLocaleConstructor.cpp
-runtime/IntlLocalePrototype.cpp
runtime/IntlNumberFormat.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect in this file.
runtime/IntlNumberFormatConstructor.cpp
runtime/IntlNumberFormatPrototype.cpp
@@ -866,9 +860,6 @@ runtime/IntlObject.cpp
runtime/IntlPluralRules.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect to this file.
runtime/IntlPluralRulesConstructor.cpp
runtime/IntlPluralRulesPrototype.cpp
-runtime/IntlRelativeTimeFormat.cpp
-runtime/IntlRelativeTimeFormatConstructor.cpp
-runtime/IntlRelativeTimeFormatPrototype.cpp
runtime/IntlSegmentIterator.cpp
runtime/IntlSegmentIteratorPrototype.cpp
runtime/IntlSegmenter.cpp
diff -urp webkitgtk-2.39.90.icu60/Source/WebCore/platform/text/CharacterProperties.h webkitgtk-2.39.90.icu52/Source/WebCore/platform/text/CharacterProperties.h
--- webkitgtk-2.39.90.icu60/Source/WebCore/platform/text/CharacterProperties.h 2023-02-20 03:22:19.281745000 -0600
+++ webkitgtk-2.39.90.icu52/Source/WebCore/platform/text/CharacterProperties.h 2023-02-24 12:26:46.827270902 -0600
@@ -44,7 +44,6 @@ static_assert(UBLOCK_SYMBOLS_AND_PICTOGR
case UBLOCK_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS:
case UBLOCK_EMOTICONS:
case UBLOCK_TRANSPORT_AND_MAP_SYMBOLS:
- case UBLOCK_SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS:
case UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A:
return true;
default:
@@ -80,12 +79,12 @@ inline bool isEmojiRegionalIndicator(UCh
inline bool isEmojiWithPresentationByDefault(UChar32 character)
{
- return u_hasBinaryProperty(character, UCHAR_EMOJI_PRESENTATION);
+ return false;
}
inline bool isEmojiModifierBase(UChar32 character)
{
- return u_hasBinaryProperty(character, UCHAR_EMOJI_MODIFIER_BASE);
+ return false;
}
inline bool isDefaultIgnorableCodePoint(UChar32 character)