Closed Bug 1945341 Opened 22 days ago Closed 21 days ago

Count characters more correctly when applying the CSS hyphenate-limit-chars length thresholds

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

RESOLVED FIXED
136 Branch
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.

In particular, this avoids counting a combining mark at the end of the word
as if it were a separate character.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef9315641dfc Count characters more correctly for hyphenate-limit-chars thresholds. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: