mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 14:27:30 +09:00
Force punycode display for IDNs with a <dotless-i/j, combining mark above> sequence.
This commit is contained in:
parent
acf9f2c39c
commit
490fdb990a
1 changed files with 14 additions and 5 deletions
|
|
@ -797,6 +797,7 @@ bool nsIDNService::isLabelSafe(const nsAString &label)
|
||||||
|
|
||||||
Script lastScript = Script::INVALID;
|
Script lastScript = Script::INVALID;
|
||||||
uint32_t previousChar = 0;
|
uint32_t previousChar = 0;
|
||||||
|
uint32_t baseChar = 0; // last non-diacritic seen (base char for marks)
|
||||||
uint32_t savedNumberingSystem = 0;
|
uint32_t savedNumberingSystem = 0;
|
||||||
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
|
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
|
||||||
#if 0
|
#if 0
|
||||||
|
|
@ -846,11 +847,19 @@ bool nsIDNService::isLabelSafe(const nsAString &label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for consecutive non-spacing marks
|
if (GetGeneralCategory(ch) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) {
|
||||||
if (previousChar != 0 &&
|
// Check for consecutive non-spacing marks
|
||||||
previousChar == ch &&
|
if (previousChar != 0 && previousChar == ch) {
|
||||||
GetGeneralCategory(ch) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) {
|
return false;
|
||||||
return false;
|
}
|
||||||
|
// Check for diacritics on dotless-i or dotless-j, which would be
|
||||||
|
// indistinguishable from normal accented letter.
|
||||||
|
if ((baseChar == 0x0237 || baseChar == 0x0131) &&
|
||||||
|
((ch >= 0x0300 && ch <= 0x0314) || ch == 0x031a)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
baseChar = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
|
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue