From e5f91e68bdafa3c5665a4571ed66b25d975aa0ab Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 30 Mar 2024 10:26:04 -0400 Subject: Revert a commit. --- www-client/chromium/Manifest | 3 +- www-client/chromium/chromium-125.0.6382.3.ebuild | 1 + .../files/chromium-125-revert-8a3bec6.patch | 450 +++++++++++++++++++++ 3 files changed, 453 insertions(+), 1 deletion(-) create mode 100644 www-client/chromium/files/chromium-125-revert-8a3bec6.patch diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest index f9f9f31..d0530be 100644 --- a/www-client/chromium/Manifest +++ b/www-client/chromium/Manifest @@ -38,6 +38,7 @@ AUX chromium-123-compiler.patch 11238 BLAKE2B 2cd6a2dc550f952685db63062d7d90f688 AUX chromium-123-qrgen-disablerust.patch 3371 BLAKE2B d4d8d37fc7c971f97467441c22bdf7dba1a22c17d73c47978b926565759b5b113c8a03a91d76cdb1e8f8d1fc3902c86bcc7ed703e84959927548cccfbc45836b SHA512 c3a5f6424806fc6528ee7eab83e13169218d82b18750298e916696a0d6fa288b1881e267a72a57cb03291fe642d7edf91d365e320587d40277ed9e7a860b497a AUX chromium-124-metrics-histograms-nodepotbin.patch 533 BLAKE2B 2dee74b4c10b4d8280ba0b0dcdea0c8f7896422c190bbf31b7ee147a6ac81b34033a156c9fd66cf8e875aaa02a8ebeb4e04d7164f7e6701836539300297f25f3 SHA512 a1ecd84d7433542779da17e79fe73a63f4bff94c49b13c51947ade9ed27f82e8fca94b08d628e7cd8853c2e9ffc11078b02fab81fba98635390805b0230035f4 AUX chromium-125-compiler.patch 11174 BLAKE2B 72d9ba637c1d726edcb4a9ff695b34f6a70e39c775ac34bc6b3bd9151ac390c9840429bef82bac1ff32502dd5dee49754bbc868eed1c28562b07ca33cf136189 SHA512 7e17a17947025ae992882828ccea0dd85d0a749c7dd27b1423ea436f0da379fe846b4808df6186f74df161f69c6b8802881ab3569511580e121aea359c4f90e3 +AUX chromium-125-revert-8a3bec6.patch 17037 BLAKE2B d2fa1845fb0a634428ff676c4cbec59d37bd1b668e1d80d17bc0a040a049160186132ac91d2202719e4936f241c3362e664d877401742b0755c49f388c2afe90 SHA512 04c2e0b6ebdc88d079f0caa6a101f306073c65c294ab8ec2bb6ab4eba216eb9fbaf5698e5db4f6c489472c5e1b9621f05bd3448f6ae7c68a23e82371342e62ab AUX chromium-78-protobuf-RepeatedPtrField-export.patch 694 BLAKE2B 3fffcb6a7289bac848b89275a9f76e4302042362fa9bcf2689df01e0a00806c7e838210fa8696ee8e2134127ec4cfb5c3b632e2739c225f8e9586e01de7035ce SHA512 e3a80775d958740eedc7c3df0e9dd12b0e6a51ccf871a2085ab77246814e748428133d27c60322a102eb8f50bb65fc2c607e0d2665a92393be55befcbf566ab0 AUX chromium-93-InkDropHost-crash.patch 1134 BLAKE2B 1593c406c48b629ea3170a518cf86e936af36c554bc97a380324ab6fc930e49a359dc3ef6787ab08314a6a8f5da85714b0fa9d8589d6a46b1d06cbbd7e401f22 SHA512 474d7f55505e1275238d71d1723d74a66fc9f27a16ed293aa80ffefbe5500cd65a0bf13ec76a9bca0334a245f22120099fb367d12b93adc14500104d11cd3bff AUX chromium-98-EnumTable-crash.patch 2854 BLAKE2B 4478e14e7f0c0d251b659546c2e4b83b712b072317c35f63376d7d58e2fa3563f0518b4cc333c5902140cfcd333b5860737d4c7ccbb3680fee1b60de25ad0917 SHA512 a1b55b04da7218cda037a38a543032aa741a589d2f0691d69f28eb173ffeff284d2f4da2cab1708335ecfc0a3c12ecbd57c4c48dee3eca44d659d9a3f9a7dff6 @@ -52,4 +53,4 @@ DIST chromium-124.0.6342.3.tar.xz 3445784432 BLAKE2B 65d682903123f2d853ceb016a41 DIST chromium-125.0.6382.3.tar.xz 3423991912 BLAKE2B 45dc9f65ab91f235f7733d818e5e80a00915eebb1b0b24b2579b8346ec2c94f541b30f39dc7702db791e8789c4921a30a351b7b05c0c02be477fde803522fd14 SHA512 be5f1cab6e71a826899252075ca4b445799bf1b4d1ca4cb2a51f544a21b502622cd469afa1be08fe3a0809d44b717c6616cac31e905c90a633a265f5e5e6c5d5 DIST chromium-profiler-0.2.tar 259952640 BLAKE2B 5e82389fce00b267280d633b26551231c558b80f0c92cd7d60271095a3503365ab673e7a46dc5f74f8a82db1f21262cb24dcc0531d954bab5fb3b175dab3394d SHA512 9fa89a5ab728419683e7495ae676567480987d68a2d589f2aa97bfcbcf123f3c8f97f8bca5f65e5e3f6e41475535add473ded83b9c7a33bb4746a9d05b298a6c EBUILD chromium-124.0.6342.3.ebuild 39546 BLAKE2B 53b528f641e5f278c045c27aeba813d93eeedd5ea6f15e2c67e54de4781329336199e6bdb67ef194e1c620193bc58e15b59cc0c8415ec42733542f1cbaec93e5 SHA512 afef968b574473c39dd50be20a85031737b6c4e11050a2e2e124edff226aba62f9eca232c7f85991929cf078af5b18ba6465b273b32be283d014be6467b4db98 -EBUILD chromium-125.0.6382.3.ebuild 39570 BLAKE2B 1fa197b229d5a83db413f64f82ae7b6ff8ce762dd1884cba97a22940568857484c2313a24d47be69a2694eb14f39b892136e4928f08762e6df5af254beec9378 SHA512 5c885f3ee28be9cd7e7a83f884a76e605f22d076b98ece3e6e263914882c217eb32d430c4130403c2be129c6bc3319ee53eeca237eb4002db4e37e936888fec8 +EBUILD chromium-125.0.6382.3.ebuild 39620 BLAKE2B 2ab469e2b1ca90ec9cb5ac1f0a1f56edef5db38a9bf4ea92a5070bf0ed0195c50f15bf4d606d1ab9c995161f245286bb888bf56978afe8981202eef0e180f9e7 SHA512 9632c3b004a5be424d41567045347d807f792b69dd36f03b09fee0f7c99a974e2b1b2dc19fc1b14d57321c58c5a37e43aec905f5b4626ef7102052e86a4f80b1 diff --git a/www-client/chromium/chromium-125.0.6382.3.ebuild b/www-client/chromium/chromium-125.0.6382.3.ebuild index 88e79e6..c7b0f8d 100644 --- a/www-client/chromium/chromium-125.0.6382.3.ebuild +++ b/www-client/chromium/chromium-125.0.6382.3.ebuild @@ -325,6 +325,7 @@ src_prepare() { "${FILESDIR}/chromium-118-material-color-utils.patch" "${FILESDIR}/chromium-118-freetype-blink.patch" "${FILESDIR}/chromium-124-metrics-histograms-nodepotbin.patch" + "${FILESDIR}/chromium-125-revert-8a3bec6.patch" "${FILESDIR}/chromium-111-InkDropHost-crash.patch" "${FILESDIR}/chromium-123-EnumTable-crash.patch" diff --git a/www-client/chromium/files/chromium-125-revert-8a3bec6.patch b/www-client/chromium/files/chromium-125-revert-8a3bec6.patch new file mode 100644 index 0000000..0f19d49 --- /dev/null +++ b/www-client/chromium/files/chromium-125-revert-8a3bec6.patch @@ -0,0 +1,450 @@ +diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn +index 2c079c06c5..34a844659b 100644 +--- a/third_party/blink/renderer/platform/BUILD.gn ++++ b/third_party/blink/renderer/platform/BUILD.gn +@@ -118,10 +118,7 @@ blink_python_runner("color_data") { + + compiled_action("character_data") { + tool = ":character_data_generator" +- outputs = [ +- "$blink_platform_output_dir/character_property_data.cc", +- "$blink_platform_output_dir/text/break_iterator_data_inline_header.h", +- ] ++ outputs = [ "$blink_platform_output_dir/character_property_data.cc" ] + args = rebase_path(outputs, root_build_dir) + } + +diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +index 28d34020f7..45942f4e89 100644 +--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 ++++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +@@ -509,11 +509,6 @@ + public: true, + status: "experimental", + }, +- { +- // crbug.com/41485013 +- name: "BreakIteratorDataGenerator", +- status: "stable", +- }, + { + name: "BrowserVerifiedUserActivationKeyboard", + base_feature: "none", +diff --git a/third_party/blink/renderer/platform/text/character_property_data_generator.cc b/third_party/blink/renderer/platform/text/character_property_data_generator.cc +index 70101dbf76..27e6852647 100644 +--- a/third_party/blink/renderer/platform/text/character_property_data_generator.cc ++++ b/third_party/blink/renderer/platform/text/character_property_data_generator.cc +@@ -5,19 +5,13 @@ + #include "third_party/blink/renderer/platform/text/character_property_data.h" + + #include +-#include +-#include + #include +-#include +-#include + #include + #include + #include + + #include + #include +-#include +-#include + #include + #include + +@@ -31,36 +25,6 @@ + namespace blink { + namespace { + +-#define CHECK_U_ERROR(error, name) \ +- CHECK(U_SUCCESS(error)) << name << ": (" << error << ")" << u_errorName(error) +- +-// +-// Load the ICU data file and set it to the ICU. +-// +-void InitializeIcu(const char* exec_path) { +- // ICU can't load the data file by itself because ICU tries to load the +- // versioned data file (e.g., "icudt73l.dat"), while the Chromium build system +- // creates the unversioned data file (e.g., "icudtl.dat"). +- std::filesystem::path path{exec_path}; +- path = path.parent_path() / "icudt" U_ICUDATA_TYPE_LETTER ".dat"; +- +- std::ifstream data_ifstream(path, std::ios_base::binary); +- CHECK(data_ifstream.is_open()); +- static std::vector icu_data; +- CHECK(icu_data.empty()); +- std::copy(std::istreambuf_iterator(data_ifstream), +- std::istreambuf_iterator(), std::back_inserter(icu_data)); +- UErrorCode error = U_ZERO_ERROR; +- udata_setCommonData(icu_data.data(), &error); +- CHECK_U_ERROR(error, "udata_setCommonData"); +- +- // Check ICU functions that need the data resources are working. +- // https://unicode-org.github.io/icu/userguide/icu/design.html#icu4c-initialization-and-termination +- UVersionInfo version; +- ulocdata_getCLDRVersion(version, &error); +- CHECK_U_ERROR(error, "ulocdata_getCLDRVersion"); +-} +- + class CharacterPropertyValues { + public: + constexpr static UChar32 kMaxCodepoint = 0x10FFFF; +@@ -255,201 +219,18 @@ static void GenerateCharacterPropertyData(FILE* fp) { + GenerateUTrieSerialized(fp, serialized_size, serialized); + } + +-// +-// Generate a line break pair table in `break_iterator_data_inline_header.h`. +-// +-// See [UAX14](https://unicode.org/reports/tr14/). +-// +-class LineBreakData { +- public: +- LineBreakData() = default; +- +- static void Generate(FILE* fp) { +- LineBreakData data; +- data.FillFromIcu(); +- data.FillAscii(); +- data.Print(fp); +- } +- +- private: +- // Fill the pair table from the ICU BreakIterator. +- void FillFromIcu() { +- UErrorCode status = U_ZERO_ERROR; +- const icu::Locale locale("en"); +- icu::BreakIterator* break_iterator = +- icu::BreakIterator::createLineInstance(locale, status); +- CHECK_U_ERROR(status, "createLineInstance"); +- +- for (UChar ch = kMinChar; ch <= kMaxChar; ++ch) { +- const icu::UnicodeString ch_str(ch); +- for (UChar ch_next = kMinChar; ch_next <= kMaxChar; ++ch_next) { +- const icu::UnicodeString ch_next_str(ch_next); +- const icu::UnicodeString str = ch_str + ch_next_str; +- break_iterator->setText(str); +- SetPairValue(ch, ch_next, break_iterator->isBoundary(1)); +- } +- } +- } +- +- // Line breaking table for printable ASCII characters. Line breaking +- // opportunities in this table are as below: +- // - before opening punctuations such as '(', '<', '[', '{' after certain +- // characters (compatible with Firefox 3.6); +- // - after '-' and '?' (backward-compatible, and compatible with Internet +- // Explorer). +- // Please refer to for line +- // breaking matrixes of different browsers and the ICU standard. +- void FillAscii() { +-#define ALL_CHAR '!', 0x7F +- SetPairValue(ALL_CHAR, ALL_CHAR, false); +- SetPairValue(ALL_CHAR, '(', '(', true); +- SetPairValue(ALL_CHAR, '<', '<', true); +- SetPairValue(ALL_CHAR, '[', '[', true); +- SetPairValue(ALL_CHAR, '{', '{', true); +- SetPairValue('-', '-', ALL_CHAR, true); +- SetPairValue('?', '?', ALL_CHAR, true); +- SetPairValue('-', '-', '$', '$', false); +- SetPairValue(ALL_CHAR, '!', '!', false); +- SetPairValue('?', '?', '"', '"', false); +- SetPairValue('?', '?', '\'', '\'', false); +- SetPairValue(ALL_CHAR, ')', ')', false); +- SetPairValue(ALL_CHAR, ',', ',', false); +- SetPairValue(ALL_CHAR, '.', '.', false); +- SetPairValue(ALL_CHAR, '/', '/', false); +- // Note: Between '-' and '[0-9]' is hard-coded in `ShouldBreakFast()`. +- SetPairValue('-', '-', '0', '9', false); +- SetPairValue(ALL_CHAR, ':', ':', false); +- SetPairValue(ALL_CHAR, ';', ';', false); +- SetPairValue(ALL_CHAR, '?', '?', false); +- SetPairValue(ALL_CHAR, ']', ']', false); +- SetPairValue(ALL_CHAR, '}', '}', false); +- SetPairValue('$', '$', ALL_CHAR, false); +- SetPairValue('\'', '\'', ALL_CHAR, false); +- SetPairValue('(', '(', ALL_CHAR, false); +- SetPairValue('/', '/', ALL_CHAR, false); +- SetPairValue('0', '9', ALL_CHAR, false); +- SetPairValue('<', '<', ALL_CHAR, false); +- SetPairValue('@', '@', ALL_CHAR, false); +- SetPairValue('A', 'Z', ALL_CHAR, false); +- SetPairValue('[', '[', ALL_CHAR, false); +- SetPairValue('^', '`', ALL_CHAR, false); +- SetPairValue('a', 'z', ALL_CHAR, false); +- SetPairValue('{', '{', ALL_CHAR, false); +- SetPairValue(0x7F, 0x7F, ALL_CHAR, false); +-#undef ALL_CHAR +- } +- +- // Print the C++ source code. +- void Print(FILE* fp) { +- // Print file headers. +- fprintf(fp, +- "#include \n" +- "#include " +- "\"third_party/blink/renderer/platform/wtf/text/wtf_uchar.h\"\n" +- "\nnamespace {\n\n"); +- +- fprintf(fp, "constexpr UChar kFastLineBreakMinChar = 0x%02X;\n", kMinChar); +- fprintf(fp, "constexpr UChar kFastLineBreakMaxChar = 0x%02X;\n", kMaxChar); +- +- // Define macros. +- fprintf(fp, +- "\n#define B(a, b, c, d, e, f, g, h)" +- " ((a) | ((b) << 1) | ((c) << 2) | ((d) << 3) |" +- " ((e) << 4) | ((f) << 5) | ((g) << 6) | ((h) << 7))\n\n"); +- +- fprintf(fp, "const uint8_t kFastLineBreakTable[%d][%d] = {\n", kNumChars, +- kNumCharsRoundUp8 / 8); +- +- // Print the column comment. +- fprintf(fp, " /*"); +- for (UChar ch = kMinChar; ch <= kMaxChar; ++ch) { +- if (ch != kMinChar && (ch - kMinChar) % 8 == 0) { +- fprintf(fp, " "); +- } +- fprintf(fp, ch < 0x7F ? " %c" : "%02X", ch); +- } +- fprintf(fp, " */\n"); +- +- // Print the data array. +- for (int y = 0; y < kNumChars; ++y) { +- const UChar ch = y + kMinChar; +- fprintf(fp, "/* %02X %c */ {B(", ch, ch < 0x7F ? ch : ' '); +- const char* prefix = ""; +- for (int x = 0; x < kNumCharsRoundUp8; ++x) { +- fprintf(fp, "%s%d", prefix, pair_[y][x]); +- prefix = (x % 8 == 7) ? "),B(" : ","; +- } +- fprintf(fp, ")},\n"); +- } +- fprintf(fp, +- "};\n\n" +- "#undef B\n\n" +- "template \n" +- "inline uint8_t GetFastLineBreak(T ch1, T ch2) {\n" +- " const T i2 = ch2 - kFastLineBreakMinChar;\n" +- " return kFastLineBreakTable[ch1 - kFastLineBreakMinChar]" +- "[i2 / 8] & (1 << (i2 %% 8));\n" +- "}\n\n" +- "} // namespace\n"); +- } +- +- void SetPairValue(UChar ch1_min, +- UChar ch1_max, +- UChar ch2_min, +- UChar ch2_max, +- bool value) { +- for (UChar ch1 = ch1_min; ch1 <= ch1_max; ++ch1) { +- for (UChar ch2 = ch2_min; ch2 <= ch2_max; ++ch2) { +- SetPairValue(ch1, ch2, value); +- } +- } +- } +- +- // Set the breakability between `ch1` and `ch2`. +- void SetPairValue(UChar ch1, UChar ch2, bool value) { +- CHECK_GE(ch1, kMinChar); +- CHECK_LE(ch1, kMaxChar); +- CHECK_GE(ch2, kMinChar); +- CHECK_LE(ch2, kMaxChar); +- pair_[ch1 - kMinChar][ch2 - kMinChar] = value; +- } +- +- constexpr static UChar kMinChar = '!'; +- constexpr static UChar kMaxChar = 0xFF; +- constexpr static int kNumChars = kMaxChar - kMinChar + 1; +- constexpr static int kNumCharsRoundUp8 = (kNumChars + 7) / 8 * 8; +- bool pair_[kNumChars][kNumCharsRoundUp8]{}; +-}; +- +-void InvokeGenerator(int index, +- int argc, +- char** argv, +- void (*generator)(FILE*)) { +- if (index >= argc) { +- return; +- } +- const char* path = argv[index]; +- if (!*path) { +- return; +- } +- +- if (strcmp(path, "-") == 0) { +- (*generator)(stdout); +- return; +- } +- +- FILE* fp = fopen(path, "wb"); +- (*generator)(fp); +- fclose(fp); +-} +- + } // namespace + } // namespace blink + + int main(int argc, char** argv) { +- blink::InitializeIcu(argv[0]); +- blink::InvokeGenerator(1, argc, argv, blink::GenerateCharacterPropertyData); +- blink::InvokeGenerator(2, argc, argv, blink::LineBreakData::Generate); ++ // Write the serialized array to the source file. ++ if (argc <= 1) { ++ blink::GenerateCharacterPropertyData(stdout); ++ } else { ++ FILE* fp = fopen(argv[1], "wb"); ++ blink::GenerateCharacterPropertyData(fp); ++ fclose(fp); ++ } + + return 0; + } +diff --git a/third_party/blink/renderer/platform/text/text_break_iterator.cc b/third_party/blink/renderer/platform/text/text_break_iterator.cc +index 650eb760b2..14de47d9fe 100644 +--- a/third_party/blink/renderer/platform/text/text_break_iterator.cc ++++ b/third_party/blink/renderer/platform/text/text_break_iterator.cc +@@ -26,8 +26,6 @@ + #include + #include + +-#include "third_party/blink/renderer/platform/runtime_enabled_features.h" +-#include "third_party/blink/renderer/platform/text/break_iterator_data_inline_header.h" + #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" + #include "third_party/blink/renderer/platform/wtf/text/ascii_ctype.h" + #include "third_party/blink/renderer/platform/wtf/text/character_names.h" +@@ -113,9 +111,6 @@ static const UChar kAsciiLineBreakTableLastChar = 127; + + #define F 0xFF + +-// Check if the generated table match the `kAsciiLineBreakTable` table. +-#define CHECK_ASCII_LINE_BRAEK_TABLE 0 +- + // Line breaking table for printable ASCII characters. Line breaking + // opportunities in this table are as below: + // - before opening punctuations such as '(', '<', '[', '{' after certain +@@ -166,24 +161,6 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar + }; + // clang-format on + +-#if CHECK_ASCII_LINE_BRAEK_TABLE +-void CheckAsciiLineBreakTable() { +- for (UChar ch2 = kAsciiLineBreakTableFirstChar; +- ch2 <= kAsciiLineBreakTableLastChar; ++ch2) { +- for (UChar ch1 = kAsciiLineBreakTableFirstChar; +- ch1 <= kAsciiLineBreakTableLastChar; ++ch1) { +- const UChar i2 = ch2 - kAsciiLineBreakTableFirstChar; +- const bool ascii = +- kAsciiLineBreakTable[ch1 - kAsciiLineBreakTableFirstChar][i2 / 8] & +- (1 << (i2 % 8)); +- const bool fast = GetFastLineBreak(ch1, ch2); +- CHECK_EQ(ascii, fast) +- << String::Format("%02X/%02X (%c/%c)", ch1, ch2, ch1, ch2); +- } +- } +-} +-#endif // CHECK_ASCII_LINE_BRAEK_TABLE +- + #define BA_LB_COUNT U_LB_COUNT + // Line breaking table for CSS word-break: break-all. This table differs from + // asciiLineBreakTable in: +@@ -298,13 +275,7 @@ static inline bool ShouldKeepAfterKeepAll(UChar last_ch, + } + + inline bool NeedsLineBreakIterator(UChar ch) { +- if (UNLIKELY(!RuntimeEnabledFeatures::BreakIteratorDataGeneratorEnabled())) { +- return ch > kAsciiLineBreakTableLastChar && ch != kNoBreakSpaceCharacter; +- } +- static_assert(kFastLineBreakMaxChar >= kAsciiLineBreakTableLastChar); +- static_assert(kNoBreakSpaceCharacter <= kFastLineBreakMaxChar, +- "Include NBSP for the performance."); +- return ch > kFastLineBreakMaxChar; ++ return ch > kAsciiLineBreakTableLastChar && ch != kNoBreakSpaceCharacter; + } + + template +@@ -349,61 +320,31 @@ struct LazyLineBreakIterator::Context { + last = current; + } + +- bool ShouldBreakFast(bool disable_soft_hyphen) const { +-#if CHECK_ASCII_LINE_BRAEK_TABLE +- DEFINE_STATIC_LOCAL(bool, is_check_done, (false)); +- if (!is_check_done) { +- is_check_done = true; +- CheckAsciiLineBreakTable(); +- LOG(INFO) << "CheckAsciiLineBreakTable() completed."; +- } +-#endif // CHECK_ASCII_LINE_BRAEK_TABLE +- ++ bool ShouldBreakFast() const { + const UChar last_ch = last.ch; + const UChar ch = current.ch; +- static_assert(kFastLineBreakMinChar == kAsciiLineBreakTableFirstChar); +- if (UNLIKELY(last_ch < kFastLineBreakMinChar || +- ch < kFastLineBreakMinChar)) { ++ if (UNLIKELY(last_ch < kAsciiLineBreakTableFirstChar || ++ ch < kAsciiLineBreakTableFirstChar)) { + return false; + } + + // Don't allow line breaking between '-' and a digit if the '-' may mean a + // minus sign in the context, while allow breaking in 'ABCD-1234' and + // '1234-5678' which may be in long URLs. +- static_assert('-' >= kFastLineBreakMinChar); ++ static_assert('-' >= kAsciiLineBreakTableFirstChar); + if (last_ch == '-' && IsASCIIDigit(ch)) { + return IsASCIIAlphanumeric(last_last_ch); + } + +- if (UNLIKELY( +- !RuntimeEnabledFeatures::BreakIteratorDataGeneratorEnabled())) { +- // If both `last_ch` and `ch` are ASCII characters, use a lookup table for +- // enhanced speed and for compatibility with other browsers (see comments +- // for asciiLineBreakTable for details). +- if (last_ch <= kAsciiLineBreakTableLastChar && +- ch <= kAsciiLineBreakTableLastChar) { +- const unsigned char* table_row = +- kAsciiLineBreakTable[last_ch - kAsciiLineBreakTableFirstChar]; +- int ch_index = ch - kAsciiLineBreakTableFirstChar; +- return table_row[ch_index / 8] & (1 << (ch_index % 8)); +- } +- +- // Otherwise defer to the Unicode algorithm by returning false. +- return false; +- } +- +- // If both characters are in the fast line break table, use it for enhanced +- // speed. For ASCII characters, it is also for compatibility. The table is +- // generated at the build time, see the `LineBreakData` class. +- if (last_ch <= kFastLineBreakMaxChar && ch <= kFastLineBreakMaxChar) { +- if (!GetFastLineBreak(last_ch, ch)) { +- return false; +- } +- static_assert(kSoftHyphenCharacter <= kFastLineBreakMaxChar); +- if (UNLIKELY(disable_soft_hyphen && last_ch == kSoftHyphenCharacter)) { +- return false; +- } +- return true; ++ // If both `last_ch` and `ch` are ASCII characters, use a lookup table for ++ // enhanced speed and for compatibility with other browsers (see comments ++ // for asciiLineBreakTable for details). ++ if (last_ch <= kAsciiLineBreakTableLastChar && ++ ch <= kAsciiLineBreakTableLastChar) { ++ const unsigned char* table_row = ++ kAsciiLineBreakTable[last_ch - kAsciiLineBreakTableFirstChar]; ++ int ch_index = ch - kAsciiLineBreakTableFirstChar; ++ return table_row[ch_index / 8] & (1 << (ch_index % 8)); + } + + // Otherwise defer to the Unicode algorithm by returning false. +@@ -452,7 +393,7 @@ inline int LazyLineBreakIterator::NextBreakablePosition( + break; + } + +- if (context.ShouldBreakFast(disable_soft_hyphen_)) { ++ if (context.ShouldBreakFast()) { + return i; + } + -- cgit v1.2.3