Bug 1719545 - Part 4: Fallback to script extension even it only has one extension or its own script code. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D131514
This commit is contained in:
Yoshi Cheng-Hao Huang 2021-11-19 13:20:23 +00:00
Родитель e699e26a37
Коммит 1403537031
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -206,8 +206,11 @@ bool gfxScriptItemizer::Next(uint32_t& aRunStart, uint32_t& aRunLimit,
// store for use in the event the run remains unresolved.
mozilla::intl::ScriptExtensionVector extensions;
auto extResult = mozilla::intl::Script::GetExtensions(ch, extensions);
if (extResult.isOk() && extensions.length() > 1) {
fallbackScript = Script(extensions[0]);
if (extResult.isOk()) {
Script ext = Script(extensions[0]);
if (!CanMergeWithContext(ext)) {
fallbackScript = ext;
}
}
}
}