-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teach TextBreakIterator about strict and loose line breaking behaviors #14162
Teach TextBreakIterator about strict and loose line breaking behaviors #14162
Conversation
EWS run on previous version of this PR (hash dcbcad6) |
dcbcad6
to
e8e59a6
Compare
966b452
to
78a497a
Compare
EWS run on previous version of this PR (hash 78a497a)
|
EWS run on previous version of this PR (hash 966b452)
|
78a497a
to
006a077
Compare
EWS run on previous version of this PR (hash 006a077)
|
006a077
to
c13879d
Compare
EWS run on previous version of this PR (hash c13879d)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message:
LazyLineBreakIterator only work with ICU, and only can do line breaking.
s/only work/only works/
s/only can do/can only do/
c13879d
to
1d81799
Compare
EWS run on current version of this PR (hash 1d81799)
|
https://bugs.webkit.org/show_bug.cgi?id=257108 rdar://109634206 Reviewed by Cameron McCormack. This is the first part of our line breaker refactoring. We currently have 2 totally separate classes, both of which can perform line breaking: TextBreakIterator and LazyLineBreakIterator. TextBreakIterator has multiple backends - it can be backed by either ICU or Core Foundation. It also supports all kinds of text segmentation: caret positions, grapheme cluster segmentation, etc. LazyLineBreakIterator only works with ICU, and can only do line breaking. However, it supports loose and strict line breaking modes, and supports a "prior context." It's kind of a shame that we have 2 classes which both do similar things, so I'm going to try to unify them into a single class which can do everything. I'd like to improve TextBreakIterator to be able to do everything that LazyLineBreakIterator can do, and then delete LazyLineBreakIterator, because I think that's going to be the most straightforward way of doing it. This patch teaches TextBreakIterator about the different line breaking behaviors, by turning the "mode" enum into a variant, and giving the Line struct a behavior enum. * Source/WTF/wtf/text/TextBreakIterator.cpp: (WTF::mapModeToBackingIterator): * Source/WTF/wtf/text/TextBreakIterator.h: (WTF::TextBreakIterator::LineMode::operator== const): (WTF::TextBreakIterator::CaretMode::operator== const): (WTF::TextBreakIterator::DeleteMode::operator== const): (WTF::TextBreakIterator::CharacterMode::operator== const): (WTF::LazyLineBreakIterator::get): (WTF::TextBreakIteratorCache::TextBreakIteratorCache): Deleted. * Source/WTF/wtf/text/WTFString.h: (WTF::StringLiterals::operator _str): * Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: (WTF::mapModeToBackingIterator): * Source/WTF/wtf/text/icu/TextBreakIteratorICU.h: (WTF::TextBreakIteratorICU::TextBreakIteratorICU): (WTF::TextBreakIteratorICU::makeLocaleWithBreakKeyword): * Source/WebCore/platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::offsetForPosition): (WebCore::ComplexTextController::collectComplexTextRuns): * Source/WebCore/platform/graphics/ComposedCharacterClusterTextIterator.h: (WebCore::ComposedCharacterClusterTextIterator::ComposedCharacterClusterTextIterator): * Source/WebCore/rendering/RenderText.cpp: (WebCore::RenderText::previousOffset const): (WebCore::RenderText::previousOffsetForBackwardDeletion const): (WebCore::RenderText::nextOffset const): * Tools/TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/264376@main
1d81799
to
99eac46
Compare
Committed 264376@main (99eac46): https://commits.webkit.org/264376@main Reviewed commits have been landed. Closing PR #14162 and removing active labels. |
99eac46
1d81799
π wincairoπ§ͺ wpe-wk2π§ͺ api-macπ§ͺ mac-wk1π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk2π§ͺ mac-AS-debug-wk2