Count characters more correctly when applying the CSS hyphenate-limit-chars length thresholds
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox136 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
Re-reading the code that implements hyphenate-limit-chars
while fixing bug 1945227, I noticed an error in how "characters" are counted for the purpose of evaluating the word-length limits. The spec requires non-spacing marks and word-internal punctuation to be ignored, which we mostly do -- but at the end of the word, we unconditionally include the last character in the count without checking its category.
This leads to incorrect application of the word-length limit in cases like the Hindi word "मामले" in our auto-hyphenation-hi-1.html testcase, which should count as 4 characters long (म-ा-म-ले), and therefore with the default hyphenate-limit-chars
setting that requires a word to be 5 characters long, no hyphenation should be applied. But we incorrectly count the last character, which is the vowel matra े (which combines with the consonant ल) as a separate unit, and so we improperly allow hyphenation.
A couple of the other Indic scripts have similar examples where we should be blocking hyphenation, but the code currently miscounts length.
Assignee | ||
Comment 1•22 days ago
|
||
In particular, this avoids counting a combining mark at the end of the word
as if it were a separate character.
Updated•22 days ago
|
Comment 3•21 days ago
|
||
bugherder |
Description
•