Bug 1647377 - Provide basic line-breaking support for Tibetan on Android by treating TSHEG like a hyphen. r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D81441
This commit is contained in:
Jonathan Kew 2020-06-30 07:27:00 +00:00
Родитель 41e33a4418
Коммит 66966abc6b
7 изменённых файлов: 71 добавлений и 25 удалений

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

@ -367,10 +367,18 @@ static inline bool IS_NONBREAKABLE_SPACE(char16_t u) {
}
static inline bool IS_HYPHEN(char16_t u) {
return (u == U_HYPHEN || u == 0x058A || // ARMENIAN HYPHEN
u == 0x2010 || // HYPHEN
return (u == U_HYPHEN || u == 0x2010 || // HYPHEN
u == 0x2012 || // FIGURE DASH
u == 0x2013); // EN DASH
u == 0x2013 || // EN DASH
#if ANDROID
/* Bug 1647377: On Android, we don't have a "platform" backend
* that supports Tibetan (nsRuleBreaker.cpp only knows about
* Thai), so instead we just treat the TSHEG like a hyphen to
* provide basic line-breaking possibilities.
*/
u == 0x0F0B || // TIBETAN MARK INTERSYLLABIC TSHEG
#endif
u == 0x058A); // ARMENIAN HYPHEN
}
static int8_t GetClass(uint32_t u, LineBreaker::Strictness aLevel,
@ -618,8 +626,10 @@ static int8_t GetClass(uint32_t u, LineBreaker::Strictness aLevel,
return GETCLASSFROMTABLE(gLBClass00, uint16_t(U_HYPHEN));
}
} else if (0x0F00 == h) {
if (0x08 == l || 0x0C == l || 0x12 == l) {
return CLASS_NON_BREAKABLE;
// Tibetan chars with class = BA
if (0x34 == l || 0x7f == l || 0x85 == l || 0xbe == l || 0xbf == l ||
0xd2 == l) {
return CLASS_BREAKABLE;
}
} else if (0x1800 == h) {
if (0x0E == l) {

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

@ -72,8 +72,14 @@ static inline bool NS_IsSpace(char16_t u) {
}
static inline bool NS_NeedsPlatformNativeHandling(char16_t aChar) {
return (0x0e01 <= aChar && aChar <= 0x0fff) || // Thai, Lao, Tibetan
(0x1780 <= aChar && aChar <= 0x17ff); // Khmer
return
#if ANDROID // Bug 1647377: no "platform native" support for Tibetan;
// better to just use our class-based breaker.
(0x0e01 <= aChar && aChar <= 0x0eff) || // Thai, Lao
#else
(0x0e01 <= aChar && aChar <= 0x0fff) || // Thai, Lao, Tibetan
#endif
(0x1780 <= aChar && aChar <= 0x17ff); // Khmer
}
} // namespace intl

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

@ -1,13 +1,20 @@
[css3-text-line-break-baspglwj-082.html]
[white-space:pre-wrap]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:pre-line]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:normal]
expected: FAIL
expected:
if os == "android": PASS
FAIL

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

@ -1,13 +1,21 @@
[css3-text-line-break-baspglwj-126.html]
[white-space:pre-wrap]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:pre-line]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:normal]
expected: FAIL
expected:
if os == "android": PASS
FAIL

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

@ -1,13 +1,21 @@
[css3-text-line-break-baspglwj-127.html]
[white-space:pre-wrap]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:pre-line]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:normal]
expected: FAIL
expected:
if os == "android": PASS
FAIL

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

@ -1,13 +1,21 @@
[css3-text-line-break-baspglwj-128.html]
[white-space:pre-wrap]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:pre-line]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected: FAIL
expected:
if os == "android": PASS
FAIL
[white-space:normal]
expected: FAIL
expected:
if os == "android": PASS
FAIL

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

@ -2,4 +2,3 @@
expected:
if (os == "win") and (processor == "x86_64"): FAIL
if (os == "win") and (processor == "aarch64"): FAIL
if os == "android": FAIL