[webkit-changes] [WebKit/WebKit] b42c0d: Hook "prior context" infrastructure up to TextBrea...

Myles C. Maxfield noreply at github.com
Wed May 31 01:37:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b42c0d74cd2e6aa99232eeb0f0267c4a3e660d04
      https://github.com/WebKit/WebKit/commit/b42c0d74cd2e6aa99232eeb0f0267c4a3e660d04
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M Source/WTF/wtf/text/NullTextBreakIterator.h
    M Source/WTF/wtf/text/TextBreakIterator.cpp
    M Source/WTF/wtf/text/TextBreakIterator.h
    M Source/WTF/wtf/text/cf/TextBreakIteratorCF.h
    M Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp
    M Source/WTF/wtf/text/icu/TextBreakIteratorICU.h
    M Source/WTF/wtf/text/icu/UTextProviderLatin1.h
    M Source/WTF/wtf/text/icu/UTextProviderUTF16.h
    M Tools/TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp

  Log Message:
  -----------
  Hook "prior context" infrastructure up to TextBreakIteratorICU
https://bugs.webkit.org/show_bug.cgi?id=257469
rdar://109989795

Reviewed by Alan Baradlay.

This patch is the next step toward replacing LazyLineBreakIterator with TextBreakIterator.
This "prior context" infrastructure is the last feature that LazyLineBreakIterator supports
that TextBreakIterator doesn't. Because LazyLineBreakIterator already uses ICU, hooking up
support to TextBreakIteratorICU is quite straightforward.

Once this piece and https://bugs.webkit.org/show_bug.cgi?id=257467 are landed,
TextBreakIterator will support all the features as LazyLineBreakIterator. At that point, we
can compare performance to determine if we can make the switch over, and determine if we can
do line breaking using platform iterators instead of ICU.

* Source/WTF/wtf/text/NullTextBreakIterator.h:
(WTF::NullTextBreakIterator::setText):
* Source/WTF/wtf/text/TextBreakIterator.cpp:
(WTF::TextBreakIterator::mapModeToBackingIterator):
* Source/WTF/wtf/text/TextBreakIterator.h:
(WTF::TextBreakIterator::setText):
* Source/WTF/wtf/text/cf/TextBreakIteratorCF.h:
(WTF::TextBreakIteratorCF::setText):
* Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp:
(WTF::TextBreakIterator::mapModeToBackingIterator):
* Source/WTF/wtf/text/icu/TextBreakIteratorICU.h:
(WTF::TextBreakIteratorICU::TextBreakIteratorICU):
(WTF::TextBreakIteratorICU::~TextBreakIteratorICU):
(WTF::TextBreakIteratorICU::setText):
(WTF::TextBreakIteratorICU::preceding const):
(WTF::TextBreakIteratorICU::following const):
(WTF::TextBreakIteratorICU::isBoundary const):
(WTF::TextBreakIteratorICU::set8BitText): Deleted.
* Source/WTF/wtf/text/icu/UTextProviderLatin1.h:
* Source/WTF/wtf/text/icu/UTextProviderUTF16.h:
* Tools/TestWebKitAPI/Tests/WTF/TextBreakIterator.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/264722@main




More information about the webkit-changes mailing list