Get rid of LineBreaker::Prev()
Categories
(Core :: Internationalization, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox95 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(1 file)
Filed per Makoto's bug 1722484 comment 2.
Prev() is used by serializer (xml and text) and quote wrap. But I guess that we can avoid Prev() by rewriting serializer, Or we provide simple text character width wrap API.
So we should remove LineBreaker::Prev(), and rewrite the callers. If possible, provider a general API for text wrapping.
Comment 1•4 years ago
|
||
To minimize the disruption to callers, one possible approach here would be not to remove Prev() but instead to reimplement it in a form that doesn't depend on the underlying break-finding engine to support backward iteration.
A fairly simple strategy would be to do a naïve backwards scan for whitespace, and then use Next() to look forwards for any potential break within the range just scanned. In principle this would be slightly less performant than a backwards-iterator that directly finds breaks, but for our (very limited) use cases I don't think it would matter.
| Assignee | ||
Comment 2•4 years ago
|
||
Depends on D128558
Updated•4 years ago
|
Comment 4•4 years ago
|
||
| bugherder | ||
Description
•