зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1827604 - Special-case the apostrophe characters in text-transform:capitalize heuristics. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175248
This commit is contained in:
Родитель
b02bbc7d96
Коммит
9404d81ceb
|
@ -68,9 +68,7 @@ static void SetupCapitalization(const char16_t* aWord, uint32_t aLength,
|
|||
case GeneralCategory::Line_Separator:
|
||||
case GeneralCategory::Paragraph_Separator:
|
||||
case GeneralCategory::Dash_Punctuation:
|
||||
case GeneralCategory::Other_Punctuation:
|
||||
case GeneralCategory::Initial_Punctuation:
|
||||
case GeneralCategory::Final_Punctuation:
|
||||
/* These punctuation categories are excluded, for examples like
|
||||
* "what colo[u]r" -> "What Colo[u]r?" (rather than "What Colo[U]R?")
|
||||
* and
|
||||
|
@ -81,6 +79,19 @@ static void SetupCapitalization(const char16_t* aWord, uint32_t aLength,
|
|||
*/
|
||||
capitalizeNextChar = true;
|
||||
break;
|
||||
case GeneralCategory::Final_Punctuation:
|
||||
/* Special-case: exclude Unicode single-close-quote/apostrophe,
|
||||
for examples like "Lowe’s" etc. */
|
||||
if (ch != 0x2019) {
|
||||
capitalizeNextChar = true;
|
||||
}
|
||||
break;
|
||||
case GeneralCategory::Other_Punctuation:
|
||||
/* Special-case: exclude ASCII apostrophe, for "Lowe's" etc. */
|
||||
if (ch != '\'') {
|
||||
capitalizeNextChar = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7,3 +7,5 @@ Snake_case
|
|||
Kebab-Case
|
||||
Colo[u]r
|
||||
Pass/Fail
|
||||
Lowe's
|
||||
Black’s
|
||||
|
|
|
@ -7,3 +7,5 @@ snake_case
|
|||
kebab-case
|
||||
colo[u]r
|
||||
pass/fail
|
||||
lowe's
|
||||
black’s
|
||||
|
|
Загрузка…
Ссылка в новой задаче