tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d331a91055cf2363e2dde81ddd745d6795f6eb1f
parent 989057eec3a07ce68a15c2bf2eb1e137dd19d5f3
Author: Makoto Kato <m_kato@ga2.so-net.ne.jp>
Date:   Mon, 22 Dec 2025 05:47:40 +0000

Bug 2006552 - Part 1. Use ICU4C for IdentifierStatus. r=platform-i18n-reviewers,dminor

`UIdentifierStatus` is stable from ICU75. So it is better to use ICU4C's
API instead of generated Unicode property data.

Differential Revision: https://phabricator.services.mozilla.com/D276981

Diffstat:
Mintl/components/src/UnicodeProperties.h | 4++++
Mintl/unicharutil/util/nsUnicodeProperties.h | 7+++----
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/intl/components/src/UnicodeProperties.h b/intl/components/src/UnicodeProperties.h @@ -56,6 +56,7 @@ class UnicodeProperties final { BidiPairedBracketType, EastAsianWidth, HangulSyllableType, + IdentifierStatus, LineBreak, NumericType, VerticalOrientation, @@ -86,6 +87,9 @@ class UnicodeProperties final { case IntProperty::VerticalOrientation: prop = UCHAR_VERTICAL_ORIENTATION; break; + case IntProperty::IdentifierStatus: + prop = UCHAR_IDENTIFIER_STATUS; + break; } return u_getIntPropertyValue(aCh, prop); } diff --git a/intl/unicharutil/util/nsUnicodeProperties.h b/intl/unicharutil/util/nsUnicodeProperties.h @@ -44,9 +44,7 @@ enum PairedBracketType { PAIRED_BRACKET_TYPE_CLOSE = 2 }; -/* Flags for Unicode security IdentifierType.txt attributes. Only a subset - of these are currently checked by Gecko, so we only define flags for the - ones we need. */ +/* This values must match the values by UIdentifierStatus by ICU */ enum IdentifierType { IDTYPE_RESTRICTED = 0, IDTYPE_ALLOWED = 1, @@ -152,7 +150,8 @@ inline VerticalOrientation GetVerticalOrientation(uint32_t aCh) { } inline IdentifierType GetIdentifierType(uint32_t aCh) { - return IdentifierType(GetCharProps2(aCh).mIdType); + return IdentifierType(intl::UnicodeProperties::GetIntPropertyValue( + aCh, intl::UnicodeProperties::IntProperty::IdentifierStatus)); } uint32_t GetFullWidth(uint32_t aCh);