|Summary:||[GTK][WPE] Enable Intl API additions|
|Product:||WebKit||Reporter:||Ms2ger (he/him; ⌚ UTC+1/+2) <Ms2ger>|
|Severity:||Normal||CC:||andy, bugs-noreply, mcatanzaro|
|Version:||WebKit Nightly Build|
Description Ms2ger (he/him; ⌚ UTC+1/+2) 2018-05-17 01:15:21 PDT
In particular: * ENABLE_INTL_NUMBER_FORMAT_TO_PARTS * ENABLE_INTL_PLURAL_RULES
Comment 1 Michael Catanzaro 2018-05-17 08:22:58 PDT
Why are there build flags for these...?
Comment 2 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-05-17 08:25:24 PDT
I'm not sure, but possibly they require relatively new ICU APIs.
Comment 3 Michael Catanzaro 2018-05-19 09:19:33 PDT
(In reply to Ms2ger from comment #2) > I'm not sure, but possibly they require relatively new ICU APIs. Sounds like this is the case. It's OK to enable the new stuff when a new ICU is available at build time, but we have to continue supporting older ICU as well.
Comment 4 Michael Catanzaro 2018-05-21 07:54:08 PDT
I suggest ENABLE_INTL_NUMBER_FORMAT_TO_PARTS and ENABLE_INTL_PLURAL_RULES should be removed and replaced with appropriate ICU_MAJOR_VERSION checks. I assume we surely want these enabled if ICU is new enough, right?
Comment 5 Andy VanWagoner 2018-07-26 08:45:12 PDT
Because these are new web-visible APIs, I was told they need to be behind flags. There are some additional guards around ICU version like: #define HAVE_ICU_FORMAT_DOUBLE_FOR_FIELDS (U_ICU_VERSION_MAJOR_NUM >= 59) #define JSC_ICU_HAS_PLURALRULES_KEYWORDS (U_ICU_VERSION_MAJOR_NUM >= 59) #define JSC_ICU_HAS_PLURALRULES_WITH_FORMAT (U_ICU_VERSION_MAJOR_NUM >= 59) #if HAVE(ICU_FORMAT_DOUBLE_FOR_FIELDS) #if JSC_ICU_HAS_PLURALRULES_KEYWORDS #if JSC_ICU_HAS_PLURALRULES_WITH_FORMAT Looking at them, the pluralrules ones should have been like the format_double one. The default enabling looks like: #if ENABLE(INTL_NUMBER_FORMAT_TO_PARTS) && (!PLATFORM(COCOA) || ENABLE(EXPERIMENTAL_FEATURES)) #if ENABLE(INTL_PLURAL_RULES) && (!PLATFORM(COCOA) || ENABLE(EXPERIMENTAL_FEATURES)) Because the additional guards are in place, I think GTK could enable the INTL_ flags. NumberFormat.formatToParts will only be available if compiled with newer ICU, and PluralRules will only work in basic use cases without newer ICU.