--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- /third_party/blink/renderer/platform/text/character.cc +++ /third_party/blink/renderer/platform/text/character.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include "third_party/blink/renderer/platform/text/icu_error.h" #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" @@ -48,22 +49,19 @@ namespace blink { #if defined(USING_SYSTEM_ICU) -static icu::UnicodeSet* createUnicodeSet(const UChar32* characters, - size_t charactersCount, - const UChar32* ranges, - size_t rangesCount) { +static icu::UnicodeSet* createUnicodeSet(std::vector characters, + std::vector ranges) { icu::UnicodeSet* unicodeSet = new icu::UnicodeSet(); - for (size_t i = 0; i < charactersCount; i++) - unicodeSet->add(characters[i]); - for (size_t i = 0; i < rangesCount; i += 2) - unicodeSet->add(ranges[i], ranges[i + 1]); + for (auto i = characters.cbegin(); i != characters.cend(); i++) + unicodeSet->add(characters[*i]); + for (auto i = ranges.cbegin(); i != ranges.cend(); i += 2) + unicodeSet->add(ranges[*i], ranges[*i + 1]); unicodeSet->freeze(); return unicodeSet; } -#define CREATE_UNICODE_SET(name) \ - createUnicodeSet(name##Array, arraysize(name##Array), name##Ranges, \ - arraysize(name##Ranges)) +#define CREATE_UNICODE_SET(name) \ + createUnicodeSet(name##Array, name##Ranges) #define RETURN_HAS_PROPERTY(c, name) \ static icu::UnicodeSet* unicodeSet = nullptr; \ --- /third_party/blink/renderer/platform/text/character_property_data_generator.h +++ /third_party/blink/renderer/platform/text/character_property_data_generator.h @@ -6,10 +6,11 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_CHARACTER_PROPERTY_DATA_GENERATOR_H_ #include +#include namespace blink { -static const UChar32 kIsCJKIdeographOrSymbolArray[] = { +static std::vector kIsCJKIdeographOrSymbolArray = { // 0x2C7 Caron, Mandarin Chinese 3rd Tone 0x2C7, // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone @@ -32,7 +33,7 @@ // Emoji. 0x1F100, 0x1F004, 0x1F0CF, 0x1F18E}; -static const UChar32 kIsCJKIdeographOrSymbolRanges[] = { +static std::vector kIsCJKIdeographOrSymbolRanges = { // STAFF OF AESCULAPIUS..SCALES for emoji sequences for doctor and judge // professions. 0x2695, 0x2696, @@ -114,10 +115,10 @@ // http://www.unicode.org/reports/tr50/ // Taken from the corresponding data file: // http://www.unicode.org/Public/vertical/revision-16/VerticalOrientation-16.txt -static const UChar32 kIsUprightInMixedVerticalArray[] = { +static std::vector kIsUprightInMixedVerticalArray = { 0x000A7, 0x000A9, 0x000AE, 0x000B1, 0x000D7, 0x000F7}; -static const UChar32 kIsUprightInMixedVerticalRanges[] = { +static std::vector kIsUprightInMixedVerticalRanges = { 0x000BC, 0x000BE, // Spacing Modifier Letters (Part of) 0x002EA, 0x002EB, @@ -212,11 +213,11 @@ }; // https://html.spec.whatwg.org/multipage/scripting.html#prod-potentialcustomelementname -static const UChar32 kIsPotentialCustomElementNameCharArray[] = { +static std::vector kIsPotentialCustomElementNameCharArray = { '-', '.', '_', 0xB7, }; -static const UChar32 kIsPotentialCustomElementNameCharRanges[] = { +static std::vector kIsPotentialCustomElementNameCharRanges = { '0', '9', 'a', 'z', 0xC0, 0xD6, 0xD8, 0xF6, 0xF8, 0x2FF, 0x300, 0x37D, 0x37F, 0x1FFF, 0x200C, 0x200D, 0x203F, 0x2040, 0x2070, 0x218F, 0x2C00, 0x2FEF, 0x3001, 0xD7FF, @@ -224,14 +225,14 @@ }; // http://unicode.org/reports/tr9/#Directional_Formatting_Characters -static const UChar32 kIsBidiControlArray[] = {0x061C, 0x200E, 0x200F}; +static std::vector kIsBidiControlArray = {0x061C, 0x200E, 0x200F}; -static const UChar32 kIsBidiControlRanges[] = { +static std::vector kIsBidiControlRanges = { 0x202A, 0x202E, 0x2066, 0x2069, }; // https://unicode.org/Public/UNIDATA/Blocks.txt -static const UChar32 kIsHangulRanges[] = { +static std::vector kIsHangulRanges = { // Hangul Jamo 0x1100, 0x11FF, // Hangul Compatibility Jamo @@ -247,7 +248,7 @@ 0xFFA0, 0xFFDC, }; -static const UChar32 kIsHangulArray[] = {}; +static std::vector kIsHangulArray = {}; } // namespace blink