Backed out changeset 5ae8ad2a0901 (bug 1722763) for causing wpt failures in /css/selectors/first-letter-flag-001. CLOSED TREE

This commit is contained in:
Sandor Molnar
2021-07-31 01:47:09 +03:00
parent a9244ab8af
commit c1a16b0ea1
5 changed files with 20 additions and 36 deletions

View File

@@ -8230,8 +8230,7 @@ static bool FindFirstLetterRange(const nsTextFragment* aFrag,
// If the next character is not a letter, number or symbol, there is no
// first-letter.
// Return true so that we don't go on looking, but set aLength to 0.
uint32_t usv = aFrag->ScalarValueAt(aOffset + i);
if (!nsContentUtils::IsAlphanumericOrSymbol(usv)) {
if (!nsContentUtils::IsAlphanumericOrSymbolAt(aFrag, aOffset + i)) {
*aLength = 0;
return true;
}
@@ -8244,17 +8243,12 @@ static bool FindFirstLetterRange(const nsTextFragment* aFrag,
bool allowSplitLigature;
typedef unicode::Script Script;
Script script = unicode::GetScriptCode(usv);
Script script = unicode::GetScriptCode(aFrag->CharAt(aOffset + i));
switch (script) {
default:
allowSplitLigature = true;
break;
// Don't break regional-indicator ligatures.
case Script::COMMON:
allowSplitLigature = !gfxFontUtils::IsRegionalIndicator(usv);
break;
// For now, lacking any definitive specification of when to apply this
// behavior, we'll base the decision on the HarfBuzz shaping engine
// used for each script: those that are handled by the Indic, Tibetan,