Implement grapheme cluster iterator on StringView
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jul 2016 19:50:40 +0000 (19:50 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jul 2016 19:50:40 +0000 (19:50 +0000)
commitd90cdb8b93366d359feb92edb9c03e6658bde873
treedf5a447639ca15ce09e5b42c6bc4a8597ab4be83
parentb3310942778a7c45392528965360b3e9e089a18d
Implement grapheme cluster iterator on StringView
https://bugs.webkit.org/show_bug.cgi?id=159598

Reviewed by Anders Carlsson.

This is in preparation for honoring the second argument to FontFaceSet.load().

Source/WTF:

* wtf/text/StringView.cpp:
(WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator++):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator*):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator==):
(WTF::StringView::GraphemeClusters::Iterator::Impl::computeIndexEnd):
(WTF::StringView::GraphemeClusters::Iterator::Iterator):
(WTF::StringView::GraphemeClusters::Iterator::~Iterator):
(WTF::StringView::GraphemeClusters::Iterator::operator*):
(WTF::StringView::GraphemeClusters::Iterator::operator==):
(WTF::StringView::GraphemeClusters::Iterator::operator!=):
* wtf/text/StringView.h:
(WTF::StringView::GraphemeClusters::GraphemeClusters):
* text/TextBreakIterator.cpp:
(WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
* text/TextBreakIterator.h:

Tools:

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::compareLoopIterations):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringView.cpp
Source/WTF/wtf/text/StringView.h
Source/WTF/wtf/text/TextBreakIterator.cpp
Source/WTF/wtf/text/TextBreakIterator.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/StringView.cpp