Add a new LineBreak::Next() that treat text end a line break opportunity
Categories
(Core :: Internationalization, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(2 files)
I notice LineBreaker::Next()
doesn't treat text end a line break opportunity. To make the integration of ICU4X line segmenter easier, we should audit the existing users of this API.
Assignee | ||
Comment 1•3 years ago
|
||
After Bug 1728708 Part 4 [1], WordBreaker always breaks at the end of
text. Therefore, we don't need to manually record the end of text as a
word break opportunity when we see NS_WORDBREAKER_NEED_MORE_TEXT.
Assignee | ||
Comment 2•3 years ago
|
||
The motivation of this patch is similar to Bug 1728708 Part 4, which
should make the future integration of ICU4X line segmenter easier. A
UAX14 compatible line breaker always breaks at the end of text
(rule LB3 [1]), and ICU4X line segmenter has this behavior, too.
Current LineBreaker::Next() doesn't treat the end of text as a line
break opportunity, so this patch deprecates it by renaming it, and add a
new Next() method.
TestASCIILB() has adopted the new Next(). All the other callers of the
DeprecatedNext() should be audited later, possibly with the removal of
Prev() because the all the usages are very close.
[1] https://www.unicode.org/reports/tr14/#LB3
Depends on D127378
Updated•3 years ago
|
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/8f0754b30e5f Part 1 - Modernize TestASCIILB and TestASCIIWB. r=m_kato https://hg.mozilla.org/integration/autoland/rev/d84f81974d8a Part 2 - Add a new LineBreaker::Next(), and deprecate the old Next(). r=m_kato
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8f0754b30e5f
https://hg.mozilla.org/mozilla-central/rev/d84f81974d8a
Description
•