<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203038] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203038">203038</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-07-10 10:15:05 -0700 (Sun, 10 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move breaking iterator code to WTF
https://bugs.webkit.org/show_bug.cgi?id=159594
Reviewed by Alex Christensen.
This is in preparation for giving StringView a GraphemeClusters iterator.
Such an interator needs to be implemented on top of our breaking iterator
code.
Source/WebCore:
No new tests because there is no behavior change.
* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* dom/CharacterData.cpp:
* editing/TextCheckingHelper.cpp:
* editing/TextIterator.cpp:
* editing/VisibleUnits.cpp:
* html/HTMLInputElement.cpp:
* html/HTMLTextAreaElement.cpp:
* html/InputType.cpp:
* html/TextFieldInputType.cpp:
* html/TextInputType.cpp:
* platform/LocalizedStrings.cpp:
* platform/graphics/StringTruncator.cpp:
* platform/graphics/cg/ColorCG.cpp:
(WTF::RetainPtr<CGColorRef>>::createValueForKey):
(WebCore::RetainPtr<CGColorRef>>::createValueForKey): Deleted.
* platform/graphics/mac/ComplexTextController.cpp:
* platform/text/LineBreakIteratorPoolICU.h:
(WebCore::LineBreakIteratorPool::LineBreakIteratorPool): Deleted.
(WebCore::LineBreakIteratorPool::sharedPool): Deleted.
(WebCore::LineBreakIteratorPool::makeLocaleWithBreakKeyword): Deleted.
(WebCore::LineBreakIteratorPool::take): Deleted.
(WebCore::LineBreakIteratorPool::put): Deleted.
* platform/text/TextBoundaries.cpp:
* platform/text/TextBreakIterator.cpp:
(WebCore::initializeIterator): Deleted.
(WebCore::initializeIteratorWithRules): Deleted.
(WebCore::setTextForIterator): Deleted.
(WebCore::setContextAwareTextForIterator): Deleted.
(WebCore::wordBreakIterator): Deleted.
(WebCore::sentenceBreakIterator): Deleted.
(WebCore::cursorMovementIterator): Deleted.
(WebCore::acquireLineBreakIterator): Deleted.
(WebCore::releaseLineBreakIterator): Deleted.
(WebCore::mapLineIteratorModeToRules): Deleted.
(WebCore::isCJKLocale): Deleted.
(WebCore::openLineBreakIterator): Deleted.
(WebCore::closeLineBreakIterator): Deleted.
(WebCore::compareAndSwapNonSharedCharacterBreakIterator): Deleted.
(WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator): Deleted.
(WebCore::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator): Deleted.
(WebCore::textBreakFirst): Deleted.
(WebCore::textBreakLast): Deleted.
(WebCore::textBreakNext): Deleted.
(WebCore::textBreakPrevious): Deleted.
(WebCore::textBreakPreceding): Deleted.
(WebCore::textBreakFollowing): Deleted.
(WebCore::textBreakCurrent): Deleted.
(WebCore::isTextBreak): Deleted.
(WebCore::isWordTextBreak): Deleted.
(WebCore::numGraphemeClusters): Deleted.
(WebCore::numCharactersInGraphemeClusters): Deleted.
* platform/text/TextBreakIterator.h:
(WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Deleted.
(WebCore::LazyLineBreakIterator::~LazyLineBreakIterator): Deleted.
(WebCore::LazyLineBreakIterator::string): Deleted.
(WebCore::LazyLineBreakIterator::isLooseCJKMode): Deleted.
(WebCore::LazyLineBreakIterator::lastCharacter): Deleted.
(WebCore::LazyLineBreakIterator::secondToLastCharacter): Deleted.
(WebCore::LazyLineBreakIterator::setPriorContext): Deleted.
(WebCore::LazyLineBreakIterator::updatePriorContext): Deleted.
(WebCore::LazyLineBreakIterator::resetPriorContext): Deleted.
(WebCore::LazyLineBreakIterator::priorContextLength): Deleted.
(WebCore::LazyLineBreakIterator::get): Deleted.
(WebCore::LazyLineBreakIterator::resetStringAndReleaseIterator): Deleted.
(WebCore::NonSharedCharacterBreakIterator::operator TextBreakIterator*): Deleted.
* platform/text/cf/HyphenationCF.cpp:
* platform/text/efl/TextBreakIteratorInternalICUEfl.cpp:
(WebCore::currentSearchLocaleID): Deleted.
(WebCore::currentTextBreakLocaleID): Deleted.
* platform/text/enchant/TextCheckerEnchant.cpp:
* platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp:
(WebCore::currentSearchLocaleID): Deleted.
(WebCore::currentTextBreakLocaleID): Deleted.
* platform/text/icu/UTextProvider.cpp:
(WebCore::fixPointer): Deleted.
(WebCore::uTextCloneImpl): Deleted.
* platform/text/icu/UTextProvider.h:
(WebCore::uTextProviderContext): Deleted.
(WebCore::initializeContextAwareUTextProvider): Deleted.
(WebCore::uTextAccessPinIndex): Deleted.
(WebCore::uTextAccessInChunkOrOutOfRange): Deleted.
* platform/text/icu/UTextProviderLatin1.cpp:
(WebCore::uTextLatin1Clone): Deleted.
(WebCore::uTextLatin1NativeLength): Deleted.
(WebCore::uTextLatin1Access): Deleted.
(WebCore::uTextLatin1Extract): Deleted.
(WebCore::uTextLatin1MapOffsetToNative): Deleted.
(WebCore::uTextLatin1MapNativeIndexToUTF16): Deleted.
(WebCore::uTextLatin1Close): Deleted.
(WebCore::openLatin1UTextProvider): Deleted.
(WebCore::textLatin1ContextAwareGetCurrentContext): Deleted.
(WebCore::textLatin1ContextAwareMoveInPrimaryContext): Deleted.
(WebCore::textLatin1ContextAwareSwitchToPrimaryContext): Deleted.
(WebCore::textLatin1ContextAwareMoveInPriorContext): Deleted.
(WebCore::textLatin1ContextAwareSwitchToPriorContext): Deleted.
(WebCore::uTextLatin1ContextAwareClone): Deleted.
(WebCore::uTextLatin1ContextAwareNativeLength): Deleted.
(WebCore::uTextLatin1ContextAwareAccess): Deleted.
(WebCore::uTextLatin1ContextAwareExtract): Deleted.
(WebCore::uTextLatin1ContextAwareClose): Deleted.
(WebCore::openLatin1ContextAwareUTextProvider): Deleted.
* platform/text/icu/UTextProviderUTF16.cpp:
(WebCore::textUTF16ContextAwareGetCurrentContext): Deleted.
(WebCore::textUTF16ContextAwareMoveInPrimaryContext): Deleted.
(WebCore::textUTF16ContextAwareSwitchToPrimaryContext): Deleted.
(WebCore::textUTF16ContextAwareMoveInPriorContext): Deleted.
(WebCore::textUTF16ContextAwareSwitchToPriorContext): Deleted.
(WebCore::uTextUTF16ContextAwareClone): Deleted.
(WebCore::uTextUTF16ContextAwareNativeLength): Deleted.
(WebCore::uTextUTF16ContextAwareAccess): Deleted.
(WebCore::uTextUTF16ContextAwareExtract): Deleted.
(WebCore::uTextUTF16ContextAwareClose): Deleted.
(WebCore::openUTF16ContextAwareUTextProvider): Deleted.
* platform/text/mac/TextBoundaries.mm:
* platform/text/mac/TextBreakIteratorInternalICUMac.mm:
(WebCore::textBreakLocalePreference): Deleted.
(WebCore::topLanguagePreference): Deleted.
(WebCore::getLocale): Deleted.
(WebCore::getSearchLocale): Deleted.
(WebCore::currentSearchLocaleID): Deleted.
(WebCore::getTextBreakLocale): Deleted.
(WebCore::currentTextBreakLocaleID): Deleted.
* platform/text/win/TextBreakIteratorInternalICUWin.cpp:
(WebCore::currentSearchLocaleID): Deleted.
(WebCore::currentTextBreakLocaleID): Deleted.
* rendering/RenderBlock.cpp:
* rendering/RenderText.cpp:
* rendering/RenderText.h:
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/break_lines.cpp:
* rendering/break_lines.h:
* rendering/line/LineBreaker.h:
Source/WTF:
* WTF.xcodeproj/project.pbxproj:
* icu/unicode/ubrk.h: Added.
* icu/unicode/utext.h: Renamed from Source/WebCore/icu/unicode/utext.h.
* wtf/CMakeLists.txt:
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWin.cmake:
* wtf/TinyLRUCache.h:
* wtf/text/LineBreakIteratorPoolICU.h: Renamed from Source/WebCore/platform/text/LineBreakIteratorPoolICU.h.
(WTF::LineBreakIteratorPool::LineBreakIteratorPool):
(WTF::LineBreakIteratorPool::sharedPool):
(WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
(WTF::LineBreakIteratorPool::take):
(WTF::LineBreakIteratorPool::put):
* wtf/text/TextBreakIterator.cpp: Renamed from Source/WebCore/platform/text/TextBreakIterator.cpp.
(WTF::initializeIterator):
(WTF::initializeIteratorWithRules):
(WTF::setTextForIterator):
(WTF::setContextAwareTextForIterator):
(WTF::wordBreakIterator):
(WTF::sentenceBreakIterator):
(WTF::cursorMovementIterator):
(WTF::acquireLineBreakIterator):
(WTF::releaseLineBreakIterator):
(WTF::mapLineIteratorModeToRules):
(WTF::isCJKLocale):
(WTF::openLineBreakIterator):
(WTF::closeLineBreakIterator):
(WTF::compareAndSwapNonSharedCharacterBreakIterator):
(WTF::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
(WTF::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator):
(WTF::textBreakFirst):
(WTF::textBreakLast):
(WTF::textBreakNext):
(WTF::textBreakPrevious):
(WTF::textBreakPreceding):
(WTF::textBreakFollowing):
(WTF::textBreakCurrent):
(WTF::isTextBreak):
(WTF::isWordTextBreak):
(WTF::numGraphemeClusters):
(WTF::numCharactersInGraphemeClusters):
* wtf/text/TextBreakIterator.h: Renamed from Source/WebCore/platform/text/TextBreakIterator.h.
(WTF::LazyLineBreakIterator::LazyLineBreakIterator):
(WTF::LazyLineBreakIterator::~LazyLineBreakIterator):
(WTF::LazyLineBreakIterator::string):
(WTF::LazyLineBreakIterator::isLooseCJKMode):
(WTF::LazyLineBreakIterator::lastCharacter):
(WTF::LazyLineBreakIterator::secondToLastCharacter):
(WTF::LazyLineBreakIterator::setPriorContext):
(WTF::LazyLineBreakIterator::updatePriorContext):
(WTF::LazyLineBreakIterator::resetPriorContext):
(WTF::LazyLineBreakIterator::priorContextLength):
(WTF::LazyLineBreakIterator::get):
(WTF::LazyLineBreakIterator::resetStringAndReleaseIterator):
(WTF::NonSharedCharacterBreakIterator::operator TextBreakIterator*):
* wtf/text/TextBreakIteratorInternalICU.h: Renamed from Source/WebCore/platform/text/TextBreakIteratorInternalICU.h.
* wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp: Renamed from Source/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp.
(WebCore::currentSearchLocaleID):
(WebCore::currentTextBreakLocaleID):
* wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Renamed from Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp.
(WebCore::currentSearchLocaleID):
(WebCore::currentTextBreakLocaleID):
* wtf/text/icu/UTextProvider.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProvider.cpp.
(WTF::fixPointer):
(WTF::uTextCloneImpl):
* wtf/text/icu/UTextProvider.h: Renamed from Source/WebCore/platform/text/icu/UTextProvider.h.
(WTF::uTextProviderContext):
(WTF::initializeContextAwareUTextProvider):
(WTF::uTextAccessPinIndex):
(WTF::uTextAccessInChunkOrOutOfRange):
* wtf/text/icu/UTextProviderLatin1.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp.
(WTF::uTextLatin1Clone):
(WTF::uTextLatin1NativeLength):
(WTF::uTextLatin1Access):
(WTF::uTextLatin1Extract):
(WTF::uTextLatin1MapOffsetToNative):
(WTF::uTextLatin1MapNativeIndexToUTF16):
(WTF::uTextLatin1Close):
(WTF::openLatin1UTextProvider):
(WTF::textLatin1ContextAwareGetCurrentContext):
(WTF::textLatin1ContextAwareMoveInPrimaryContext):
(WTF::textLatin1ContextAwareSwitchToPrimaryContext):
(WTF::textLatin1ContextAwareMoveInPriorContext):
(WTF::textLatin1ContextAwareSwitchToPriorContext):
(WTF::uTextLatin1ContextAwareClone):
(WTF::uTextLatin1ContextAwareNativeLength):
(WTF::uTextLatin1ContextAwareAccess):
(WTF::uTextLatin1ContextAwareExtract):
(WTF::uTextLatin1ContextAwareClose):
(WTF::openLatin1ContextAwareUTextProvider):
* wtf/text/icu/UTextProviderLatin1.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.h.
* wtf/text/icu/UTextProviderUTF16.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp.
(WTF::textUTF16ContextAwareGetCurrentContext):
(WTF::textUTF16ContextAwareMoveInPrimaryContext):
(WTF::textUTF16ContextAwareSwitchToPrimaryContext):
(WTF::textUTF16ContextAwareMoveInPriorContext):
(WTF::textUTF16ContextAwareSwitchToPriorContext):
(WTF::uTextUTF16ContextAwareClone):
(WTF::uTextUTF16ContextAwareNativeLength):
(WTF::uTextUTF16ContextAwareAccess):
(WTF::uTextUTF16ContextAwareExtract):
(WTF::uTextUTF16ContextAwareClose):
(WTF::openUTF16ContextAwareUTextProvider):
* wtf/text/icu/UTextProviderUTF16.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.h.
* wtf/text/mac/TextBreakIteratorInternalICUMac.mm: Renamed from Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm.
(WTF::textBreakLocalePreference):
(WTF::topLanguagePreference):
(WTF::getLocale):
(WTF::getSearchLocale):
(WTF::currentSearchLocaleID):
(WTF::getTextBreakLocale):
(WTF::currentTextBreakLocaleID):
* wtf/text/win/TextBreakIteratorInternalICUWin.cpp: Renamed from Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp.
(WebCore::currentSearchLocaleID):
(WebCore::currentTextBreakLocaleID):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFWTFxcodeprojprojectpbxproj">trunk/Source/WTF/WTF.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWTFwtfCMakeListstxt">trunk/Source/WTF/wtf/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWTFwtfPlatformEflcmake">trunk/Source/WTF/wtf/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWTFwtfPlatformGTKcmake">trunk/Source/WTF/wtf/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWTFwtfPlatformMaccmake">trunk/Source/WTF/wtf/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWTFwtfPlatformWincmake">trunk/Source/WTF/wtf/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWTFwtfTinyLRUCacheh">trunk/Source/WTF/wtf/TinyLRUCache.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformWincmake">trunk/Source/WebCore/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextCheckingHelpercpp">trunk/Source/WebCore/editing/TextCheckingHelper.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitscpp">trunk/Source/WebCore/editing/VisibleUnits.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypecpp">trunk/Source/WebCore/html/InputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypecpp">trunk/Source/WebCore/html/TextFieldInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTextInputTypecpp">trunk/Source/WebCore/html/TextInputType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringscpp">trunk/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsStringTruncatorcpp">trunk/Source/WebCore/platform/graphics/StringTruncator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorCGcpp">trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBoundariescpp">trunk/Source/WebCore/platform/text/TextBoundaries.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextcfHyphenationCFcpp">trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextenchantTextCheckerEnchantcpp">trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtexthyphenHyphenationLibHyphencpp">trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacTextBoundariesmm">trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTexth">trunk/Source/WebCore/rendering/RenderText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingbreak_linescpp">trunk/Source/WebCore/rendering/break_lines.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingbreak_linesh">trunk/Source/WebCore/rendering/break_lines.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakerh">trunk/Source/WebCore/rendering/line/LineBreaker.h</a></li>
<li><a href="#trunkSourceWebKitiosMiscWebUIKitSupportmm">trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflTextCheckerEflcpp">trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkTextCheckerGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWTFicuunicodeubrkh">trunk/Source/WTF/icu/unicode/ubrk.h</a></li>
<li><a href="#trunkSourceWTFicuunicodeutexth">trunk/Source/WTF/icu/unicode/utext.h</a></li>
<li><a href="#trunkSourceWTFwtftextLineBreakIteratorPoolICUh">trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h</a></li>
<li><a href="#trunkSourceWTFwtftextTextBreakIteratorcpp">trunk/Source/WTF/wtf/text/TextBreakIterator.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextTextBreakIteratorh">trunk/Source/WTF/wtf/text/TextBreakIterator.h</a></li>
<li><a href="#trunkSourceWTFwtftextTextBreakIteratorInternalICUh">trunk/Source/WTF/wtf/text/TextBreakIteratorInternalICU.h</a></li>
<li>trunk/Source/WTF/wtf/text/efl/</li>
<li><a href="#trunkSourceWTFwtftexteflTextBreakIteratorInternalICUEflcpp">trunk/Source/WTF/wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp</a></li>
<li>trunk/Source/WTF/wtf/text/gtk/</li>
<li><a href="#trunkSourceWTFwtftextgtkTextBreakIteratorInternalICUGtkcpp">trunk/Source/WTF/wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp</a></li>
<li>trunk/Source/WTF/wtf/text/icu/</li>
<li><a href="#trunkSourceWTFwtftexticuUTextProvidercpp">trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp</a></li>
<li><a href="#trunkSourceWTFwtftexticuUTextProviderh">trunk/Source/WTF/wtf/text/icu/UTextProvider.h</a></li>
<li><a href="#trunkSourceWTFwtftexticuUTextProviderLatin1cpp">trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp</a></li>
<li><a href="#trunkSourceWTFwtftexticuUTextProviderLatin1h">trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.h</a></li>
<li><a href="#trunkSourceWTFwtftexticuUTextProviderUTF16cpp">trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp</a></li>
<li><a href="#trunkSourceWTFwtftexticuUTextProviderUTF16h">trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.h</a></li>
<li><a href="#trunkSourceWTFwtftextmacTextBreakIteratorInternalICUMacmm">trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm</a></li>
<li>trunk/Source/WTF/wtf/text/win/</li>
<li><a href="#trunkSourceWTFwtftextwinTextBreakIteratorInternalICUWincpp">trunk/Source/WTF/wtf/text/win/TextBreakIteratorInternalICUWin.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformtextLineBreakIteratorPoolICUh">trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorcpp">trunk/Source/WebCore/platform/text/TextBreakIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorh">trunk/Source/WebCore/platform/text/TextBreakIterator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorInternalICUh">trunk/Source/WebCore/platform/text/TextBreakIteratorInternalICU.h</a></li>
<li>trunk/Source/WebCore/platform/text/efl/</li>
<li>trunk/Source/WebCore/platform/text/gtk/</li>
<li>trunk/Source/WebCore/platform/text/icu/</li>
<li><a href="#trunkSourceWebCoreplatformtextmacTextBreakIteratorInternalICUMacmm">trunk/Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformtextwinTextBreakIteratorInternalICUWincpp">trunk/Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/ChangeLog        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,3 +1,132 @@
</span><ins>+2016-07-10 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Move breaking iterator code to WTF
+ https://bugs.webkit.org/show_bug.cgi?id=159594
+
+ Reviewed by Alex Christensen.
+
+ This is in preparation for giving StringView a GraphemeClusters iterator.
+ Such an interator needs to be implemented on top of our breaking iterator
+ code.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * icu/unicode/ubrk.h: Added.
+ * icu/unicode/utext.h: Renamed from Source/WebCore/icu/unicode/utext.h.
+ * wtf/CMakeLists.txt:
+ * wtf/PlatformEfl.cmake:
+ * wtf/PlatformGTK.cmake:
+ * wtf/PlatformMac.cmake:
+ * wtf/PlatformWin.cmake:
+ * wtf/TinyLRUCache.h:
+ * wtf/text/LineBreakIteratorPoolICU.h: Renamed from Source/WebCore/platform/text/LineBreakIteratorPoolICU.h.
+ (WTF::LineBreakIteratorPool::LineBreakIteratorPool):
+ (WTF::LineBreakIteratorPool::sharedPool):
+ (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
+ (WTF::LineBreakIteratorPool::take):
+ (WTF::LineBreakIteratorPool::put):
+ * wtf/text/TextBreakIterator.cpp: Renamed from Source/WebCore/platform/text/TextBreakIterator.cpp.
+ (WTF::initializeIterator):
+ (WTF::initializeIteratorWithRules):
+ (WTF::setTextForIterator):
+ (WTF::setContextAwareTextForIterator):
+ (WTF::wordBreakIterator):
+ (WTF::sentenceBreakIterator):
+ (WTF::cursorMovementIterator):
+ (WTF::acquireLineBreakIterator):
+ (WTF::releaseLineBreakIterator):
+ (WTF::mapLineIteratorModeToRules):
+ (WTF::isCJKLocale):
+ (WTF::openLineBreakIterator):
+ (WTF::closeLineBreakIterator):
+ (WTF::compareAndSwapNonSharedCharacterBreakIterator):
+ (WTF::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
+ (WTF::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator):
+ (WTF::textBreakFirst):
+ (WTF::textBreakLast):
+ (WTF::textBreakNext):
+ (WTF::textBreakPrevious):
+ (WTF::textBreakPreceding):
+ (WTF::textBreakFollowing):
+ (WTF::textBreakCurrent):
+ (WTF::isTextBreak):
+ (WTF::isWordTextBreak):
+ (WTF::numGraphemeClusters):
+ (WTF::numCharactersInGraphemeClusters):
+ * wtf/text/TextBreakIterator.h: Renamed from Source/WebCore/platform/text/TextBreakIterator.h.
+ (WTF::LazyLineBreakIterator::LazyLineBreakIterator):
+ (WTF::LazyLineBreakIterator::~LazyLineBreakIterator):
+ (WTF::LazyLineBreakIterator::string):
+ (WTF::LazyLineBreakIterator::isLooseCJKMode):
+ (WTF::LazyLineBreakIterator::lastCharacter):
+ (WTF::LazyLineBreakIterator::secondToLastCharacter):
+ (WTF::LazyLineBreakIterator::setPriorContext):
+ (WTF::LazyLineBreakIterator::updatePriorContext):
+ (WTF::LazyLineBreakIterator::resetPriorContext):
+ (WTF::LazyLineBreakIterator::priorContextLength):
+ (WTF::LazyLineBreakIterator::get):
+ (WTF::LazyLineBreakIterator::resetStringAndReleaseIterator):
+ (WTF::NonSharedCharacterBreakIterator::operator TextBreakIterator*):
+ * wtf/text/TextBreakIteratorInternalICU.h: Renamed from Source/WebCore/platform/text/TextBreakIteratorInternalICU.h.
+ * wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp: Renamed from Source/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp.
+ (WebCore::currentSearchLocaleID):
+ (WebCore::currentTextBreakLocaleID):
+ * wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Renamed from Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp.
+ (WebCore::currentSearchLocaleID):
+ (WebCore::currentTextBreakLocaleID):
+ * wtf/text/icu/UTextProvider.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProvider.cpp.
+ (WTF::fixPointer):
+ (WTF::uTextCloneImpl):
+ * wtf/text/icu/UTextProvider.h: Renamed from Source/WebCore/platform/text/icu/UTextProvider.h.
+ (WTF::uTextProviderContext):
+ (WTF::initializeContextAwareUTextProvider):
+ (WTF::uTextAccessPinIndex):
+ (WTF::uTextAccessInChunkOrOutOfRange):
+ * wtf/text/icu/UTextProviderLatin1.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp.
+ (WTF::uTextLatin1Clone):
+ (WTF::uTextLatin1NativeLength):
+ (WTF::uTextLatin1Access):
+ (WTF::uTextLatin1Extract):
+ (WTF::uTextLatin1MapOffsetToNative):
+ (WTF::uTextLatin1MapNativeIndexToUTF16):
+ (WTF::uTextLatin1Close):
+ (WTF::openLatin1UTextProvider):
+ (WTF::textLatin1ContextAwareGetCurrentContext):
+ (WTF::textLatin1ContextAwareMoveInPrimaryContext):
+ (WTF::textLatin1ContextAwareSwitchToPrimaryContext):
+ (WTF::textLatin1ContextAwareMoveInPriorContext):
+ (WTF::textLatin1ContextAwareSwitchToPriorContext):
+ (WTF::uTextLatin1ContextAwareClone):
+ (WTF::uTextLatin1ContextAwareNativeLength):
+ (WTF::uTextLatin1ContextAwareAccess):
+ (WTF::uTextLatin1ContextAwareExtract):
+ (WTF::uTextLatin1ContextAwareClose):
+ (WTF::openLatin1ContextAwareUTextProvider):
+ * wtf/text/icu/UTextProviderLatin1.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.h.
+ * wtf/text/icu/UTextProviderUTF16.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp.
+ (WTF::textUTF16ContextAwareGetCurrentContext):
+ (WTF::textUTF16ContextAwareMoveInPrimaryContext):
+ (WTF::textUTF16ContextAwareSwitchToPrimaryContext):
+ (WTF::textUTF16ContextAwareMoveInPriorContext):
+ (WTF::textUTF16ContextAwareSwitchToPriorContext):
+ (WTF::uTextUTF16ContextAwareClone):
+ (WTF::uTextUTF16ContextAwareNativeLength):
+ (WTF::uTextUTF16ContextAwareAccess):
+ (WTF::uTextUTF16ContextAwareExtract):
+ (WTF::uTextUTF16ContextAwareClose):
+ (WTF::openUTF16ContextAwareUTextProvider):
+ * wtf/text/icu/UTextProviderUTF16.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.h.
+ * wtf/text/mac/TextBreakIteratorInternalICUMac.mm: Renamed from Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm.
+ (WTF::textBreakLocalePreference):
+ (WTF::topLanguagePreference):
+ (WTF::getLocale):
+ (WTF::getSearchLocale):
+ (WTF::currentSearchLocaleID):
+ (WTF::getTextBreakLocale):
+ (WTF::currentTextBreakLocaleID):
+ * wtf/text/win/TextBreakIteratorInternalICUWin.cpp: Renamed from Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp.
+ (WebCore::currentSearchLocaleID):
+ (WebCore::currentTextBreakLocaleID):
+
</ins><span class="cx"> 2016-07-08 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r202799.
</span></span></pre></div>
<a id="trunkSourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -89,6 +89,15 @@
</span><span class="cx">                 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */; };
</span><span class="cx">                 1AFDE648195201C300C48FFA /* TypeCastsCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFDE647195201C300C48FFA /* TypeCastsCF.h */; };
</span><span class="cx">                 1AFDE6531953B23D00C48FFA /* Optional.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFDE6521953B23D00C48FFA /* Optional.h */; };
</span><ins>+                1C181C7F1D3078DA00F5FA16 /* TextBreakIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C7D1D3078DA00F5FA16 /* TextBreakIterator.cpp */; };
+                1C181C801D3078DA00F5FA16 /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C181C7E1D3078DA00F5FA16 /* TextBreakIterator.h */; };
+                1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C891D307AB800F5FA16 /* UTextProvider.cpp */; };
+                1C181C901D307AB800F5FA16 /* UTextProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C181C8A1D307AB800F5FA16 /* UTextProvider.h */; };
+                1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C8B1D307AB800F5FA16 /* UTextProviderLatin1.cpp */; };
+                1C181C921D307AB800F5FA16 /* UTextProviderLatin1.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C181C8C1D307AB800F5FA16 /* UTextProviderLatin1.h */; };
+                1C181C931D307AB800F5FA16 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C8D1D307AB800F5FA16 /* UTextProviderUTF16.cpp */; };
+                1C181C941D307AB800F5FA16 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C181C8E1D307AB800F5FA16 /* UTextProviderUTF16.h */; };
+                1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */; };
</ins><span class="cx">                 1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; };
</span><span class="cx">                 1FA47C8B152502DA00568D1B /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; };
</span><span class="cx">                 26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; };
</span><span class="lines">@@ -414,6 +423,17 @@
</span><span class="cx">                 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedSymbolsUsedBySafari.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1AFDE647195201C300C48FFA /* TypeCastsCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeCastsCF.h; sourceTree = "<group>"; };
</span><span class="cx">                 1AFDE6521953B23D00C48FFA /* Optional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Optional.h; sourceTree = "<group>"; };
</span><ins>+                1C181C7D1D3078DA00F5FA16 /* TextBreakIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIterator.cpp; sourceTree = "<group>"; };
+                1C181C7E1D3078DA00F5FA16 /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; };
+                1C181C811D30797C00F5FA16 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
+                1C181C821D3079AC00F5FA16 /* TextBreakIteratorInternalICU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextBreakIteratorInternalICU.h; sourceTree = "<group>"; };
+                1C181C891D307AB800F5FA16 /* UTextProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProvider.cpp; sourceTree = "<group>"; };
+                1C181C8A1D307AB800F5FA16 /* UTextProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProvider.h; sourceTree = "<group>"; };
+                1C181C8B1D307AB800F5FA16 /* UTextProviderLatin1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderLatin1.cpp; sourceTree = "<group>"; };
+                1C181C8C1D307AB800F5FA16 /* UTextProviderLatin1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderLatin1.h; sourceTree = "<group>"; };
+                1C181C8D1D307AB800F5FA16 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = "<group>"; };
+                1C181C8E1D307AB800F5FA16 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = "<group>"; };
+                1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextBreakIteratorInternalICUMac.mm; path = mac/TextBreakIteratorInternalICUMac.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreThread.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1FA47C89152502DA00568D1B /* WebCoreThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreThread.h; sourceTree = "<group>"; };
</span><span class="cx">                 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegerToStringConversion.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -688,6 +708,19 @@
</span><span class="cx">                         name = Libraries;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><ins>+                1C181C881D307AB800F5FA16 /* icu */ = {
+                        isa = PBXGroup;
+                        children = (
+                                1C181C891D307AB800F5FA16 /* UTextProvider.cpp */,
+                                1C181C8A1D307AB800F5FA16 /* UTextProvider.h */,
+                                1C181C8B1D307AB800F5FA16 /* UTextProviderLatin1.cpp */,
+                                1C181C8C1D307AB800F5FA16 /* UTextProviderLatin1.h */,
+                                1C181C8D1D307AB800F5FA16 /* UTextProviderUTF16.cpp */,
+                                1C181C8E1D307AB800F5FA16 /* UTextProviderUTF16.h */,
+                        );
+                        path = icu;
+                        sourceTree = "<group>";
+                };
</ins><span class="cx">                 1FA47C87152502DA00568D1B /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -751,6 +784,7 @@
</span><span class="cx">                 A5BA15F11824339F00A82E69 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */,
</ins><span class="cx">                                 A5BA15F41824348000A82E69 /* StringImplMac.mm */,
</span><span class="cx">                                 A5BA15F2182433A900A82E69 /* StringMac.mm */,
</span><span class="cx">                                 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */,
</span><span class="lines">@@ -1043,6 +1077,7 @@
</span><span class="cx">                 A8A4731B151A825B004123FF /* text */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1C181C881D307AB800F5FA16 /* icu */,
</ins><span class="cx">                                 A5BA15F61824359E00A82E69 /* cf */,
</span><span class="cx">                                 A5BA15F11824339F00A82E69 /* mac */,
</span><span class="cx">                                 A8A4731C151A825B004123FF /* ASCIIFastPath.h */,
</span><span class="lines">@@ -1079,6 +1114,10 @@
</span><span class="cx">                                 70ECA60C1B02426800449739 /* UniquedStringImpl.h */,
</span><span class="cx">                                 A8A4732D151A825B004123FF /* WTFString.cpp */,
</span><span class="cx">                                 A8A4732E151A825B004123FF /* WTFString.h */,
</span><ins>+                                1C181C7D1D3078DA00F5FA16 /* TextBreakIterator.cpp */,
+                                1C181C7E1D3078DA00F5FA16 /* TextBreakIterator.h */,
+                                1C181C811D30797C00F5FA16 /* LineBreakIteratorPoolICU.h */,
+                                1C181C821D3079AC00F5FA16 /* TextBreakIteratorInternalICU.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = text;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -1247,6 +1286,7 @@
</span><span class="cx">                                 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */,
</span><span class="cx">                                 A8A473D3151A825B004123FF /* HashCountedSet.h in Headers */,
</span><span class="cx">                                 A8A4742D151A825B004123FF /* Hasher.h in Headers */,
</span><ins>+                                1C181C901D307AB800F5FA16 /* UTextProvider.h in Headers */,
</ins><span class="cx">                                 A8A473D4151A825B004123FF /* HashFunctions.h in Headers */,
</span><span class="cx">                                 A8A473D5151A825B004123FF /* HashIterators.h in Headers */,
</span><span class="cx">                                 A8A473D6151A825B004123FF /* HashMap.h in Headers */,
</span><span class="lines">@@ -1263,6 +1303,7 @@
</span><span class="cx">                                 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */,
</span><span class="cx">                                 93AC91A818942FC400244939 /* LChar.h in Headers */,
</span><span class="cx">                                 A70DA0851799F04D00529A9B /* ListDump.h in Headers */,
</span><ins>+                                1C181C941D307AB800F5FA16 /* UTextProviderUTF16.h in Headers */,
</ins><span class="cx">                                 A8A473E1151A825B004123FF /* ListHashSet.h in Headers */,
</span><span class="cx">                                 0FE1646B1B6FFC9600400E7C /* Lock.h in Headers */,
</span><span class="cx">                                 A8A473E3151A825B004123FF /* Locker.h in Headers */,
</span><span class="lines">@@ -1272,6 +1313,7 @@
</span><span class="cx">                                 A8A473E8151A825B004123FF /* MathExtras.h in Headers */,
</span><span class="cx">                                 A8A473EA151A825B004123FF /* MD5.h in Headers */,
</span><span class="cx">                                 CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */,
</span><ins>+                                1C181C801D3078DA00F5FA16 /* TextBreakIterator.h in Headers */,
</ins><span class="cx">                                 A8A473EB151A825B004123FF /* MessageQueue.h in Headers */,
</span><span class="cx">                                 A8A473ED151A825B004123FF /* MetaAllocator.h in Headers */,
</span><span class="cx">                                 A8A473EE151A825B004123FF /* MetaAllocatorHandle.h in Headers */,
</span><span class="lines">@@ -1332,6 +1374,7 @@
</span><span class="cx">                                 A748745317A0BDAE00FA04CB /* SixCharacterHash.h in Headers */,
</span><span class="cx">                                 A8A47426151A825B004123FF /* Spectrum.h in Headers */,
</span><span class="cx">                                 A8A47428151A825B004123FF /* StackBounds.h in Headers */,
</span><ins>+                                1C181C921D307AB800F5FA16 /* UTextProviderLatin1.h in Headers */,
</ins><span class="cx">                                 FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */,
</span><span class="cx">                                 A8A47429151A825B004123FF /* StaticConstructors.h in Headers */,
</span><span class="cx">                                 A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */,
</span><span class="lines">@@ -1502,6 +1545,7 @@
</span><span class="cx">                                 A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */,
</span><span class="cx">                                 E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */,
</span><span class="cx">                                 A8A47439151A825B004123FF /* CString.cpp in Sources */,
</span><ins>+                                1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm in Sources */,
</ins><span class="cx">                                 A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */,
</span><span class="cx">                                 A8A4739E151A825B004123FF /* DataLog.cpp in Sources */,
</span><span class="cx">                                 A8A473A0151A825B004123FF /* DateMath.cpp in Sources */,
</span><span class="lines">@@ -1515,6 +1559,7 @@
</span><span class="cx">                                 A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */,
</span><span class="cx">                                 DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */,
</span><span class="cx">                                 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */,
</span><ins>+                                1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */,
</ins><span class="cx">                                 A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */,
</span><span class="cx">                                 1A1D8B9E1731879800141DA4 /* FunctionDispatcher.cpp in Sources */,
</span><span class="cx">                                 2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */,
</span><span class="lines">@@ -1529,6 +1574,7 @@
</span><span class="cx">                                 A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */,
</span><span class="cx">                                 A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */,
</span><span class="cx">                                 A8A47402151A825B004123FF /* PageBlock.cpp in Sources */,
</span><ins>+                                1C181C931D307AB800F5FA16 /* UTextProviderUTF16.cpp in Sources */,
</ins><span class="cx">                                 0FFF19DC1BB334EB00886D91 /* ParallelHelperPool.cpp in Sources */,
</span><span class="cx">                                 0F824A681B7443A0002E345D /* ParkingLot.cpp in Sources */,
</span><span class="cx">                                 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */,
</span><span class="lines">@@ -1558,6 +1604,8 @@
</span><span class="cx">                                 93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */,
</span><span class="cx">                                 93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */,
</span><span class="cx">                                 A8A473B7151A825B004123FF /* strtod.cc in Sources */,
</span><ins>+                                1C181C7F1D3078DA00F5FA16 /* TextBreakIterator.cpp in Sources */,
+                                1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */,
</ins><span class="cx">                                 70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */,
</span><span class="cx">                                 A8A47448151A825B004123FF /* ThreadIdentifierDataPthreads.cpp in Sources */,
</span><span class="cx">                                 A8A4744A151A825B004123FF /* Threading.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWTFicuunicodeubrkh"></a>
<div class="addfile"><h4>Added: trunk/Source/WTF/icu/unicode/ubrk.h (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/icu/unicode/ubrk.h         (rev 0)
+++ trunk/Source/WTF/icu/unicode/ubrk.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,541 @@
</span><ins>+/*
+******************************************************************************
+* Copyright (C) 1996-2013, International Business Machines Corporation and others.
+* All Rights Reserved.
+******************************************************************************
+*/
+
+#ifndef UBRK_H
+#define UBRK_H
+
+#include "unicode/utypes.h"
+#include "unicode/uloc.h"
+#include "unicode/utext.h"
+#include "unicode/localpointer.h"
+
+/**
+ * A text-break iterator.
+ * For usage in C programs.
+ */
+#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
+# define UBRK_TYPEDEF_UBREAK_ITERATOR
+ /**
+ * Opaque type representing an ICU Break iterator object.
+ * @stable ICU 2.0
+ */
+ typedef struct UBreakIterator UBreakIterator;
+#endif
+
+#if !UCONFIG_NO_BREAK_ITERATION
+
+#include "unicode/parseerr.h"
+
+/**
+ * \file
+ * \brief C API: BreakIterator
+ *
+ * <h2> BreakIterator C API </h2>
+ *
+ * The BreakIterator C API defines methods for finding the location
+ * of boundaries in text. Pointer to a UBreakIterator maintain a
+ * current position and scan over text returning the index of characters
+ * where boundaries occur.
+ * <p>
+ * Line boundary analysis determines where a text string can be broken
+ * when line-wrapping. The mechanism correctly handles punctuation and
+ * hyphenated words.
+ * <p>
+ * Sentence boundary analysis allows selection with correct
+ * interpretation of periods within numbers and abbreviations, and
+ * trailing punctuation marks such as quotation marks and parentheses.
+ * <p>
+ * Word boundary analysis is used by search and replace functions, as
+ * well as within text editing applications that allow the user to
+ * select words with a double click. Word selection provides correct
+ * interpretation of punctuation marks within and following
+ * words. Characters that are not part of a word, such as symbols or
+ * punctuation marks, have word-breaks on both sides.
+ * <p>
+ * Character boundary analysis identifies the boundaries of
+ * "Extended Grapheme Clusters", which are groupings of codepoints
+ * that should be treated as character-like units for many text operations.
+ * Please see Unicode Standard Annex #29, Unicode Text Segmentation,
+ * http://www.unicode.org/reports/tr29/ for additional information
+ * on grapheme clusters and guidelines on their use.
+ * <p>
+ * Title boundary analysis locates all positions,
+ * typically starts of words, that should be set to Title Case
+ * when title casing the text.
+ * <p>
+ * The text boundary positions are found according to the rules
+ * described in Unicode Standard Annex #29, Text Boundaries, and
+ * Unicode Standard Annex #14, Line Breaking Properties. These
+ * are available at http://www.unicode.org/reports/tr14/ and
+ * http://www.unicode.org/reports/tr29/.
+ * <p>
+ * In addition to the plain C API defined in this header file, an
+ * object oriented C++ API with equivalent functionality is defined in the
+ * file brkiter.h.
+ * <p>
+ * Code snippets illustrating the use of the Break Iterator APIs
+ * are available in the ICU User Guide,
+ * http://icu-project.org/userguide/boundaryAnalysis.html
+ * and in the sample program icu/source/samples/break/break.cpp
+ */
+
+/** The possible types of text boundaries. @stable ICU 2.0 */
+typedef enum UBreakIteratorType {
+ /** Character breaks @stable ICU 2.0 */
+ UBRK_CHARACTER = 0,
+ /** Word breaks @stable ICU 2.0 */
+ UBRK_WORD = 1,
+ /** Line breaks @stable ICU 2.0 */
+ UBRK_LINE = 2,
+ /** Sentence breaks @stable ICU 2.0 */
+ UBRK_SENTENCE = 3,
+
+#ifndef U_HIDE_DEPRECATED_API
+ /**
+ * Title Case breaks
+ * The iterator created using this type locates title boundaries as described for
+ * Unicode 3.2 only. For Unicode 4.0 and above title boundary iteration,
+ * please use Word Boundary iterator.
+ *
+ * @deprecated ICU 2.8 Use the word break iterator for titlecasing for Unicode 4 and later.
+ */
+ UBRK_TITLE = 4,
+#endif /* U_HIDE_DEPRECATED_API */
+ UBRK_COUNT = 5
+} UBreakIteratorType;
+
+/** Value indicating all text boundaries have been returned.
+ * @stable ICU 2.0
+ */
+#define UBRK_DONE ((int32_t) -1)
+
+
+/**
+ * Enum constants for the word break tags returned by
+ * getRuleStatus(). A range of values is defined for each category of
+ * word, to allow for further subdivisions of a category in future releases.
+ * Applications should check for tag values falling within the range, rather
+ * than for single individual values.
+ * @stable ICU 2.2
+*/
+typedef enum UWordBreak {
+ /** Tag value for "words" that do not fit into any of other categories.
+ * Includes spaces and most punctuation. */
+ UBRK_WORD_NONE = 0,
+ /** Upper bound for tags for uncategorized words. */
+ UBRK_WORD_NONE_LIMIT = 100,
+ /** Tag value for words that appear to be numbers, lower limit. */
+ UBRK_WORD_NUMBER = 100,
+ /** Tag value for words that appear to be numbers, upper limit. */
+ UBRK_WORD_NUMBER_LIMIT = 200,
+ /** Tag value for words that contain letters, excluding
+ * hiragana, katakana or ideographic characters, lower limit. */
+ UBRK_WORD_LETTER = 200,
+ /** Tag value for words containing letters, upper limit */
+ UBRK_WORD_LETTER_LIMIT = 300,
+ /** Tag value for words containing kana characters, lower limit */
+ UBRK_WORD_KANA = 300,
+ /** Tag value for words containing kana characters, upper limit */
+ UBRK_WORD_KANA_LIMIT = 400,
+ /** Tag value for words containing ideographic characters, lower limit */
+ UBRK_WORD_IDEO = 400,
+ /** Tag value for words containing ideographic characters, upper limit */
+ UBRK_WORD_IDEO_LIMIT = 500
+} UWordBreak;
+
+/**
+ * Enum constants for the line break tags returned by getRuleStatus().
+ * A range of values is defined for each category of
+ * word, to allow for further subdivisions of a category in future releases.
+ * Applications should check for tag values falling within the range, rather
+ * than for single individual values.
+ * @stable ICU 2.8
+*/
+typedef enum ULineBreakTag {
+ /** Tag value for soft line breaks, positions at which a line break
+ * is acceptable but not required */
+ UBRK_LINE_SOFT = 0,
+ /** Upper bound for soft line breaks. */
+ UBRK_LINE_SOFT_LIMIT = 100,
+ /** Tag value for a hard, or mandatory line break */
+ UBRK_LINE_HARD = 100,
+ /** Upper bound for hard line breaks. */
+ UBRK_LINE_HARD_LIMIT = 200
+} ULineBreakTag;
+
+
+
+/**
+ * Enum constants for the sentence break tags returned by getRuleStatus().
+ * A range of values is defined for each category of
+ * sentence, to allow for further subdivisions of a category in future releases.
+ * Applications should check for tag values falling within the range, rather
+ * than for single individual values.
+ * @stable ICU 2.8
+*/
+typedef enum USentenceBreakTag {
+ /** Tag value for for sentences ending with a sentence terminator
+ * ('.', '?', '!', etc.) character, possibly followed by a
+ * hard separator (CR, LF, PS, etc.)
+ */
+ UBRK_SENTENCE_TERM = 0,
+ /** Upper bound for tags for sentences ended by sentence terminators. */
+ UBRK_SENTENCE_TERM_LIMIT = 100,
+ /** Tag value for for sentences that do not contain an ending
+ * sentence terminator ('.', '?', '!', etc.) character, but
+ * are ended only by a hard separator (CR, LF, PS, etc.) or end of input.
+ */
+ UBRK_SENTENCE_SEP = 100,
+ /** Upper bound for tags for sentences ended by a separator. */
+ UBRK_SENTENCE_SEP_LIMIT = 200
+ /** Tag value for a hard, or mandatory line break */
+} USentenceBreakTag;
+
+
+/**
+ * Open a new UBreakIterator for locating text boundaries for a specified locale.
+ * A UBreakIterator may be used for detecting character, line, word,
+ * and sentence breaks in text.
+ * @param type The type of UBreakIterator to open: one of UBRK_CHARACTER, UBRK_WORD,
+ * UBRK_LINE, UBRK_SENTENCE
+ * @param locale The locale specifying the text-breaking conventions.
+ * @param text The text to be iterated over.
+ * @param textLength The number of characters in text, or -1 if null-terminated.
+ * @param status A UErrorCode to receive any errors.
+ * @return A UBreakIterator for the specified locale.
+ * @see ubrk_openRules
+ * @stable ICU 2.0
+ */
+U_STABLE UBreakIterator* U_EXPORT2
+ubrk_open(UBreakIteratorType type,
+ const char *locale,
+ const UChar *text,
+ int32_t textLength,
+ UErrorCode *status);
+
+/**
+ * Open a new UBreakIterator for locating text boundaries using specified breaking rules.
+ * The rule syntax is ... (TBD)
+ * @param rules A set of rules specifying the text breaking conventions.
+ * @param rulesLength The number of characters in rules, or -1 if null-terminated.
+ * @param text The text to be iterated over. May be null, in which case ubrk_setText() is
+ * used to specify the text to be iterated.
+ * @param textLength The number of characters in text, or -1 if null-terminated.
+ * @param parseErr Receives position and context information for any syntax errors
+ * detected while parsing the rules.
+ * @param status A UErrorCode to receive any errors.
+ * @return A UBreakIterator for the specified rules.
+ * @see ubrk_open
+ * @stable ICU 2.2
+ */
+U_STABLE UBreakIterator* U_EXPORT2
+ubrk_openRules(const UChar *rules,
+ int32_t rulesLength,
+ const UChar *text,
+ int32_t textLength,
+ UParseError *parseErr,
+ UErrorCode *status);
+
+/**
+ * Thread safe cloning operation
+ * @param bi iterator to be cloned
+ * @param stackBuffer <em>Deprecated functionality as of ICU 52, use NULL.</em><br>
+ * user allocated space for the new clone. If NULL new memory will be allocated.
+ * If buffer is not large enough, new memory will be allocated.
+ * Clients can use the U_BRK_SAFECLONE_BUFFERSIZE.
+ * @param pBufferSize <em>Deprecated functionality as of ICU 52, use NULL or 1.</em><br>
+ * pointer to size of allocated space.
+ * If *pBufferSize == 0, a sufficient size for use in cloning will
+ * be returned ('pre-flighting')
+ * If *pBufferSize is not enough for a stack-based safe clone,
+ * new memory will be allocated.
+ * @param status to indicate whether the operation went on smoothly or there were errors
+ * An informational status value, U_SAFECLONE_ALLOCATED_ERROR, is used if any allocations were necessary.
+ * @return pointer to the new clone
+ * @stable ICU 2.0
+ */
+U_STABLE UBreakIterator * U_EXPORT2
+ubrk_safeClone(
+ const UBreakIterator *bi,
+ void *stackBuffer,
+ int32_t *pBufferSize,
+ UErrorCode *status);
+
+#ifndef U_HIDE_DEPRECATED_API
+
+/**
+ * A recommended size (in bytes) for the memory buffer to be passed to ubrk_saveClone().
+ * @deprecated ICU 52. Do not rely on ubrk_safeClone() cloning into any provided buffer.
+ */
+#define U_BRK_SAFECLONE_BUFFERSIZE 1
+
+#endif /* U_HIDE_DEPRECATED_API */
+
+/**
+* Close a UBreakIterator.
+* Once closed, a UBreakIterator may no longer be used.
+* @param bi The break iterator to close.
+ * @stable ICU 2.0
+*/
+U_STABLE void U_EXPORT2
+ubrk_close(UBreakIterator *bi);
+
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUBreakIteratorPointer
+ * "Smart pointer" class, closes a UBreakIterator via ubrk_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUBreakIteratorPointer, UBreakIterator, ubrk_close);
+
+U_NAMESPACE_END
+
+#endif
+
+/**
+ * Sets an existing iterator to point to a new piece of text
+ * @param bi The iterator to use
+ * @param text The text to be set
+ * @param textLength The length of the text
+ * @param status The error code
+ * @stable ICU 2.0
+ */
+U_STABLE void U_EXPORT2
+ubrk_setText(UBreakIterator* bi,
+ const UChar* text,
+ int32_t textLength,
+ UErrorCode* status);
+
+
+/**
+ * Sets an existing iterator to point to a new piece of text.
+ *
+ * All index positions returned by break iterator functions are
+ * native indices from the UText. For example, when breaking UTF-8
+ * encoded text, the break positions returned by \ref ubrk_next, \ref ubrk_previous, etc.
+ * will be UTF-8 string indices, not UTF-16 positions.
+ *
+ * @param bi The iterator to use
+ * @param text The text to be set.
+ * This function makes a shallow clone of the supplied UText. This means
+ * that the caller is free to immediately close or otherwise reuse the
+ * UText that was passed as a parameter, but that the underlying text itself
+ * must not be altered while being referenced by the break iterator.
+ * @param status The error code
+ * @stable ICU 3.4
+ */
+U_STABLE void U_EXPORT2
+ubrk_setUText(UBreakIterator* bi,
+ UText* text,
+ UErrorCode* status);
+
+
+
+/**
+ * Determine the most recently-returned text boundary.
+ *
+ * @param bi The break iterator to use.
+ * @return The character index most recently returned by \ref ubrk_next, \ref ubrk_previous,
+ * \ref ubrk_first, or \ref ubrk_last.
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_current(const UBreakIterator *bi);
+
+/**
+ * Advance the iterator to the boundary following the current boundary.
+ *
+ * @param bi The break iterator to use.
+ * @return The character index of the next text boundary, or UBRK_DONE
+ * if all text boundaries have been returned.
+ * @see ubrk_previous
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_next(UBreakIterator *bi);
+
+/**
+ * Set the iterator position to the boundary preceding the current boundary.
+ *
+ * @param bi The break iterator to use.
+ * @return The character index of the preceding text boundary, or UBRK_DONE
+ * if all text boundaries have been returned.
+ * @see ubrk_next
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_previous(UBreakIterator *bi);
+
+/**
+ * Set the iterator position to the index of the first character in the text being scanned.
+ * This is not always the same as index 0 of the text.
+ * @param bi The break iterator to use.
+ * @return The character index of the first character in the text being scanned.
+ * @see ubrk_last
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_first(UBreakIterator *bi);
+
+/**
+ * Set the iterator position to the index immediately <EM>beyond</EM> the last character in the text being scanned.
+ * This is not the same as the last character.
+ * @param bi The break iterator to use.
+ * @return The character offset immediately <EM>beyond</EM> the last character in the
+ * text being scanned.
+ * @see ubrk_first
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_last(UBreakIterator *bi);
+
+/**
+ * Set the iterator position to the first boundary preceding the specified offset.
+ * The new position is always smaller than offset, or UBRK_DONE.
+ * @param bi The break iterator to use.
+ * @param offset The offset to begin scanning.
+ * @return The text boundary preceding offset, or UBRK_DONE.
+ * @see ubrk_following
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_preceding(UBreakIterator *bi,
+ int32_t offset);
+
+/**
+ * Advance the iterator to the first boundary following the specified offset.
+ * The value returned is always greater than offset, or UBRK_DONE.
+ * @param bi The break iterator to use.
+ * @param offset The offset to begin scanning.
+ * @return The text boundary following offset, or UBRK_DONE.
+ * @see ubrk_preceding
+ * @stable ICU 2.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_following(UBreakIterator *bi,
+ int32_t offset);
+
+/**
+* Get a locale for which text breaking information is available.
+* A UBreakIterator in a locale returned by this function will perform the correct
+* text breaking for the locale.
+* @param index The index of the desired locale.
+* @return A locale for which number text breaking information is available, or 0 if none.
+* @see ubrk_countAvailable
+* @stable ICU 2.0
+*/
+U_STABLE const char* U_EXPORT2
+ubrk_getAvailable(int32_t index);
+
+/**
+* Determine how many locales have text breaking information available.
+* This function is most useful as determining the loop ending condition for
+* calls to \ref ubrk_getAvailable.
+* @return The number of locales for which text breaking information is available.
+* @see ubrk_getAvailable
+* @stable ICU 2.0
+*/
+U_STABLE int32_t U_EXPORT2
+ubrk_countAvailable(void);
+
+
+/**
+* Returns true if the specfied position is a boundary position. As a side
+* effect, leaves the iterator pointing to the first boundary position at
+* or after "offset".
+* @param bi The break iterator to use.
+* @param offset the offset to check.
+* @return True if "offset" is a boundary position.
+* @stable ICU 2.0
+*/
+U_STABLE UBool U_EXPORT2
+ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
+
+/**
+ * Return the status from the break rule that determined the most recently
+ * returned break position. The values appear in the rule source
+ * within brackets, {123}, for example. For rules that do not specify a
+ * status, a default value of 0 is returned.
+ * <p>
+ * For word break iterators, the possible values are defined in enum UWordBreak.
+ * @stable ICU 2.2
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_getRuleStatus(UBreakIterator *bi);
+
+/**
+ * Get the statuses from the break rules that determined the most recently
+ * returned break position. The values appear in the rule source
+ * within brackets, {123}, for example. The default status value for rules
+ * that do not explicitly provide one is zero.
+ * <p>
+ * For word break iterators, the possible values are defined in enum UWordBreak.
+ * @param bi The break iterator to use
+ * @param fillInVec an array to be filled in with the status values.
+ * @param capacity the length of the supplied vector. A length of zero causes
+ * the function to return the number of status values, in the
+ * normal way, without attemtping to store any values.
+ * @param status receives error codes.
+ * @return The number of rule status values from rules that determined
+ * the most recent boundary returned by the break iterator.
+ * @stable ICU 3.0
+ */
+U_STABLE int32_t U_EXPORT2
+ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
+
+/**
+ * Return the locale of the break iterator. You can choose between the valid and
+ * the actual locale.
+ * @param bi break iterator
+ * @param type locale type (valid or actual)
+ * @param status error code
+ * @return locale string
+ * @stable ICU 2.8
+ */
+U_STABLE const char* U_EXPORT2
+ubrk_getLocaleByType(const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
+
+/**
+ * Set the subject text string upon which the break iterator is operating
+ * without changing any other aspect of the state.
+ * The new and previous text strings must have the same content.
+ *
+ * This function is intended for use in environments where ICU is operating on
+ * strings that may move around in memory. It provides a mechanism for notifying
+ * ICU that the string has been relocated, and providing a new UText to access the
+ * string in its new position.
+ *
+ * Note that the break iterator never copies the underlying text
+ * of a string being processed, but always operates directly on the original text
+ * provided by the user. Refreshing simply drops the references to the old text
+ * and replaces them with references to the new.
+ *
+ * Caution: this function is normally used only by very specialized
+ * system-level code. One example use case is with garbage collection
+ * that moves the text in memory.
+ *
+ * @param bi The break iterator.
+ * @param text The new (moved) text string.
+ * @param status Receives errors detected by this function.
+ *
+ * @stable ICU 49
+ */
+U_STABLE void U_EXPORT2
+ubrk_refreshUText(UBreakIterator *bi,
+ UText *text,
+ UErrorCode *status);
+
+#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWTFicuunicodeutexth"></a>
<div class="addfile"><h4>Added: trunk/Source/WTF/icu/unicode/utext.h (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/icu/unicode/utext.h         (rev 0)
+++ trunk/Source/WTF/icu/unicode/utext.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,1600 @@
</span><ins>+/*
+*******************************************************************************
+*
+* Copyright (C) 2004-2012, International Business Machines
+* Corporation and others. All Rights Reserved.
+*
+*******************************************************************************
+* file name: utext.h
+* encoding: US-ASCII
+* tab size: 8 (not used)
+* indentation:4
+*
+* created on: 2004oct06
+* created by: Markus W. Scherer
+*/
+
+#ifndef __UTEXT_H__
+#define __UTEXT_H__
+
+/**
+ * \file
+ * \brief C API: Abstract Unicode Text API
+ *
+ * The Text Access API provides a means to allow text that is stored in alternative
+ * formats to work with ICU services. ICU normally operates on text that is
+ * stored in UTF-16 format, in (UChar *) arrays for the C APIs or as type
+ * UnicodeString for C++ APIs.
+ *
+ * ICU Text Access allows other formats, such as UTF-8 or non-contiguous
+ * UTF-16 strings, to be placed in a UText wrapper and then passed to ICU services.
+ *
+ * There are three general classes of usage for UText:
+ *
+ * Application Level Use. This is the simplest usage - applications would
+ * use one of the utext_open() functions on their input text, and pass
+ * the resulting UText to the desired ICU service.
+ *
+ * Second is usage in ICU Services, such as break iteration, that will need to
+ * operate on input presented to them as a UText. These implementations
+ * will need to use the iteration and related UText functions to gain
+ * access to the actual text.
+ *
+ * The third class of UText users are "text providers." These are the
+ * UText implementations for the various text storage formats. An application
+ * or system with a unique text storage format can implement a set of
+ * UText provider functions for that format, which will then allow
+ * ICU services to operate on that format.
+ *
+ *
+ * <em>Iterating over text</em>
+ *
+ * Here is sample code for a forward iteration over the contents of a UText
+ *
+ * \code
+ * UChar32 c;
+ * UText *ut = whatever();
+ *
+ * for (c=utext_next32From(ut, 0); c>=0; c=utext_next32(ut)) {
+ * // do whatever with the codepoint c here.
+ * }
+ * \endcode
+ *
+ * And here is similar code to iterate in the reverse direction, from the end
+ * of the text towards the beginning.
+ *
+ * \code
+ * UChar32 c;
+ * UText *ut = whatever();
+ * int textLength = utext_nativeLength(ut);
+ * for (c=utext_previous32From(ut, textLength); c>=0; c=utext_previous32(ut)) {
+ * // do whatever with the codepoint c here.
+ * }
+ * \endcode
+ *
+ * <em>Characters and Indexing</em>
+ *
+ * Indexing into text by UText functions is nearly always in terms of the native
+ * indexing of the underlying text storage. The storage format could be UTF-8
+ * or UTF-32, for example. When coding to the UText access API, no assumptions
+ * can be made regarding the size of characters, or how far an index
+ * may move when iterating between characters.
+ *
+ * All indices supplied to UText functions are pinned to the length of the
+ * text. An out-of-bounds index is not considered to be an error, but is
+ * adjusted to be in the range 0 <= index <= length of input text.
+ *
+ *
+ * When an index position is returned from a UText function, it will be
+ * a native index to the underlying text. In the case of multi-unit characters,
+ * it will always refer to the first position of the character,
+ * never to the interior. This is essentially the same thing as saying that
+ * a returned index will always point to a boundary between characters.
+ *
+ * When a native index is supplied to a UText function, all indices that
+ * refer to any part of a multi-unit character representation are considered
+ * to be equivalent. In the case of multi-unit characters, an incoming index
+ * will be logically normalized to refer to the start of the character.
+ *
+ * It is possible to test whether a native index is on a code point boundary
+ * by doing a utext_setNativeIndex() followed by a utext_getNativeIndex().
+ * If the index is returned unchanged, it was on a code point boundary. If
+ * an adjusted index is returned, the original index referred to the
+ * interior of a character.
+ *
+ * <em>Conventions for calling UText functions</em>
+ *
+ * Most UText access functions have as their first parameter a (UText *) pointer,
+ * which specifies the UText to be used. Unless otherwise noted, the
+ * pointer must refer to a valid, open UText. Attempting to
+ * use a closed UText or passing a NULL pointer is a programming error and
+ * will produce undefined results or NULL pointer exceptions.
+ *
+ * The UText_Open family of functions can either open an existing (closed)
+ * UText, or heap allocate a new UText. Here is sample code for creating
+ * a stack-allocated UText.
+ *
+ * \code
+ * char *s = whatever(); // A utf-8 string
+ * U_ErrorCode status = U_ZERO_ERROR;
+ * UText ut = UTEXT_INITIALIZER;
+ * utext_openUTF8(ut, s, -1, &status);
+ * if (U_FAILURE(status)) {
+ * // error handling
+ * } else {
+ * // work with the UText
+ * }
+ * \endcode
+ *
+ * Any existing UText passed to an open function _must_ have been initialized,
+ * either by the UTEXT_INITIALIZER, or by having been originally heap-allocated
+ * by an open function. Passing NULL will cause the open function to
+ * heap-allocate and fully initialize a new UText.
+ *
+ */
+
+
+
+#include "unicode/utypes.h"
+#include "unicode/uchar.h"
+#if U_SHOW_CPLUSPLUS_API
+#include "unicode/localpointer.h"
+#include "unicode/rep.h"
+#include "unicode/unistr.h"
+#include "unicode/chariter.h"
+#endif
+
+
+U_CDECL_BEGIN
+
+struct UText;
+typedef struct UText UText; /**< C typedef for struct UText. @stable ICU 3.6 */
+
+
+/***************************************************************************************
+ *
+ * C Functions for creating UText wrappers around various kinds of text strings.
+ *
+ ****************************************************************************************/
+
+
+/**
+ * Close function for UText instances.
+ * Cleans up, releases any resources being held by an open UText.
+ * <p>
+ * If the UText was originally allocated by one of the utext_open functions,
+ * the storage associated with the utext will also be freed.
+ * If the UText storage originated with the application, as it would with
+ * a local or static instance, the storage will not be deleted.
+ *
+ * An open UText can be reset to refer to new string by using one of the utext_open()
+ * functions without first closing the UText.
+ *
+ * @param ut The UText to be closed.
+ * @return NULL if the UText struct was deleted by the close. If the UText struct
+ * was originally provided by the caller to the open function, it is
+ * returned by this function, and may be safely used again in
+ * a subsequent utext_open.
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_close(UText *ut);
+
+#if U_SHOW_CPLUSPLUS_API
+
+U_NAMESPACE_BEGIN
+
+/**
+ * \class LocalUTextPointer
+ * "Smart pointer" class, closes a UText via utext_close().
+ * For most methods see the LocalPointerBase base class.
+ *
+ * @see LocalPointerBase
+ * @see LocalPointer
+ * @stable ICU 4.4
+ */
+U_DEFINE_LOCAL_OPEN_POINTER(LocalUTextPointer, UText, utext_close);
+
+U_NAMESPACE_END
+
+#endif
+
+/**
+ * Open a read-only UText implementation for UTF-8 strings.
+ *
+ * \htmlonly
+ * Any invalid UTF-8 in the input will be handled in this way:
+ * a sequence of bytes that has the form of a truncated, but otherwise valid,
+ * UTF-8 sequence will be replaced by a single unicode replacement character, \uFFFD.
+ * Any other illegal bytes will each be replaced by a \uFFFD.
+ * \endhtmlonly
+ *
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an initialized UText struct, which will then
+ * be reset to reference the specified UTF-8 string.
+ * @param s A UTF-8 string. Must not be NULL.
+ * @param length The length of the UTF-8 string in bytes, or -1 if the string is
+ * zero terminated.
+ * @param status Errors are returned here.
+ * @return A pointer to the UText. If a pre-allocated UText was provided, it
+ * will always be used and returned.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openUTF8(UText *ut, const char *s, int64_t length, UErrorCode *status);
+
+
+/**
+ * Open a read-only UText for UChar * string.
+ *
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an initialized UText struct, which will then
+ * be reset to reference the specified UChar string.
+ * @param s A UChar (UTF-16) string
+ * @param length The number of UChars in the input string, or -1 if the string is
+ * zero terminated.
+ * @param status Errors are returned here.
+ * @return A pointer to the UText. If a pre-allocated UText was provided, it
+ * will always be used and returned.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status);
+
+
+#if U_SHOW_CPLUSPLUS_API
+/**
+ * Open a writable UText for a non-const UnicodeString.
+ *
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an initialized UText struct, which will then
+ * be reset to reference the specified input string.
+ * @param s A UnicodeString.
+ * @param status Errors are returned here.
+ * @return Pointer to the UText. If a UText was supplied as input, this
+ * will always be used and returned.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openUnicodeString(UText *ut, icu::UnicodeString *s, UErrorCode *status);
+
+
+/**
+ * Open a UText for a const UnicodeString. The resulting UText will not be writable.
+ *
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an initialized UText struct, which will then
+ * be reset to reference the specified input string.
+ * @param s A const UnicodeString to be wrapped.
+ * @param status Errors are returned here.
+ * @return Pointer to the UText. If a UText was supplied as input, this
+ * will always be used and returned.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openConstUnicodeString(UText *ut, const icu::UnicodeString *s, UErrorCode *status);
+
+
+/**
+ * Open a writable UText implementation for an ICU Replaceable object.
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an already existing UText, which will then
+ * be reset to reference the specified replaceable text.
+ * @param rep A Replaceable text object.
+ * @param status Errors are returned here.
+ * @return Pointer to the UText. If a UText was supplied as input, this
+ * will always be used and returned.
+ * @see Replaceable
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openReplaceable(UText *ut, icu::Replaceable *rep, UErrorCode *status);
+
+/**
+ * Open a UText implementation over an ICU CharacterIterator.
+ * @param ut Pointer to a UText struct. If NULL, a new UText will be created.
+ * If non-NULL, must refer to an already existing UText, which will then
+ * be reset to reference the specified replaceable text.
+ * @param ci A Character Iterator.
+ * @param status Errors are returned here.
+ * @return Pointer to the UText. If a UText was supplied as input, this
+ * will always be used and returned.
+ * @see Replaceable
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_openCharacterIterator(UText *ut, icu::CharacterIterator *ci, UErrorCode *status);
+
+#endif
+
+
+/**
+ * Clone a UText. This is much like opening a UText where the source text is itself
+ * another UText.
+ *
+ * A deep clone will copy both the UText data structures and the underlying text.
+ * The original and cloned UText will operate completely independently; modifications
+ * made to the text in one will not affect the other. Text providers are not
+ * required to support deep clones. The user of clone() must check the status return
+ * and be prepared to handle failures.
+ *
+ * The standard UText implementations for UTF8, UChar *, UnicodeString and
+ * Replaceable all support deep cloning.
+ *
+ * The UText returned from a deep clone will be writable, assuming that the text
+ * provider is able to support writing, even if the source UText had been made
+ * non-writable by means of UText_freeze().
+ *
+ * A shallow clone replicates only the UText data structures; it does not make
+ * a copy of the underlying text. Shallow clones can be used as an efficient way to
+ * have multiple iterators active in a single text string that is not being
+ * modified.
+ *
+ * A shallow clone operation will not fail, barring truly exceptional conditions such
+ * as memory allocation failures.
+ *
+ * Shallow UText clones should be avoided if the UText functions that modify the
+ * text are expected to be used, either on the original or the cloned UText.
+ * Any such modifications can cause unpredictable behavior. Read Only
+ * shallow clones provide some protection against errors of this type by
+ * disabling text modification via the cloned UText.
+ *
+ * A shallow clone made with the readOnly parameter == FALSE will preserve the
+ * utext_isWritable() state of the source object. Note, however, that
+ * write operations must be avoided while more than one UText exists that refer
+ * to the same underlying text.
+ *
+ * A UText and its clone may be safely concurrently accessed by separate threads.
+ * This is true for read access only with shallow clones, and for both read and
+ * write access with deep clones.
+ * It is the responsibility of the Text Provider to ensure that this thread safety
+ * constraint is met.
+ *
+ * @param dest A UText struct to be filled in with the result of the clone operation,
+ * or NULL if the clone function should heap-allocate a new UText struct.
+ * If non-NULL, must refer to an already existing UText, which will then
+ * be reset to become the clone.
+ * @param src The UText to be cloned.
+ * @param deep TRUE to request a deep clone, FALSE for a shallow clone.
+ * @param readOnly TRUE to request that the cloned UText have read only access to the
+ * underlying text.
+
+ * @param status Errors are returned here. For deep clones, U_UNSUPPORTED_ERROR
+ * will be returned if the text provider is unable to clone the
+ * original text.
+ * @return The newly created clone, or NULL if the clone operation failed.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_clone(UText *dest, const UText *src, UBool deep, UBool readOnly, UErrorCode *status);
+
+
+/**
+ * Compare two UText objects for equality.
+ * UTexts are equal if they are iterating over the same text, and
+ * have the same iteration position within the text.
+ * If either or both of the parameters are NULL, the comparison is FALSE.
+ *
+ * @param a The first of the two UTexts to compare.
+ * @param b The other UText to be compared.
+ * @return TRUE if the two UTexts are equal.
+ * @stable ICU 3.6
+ */
+U_STABLE UBool U_EXPORT2
+utext_equals(const UText *a, const UText *b);
+
+
+/*****************************************************************************
+ *
+ * Functions to work with the text represeted by a UText wrapper
+ *
+ *****************************************************************************/
+
+/**
+ * Get the length of the text. Depending on the characteristics
+ * of the underlying text representation, this may be expensive.
+ * @see utext_isLengthExpensive()
+ *
+ *
+ * @param ut the text to be accessed.
+ * @return the length of the text, expressed in native units.
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE int64_t U_EXPORT2
+utext_nativeLength(UText *ut);
+
+/**
+ * Return TRUE if calculating the length of the text could be expensive.
+ * Finding the length of NUL terminated strings is considered to be expensive.
+ *
+ * Note that the value of this function may change
+ * as the result of other operations on a UText.
+ * Once the length of a string has been discovered, it will no longer
+ * be expensive to report it.
+ *
+ * @param ut the text to be accessed.
+ * @return TRUE if determining the length of the text could be time consuming.
+ * @stable ICU 3.4
+ */
+U_STABLE UBool U_EXPORT2
+utext_isLengthExpensive(const UText *ut);
+
+/**
+ * Returns the code point at the requested index,
+ * or U_SENTINEL (-1) if it is out of bounds.
+ *
+ * If the specified index points to the interior of a multi-unit
+ * character - one of the trail bytes of a UTF-8 sequence, for example -
+ * the complete code point will be returned.
+ *
+ * The iteration position will be set to the start of the returned code point.
+ *
+ * This function is roughly equivalent to the the sequence
+ * utext_setNativeIndex(index);
+ * utext_current32();
+ * (There is a subtle difference if the index is out of bounds by being less than zero -
+ * utext_setNativeIndex(negative value) sets the index to zero, after which utext_current()
+ * will return the char at zero. utext_char32At(negative index), on the other hand, will
+ * return the U_SENTINEL value of -1.)
+ *
+ * @param ut the text to be accessed
+ * @param nativeIndex the native index of the character to be accessed. If the index points
+ * to other than the first unit of a multi-unit character, it will be adjusted
+ * to the start of the character.
+ * @return the code point at the specified index.
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_char32At(UText *ut, int64_t nativeIndex);
+
+
+/**
+ *
+ * Get the code point at the current iteration position,
+ * or U_SENTINEL (-1) if the iteration has reached the end of
+ * the input text.
+ *
+ * @param ut the text to be accessed.
+ * @return the Unicode code point at the current iterator position.
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_current32(UText *ut);
+
+
+/**
+ * Get the code point at the current iteration position of the UText, and
+ * advance the position to the first index following the character.
+ *
+ * If the position is at the end of the text (the index following
+ * the last character, which is also the length of the text),
+ * return U_SENTINEL (-1) and do not advance the index.
+ *
+ * This is a post-increment operation.
+ *
+ * An inline macro version of this function, UTEXT_NEXT32(),
+ * is available for performance critical use.
+ *
+ * @param ut the text to be accessed.
+ * @return the Unicode code point at the iteration position.
+ * @see UTEXT_NEXT32
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_next32(UText *ut);
+
+
+/**
+ * Move the iterator position to the character (code point) whose
+ * index precedes the current position, and return that character.
+ * This is a pre-decrement operation.
+ *
+ * If the initial position is at the start of the text (index of 0)
+ * return U_SENTINEL (-1), and leave the position unchanged.
+ *
+ * An inline macro version of this function, UTEXT_PREVIOUS32(),
+ * is available for performance critical use.
+ *
+ * @param ut the text to be accessed.
+ * @return the previous UChar32 code point, or U_SENTINEL (-1)
+ * if the iteration has reached the start of the text.
+ * @see UTEXT_PREVIOUS32
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_previous32(UText *ut);
+
+
+/**
+ * Set the iteration index and return the code point at that index.
+ * Leave the iteration index at the start of the following code point.
+ *
+ * This function is the most efficient and convenient way to
+ * begin a forward iteration. The results are identical to the those
+ * from the sequence
+ * \code
+ * utext_setIndex();
+ * utext_next32();
+ * \endcode
+ *
+ * @param ut the text to be accessed.
+ * @param nativeIndex Iteration index, in the native units of the text provider.
+ * @return Code point which starts at or before index,
+ * or U_SENTINEL (-1) if it is out of bounds.
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_next32From(UText *ut, int64_t nativeIndex);
+
+
+
+/**
+ * Set the iteration index, and return the code point preceding the
+ * one specified by the initial index. Leave the iteration position
+ * at the start of the returned code point.
+ *
+ * This function is the most efficient and convenient way to
+ * begin a backwards iteration.
+ *
+ * @param ut the text to be accessed.
+ * @param nativeIndex Iteration index in the native units of the text provider.
+ * @return Code point preceding the one at the initial index,
+ * or U_SENTINEL (-1) if it is out of bounds.
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE UChar32 U_EXPORT2
+utext_previous32From(UText *ut, int64_t nativeIndex);
+
+/**
+ * Get the current iterator position, which can range from 0 to
+ * the length of the text.
+ * The position is a native index into the input text, in whatever format it
+ * may have (possibly UTF-8 for example), and may not always be the same as
+ * the corresponding UChar (UTF-16) index.
+ * The returned position will always be aligned to a code point boundary.
+ *
+ * @param ut the text to be accessed.
+ * @return the current index position, in the native units of the text provider.
+ * @stable ICU 3.4
+ */
+U_STABLE int64_t U_EXPORT2
+utext_getNativeIndex(const UText *ut);
+
+/**
+ * Set the current iteration position to the nearest code point
+ * boundary at or preceding the specified index.
+ * The index is in the native units of the original input text.
+ * If the index is out of range, it will be pinned to be within
+ * the range of the input text.
+ * <p>
+ * It will usually be more efficient to begin an iteration
+ * using the functions utext_next32From() or utext_previous32From()
+ * rather than setIndex().
+ * <p>
+ * Moving the index position to an adjacent character is best done
+ * with utext_next32(), utext_previous32() or utext_moveIndex32().
+ * Attempting to do direct arithmetic on the index position is
+ * complicated by the fact that the size (in native units) of a
+ * character depends on the underlying representation of the character
+ * (UTF-8, UTF-16, UTF-32, arbitrary codepage), and is not
+ * easily knowable.
+ *
+ * @param ut the text to be accessed.
+ * @param nativeIndex the native unit index of the new iteration position.
+ * @stable ICU 3.4
+ */
+U_STABLE void U_EXPORT2
+utext_setNativeIndex(UText *ut, int64_t nativeIndex);
+
+/**
+ * Move the iterator postion by delta code points. The number of code points
+ * is a signed number; a negative delta will move the iterator backwards,
+ * towards the start of the text.
+ * <p>
+ * The index is moved by <code>delta</code> code points
+ * forward or backward, but no further backward than to 0 and
+ * no further forward than to utext_nativeLength().
+ * The resulting index value will be in between 0 and length, inclusive.
+ *
+ * @param ut the text to be accessed.
+ * @param delta the signed number of code points to move the iteration position.
+ * @return TRUE if the position could be moved the requested number of positions while
+ * staying within the range [0 - text length].
+ * @stable ICU 3.4
+ */
+U_STABLE UBool U_EXPORT2
+utext_moveIndex32(UText *ut, int32_t delta);
+
+/**
+ * Get the native index of the character preceeding the current position.
+ * If the iteration position is already at the start of the text, zero
+ * is returned.
+ * The value returned is the same as that obtained from the following sequence,
+ * but without the side effect of changing the iteration position.
+ *
+ * \code
+ * UText *ut = whatever;
+ * ...
+ * utext_previous(ut)
+ * utext_getNativeIndex(ut);
+ * \endcode
+ *
+ * This function is most useful during forwards iteration, where it will get the
+ * native index of the character most recently returned from utext_next().
+ *
+ * @param ut the text to be accessed
+ * @return the native index of the character preceeding the current index position,
+ * or zero if the current position is at the start of the text.
+ * @stable ICU 3.6
+ */
+U_STABLE int64_t U_EXPORT2
+utext_getPreviousNativeIndex(UText *ut);
+
+
+/**
+ *
+ * Extract text from a UText into a UChar buffer. The range of text to be extracted
+ * is specified in the native indices of the UText provider. These may not necessarily
+ * be UTF-16 indices.
+ * <p>
+ * The size (number of 16 bit UChars) of the data to be extracted is returned. The
+ * full number of UChars is returned, even when the extracted text is truncated
+ * because the specified buffer size is too small.
+ * <p>
+ * The extracted string will (if you are a user) / must (if you are a text provider)
+ * be NUL-terminated if there is sufficient space in the destination buffer. This
+ * terminating NUL is not included in the returned length.
+ * <p>
+ * The iteration index is left at the position following the last extracted character.
+ *
+ * @param ut the UText from which to extract data.
+ * @param nativeStart the native index of the first character to extract.\
+ * If the specified index is out of range,
+ * it will be pinned to to be within 0 <= index <= textLength
+ * @param nativeLimit the native string index of the position following the last
+ * character to extract. If the specified index is out of range,
+ * it will be pinned to to be within 0 <= index <= textLength.
+ * nativeLimit must be >= nativeStart.
+ * @param dest the UChar (UTF-16) buffer into which the extracted text is placed
+ * @param destCapacity The size, in UChars, of the destination buffer. May be zero
+ * for precomputing the required size.
+ * @param status receives any error status.
+ * U_BUFFER_OVERFLOW_ERROR: the extracted text was truncated because the
+ * buffer was too small. Returns number of UChars for preflighting.
+ * @return Number of UChars in the data to be extracted. Does not include a trailing NUL.
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE int32_t U_EXPORT2
+utext_extract(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ UChar *dest, int32_t destCapacity,
+ UErrorCode *status);
+
+
+
+/************************************************************************************
+ *
+ * #define inline versions of selected performance-critical text access functions
+ * Caution: do not use auto increment++ or decrement-- expressions
+ * as parameters to these macros.
+ *
+ * For most use, where there is no extreme performance constraint, the
+ * normal, non-inline functions are a better choice. The resulting code
+ * will be smaller, and, if the need ever arises, easier to debug.
+ *
+ * These are implemented as #defines rather than real functions
+ * because there is no fully portable way to do inline functions in plain C.
+ *
+ ************************************************************************************/
+
+#ifndef U_HIDE_INTERNAL_API
+/**
+ * inline version of utext_current32(), for performance-critical situations.
+ *
+ * Get the code point at the current iteration position of the UText.
+ * Returns U_SENTINEL (-1) if the position is at the end of the
+ * text.
+ *
+ * @internal ICU 4.4 technology preview
+ */
+#define UTEXT_CURRENT32(ut) \
+ ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
+ ((ut)->chunkContents)[((ut)->chunkOffset)] : utext_current32(ut))
+#endif /* U_HIDE_INTERNAL_API */
+
+/**
+ * inline version of utext_next32(), for performance-critical situations.
+ *
+ * Get the code point at the current iteration position of the UText, and
+ * advance the position to the first index following the character.
+ * This is a post-increment operation.
+ * Returns U_SENTINEL (-1) if the position is at the end of the
+ * text.
+ *
+ * @stable ICU 3.4
+ */
+#define UTEXT_NEXT32(ut) \
+ ((ut)->chunkOffset < (ut)->chunkLength && ((ut)->chunkContents)[(ut)->chunkOffset]<0xd800 ? \
+ ((ut)->chunkContents)[((ut)->chunkOffset)++] : utext_next32(ut))
+
+/**
+ * inline version of utext_previous32(), for performance-critical situations.
+ *
+ * Move the iterator position to the character (code point) whose
+ * index precedes the current position, and return that character.
+ * This is a pre-decrement operation.
+ * Returns U_SENTINEL (-1) if the position is at the start of the text.
+ *
+ * @stable ICU 3.4
+ */
+#define UTEXT_PREVIOUS32(ut) \
+ ((ut)->chunkOffset > 0 && \
+ (ut)->chunkContents[(ut)->chunkOffset-1] < 0xd800 ? \
+ (ut)->chunkContents[--((ut)->chunkOffset)] : utext_previous32(ut))
+
+/**
+ * inline version of utext_getNativeIndex(), for performance-critical situations.
+ *
+ * Get the current iterator position, which can range from 0 to
+ * the length of the text.
+ * The position is a native index into the input text, in whatever format it
+ * may have (possibly UTF-8 for example), and may not always be the same as
+ * the corresponding UChar (UTF-16) index.
+ * The returned position will always be aligned to a code point boundary.
+ *
+ * @stable ICU 3.6
+ */
+#define UTEXT_GETNATIVEINDEX(ut) \
+ ((ut)->chunkOffset <= (ut)->nativeIndexingLimit? \
+ (ut)->chunkNativeStart+(ut)->chunkOffset : \
+ (ut)->pFuncs->mapOffsetToNative(ut))
+
+/**
+ * inline version of utext_setNativeIndex(), for performance-critical situations.
+ *
+ * Set the current iteration position to the nearest code point
+ * boundary at or preceding the specified index.
+ * The index is in the native units of the original input text.
+ * If the index is out of range, it will be pinned to be within
+ * the range of the input text.
+ *
+ * @stable ICU 3.8
+ */
+#define UTEXT_SETNATIVEINDEX(ut, ix) \
+ { int64_t __offset = (ix) - (ut)->chunkNativeStart; \
+ if (__offset>=0 && __offset<=(int64_t)(ut)->nativeIndexingLimit) { \
+ (ut)->chunkOffset=(int32_t)__offset; \
+ } else { \
+ utext_setNativeIndex((ut), (ix)); } }
+
+
+
+/************************************************************************************
+ *
+ * Functions related to writing or modifying the text.
+ * These will work only with modifiable UTexts. Attempting to
+ * modify a read-only UText will return an error status.
+ *
+ ************************************************************************************/
+
+
+/**
+ * Return TRUE if the text can be written (modified) with utext_replace() or
+ * utext_copy(). For the text to be writable, the text provider must
+ * be of a type that supports writing and the UText must not be frozen.
+ *
+ * Attempting to modify text when utext_isWriteable() is FALSE will fail -
+ * the text will not be modified, and an error will be returned from the function
+ * that attempted the modification.
+ *
+ * @param ut the UText to be tested.
+ * @return TRUE if the text is modifiable.
+ *
+ * @see utext_freeze()
+ * @see utext_replace()
+ * @see utext_copy()
+ * @stable ICU 3.4
+ *
+ */
+U_STABLE UBool U_EXPORT2
+utext_isWritable(const UText *ut);
+
+
+/**
+ * Test whether there is meta data associated with the text.
+ * @see Replaceable::hasMetaData()
+ *
+ * @param ut The UText to be tested
+ * @return TRUE if the underlying text includes meta data.
+ * @stable ICU 3.4
+ */
+U_STABLE UBool U_EXPORT2
+utext_hasMetaData(const UText *ut);
+
+
+/**
+ * Replace a range of the original text with a replacement text.
+ *
+ * Leaves the current iteration position at the position following the
+ * newly inserted replacement text.
+ *
+ * This function is only available on UText types that support writing,
+ * that is, ones where utext_isWritable() returns TRUE.
+ *
+ * When using this function, there should be only a single UText opened onto the
+ * underlying native text string. Behavior after a replace operation
+ * on a UText is undefined for any other additional UTexts that refer to the
+ * modified string.
+ *
+ * @param ut the UText representing the text to be operated on.
+ * @param nativeStart the native index of the start of the region to be replaced
+ * @param nativeLimit the native index of the character following the region to be replaced.
+ * @param replacementText pointer to the replacement text
+ * @param replacementLength length of the replacement text, or -1 if the text is NUL terminated.
+ * @param status receives any error status. Possible errors include
+ * U_NO_WRITE_PERMISSION
+ *
+ * @return The signed number of (native) storage units by which
+ * the length of the text expanded or contracted.
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE int32_t U_EXPORT2
+utext_replace(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ const UChar *replacementText, int32_t replacementLength,
+ UErrorCode *status);
+
+
+
+/**
+ *
+ * Copy or move a substring from one position to another within the text,
+ * while retaining any metadata associated with the text.
+ * This function is used to duplicate or reorder substrings.
+ * The destination index must not overlap the source range.
+ *
+ * The text to be copied or moved is inserted at destIndex;
+ * it does not replace or overwrite any existing text.
+ *
+ * The iteration position is left following the newly inserted text
+ * at the destination position.
+ *
+ * This function is only available on UText types that support writing,
+ * that is, ones where utext_isWritable() returns TRUE.
+ *
+ * When using this function, there should be only a single UText opened onto the
+ * underlying native text string. Behavior after a copy operation
+ * on a UText is undefined in any other additional UTexts that refer to the
+ * modified string.
+ *
+ * @param ut The UText representing the text to be operated on.
+ * @param nativeStart The native index of the start of the region to be copied or moved
+ * @param nativeLimit The native index of the character position following the region
+ * to be copied.
+ * @param destIndex The native destination index to which the source substring is
+ * copied or moved.
+ * @param move If TRUE, then the substring is moved, not copied/duplicated.
+ * @param status receives any error status. Possible errors include U_NO_WRITE_PERMISSION
+ *
+ * @stable ICU 3.4
+ */
+U_STABLE void U_EXPORT2
+utext_copy(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ int64_t destIndex,
+ UBool move,
+ UErrorCode *status);
+
+
+/**
+ * <p>
+ * Freeze a UText. This prevents any modification to the underlying text itself
+ * by means of functions operating on this UText.
+ * </p>
+ * <p>
+ * Once frozen, a UText can not be unfrozen. The intent is to ensure
+ * that a the text underlying a frozen UText wrapper cannot be modified via that UText.
+ * </p>
+ * <p>
+ * Caution: freezing a UText will disable changes made via the specific
+ * frozen UText wrapper only; it will not have any effect on the ability to
+ * directly modify the text by bypassing the UText. Any such backdoor modifications
+ * are always an error while UText access is occuring because the underlying
+ * text can get out of sync with UText's buffering.
+ * </p>
+ *
+ * @param ut The UText to be frozen.
+ * @see utext_isWritable()
+ * @stable ICU 3.6
+ */
+U_STABLE void U_EXPORT2
+utext_freeze(UText *ut);
+
+
+/**
+ * UText provider properties (bit field indexes).
+ *
+ * @see UText
+ * @stable ICU 3.4
+ */
+enum {
+ /**
+ * It is potentially time consuming for the provider to determine the length of the text.
+ * @stable ICU 3.4
+ */
+ UTEXT_PROVIDER_LENGTH_IS_EXPENSIVE = 1,
+ /**
+ * Text chunks remain valid and usable until the text object is modified or
+ * deleted, not just until the next time the access() function is called
+ * (which is the default).
+ * @stable ICU 3.4
+ */
+ UTEXT_PROVIDER_STABLE_CHUNKS = 2,
+ /**
+ * The provider supports modifying the text via the replace() and copy()
+ * functions.
+ * @see Replaceable
+ * @stable ICU 3.4
+ */
+ UTEXT_PROVIDER_WRITABLE = 3,
+ /**
+ * There is meta data associated with the text.
+ * @see Replaceable::hasMetaData()
+ * @stable ICU 3.4
+ */
+ UTEXT_PROVIDER_HAS_META_DATA = 4,
+ /**
+ * Text provider owns the text storage.
+ * Generally occurs as the result of a deep clone of the UText.
+ * When closing the UText, the associated text must
+ * also be closed/deleted/freed/ whatever is appropriate.
+ * @stable ICU 3.6
+ */
+ UTEXT_PROVIDER_OWNS_TEXT = 5
+};
+
+/**
+ * Function type declaration for UText.clone().
+ *
+ * clone a UText. Much like opening a UText where the source text is itself
+ * another UText.
+ *
+ * A deep clone will copy both the UText data structures and the underlying text.
+ * The original and cloned UText will operate completely independently; modifications
+ * made to the text in one will not effect the other. Text providers are not
+ * required to support deep clones. The user of clone() must check the status return
+ * and be prepared to handle failures.
+ *
+ * A shallow clone replicates only the UText data structures; it does not make
+ * a copy of the underlying text. Shallow clones can be used as an efficient way to
+ * have multiple iterators active in a single text string that is not being
+ * modified.
+ *
+ * A shallow clone operation must not fail except for truly exceptional conditions such
+ * as memory allocation failures.
+ *
+ * A UText and its clone may be safely concurrently accessed by separate threads.
+ * This is true for both shallow and deep clones.
+ * It is the responsibility of the Text Provider to ensure that this thread safety
+ * constraint is met.
+
+ *
+ * @param dest A UText struct to be filled in with the result of the clone operation,
+ * or NULL if the clone function should heap-allocate a new UText struct.
+ * @param src The UText to be cloned.
+ * @param deep TRUE to request a deep clone, FALSE for a shallow clone.
+ * @param status Errors are returned here. For deep clones, U_UNSUPPORTED_ERROR
+ * should be returned if the text provider is unable to clone the
+ * original text.
+ * @return The newly created clone, or NULL if the clone operation failed.
+ *
+ * @stable ICU 3.4
+ */
+typedef UText * U_CALLCONV
+UTextClone(UText *dest, const UText *src, UBool deep, UErrorCode *status);
+
+
+/**
+ * Function type declaration for UText.nativeLength().
+ *
+ * @param ut the UText to get the length of.
+ * @return the length, in the native units of the original text string.
+ * @see UText
+ * @stable ICU 3.4
+ */
+typedef int64_t U_CALLCONV
+UTextNativeLength(UText *ut);
+
+/**
+ * Function type declaration for UText.access(). Get the description of the text chunk
+ * containing the text at a requested native index. The UText's iteration
+ * position will be left at the requested index. If the index is out
+ * of bounds, the iteration position will be left at the start or end
+ * of the string, as appropriate.
+ *
+ * Chunks must begin and end on code point boundaries. A single code point
+ * comprised of multiple storage units must never span a chunk boundary.
+ *
+ *
+ * @param ut the UText being accessed.
+ * @param nativeIndex Requested index of the text to be accessed.
+ * @param forward If TRUE, then the returned chunk must contain text
+ * starting from the index, so that start<=index<limit.
+ * If FALSE, then the returned chunk must contain text
+ * before the index, so that start<index<=limit.
+ * @return True if the requested index could be accessed. The chunk
+ * will contain the requested text.
+ * False value if a chunk cannot be accessed
+ * (the requested index is out of bounds).
+ *
+ * @see UText
+ * @stable ICU 3.4
+ */
+typedef UBool U_CALLCONV
+UTextAccess(UText *ut, int64_t nativeIndex, UBool forward);
+
+/**
+ * Function type declaration for UText.extract().
+ *
+ * Extract text from a UText into a UChar buffer. The range of text to be extracted
+ * is specified in the native indices of the UText provider. These may not necessarily
+ * be UTF-16 indices.
+ * <p>
+ * The size (number of 16 bit UChars) in the data to be extracted is returned. The
+ * full amount is returned, even when the specified buffer size is smaller.
+ * <p>
+ * The extracted string will (if you are a user) / must (if you are a text provider)
+ * be NUL-terminated if there is sufficient space in the destination buffer.
+ *
+ * @param ut the UText from which to extract data.
+ * @param nativeStart the native index of the first characer to extract.
+ * @param nativeLimit the native string index of the position following the last
+ * character to extract.
+ * @param dest the UChar (UTF-16) buffer into which the extracted text is placed
+ * @param destCapacity The size, in UChars, of the destination buffer. May be zero
+ * for precomputing the required size.
+ * @param status receives any error status.
+ * If U_BUFFER_OVERFLOW_ERROR: Returns number of UChars for
+ * preflighting.
+ * @return Number of UChars in the data. Does not include a trailing NUL.
+ *
+ * @stable ICU 3.4
+ */
+typedef int32_t U_CALLCONV
+UTextExtract(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ UChar *dest, int32_t destCapacity,
+ UErrorCode *status);
+
+/**
+ * Function type declaration for UText.replace().
+ *
+ * Replace a range of the original text with a replacement text.
+ *
+ * Leaves the current iteration position at the position following the
+ * newly inserted replacement text.
+ *
+ * This function need only be implemented on UText types that support writing.
+ *
+ * When using this function, there should be only a single UText opened onto the
+ * underlying native text string. The function is responsible for updating the
+ * text chunk within the UText to reflect the updated iteration position,
+ * taking into account any changes to the underlying string's structure caused
+ * by the replace operation.
+ *
+ * @param ut the UText representing the text to be operated on.
+ * @param nativeStart the index of the start of the region to be replaced
+ * @param nativeLimit the index of the character following the region to be replaced.
+ * @param replacementText pointer to the replacement text
+ * @param replacmentLength length of the replacement text in UChars, or -1 if the text is NUL terminated.
+ * @param status receives any error status. Possible errors include
+ * U_NO_WRITE_PERMISSION
+ *
+ * @return The signed number of (native) storage units by which
+ * the length of the text expanded or contracted.
+ *
+ * @stable ICU 3.4
+ */
+typedef int32_t U_CALLCONV
+UTextReplace(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ const UChar *replacementText, int32_t replacmentLength,
+ UErrorCode *status);
+
+/**
+ * Function type declaration for UText.copy().
+ *
+ * Copy or move a substring from one position to another within the text,
+ * while retaining any metadata associated with the text.
+ * This function is used to duplicate or reorder substrings.
+ * The destination index must not overlap the source range.
+ *
+ * The text to be copied or moved is inserted at destIndex;
+ * it does not replace or overwrite any existing text.
+ *
+ * This function need only be implemented for UText types that support writing.
+ *
+ * When using this function, there should be only a single UText opened onto the
+ * underlying native text string. The function is responsible for updating the
+ * text chunk within the UText to reflect the updated iteration position,
+ * taking into account any changes to the underlying string's structure caused
+ * by the replace operation.
+ *
+ * @param ut The UText representing the text to be operated on.
+ * @param nativeStart The index of the start of the region to be copied or moved
+ * @param nativeLimit The index of the character following the region to be replaced.
+ * @param nativeDest The destination index to which the source substring is copied or moved.
+ * @param move If TRUE, then the substring is moved, not copied/duplicated.
+ * @param status receives any error status. Possible errors include U_NO_WRITE_PERMISSION
+ *
+ * @stable ICU 3.4
+ */
+typedef void U_CALLCONV
+UTextCopy(UText *ut,
+ int64_t nativeStart, int64_t nativeLimit,
+ int64_t nativeDest,
+ UBool move,
+ UErrorCode *status);
+
+/**
+ * Function type declaration for UText.mapOffsetToNative().
+ * Map from the current UChar offset within the current text chunk to
+ * the corresponding native index in the original source text.
+ *
+ * This is required only for text providers that do not use native UTF-16 indexes.
+ *
+ * @param ut the UText.
+ * @return Absolute (native) index corresponding to chunkOffset in the current chunk.
+ * The returned native index should always be to a code point boundary.
+ *
+ * @stable ICU 3.4
+ */
+typedef int64_t U_CALLCONV
+UTextMapOffsetToNative(const UText *ut);
+
+/**
+ * Function type declaration for UText.mapIndexToUTF16().
+ * Map from a native index to a UChar offset within a text chunk.
+ * Behavior is undefined if the native index does not fall within the
+ * current chunk.
+ *
+ * This function is required only for text providers that do not use native UTF-16 indexes.
+ *
+ * @param ut The UText containing the text chunk.
+ * @param nativeIndex Absolute (native) text index, chunk->start<=index<=chunk->limit.
+ * @return Chunk-relative UTF-16 offset corresponding to the specified native
+ * index.
+ *
+ * @stable ICU 3.4
+ */
+typedef int32_t U_CALLCONV
+UTextMapNativeIndexToUTF16(const UText *ut, int64_t nativeIndex);
+
+
+/**
+ * Function type declaration for UText.utextClose().
+ *
+ * A Text Provider close function is only required for provider types that make
+ * allocations in their open function (or other functions) that must be
+ * cleaned when the UText is closed.
+ *
+ * The allocation of the UText struct itself and any "extra" storage
+ * associated with the UText is handled by the common UText implementation
+ * and does not require provider specific cleanup in a close function.
+ *
+ * Most UText provider implementations do not need to implement this function.
+ *
+ * @param ut A UText object to be closed.
+ *
+ * @stable ICU 3.4
+ */
+typedef void U_CALLCONV
+UTextClose(UText *ut);
+
+
+/**
+ * (public) Function dispatch table for UText.
+ * Conceptually very much like a C++ Virtual Function Table.
+ * This struct defines the organization of the table.
+ * Each text provider implementation must provide an
+ * actual table that is initialized with the appropriate functions
+ * for the type of text being handled.
+ * @stable ICU 3.6
+ */
+struct UTextFuncs {
+ /**
+ * (public) Function table size, sizeof(UTextFuncs)
+ * Intended for use should the table grow to accomodate added
+ * functions in the future, to allow tests for older format
+ * function tables that do not contain the extensions.
+ *
+ * Fields are placed for optimal alignment on
+ * 32/64/128-bit-pointer machines, by normally grouping together
+ * 4 32-bit fields,
+ * 4 pointers,
+ * 2 64-bit fields
+ * in sequence.
+ * @stable ICU 3.6
+ */
+ int32_t tableSize;
+
+ /**
+ * (private) Alignment padding.
+ * Do not use, reserved for use by the UText framework only.
+ * @internal
+ */
+ int32_t reserved1, /** @internal */ reserved2, /** @internal */ reserved3;
+
+
+ /**
+ * (public) Function pointer for UTextClone
+ *
+ * @see UTextClone
+ * @stable ICU 3.6
+ */
+ UTextClone *clone;
+
+ /**
+ * (public) function pointer for UTextLength
+ * May be expensive to compute!
+ *
+ * @see UTextLength
+ * @stable ICU 3.6
+ */
+ UTextNativeLength *nativeLength;
+
+ /**
+ * (public) Function pointer for UTextAccess.
+ *
+ * @see UTextAccess
+ * @stable ICU 3.6
+ */
+ UTextAccess *access;
+
+ /**
+ * (public) Function pointer for UTextExtract.
+ *
+ * @see UTextExtract
+ * @stable ICU 3.6
+ */
+ UTextExtract *extract;
+
+ /**
+ * (public) Function pointer for UTextReplace.
+ *
+ * @see UTextReplace
+ * @stable ICU 3.6
+ */
+ UTextReplace *replace;
+
+ /**
+ * (public) Function pointer for UTextCopy.
+ *
+ * @see UTextCopy
+ * @stable ICU 3.6
+ */
+ UTextCopy *copy;
+
+ /**
+ * (public) Function pointer for UTextMapOffsetToNative.
+ *
+ * @see UTextMapOffsetToNative
+ * @stable ICU 3.6
+ */
+ UTextMapOffsetToNative *mapOffsetToNative;
+
+ /**
+ * (public) Function pointer for UTextMapNativeIndexToUTF16.
+ *
+ * @see UTextMapNativeIndexToUTF16
+ * @stable ICU 3.6
+ */
+ UTextMapNativeIndexToUTF16 *mapNativeIndexToUTF16;
+
+ /**
+ * (public) Function pointer for UTextClose.
+ *
+ * @see UTextClose
+ * @stable ICU 3.6
+ */
+ UTextClose *close;
+
+ /**
+ * (private) Spare function pointer
+ * @internal
+ */
+ UTextClose *spare1;
+
+ /**
+ * (private) Spare function pointer
+ * @internal
+ */
+ UTextClose *spare2;
+
+ /**
+ * (private) Spare function pointer
+ * @internal
+ */
+ UTextClose *spare3;
+
+};
+/**
+ * Function dispatch table for UText
+ * @see UTextFuncs
+ */
+typedef struct UTextFuncs UTextFuncs;
+
+ /**
+ * UText struct. Provides the interface between the generic UText access code
+ * and the UText provider code that works on specific kinds of
+ * text (UTF-8, noncontiguous UTF-16, whatever.)
+ *
+ * Applications that are using predefined types of text providers
+ * to pass text data to ICU services will have no need to view the
+ * internals of the UText structs that they open.
+ *
+ * @stable ICU 3.6
+ */
+struct UText {
+ /**
+ * (private) Magic. Used to help detect when UText functions are handed
+ * invalid or unitialized UText structs.
+ * utext_openXYZ() functions take an initialized,
+ * but not necessarily open, UText struct as an
+ * optional fill-in parameter. This magic field
+ * is used to check for that initialization.
+ * Text provider close functions must NOT clear
+ * the magic field because that would prevent
+ * reuse of the UText struct.
+ * @internal
+ */
+ uint32_t magic;
+
+
+ /**
+ * (private) Flags for managing the allocation and freeing of
+ * memory associated with this UText.
+ * @internal
+ */
+ int32_t flags;
+
+
+ /**
+ * Text provider properties. This set of flags is maintainted by the
+ * text provider implementation.
+ * @stable ICU 3.4
+ */
+ int32_t providerProperties;
+
+ /**
+ * (public) sizeOfStruct=sizeof(UText)
+ * Allows possible backward compatible extension.
+ *
+ * @stable ICU 3.4
+ */
+ int32_t sizeOfStruct;
+
+ /* ------ 16 byte alignment boundary ----------- */
+
+
+ /**
+ * (protected) Native index of the first character position following
+ * the current chunk.
+ * @stable ICU 3.6
+ */
+ int64_t chunkNativeLimit;
+
+ /**
+ * (protected) Size in bytes of the extra space (pExtra).
+ * @stable ICU 3.4
+ */
+ int32_t extraSize;
+
+ /**
+ * (protected) The highest chunk offset where native indexing and
+ * chunk (UTF-16) indexing correspond. For UTF-16 sources, value
+ * will be equal to chunkLength.
+ *
+ * @stable ICU 3.6
+ */
+ int32_t nativeIndexingLimit;
+
+ /* ---- 16 byte alignment boundary------ */
+
+ /**
+ * (protected) Native index of the first character in the text chunk.
+ * @stable ICU 3.6
+ */
+ int64_t chunkNativeStart;
+
+ /**
+ * (protected) Current iteration position within the text chunk (UTF-16 buffer).
+ * This is the index to the character that will be returned by utext_next32().
+ * @stable ICU 3.6
+ */
+ int32_t chunkOffset;
+
+ /**
+ * (protected) Length the text chunk (UTF-16 buffer), in UChars.
+ * @stable ICU 3.6
+ */
+ int32_t chunkLength;
+
+ /* ---- 16 byte alignment boundary-- */
+
+
+ /**
+ * (protected) pointer to a chunk of text in UTF-16 format.
+ * May refer either to original storage of the source of the text, or
+ * if conversion was required, to a buffer owned by the UText.
+ * @stable ICU 3.6
+ */
+ const UChar *chunkContents;
+
+ /**
+ * (public) Pointer to Dispatch table for accessing functions for this UText.
+ * @stable ICU 3.6
+ */
+ const UTextFuncs *pFuncs;
+
+ /**
+ * (protected) Pointer to additional space requested by the
+ * text provider during the utext_open operation.
+ * @stable ICU 3.4
+ */
+ void *pExtra;
+
+ /**
+ * (protected) Pointer to string or text-containin object or similar.
+ * This is the source of the text that this UText is wrapping, in a format
+ * that is known to the text provider functions.
+ * @stable ICU 3.4
+ */
+ const void *context;
+
+ /* --- 16 byte alignment boundary--- */
+
+ /**
+ * (protected) Pointer fields available for use by the text provider.
+ * Not used by UText common code.
+ * @stable ICU 3.6
+ */
+ const void *p;
+ /**
+ * (protected) Pointer fields available for use by the text provider.
+ * Not used by UText common code.
+ * @stable ICU 3.6
+ */
+ const void *q;
+ /**
+ * (protected) Pointer fields available for use by the text provider.
+ * Not used by UText common code.
+ * @stable ICU 3.6
+ */
+ const void *r;
+
+ /**
+ * Private field reserved for future use by the UText framework
+ * itself. This is not to be touched by the text providers.
+ * @internal ICU 3.4
+ */
+ void *privP;
+
+
+ /* --- 16 byte alignment boundary--- */
+
+
+ /**
+ * (protected) Integer field reserved for use by the text provider.
+ * Not used by the UText framework, or by the client (user) of the UText.
+ * @stable ICU 3.4
+ */
+ int64_t a;
+
+ /**
+ * (protected) Integer field reserved for use by the text provider.
+ * Not used by the UText framework, or by the client (user) of the UText.
+ * @stable ICU 3.4
+ */
+ int32_t b;
+
+ /**
+ * (protected) Integer field reserved for use by the text provider.
+ * Not used by the UText framework, or by the client (user) of the UText.
+ * @stable ICU 3.4
+ */
+ int32_t c;
+
+ /* ---- 16 byte alignment boundary---- */
+
+
+ /**
+ * Private field reserved for future use by the UText framework
+ * itself. This is not to be touched by the text providers.
+ * @internal ICU 3.4
+ */
+ int64_t privA;
+ /**
+ * Private field reserved for future use by the UText framework
+ * itself. This is not to be touched by the text providers.
+ * @internal ICU 3.4
+ */
+ int32_t privB;
+ /**
+ * Private field reserved for future use by the UText framework
+ * itself. This is not to be touched by the text providers.
+ * @internal ICU 3.4
+ */
+ int32_t privC;
+};
+
+
+/**
+ * Common function for use by Text Provider implementations to allocate and/or initialize
+ * a new UText struct. To be called in the implementation of utext_open() functions.
+ * If the supplied UText parameter is null, a new UText struct will be allocated on the heap.
+ * If the supplied UText is already open, the provider's close function will be called
+ * so that the struct can be reused by the open that is in progress.
+ *
+ * @param ut pointer to a UText struct to be re-used, or null if a new UText
+ * should be allocated.
+ * @param extraSpace The amount of additional space to be allocated as part
+ * of this UText, for use by types of providers that require
+ * additional storage.
+ * @param status Errors are returned here.
+ * @return pointer to the UText, allocated if necessary, with extra space set up if requested.
+ * @stable ICU 3.4
+ */
+U_STABLE UText * U_EXPORT2
+utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status);
+
+#ifndef U_HIDE_INTERNAL_API
+/**
+ * @internal
+ * Value used to help identify correctly initialized UText structs.
+ * Note: must be publicly visible so that UTEXT_INITIALIZER can access it.
+ */
+enum {
+ UTEXT_MAGIC = 0x345ad82c
+};
+#endif /* U_HIDE_INTERNAL_API */
+
+/**
+ * initializer to be used with local (stack) instances of a UText
+ * struct. UText structs must be initialized before passing
+ * them to one of the utext_open functions.
+ *
+ * @stable ICU 3.6
+ */
+#define UTEXT_INITIALIZER { \
+ UTEXT_MAGIC, /* magic */ \
+ 0, /* flags */ \
+ 0, /* providerProps */ \
+ sizeof(UText), /* sizeOfStruct */ \
+ 0, /* chunkNativeLimit */ \
+ 0, /* extraSize */ \
+ 0, /* nativeIndexingLimit */ \
+ 0, /* chunkNativeStart */ \
+ 0, /* chunkOffset */ \
+ 0, /* chunkLength */ \
+ NULL, /* chunkContents */ \
+ NULL, /* pFuncs */ \
+ NULL, /* pExtra */ \
+ NULL, /* context */ \
+ NULL, NULL, NULL, /* p, q, r */ \
+ NULL, /* privP */ \
+ 0, 0, 0, /* a, b, c */ \
+ 0, 0, 0 /* privA,B,C, */ \
+ }
+
+
+U_CDECL_END
+
+
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CMakeLists.txt (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CMakeLists.txt        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/CMakeLists.txt        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -140,6 +140,7 @@
</span><span class="cx"> text/CString.h
</span><span class="cx"> text/IntegerToStringConversion.h
</span><span class="cx"> text/LChar.h
</span><ins>+ text/LineBreakIteratorPoolICU.h
</ins><span class="cx"> text/StringBuffer.h
</span><span class="cx"> text/StringCommon.h
</span><span class="cx"> text/StringHash.h
</span><span class="lines">@@ -147,9 +148,15 @@
</span><span class="cx"> text/StringView.h
</span><span class="cx"> text/SymbolImpl.h
</span><span class="cx"> text/SymbolRegistry.h
</span><ins>+ text/TextBreakIterator.h
+ text/TextBreakIteratorInternalICU.h
</ins><span class="cx"> text/UniquedStringImpl.h
</span><span class="cx"> text/WTFString.h
</span><span class="cx">
</span><ins>+ text/icu/UTextProvider.h
+ text/icu/UTextProviderLatin1.h
+ text/icu/UTextProviderUTF16.h
+
</ins><span class="cx"> threads/BinarySemaphore.h
</span><span class="cx">
</span><span class="cx"> unicode/CharacterNames.h
</span><span class="lines">@@ -221,8 +228,13 @@
</span><span class="cx"> text/StringStatics.cpp
</span><span class="cx"> text/StringView.cpp
</span><span class="cx"> text/SymbolRegistry.cpp
</span><ins>+ text/TextBreakIterator.cpp
</ins><span class="cx"> text/WTFString.cpp
</span><span class="cx">
</span><ins>+ text/icu/UTextProvider.cpp
+ text/icu/UTextProviderLatin1.cpp
+ text/icu/UTextProviderUTF16.cpp
+
</ins><span class="cx"> threads/BinarySemaphore.cpp
</span><span class="cx">
</span><span class="cx"> unicode/UTF8.cpp
</span><span class="lines">@@ -234,6 +246,7 @@
</span><span class="cx"> "${WTF_DIR}/wtf"
</span><span class="cx"> "${WTF_DIR}/wtf/dtoa"
</span><span class="cx"> "${WTF_DIR}/wtf/text"
</span><ins>+ "${WTF_DIR}/wtf/text/icu"
</ins><span class="cx"> "${WTF_DIR}/wtf/threads"
</span><span class="cx"> "${WTF_DIR}/wtf/unicode"
</span><span class="cx"> "${THIRDPARTY_DIR}"
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformEfl.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformEfl.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/PlatformEfl.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,6 +1,8 @@
</span><span class="cx"> list(APPEND WTF_SOURCES
</span><span class="cx"> PlatformUserPreferredLanguagesUnix.cpp
</span><span class="cx">
</span><ins>+ text/efl/TextBreakIteratorInternalICUEfl.cpp
+
</ins><span class="cx"> efl/DispatchQueueEfl.cpp
</span><span class="cx"> efl/MainThreadEfl.cpp
</span><span class="cx"> efl/RunLoopEfl.cpp
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformGTK.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformGTK.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/PlatformGTK.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -8,6 +8,8 @@
</span><span class="cx"> glib/MainThreadGLib.cpp
</span><span class="cx"> glib/RunLoopGLib.cpp
</span><span class="cx"> PlatformUserPreferredLanguagesUnix.cpp
</span><ins>+
+ text/gtk/TextBreakIteratorInternalICUGtk.cpp
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> list(APPEND WTF_LIBRARIES
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformMac.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformMac.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/PlatformMac.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -18,6 +18,8 @@
</span><span class="cx"> SchedulePairCF.cpp
</span><span class="cx"> SchedulePairMac.mm
</span><span class="cx">
</span><ins>+ text/mac/TextBreakIteratorInternalICUMac.mm
+
</ins><span class="cx"> cf/RunLoopCF.cpp
</span><span class="cx">
</span><span class="cx"> cocoa/WorkQueueCocoa.cpp
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformWin.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformWin.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/PlatformWin.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,6 +1,8 @@
</span><span class="cx"> list(APPEND WTF_SOURCES
</span><del>- PLatformUserPreferredLanguagesWin.cpp
</del><ins>+ PlatformUserPreferredLanguagesWin.cpp
</ins><span class="cx">
</span><ins>+ text/win/TextBreakIteratorInternalICUWin.cpp
+
</ins><span class="cx"> text/cf/AtomicStringImplCF.cpp
</span><span class="cx"> text/cf/StringCF.cpp
</span><span class="cx"> text/cf/StringImplCF.cpp
</span></span></pre></div>
<a id="trunkSourceWTFwtfTinyLRUCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/TinyLRUCache.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/TinyLRUCache.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WTF/wtf/TinyLRUCache.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-namespace WebCore {
</del><ins>+namespace WTF {
</ins><span class="cx">
</span><span class="cx"> template<typename KeyType, typename ValueType>
</span><span class="cx"> struct TinyLRUCachePolicy {
</span><span class="lines">@@ -78,4 +78,7 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+using WTF::TinyLRUCache;
+using WTF::TinyLRUCachePolicy;
+
</ins><span class="cx"> #endif // TinyLRUCache_h
</span></span></pre></div>
<a id="trunkSourceWTFwtftextLineBreakIteratorPoolICUhfromrev203037trunkSourceWebCoreplatformtextLineBreakIteratorPoolICUh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h (from rev 203037, trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,127 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LineBreakIteratorPoolICU_h
+#define LineBreakIteratorPoolICU_h
+
+#include "TextBreakIterator.h"
+#include "TextBreakIteratorInternalICU.h"
+#include <unicode/ubrk.h>
+#include <wtf/Assertions.h>
+#include <wtf/HashMap.h>
+#include <wtf/ThreadSpecific.h>
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringBuilder.h>
+
+namespace WTF {
+
+class LineBreakIteratorPool {
+ WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool);
+public:
+ LineBreakIteratorPool() { }
+
+ static LineBreakIteratorPool& sharedPool()
+ {
+ static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::ThreadSpecific<LineBreakIteratorPool>;
+ return **pool;
+ }
+
+ static String makeLocaleWithBreakKeyword(const AtomicString& locale, LineBreakIteratorMode mode)
+ {
+ StringBuilder localeWithKeyword;
+ localeWithKeyword.append(locale);
+ localeWithKeyword.appendLiteral("@break=");
+ switch (mode) {
+ case LineBreakIteratorModeUAX14:
+ ASSERT_NOT_REACHED();
+ break;
+ case LineBreakIteratorModeUAX14Loose:
+ localeWithKeyword.appendLiteral("loose");
+ break;
+ case LineBreakIteratorModeUAX14Normal:
+ localeWithKeyword.appendLiteral("normal");
+ break;
+ case LineBreakIteratorModeUAX14Strict:
+ localeWithKeyword.appendLiteral("strict");
+ break;
+ }
+ return localeWithKeyword.toString();
+ }
+
+ TextBreakIterator* take(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
+ {
+ AtomicString localeWithOptionalBreakKeyword;
+ if (mode == LineBreakIteratorModeUAX14)
+ localeWithOptionalBreakKeyword = locale;
+ else
+ localeWithOptionalBreakKeyword = makeLocaleWithBreakKeyword(locale, mode);
+
+ TextBreakIterator* iterator = 0;
+ for (size_t i = 0; i < m_pool.size(); ++i) {
+ if (m_pool[i].first == localeWithOptionalBreakKeyword) {
+ iterator = m_pool[i].second;
+ m_pool.remove(i);
+ break;
+ }
+ }
+
+ if (!iterator) {
+ iterator = openLineBreakIterator(localeWithOptionalBreakKeyword, mode, isCJK);
+ if (!iterator)
+ return 0;
+ }
+
+ ASSERT(!m_vendedIterators.contains(iterator));
+ m_vendedIterators.set(iterator, localeWithOptionalBreakKeyword);
+ return iterator;
+ }
+
+ void put(TextBreakIterator* iterator)
+ {
+ ASSERT_ARG(iterator, m_vendedIterators.contains(iterator));
+
+ if (m_pool.size() == capacity) {
+ closeLineBreakIterator(m_pool[0].second);
+ m_pool.remove(0);
+ }
+
+ m_pool.append(Entry(m_vendedIterators.take(iterator), iterator));
+ }
+
+private:
+ static const size_t capacity = 4;
+
+ typedef std::pair<AtomicString, TextBreakIterator*> Entry;
+ typedef Vector<Entry, capacity> Pool;
+ Pool m_pool;
+ HashMap<TextBreakIterator*, AtomicString> m_vendedIterators;
+
+ friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIteratorPool*();
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextTextBreakIteratorcppfromrev203037trunkSourceWebCoreplatformtextTextBreakIteratorcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/TextBreakIterator.cpp (from rev 203037, trunk/Source/WebCore/platform/text/TextBreakIterator.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextBreakIterator.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/TextBreakIterator.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,929 @@
</span><ins>+/*
+ * (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TextBreakIterator.h"
+
+#include "LineBreakIteratorPoolICU.h"
+#include "UTextProviderLatin1.h"
+#include "UTextProviderUTF16.h"
+#include <mutex>
+#include <wtf/Atomics.h>
+#include <wtf/text/StringView.h>
+
+// FIXME: This needs a better name
+#define ADDITIONAL_EMOJI_SUPPORT (PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100))
+
+namespace WTF {
+
+// Iterator initialization
+
+static TextBreakIterator* initializeIterator(UBreakIteratorType type, const char* locale = currentTextBreakLocaleID())
+{
+ UErrorCode openStatus = U_ZERO_ERROR;
+ TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, locale, 0, 0, &openStatus));
+ ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
+ return iterator;
+}
+
+#if !PLATFORM(IOS)
+
+static TextBreakIterator* initializeIteratorWithRules(const char* breakRules)
+{
+ UParseError parseStatus;
+ UErrorCode openStatus = U_ZERO_ERROR;
+ unsigned length = strlen(breakRules);
+ auto upconvertedCharacters = StringView(reinterpret_cast<const LChar*>(breakRules), length).upconvertedCharacters();
+ TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(upconvertedCharacters, length, 0, 0, &parseStatus, &openStatus));
+ ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
+ return iterator;
+}
+
+#endif
+
+
+// Iterator text setting
+
+static TextBreakIterator* setTextForIterator(TextBreakIterator& iterator, StringView string)
+{
+ if (string.is8Bit()) {
+ UTextWithBuffer textLocal;
+ textLocal.text = UTEXT_INITIALIZER;
+ textLocal.text.extraSize = sizeof(textLocal.buffer);
+ textLocal.text.pExtra = textLocal.buffer;
+
+ UErrorCode openStatus = U_ZERO_ERROR;
+ UText* text = openLatin1UTextProvider(&textLocal, string.characters8(), string.length(), &openStatus);
+ if (U_FAILURE(openStatus)) {
+ LOG_ERROR("uTextOpenLatin1 failed with status %d", openStatus);
+ return nullptr;
+ }
+
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+ ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
+ if (U_FAILURE(setTextStatus)) {
+ LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
+ return nullptr;
+ }
+
+ utext_close(text);
+ } else {
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+ ubrk_setText(reinterpret_cast<UBreakIterator*>(&iterator), string.characters16(), string.length(), &setTextStatus);
+ if (U_FAILURE(setTextStatus))
+ return nullptr;
+ }
+
+ return &iterator;
+}
+
+static TextBreakIterator* setContextAwareTextForIterator(TextBreakIterator& iterator, StringView string, const UChar* priorContext, unsigned priorContextLength)
+{
+ if (string.is8Bit()) {
+ UTextWithBuffer textLocal;
+ textLocal.text = UTEXT_INITIALIZER;
+ textLocal.text.extraSize = sizeof(textLocal.buffer);
+ textLocal.text.pExtra = textLocal.buffer;
+
+ UErrorCode openStatus = U_ZERO_ERROR;
+ UText* text = openLatin1ContextAwareUTextProvider(&textLocal, string.characters8(), string.length(), priorContext, priorContextLength, &openStatus);
+ if (U_FAILURE(openStatus)) {
+ LOG_ERROR("openLatin1ContextAwareUTextProvider failed with status %d", openStatus);
+ return nullptr;
+ }
+
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+ ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
+ if (U_FAILURE(setTextStatus)) {
+ LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
+ return nullptr;
+ }
+
+ utext_close(text);
+ } else {
+ UText textLocal = UTEXT_INITIALIZER;
+
+ UErrorCode openStatus = U_ZERO_ERROR;
+ UText* text = openUTF16ContextAwareUTextProvider(&textLocal, string.characters16(), string.length(), priorContext, priorContextLength, &openStatus);
+ if (U_FAILURE(openStatus)) {
+ LOG_ERROR("openUTF16ContextAwareUTextProvider failed with status %d", openStatus);
+ return 0;
+ }
+
+ UErrorCode setTextStatus = U_ZERO_ERROR;
+ ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
+ if (U_FAILURE(setTextStatus)) {
+ LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
+ return nullptr;
+ }
+
+ utext_close(text);
+ }
+
+ return &iterator;
+}
+
+
+// Static iterators
+
+TextBreakIterator* wordBreakIterator(StringView string)
+{
+ static TextBreakIterator* staticWordBreakIterator = initializeIterator(UBRK_WORD);
+ if (!staticWordBreakIterator)
+ return nullptr;
+
+ return setTextForIterator(*staticWordBreakIterator, string);
+}
+
+TextBreakIterator* sentenceBreakIterator(StringView string)
+{
+ static TextBreakIterator* staticSentenceBreakIterator = initializeIterator(UBRK_SENTENCE);
+ if (!staticSentenceBreakIterator)
+ return nullptr;
+
+ return setTextForIterator(*staticSentenceBreakIterator, string);
+}
+
+TextBreakIterator* cursorMovementIterator(StringView string)
+{
+#if !PLATFORM(IOS)
+ // This rule set is based on character-break iterator rules of ICU 4.0
+ // <http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt>.
+ // The major differences from the original ones are listed below:
+ // * Replaced '[\p{Grapheme_Cluster_Break = SpacingMark}]' with '[\p{General_Category = Spacing Mark} - $Extend]' for ICU 3.8 or earlier;
+ // * Removed rules that prevent a cursor from moving after prepend characters (Bug 24342);
+ // * Added rules that prevent a cursor from moving after virama signs of Indic languages except Tamil (Bug 15790), and;
+ // * Added rules that prevent a cursor from moving before Japanese half-width katakara voiced marks.
+ // * Added rules for regional indicator symbols.
+ static const char* kRules =
+ "$CR = [\\p{Grapheme_Cluster_Break = CR}];"
+ "$LF = [\\p{Grapheme_Cluster_Break = LF}];"
+ "$Control = [\\p{Grapheme_Cluster_Break = Control}];"
+ "$VoiceMarks = [\\uFF9E\\uFF9F];" // Japanese half-width katakana voiced marks
+ "$Extend = [\\p{Grapheme_Cluster_Break = Extend} $VoiceMarks - [\\u0E30 \\u0E32 \\u0E45 \\u0EB0 \\u0EB2]];"
+ "$SpacingMark = [[\\p{General_Category = Spacing Mark}] - $Extend];"
+ "$L = [\\p{Grapheme_Cluster_Break = L}];"
+ "$V = [\\p{Grapheme_Cluster_Break = V}];"
+ "$T = [\\p{Grapheme_Cluster_Break = T}];"
+ "$LV = [\\p{Grapheme_Cluster_Break = LV}];"
+ "$LVT = [\\p{Grapheme_Cluster_Break = LVT}];"
+ "$Hin0 = [\\u0905-\\u0939];" // Devanagari Letter A,...,Ha
+ "$HinV = \\u094D;" // Devanagari Sign Virama
+ "$Hin1 = [\\u0915-\\u0939];" // Devanagari Letter Ka,...,Ha
+ "$Ben0 = [\\u0985-\\u09B9];" // Bengali Letter A,...,Ha
+ "$BenV = \\u09CD;" // Bengali Sign Virama
+ "$Ben1 = [\\u0995-\\u09B9];" // Bengali Letter Ka,...,Ha
+ "$Pan0 = [\\u0A05-\\u0A39];" // Gurmukhi Letter A,...,Ha
+ "$PanV = \\u0A4D;" // Gurmukhi Sign Virama
+ "$Pan1 = [\\u0A15-\\u0A39];" // Gurmukhi Letter Ka,...,Ha
+ "$Guj0 = [\\u0A85-\\u0AB9];" // Gujarati Letter A,...,Ha
+ "$GujV = \\u0ACD;" // Gujarati Sign Virama
+ "$Guj1 = [\\u0A95-\\u0AB9];" // Gujarati Letter Ka,...,Ha
+ "$Ori0 = [\\u0B05-\\u0B39];" // Oriya Letter A,...,Ha
+ "$OriV = \\u0B4D;" // Oriya Sign Virama
+ "$Ori1 = [\\u0B15-\\u0B39];" // Oriya Letter Ka,...,Ha
+ "$Tel0 = [\\u0C05-\\u0C39];" // Telugu Letter A,...,Ha
+ "$TelV = \\u0C4D;" // Telugu Sign Virama
+ "$Tel1 = [\\u0C14-\\u0C39];" // Telugu Letter Ka,...,Ha
+ "$Kan0 = [\\u0C85-\\u0CB9];" // Kannada Letter A,...,Ha
+ "$KanV = \\u0CCD;" // Kannada Sign Virama
+ "$Kan1 = [\\u0C95-\\u0CB9];" // Kannada Letter A,...,Ha
+ "$Mal0 = [\\u0D05-\\u0D39];" // Malayalam Letter A,...,Ha
+ "$MalV = \\u0D4D;" // Malayalam Sign Virama
+ "$Mal1 = [\\u0D15-\\u0D39];" // Malayalam Letter A,...,Ha
+ "$RI = [\\U0001F1E6-\\U0001F1FF];" // Emoji regional indicators
+ "$ZWJ = \\u200D;" // Zero width joiner
+ "$EmojiVar = [\\uFE0F];" // Emoji-style variation selector
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$EmojiForSeqs = [\\u2764 \\U0001F441 \\U0001F466-\\U0001F469 \\U0001F48B \\U0001F5E8];" // Emoji that participate in ZWJ sequences
+ "$EmojiForMods = [\\u261D \\u26F9 \\u270A-\\u270D \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA \\U0001F3CB \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F575 \\U0001F590 \\U0001F595 \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0 \\U0001F918] ;" // Emoji that take Fitzpatrick modifiers
+#else
+ "$EmojiForSeqs = [\\u2764 \\U0001F466-\\U0001F469 \\U0001F48B];" // Emoji that participate in ZWJ sequences
+ "$EmojiForMods = [\\u261D \\u270A-\\u270C \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3C7 \\U0001F3CA \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0] ;" // Emoji that take Fitzpatrick modifiers
+#endif
+ "$EmojiMods = [\\U0001F3FB-\\U0001F3FF];" // Fitzpatrick modifiers
+ "!!chain;"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "!!RINoChain;"
+#endif
+ "!!forward;"
+ "$CR $LF;"
+ "$L ($L | $V | $LV | $LVT);"
+ "($LV | $V) ($V | $T);"
+ "($LVT | $T) $T;"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$RI $RI $Extend* / $RI;"
+ "$RI $RI $Extend*;"
+ "[^$Control $CR $LF] $Extend;"
+ "[^$Control $CR $LF] $SpacingMark;"
+#else
+ "[^$Control $CR $LF] $Extend;"
+ "[^$Control $CR $LF] $SpacingMark;"
+ "$RI $RI / $RI;"
+ "$RI $RI;"
+#endif
+ "$Hin0 $HinV $Hin1;" // Devanagari Virama (forward)
+ "$Ben0 $BenV $Ben1;" // Bengali Virama (forward)
+ "$Pan0 $PanV $Pan1;" // Gurmukhi Virama (forward)
+ "$Guj0 $GujV $Guj1;" // Gujarati Virama (forward)
+ "$Ori0 $OriV $Ori1;" // Oriya Virama (forward)
+ "$Tel0 $TelV $Tel1;" // Telugu Virama (forward)
+ "$Kan0 $KanV $Kan1;" // Kannada Virama (forward)
+ "$Mal0 $MalV $Mal1;" // Malayalam Virama (forward)
+ "$ZWJ $EmojiForSeqs;" // Don't break in emoji ZWJ sequences
+ "$EmojiForMods $EmojiVar? $EmojiMods;" // Don't break between relevant emoji (possibly with variation selector) and Fitzpatrick modifier
+ "!!reverse;"
+ "$LF $CR;"
+ "($L | $V | $LV | $LVT) $L;"
+ "($V | $T) ($LV | $V);"
+ "$T ($LVT | $T);"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$Extend* $RI $RI / $Extend* $RI $RI;"
+ "$Extend* $RI $RI;"
+ "$Extend [^$Control $CR $LF];"
+ "$SpacingMark [^$Control $CR $LF];"
+#else
+ "$Extend [^$Control $CR $LF];"
+ "$SpacingMark [^$Control $CR $LF];"
+ "$RI $RI / $RI $RI;"
+ "$RI $RI;"
+#endif
+ "$Hin1 $HinV $Hin0;" // Devanagari Virama (backward)
+ "$Ben1 $BenV $Ben0;" // Bengali Virama (backward)
+ "$Pan1 $PanV $Pan0;" // Gurmukhi Virama (backward)
+ "$Guj1 $GujV $Guj0;" // Gujarati Virama (backward)
+ "$Ori1 $OriV $Ori0;" // Gujarati Virama (backward)
+ "$Tel1 $TelV $Tel0;" // Telugu Virama (backward)
+ "$Kan1 $KanV $Kan0;" // Kannada Virama (backward)
+ "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward)
+ "$EmojiForSeqs $ZWJ;" // Don't break in emoji ZWJ sequences
+ "$EmojiMods $EmojiVar? $EmojiForMods;" // Don't break between relevant emoji (possibly with variation selector) and Fitzpatrick modifier
+#if ADDITIONAL_EMOJI_SUPPORT
+ "!!safe_reverse;"
+ "$RI $RI+;"
+ "[$EmojiVar $EmojiMods]+ $EmojiForMods;"
+ "!!safe_forward;"
+ "$RI $RI+;"
+ "$EmojiForMods [$EmojiVar $EmojiMods]+;";
+#else
+ "[$EmojiVar $EmojiMods]+ $EmojiForMods;"
+ "$EmojiForMods [$EmojiVar $EmojiMods]+;"
+ "!!safe_reverse;"
+ "!!safe_forward;";
+#endif
+ static TextBreakIterator* staticCursorMovementIterator = initializeIteratorWithRules(kRules);
+#else // PLATFORM(IOS)
+ // Use the special Thai character break iterator for all locales
+ static TextBreakIterator* staticCursorMovementIterator = initializeIterator(UBRK_CHARACTER, "th");
+#endif // !PLATFORM(IOS)
+
+ if (!staticCursorMovementIterator)
+ return nullptr;
+
+ return setTextForIterator(*staticCursorMovementIterator, string);
+}
+
+TextBreakIterator* acquireLineBreakIterator(StringView string, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode mode, bool isCJK)
+{
+ TextBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale, mode, isCJK);
+ if (!iterator)
+ return nullptr;
+
+ return setContextAwareTextForIterator(*iterator, string, priorContext, priorContextLength);
+}
+
+void releaseLineBreakIterator(TextBreakIterator* iterator)
+{
+ ASSERT_ARG(iterator, iterator);
+
+ LineBreakIteratorPool::sharedPool().put(iterator);
+}
+
+static const char* uax14Prologue =
+ "!!chain;"
+ "!!LBCMNoChain;"
+ "!!lookAheadHardBreak;";
+
+static const char* uax14AssignmentsBefore =
+ // explicitly enumerate $CJ since ICU versions prior to 49 don't support :LineBreak=Conditional_Japanese_Starter:
+ "$CJ = ["
+#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
+ ":LineBreak=Conditional_Japanese_Starter:"
+#else
+ "\\u3041\\u3043\\u3045\\u3047\\u3049\\u3063\\u3083\\u3085\\u3087\\u308E\\u3095\\u3096\\u30A1\\u30A3\\u30A5\\u30A7"
+ "\\u30A9\\u30C3\\u30E3\\u30E5\\u30E7\\u30EE\\u30F5\\u30F6\\u30FC"
+ "\\u31F0\\u31F1\\u31F2\\u31F3\\u31F4\\u31F5\\u31F6\\u31F7\\u31F8\\u31F9\\u31FA\\u31FB\\u31FC\\u31FD\\u31FE\\u31FF"
+ "\\uFF67\\uFF68\\uFF69\\uFF6A\\uFF6B\\uFF6C\\uFF6D\\uFF6E\\uFF6F\\uFF70"
+#endif
+ "];";
+
+static const char* uax14AssignmentsCustomLooseCJK =
+ "$BA_SUB = [\\u2010\\u2013];"
+ "$EX_SUB = [\\u0021\\u003F\\uFF01\\uFF1F];"
+ "$ID_SUB = '';"
+ "$IN_SUB = [\\u2025\\u2026];"
+ "$IS_SUB = [\\u003A\\u003B];"
+ "$NS_SUB = [\\u203C\\u2047\\u2048\\u2049\\u3005\\u301C\\u303B\\u309D\\u309E\\u30A0\\u30FB\\u30FD\\u30FE\\uFF1A\\uFF1B\\uFF65];"
+ "$PO_SUB = [\\u0025\\u00A2\\u00B0\\u2030\\u2032\\u2033\\u2103\\uFF05\\uFFE0];"
+ "$PR_SUB = [\\u0024\\u00A3\\u00A5\\u20AC\\u2116\\uFF04\\uFFE1\\uFFE5];"
+ "$ID_ADD = [$CJ $BA_SUB $EX_SUB $IN_SUB $IS_SUB $NS_SUB $PO_SUB $PR_SUB];"
+ "$NS_ADD = '';";
+
+static const char* uax14AssignmentsCustomLooseNonCJK =
+ "$BA_SUB = '';"
+ "$EX_SUB = '';"
+ "$ID_SUB = '';"
+ "$IN_SUB = [\\u2025\\u2026];"
+ "$IS_SUB = '';"
+ "$NS_SUB = [\\u3005\\u303B\\u309D\\u309E\\u30FD\\u30FE];"
+ "$PO_SUB = '';"
+ "$PR_SUB = '';"
+ "$ID_ADD = [$CJ $IN_SUB $NS_SUB];"
+ "$NS_ADD = '';";
+
+static const char* uax14AssignmentsCustomNormalCJK =
+ "$BA_SUB = [\\u2010\\u2013];"
+ "$EX_SUB = '';"
+ "$IN_SUB = '';"
+ "$ID_SUB = '';"
+ "$IS_SUB = '';"
+ "$NS_SUB = [\\u301C\\u30A0];"
+ "$PO_SUB = '';"
+ "$PR_SUB = '';"
+ "$ID_ADD = [$CJ $BA_SUB $NS_SUB];"
+ "$NS_ADD = '';";
+
+static const char* uax14AssignmentsCustomNormalNonCJK =
+ "$BA_SUB = '';"
+ "$EX_SUB = '';"
+ "$ID_SUB = '';"
+ "$IN_SUB = '';"
+ "$IS_SUB = '';"
+ "$NS_SUB = '';"
+ "$PO_SUB = '';"
+ "$PR_SUB = '';"
+ "$ID_ADD = [$CJ];"
+ "$NS_ADD = '';";
+
+static const char* uax14AssignmentsCustomStrictCJK =
+ "$BA_SUB = '';"
+ "$EX_SUB = '';"
+ "$ID_SUB = '';"
+ "$IN_SUB = '';"
+ "$IS_SUB = '';"
+ "$NS_SUB = '';"
+ "$PO_SUB = '';"
+ "$PR_SUB = '';"
+ "$ID_ADD = '';"
+ "$NS_ADD = [$CJ];";
+
+#define uax14AssignmentsCustomStrictNonCJK uax14AssignmentsCustomStrictCJK
+#define uax14AssignmentsCustomDefaultCJK uax14AssignmentsCustomNormalCJK
+#define uax14AssignmentsCustomDefaultNonCJK uax14AssignmentsCustomStrictNonCJK
+
+static const char* uax14AssignmentsAfter =
+ "$AI = [:LineBreak = Ambiguous:];"
+ "$AL = [:LineBreak = Alphabetic:];"
+ "$BA = [[:LineBreak = Break_After:] - $BA_SUB];"
+ "$BB = [:LineBreak = Break_Before:];"
+ "$BK = [:LineBreak = Mandatory_Break:];"
+ "$B2 = [:LineBreak = Break_Both:];"
+ "$CB = [:LineBreak = Contingent_Break:];"
+ "$CL = [:LineBreak = Close_Punctuation:];"
+ "$CM = [:LineBreak = Combining_Mark:];"
+ "$CP = [:LineBreak = Close_Parenthesis:];"
+ "$CR = [:LineBreak = Carriage_Return:];"
+ "$EX = [[:LineBreak = Exclamation:] - $EX_SUB];"
+ "$GL = [:LineBreak = Glue:];"
+#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
+ "$HL = [:LineBreak = Hebrew_Letter:];"
+#else
+ "$HL = [[:Hebrew:] & [:Letter:]];"
+#endif
+ "$HY = [:LineBreak = Hyphen:];"
+ "$H2 = [:LineBreak = H2:];"
+ "$H3 = [:LineBreak = H3:];"
+ "$ID = [[[[:LineBreak = Ideographic:] - $CJ] $ID_ADD] - $ID_SUB];"
+ "$IN = [[:LineBreak = Inseparable:] - $IN_SUB];"
+ "$IS = [[:LineBreak = Infix_Numeric:] - $IS_SUB];"
+ "$JL = [:LineBreak = JL:];"
+ "$JV = [:LineBreak = JV:];"
+ "$JT = [:LineBreak = JT:];"
+ "$LF = [:LineBreak = Line_Feed:];"
+ "$NL = [:LineBreak = Next_Line:];"
+ "$NS = [[[[:LineBreak = Nonstarter:] - $CJ] $NS_ADD] - $NS_SUB];"
+ "$NU = [:LineBreak = Numeric:];"
+ "$OP = [:LineBreak = Open_Punctuation:];"
+ "$PO = [[:LineBreak = Postfix_Numeric:] - $PO_SUB];"
+ "$PR = [[:LineBreak = Prefix_Numeric:] - $PR_SUB];"
+ "$QU = [:LineBreak = Quotation:];"
+ "$RI = [\\U0001F1E6-\\U0001F1FF];"
+ "$SA = [:LineBreak = Complex_Context:];"
+ "$SG = [:LineBreak = Surrogate:];"
+ "$SP = [:LineBreak = Space:];"
+ "$SY = [:LineBreak = Break_Symbols:];"
+ "$WJ = [:LineBreak = Word_Joiner:];"
+ "$XX = [:LineBreak = Unknown:];"
+ "$ZW = [:LineBreak = ZWSpace:];"
+ "$ZWJ = \\u200D;"
+ "$EmojiVar = \\uFE0F;"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$EmojiForSeqs = [\\u2764 \\U0001F441 \\U0001F466-\\U0001F469 \\U0001F48B \\U0001F5E8];"
+ "$EmojiForMods = [\\u261D \\u26F9 \\u270A-\\u270D \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA \\U0001F3CB \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F575 \\U0001F590 \\U0001F595 \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0 \\U0001F918] ;" // Emoji that take Fitzpatrick modifiers
+#else
+ "$EmojiForSeqs = [\\u2764 \\U0001F466-\\U0001F469 \\U0001F48B];"
+ "$EmojiForMods = [\\u261D \\u270A-\\u270C \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3C7 \\U0001F3CA \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0] ;" // Emoji that take Fitzpatrick modifiers
+#endif
+ "$EmojiMods = [\\U0001F3FB-\\U0001F3FF];"
+ "$dictionary = [:LineBreak = Complex_Context:];"
+ "$ALPlus = [$AL $AI $SA $SG $XX];"
+ "$ALcm = $ALPlus $CM*;"
+ "$BAcm = $BA $CM*;"
+ "$BBcm = $BB $CM*;"
+ "$B2cm = $B2 $CM*;"
+ "$CLcm = $CL $CM*;"
+ "$CPcm = $CP $CM*;"
+ "$EXcm = $EX $CM*;"
+ "$GLcm = $GL $CM*;"
+ "$HLcm = $HL $CM*;"
+ "$HYcm = $HY $CM*;"
+ "$H2cm = $H2 $CM*;"
+ "$H3cm = $H3 $CM*;"
+ "$IDcm = $ID $CM*;"
+ "$INcm = $IN $CM*;"
+ "$IScm = $IS $CM*;"
+ "$JLcm = $JL $CM*;"
+ "$JVcm = $JV $CM*;"
+ "$JTcm = $JT $CM*;"
+ "$NScm = $NS $CM*;"
+ "$NUcm = $NU $CM*;"
+ "$OPcm = $OP $CM*;"
+ "$POcm = $PO $CM*;"
+ "$PRcm = $PR $CM*;"
+ "$QUcm = $QU $CM*;"
+ "$RIcm = $QU $CM*;"
+ "$SYcm = $SY $CM*;"
+ "$WJcm = $WJ $CM*;";
+
+static const char* uax14Forward =
+ "!!forward;"
+ "$CAN_CM = [^$SP $BK $CR $LF $NL $ZW $CM];"
+ "$CANT_CM = [$SP $BK $CR $LF $NL $ZW $CM];"
+ "$AL_FOLLOW_NOCM = [$BK $CR $LF $NL $ZW $SP];"
+ "$AL_FOLLOW_CM = [$CL $CP $EX $HL $IS $SY $WJ $GL $OP $QU $BA $HY $NS $IN $NU $ALPlus];"
+ "$AL_FOLLOW = [$AL_FOLLOW_NOCM $AL_FOLLOW_CM];"
+ "$LB4Breaks = [$BK $CR $LF $NL];"
+ "$LB4NonBreaks = [^$BK $CR $LF $NL];"
+ "$LB8Breaks = [$LB4Breaks $ZW];"
+ "$LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]];"
+ "$LB18NonBreaks = [$LB8NonBreaks - [$SP]];"
+ "$LB18Breaks = [$LB8Breaks $SP];"
+ "$LB20NonBreaks = [$LB18NonBreaks - $CB];"
+ "$ALPlus $CM+;"
+ "$BA $CM+;"
+ "$BB $CM+;"
+ "$B2 $CM+;"
+ "$CL $CM+;"
+ "$CP $CM+;"
+ "$EX $CM+;"
+ "$GL $CM+;"
+ "$HL $CM+;"
+ "$HY $CM+;"
+ "$H2 $CM+;"
+ "$H3 $CM+;"
+ "$ID $CM+;"
+ "$IN $CM+;"
+ "$IS $CM+;"
+ "$JL $CM+;"
+ "$JV $CM+;"
+ "$JT $CM+;"
+ "$NS $CM+;"
+ "$NU $CM+;"
+ "$OP $CM+;"
+ "$PO $CM+;"
+ "$PR $CM+;"
+ "$QU $CM+;"
+ "$SY $CM+;"
+ "$WJ $CM+;"
+ "$CR $LF {100};"
+ "$LB4NonBreaks? $LB4Breaks {100};"
+ "$CAN_CM $CM* $LB4Breaks {100};"
+ "$CM+ $LB4Breaks {100};"
+ "$LB4NonBreaks [$SP $ZW];"
+ "$CAN_CM $CM* [$SP $ZW];"
+ "$CM+ [$SP $ZW];"
+ "$EmojiForSeqs $EmojiVar? $EmojiMods? $ZWJ $EmojiForSeqs;"
+ "$CAN_CM $CM+;"
+ "$CM+;"
+ "$CAN_CM $CM* $WJcm;"
+ "$LB8NonBreaks $WJcm;"
+ "$CM+ $WJcm;"
+ "$WJcm $CANT_CM;"
+ "$WJcm $CAN_CM $CM*;"
+ "$GLcm $CAN_CM $CM*;"
+ "$GLcm $CANT_CM;"
+ "[[$LB8NonBreaks] - [$SP $BA $HY]] $CM* $GLcm;"
+ "$CM+ GLcm;"
+ "$LB8NonBreaks $CL;"
+ "$CAN_CM $CM* $CL;"
+ "$CM+ $CL;"
+ "$LB8NonBreaks $CP;"
+ "$CAN_CM $CM* $CP;"
+ "$CM+ $CP;"
+ "$LB8NonBreaks $EX;"
+ "$CAN_CM $CM* $EX;"
+ "$CM+ $EX;"
+ "$LB8NonBreaks $IS;"
+ "$CAN_CM $CM* $IS;"
+ "$CM+ $IS;"
+ "$LB8NonBreaks $SY;"
+ "$CAN_CM $CM* $SY;"
+ "$CM+ $SY;"
+ "$OPcm $SP* $CAN_CM $CM*;"
+ "$OPcm $SP* $CANT_CM;"
+ "$OPcm $SP+ $CM+ $AL_FOLLOW?;"
+ "$QUcm $SP* $OPcm;"
+ "($CLcm | $CPcm) $SP* $NScm;"
+ "$B2cm $SP* $B2cm;"
+ "$LB18NonBreaks $CM* $QUcm;"
+ "$CM+ $QUcm;"
+ "$QUcm .?;"
+ "$QUcm $LB18NonBreaks $CM*;"
+ "$LB20NonBreaks $CM* ($BAcm | $HYcm | $NScm); "
+ "$BBcm [^$CB];"
+ "$BBcm $LB20NonBreaks $CM*;"
+ "$HLcm ($HYcm | $BAcm) [^$CB]?;"
+ "($ALcm | $HLcm) $INcm;"
+ "$CM+ $INcm;"
+ "$IDcm $INcm;"
+ "$INcm $INcm;"
+ "$NUcm $INcm;"
+ "$IDcm $POcm;"
+ "$ALcm $NUcm;"
+ "$HLcm $NUcm;"
+ "$CM+ $NUcm;"
+ "$NUcm $ALcm;"
+ "$NUcm $HLcm;"
+ "$PRcm $IDcm;"
+ "$PRcm ($ALcm | $HLcm);"
+ "$POcm ($ALcm | $HLcm);"
+ "($PRcm | $POcm)? ($OPcm | $HYcm)? $NUcm ($NUcm | $SYcm | $IScm)* ($CLcm | $CPcm)? ($PRcm | $POcm)?;"
+ "$JLcm ($JLcm | $JVcm | $H2cm | $H3cm);"
+ "($JVcm | $H2cm) ($JVcm | $JTcm);"
+ "($JTcm | $H3cm) $JTcm;"
+ "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $INcm;"
+ "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $POcm;"
+ "$PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm);"
+ "($ALcm | $HLcm) ($ALcm | $HLcm);"
+ "$CM+ ($ALcm | $HLcm);"
+ "$IScm ($ALcm | $HLcm);"
+ "($ALcm | $HLcm | $NUcm) $OPcm;"
+ "$CM+ $OPcm;"
+ "$CPcm ($ALcm | $HLcm | $NUcm);"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$RIcm $RIcm;"
+#endif
+ "$EmojiForMods $EmojiVar? $EmojiMods;";
+
+static const char* uax14Reverse =
+ "!!reverse;"
+ "$CM+ $ALPlus;"
+ "$CM+ $BA;"
+ "$CM+ $BB;"
+ "$CM+ $B2;"
+ "$CM+ $CL;"
+ "$CM+ $CP;"
+ "$CM+ $EX;"
+ "$CM+ $GL;"
+ "$CM+ $HL;"
+ "$CM+ $HY;"
+ "$CM+ $H2;"
+ "$CM+ $H3;"
+ "$CM+ $ID;"
+ "$CM+ $IN;"
+ "$CM+ $IS;"
+ "$CM+ $JL;"
+ "$CM+ $JV;"
+ "$CM+ $JT;"
+ "$CM+ $NS;"
+ "$CM+ $NU;"
+ "$CM+ $OP;"
+ "$CM+ $PO;"
+ "$CM+ $PR;"
+ "$CM+ $QU;"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$CM+ $RI;"
+#endif
+ "$CM+ $SY;"
+ "$CM+ $WJ;"
+ "$CM+;"
+ "$AL_FOLLOW $CM+ / ([$BK $CR $LF $NL $ZW {eof}] | $SP+ $CM+ $SP | $SP+ $CM* ([^$OP $CM $SP] | [$AL {eof}]));"
+ "[$PR] / $CM+ [$BK $CR $LF $NL $ZW $SP {eof}];"
+ "$LB4Breaks [$LB4NonBreaks-$CM];"
+ "$LB4Breaks $CM+ $CAN_CM;"
+ "$LF $CR;"
+ "[$SP $ZW] [$LB4NonBreaks-$CM];"
+ "[$SP $ZW] $CM+ $CAN_CM;"
+ "$EmojiForSeqs $ZWJ $EmojiMods? $EmojiVar? $EmojiForSeqs;"
+ "$CM+ $CAN_CM;"
+ "$CM* $WJ $CM* $CAN_CM;"
+ "$CM* $WJ [$LB8NonBreaks-$CM];"
+ "$CANT_CM $CM* $WJ;"
+ "$CM* $CAN_CM $CM* $WJ;"
+ "$CM* $GL $CM* [$LB8NonBreaks-[$CM $SP $BA $HY]];"
+ "$CANT_CM $CM* $GL;"
+ "$CM* $CAN_CM $CM* $GL;"
+ "$CL $CM+ $CAN_CM;"
+ "$CP $CM+ $CAN_CM;"
+ "$EX $CM+ $CAN_CM;"
+ "$IS $CM+ $CAN_CM;"
+ "$SY $CM+ $CAN_CM;"
+ "$CL [$LB8NonBreaks-$CM];"
+ "$CP [$LB8NonBreaks-$CM];"
+ "$EX [$LB8NonBreaks-$CM];"
+ "$IS [$LB8NonBreaks-$CM];"
+ "$SY [$LB8NonBreaks-$CM];"
+ "[$CL $CP $EX $IS $SY] $CM+ $SP+ $CM* $OP; "
+ "$CM* $CAN_CM $SP* $CM* $OP;"
+ "$CANT_CM $SP* $CM* $OP;"
+ "$AL_FOLLOW? $CM+ $SP $SP* $CM* $OP;"
+ "$AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP;"
+ "$CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP;"
+ "$SY $CM $SP+ $OP;"
+ "$CM* $OP $SP* $CM* $QU;"
+ "$CM* $NS $SP* $CM* ($CL | $CP);"
+ "$CM* $B2 $SP* $CM* $B2;"
+ "$CM* $QU $CM* $CAN_CM;"
+ "$CM* $QU $LB18NonBreaks;"
+ "$CM* $CAN_CM $CM* $QU;"
+ "$CANT_CM $CM* $QU;"
+ "$CM* ($BA | $HY | $NS) $CM* [$LB20NonBreaks-$CM];"
+ "$CM* [$LB20NonBreaks-$CM] $CM* $BB;"
+ "[^$CB] $CM* $BB;"
+ "[^$CB] $CM* ($HY | $BA) $CM* $HL;"
+ "$CM* $IN $CM* ($ALPlus | $HL);"
+ "$CM* $IN $CM* $ID;"
+ "$CM* $IN $CM* $IN;"
+ "$CM* $IN $CM* $NU;"
+ "$CM* $PO $CM* $ID;"
+ "$CM* $NU $CM* ($ALPlus | $HL);"
+ "$CM* ($ALPlus | $HL) $CM* $NU;"
+ "$CM* $ID $CM* $PR;"
+ "$CM* ($ALPlus | $HL) $CM* $PR;"
+ "$CM* ($ALPlus | $HL) $CM* $PO;"
+ "($CM* ($PR | $PO))? ($CM* ($CL | $CP))? ($CM* ($NU | $IS | $SY))* $CM* $NU ($CM* ($OP | $HY))? ($CM* ($PR | $PO))?;"
+ "$CM* ($H3 | $H2 | $JV | $JL) $CM* $JL;"
+ "$CM* ($JT | $JV) $CM* ($H2 | $JV);"
+ "$CM* $JT $CM* ($H3 | $JT);"
+ "$CM* $IN $CM* ($H3 | $H2 | $JT | $JV | $JL);"
+ "$CM* $PO $CM* ($H3 | $H2 | $JT | $JV | $JL);"
+ "$CM* ($H3 | $H2 | $JT | $JV | $JL) $CM* $PR;"
+ "$CM* ($ALPlus | $HL) $CM* ($ALPlus | $HL);"
+ "$CM* ($ALPlus | $HL) $CM* $IS;"
+ "$CM* $OP $CM* ($ALPlus | $HL | $NU);"
+ "$CM* ($ALPlus | $HL | $NU) $CM* $CP;"
+#if ADDITIONAL_EMOJI_SUPPORT
+ "$CM* $RI $CM* $RI;"
+#endif
+ "$EmojiMods $EmojiVar? $EmojiForMods;";
+
+static const char* uax14SafeForward =
+ "!!safe_forward;"
+ "[$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2 $PR $HY $BA $dictionary];"
+ "$dictionary $dictionary;";
+
+static const char* uax14SafeReverse =
+ "!!safe_reverse;"
+ "$CM+ [^$CM $BK $CR $LF $NL $ZW $SP];"
+ "$CM+ $SP / .;"
+ "$SP+ $CM* $OP;"
+ "$SP+ $CM* $QU;"
+ "$SP+ $CM* ($CL | $CP);"
+ "$SP+ $CM* $B2;"
+ "$CM* ($HY | $BA) $CM* $HL;"
+ "($CM* ($IS | $SY))+ $CM* $NU;"
+ "($CL | $CP) $CM* ($NU | $IS | $SY);"
+ "$dictionary $dictionary;";
+
+static String mapLineIteratorModeToRules(LineBreakIteratorMode mode, bool isCJK)
+{
+ StringBuilder rulesBuilder;
+ rulesBuilder.append(uax14Prologue);
+ rulesBuilder.append(uax14AssignmentsBefore);
+ switch (mode) {
+ case LineBreakIteratorModeUAX14:
+ rulesBuilder.append(isCJK ? uax14AssignmentsCustomDefaultCJK : uax14AssignmentsCustomDefaultNonCJK);
+ break;
+ case LineBreakIteratorModeUAX14Loose:
+ rulesBuilder.append(isCJK ? uax14AssignmentsCustomLooseCJK : uax14AssignmentsCustomLooseNonCJK);
+ break;
+ case LineBreakIteratorModeUAX14Normal:
+ rulesBuilder.append(isCJK ? uax14AssignmentsCustomNormalCJK : uax14AssignmentsCustomNormalNonCJK);
+ break;
+ case LineBreakIteratorModeUAX14Strict:
+ rulesBuilder.append(isCJK ? uax14AssignmentsCustomStrictCJK : uax14AssignmentsCustomStrictNonCJK);
+ break;
+ }
+ rulesBuilder.append(uax14AssignmentsAfter);
+ rulesBuilder.append(uax14Forward);
+ rulesBuilder.append(uax14Reverse);
+ rulesBuilder.append(uax14SafeForward);
+ rulesBuilder.append(uax14SafeReverse);
+ return rulesBuilder.toString();
+}
+
+// Recognize BCP47 compliant primary language values of 'zh', 'ja', 'ko'
+// (in any combination of case), optionally followed by subtags. Don't
+// recognize 3-letter variants 'chi'/'zho', 'jpn', or 'kor' since BCP47
+// requires use of shortest language tag.
+bool isCJKLocale(const AtomicString& locale)
+{
+ size_t length = locale.length();
+ if (length < 2)
+ return false;
+ auto c1 = locale[0];
+ auto c2 = locale[1];
+ auto c3 = length == 2 ? 0 : locale[2];
+ if (!c3 || c3 == '-' || c3 == '_' || c3 == '@') {
+ if (c1 == 'z' || c1 == 'Z')
+ return c2 == 'h' || c2 == 'H';
+ if (c1 == 'j' || c1 == 'J')
+ return c2 == 'a' || c2 == 'A';
+ if (c1 == 'k' || c1 == 'K')
+ return c2 == 'o' || c2 == 'O';
+ }
+ return false;
+}
+
+TextBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
+{
+ UBreakIterator* ubrkIter;
+ UErrorCode openStatus = U_ZERO_ERROR;
+ bool localeIsEmpty = locale.isEmpty();
+ if (mode == LineBreakIteratorModeUAX14)
+ ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), 0, 0, &openStatus);
+ else {
+ UParseError parseStatus;
+ auto rules = mapLineIteratorModeToRules(mode, isCJK);
+ ubrkIter = ubrk_openRules(StringView(rules).upconvertedCharacters(), rules.length(), 0, 0, &parseStatus, &openStatus);
+ }
+ // locale comes from a web page and it can be invalid, leading ICU
+ // to fail, in which case we fall back to the default locale.
+ if (!localeIsEmpty && U_FAILURE(openStatus)) {
+ openStatus = U_ZERO_ERROR;
+ ubrkIter = ubrk_open(UBRK_LINE, currentTextBreakLocaleID(), 0, 0, &openStatus);
+ }
+
+ if (U_FAILURE(openStatus)) {
+ LOG_ERROR("ubrk_open failed with status %d", openStatus);
+ return nullptr;
+ }
+
+ return reinterpret_cast<TextBreakIterator*>(ubrkIter);
+}
+
+void closeLineBreakIterator(TextBreakIterator*& iterator)
+{
+ UBreakIterator* ubrkIter = reinterpret_cast<UBreakIterator*>(iterator);
+ ASSERT(ubrkIter);
+ ubrk_close(ubrkIter);
+ iterator = nullptr;
+}
+
+static TextBreakIterator* nonSharedCharacterBreakIterator;
+
+static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newValue)
+{
+ return WTF::weakCompareAndSwap(&nonSharedCharacterBreakIterator, expected, newValue);
+}
+
+NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(StringView string)
+{
+ m_iterator = nonSharedCharacterBreakIterator;
+
+ bool createdIterator = m_iterator && compareAndSwapNonSharedCharacterBreakIterator(m_iterator, 0);
+ if (!createdIterator)
+ m_iterator = initializeIterator(UBRK_CHARACTER);
+ if (!m_iterator)
+ return;
+
+ m_iterator = setTextForIterator(*m_iterator, string);
+}
+
+NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
+{
+ if (!compareAndSwapNonSharedCharacterBreakIterator(0, m_iterator))
+ ubrk_close(reinterpret_cast<UBreakIterator*>(m_iterator));
+}
+
+
+// Iterator implemenation.
+
+int textBreakFirst(TextBreakIterator* iterator)
+{
+ return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator));
+}
+
+int textBreakLast(TextBreakIterator* iterator)
+{
+ return ubrk_last(reinterpret_cast<UBreakIterator*>(iterator));
+}
+
+int textBreakNext(TextBreakIterator* iterator)
+{
+ return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator));
+}
+
+int textBreakPrevious(TextBreakIterator* iterator)
+{
+ return ubrk_previous(reinterpret_cast<UBreakIterator*>(iterator));
+}
+
+int textBreakPreceding(TextBreakIterator* iterator, int pos)
+{
+ return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos);
+}
+
+int textBreakFollowing(TextBreakIterator* iterator, int pos)
+{
+ return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos);
+}
+
+int textBreakCurrent(TextBreakIterator* iterator)
+{
+ return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator));
+}
+
+bool isTextBreak(TextBreakIterator* iterator, int position)
+{
+ return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position);
+}
+
+bool isWordTextBreak(TextBreakIterator* iterator)
+{
+ int ruleStatus = ubrk_getRuleStatus(reinterpret_cast<UBreakIterator*>(iterator));
+ return ruleStatus != UBRK_WORD_NONE;
+}
+
+unsigned numGraphemeClusters(const String& s)
+{
+ unsigned stringLength = s.length();
+
+ if (!stringLength)
+ return 0;
+
+ // The only Latin-1 Extended Grapheme Cluster is CR LF
+ if (s.is8Bit() && !s.contains('\r'))
+ return stringLength;
+
+ NonSharedCharacterBreakIterator it(s);
+ if (!it)
+ return stringLength;
+
+ unsigned num = 0;
+ while (textBreakNext(it) != TextBreakDone)
+ ++num;
+ return num;
+}
+
+unsigned numCharactersInGraphemeClusters(const StringView& s, unsigned numGraphemeClusters)
+{
+ unsigned stringLength = s.length();
+
+ if (!stringLength)
+ return 0;
+
+ // The only Latin-1 Extended Grapheme Cluster is CR LF
+ if (s.is8Bit() && !s.contains('\r'))
+ return std::min(stringLength, numGraphemeClusters);
+
+ NonSharedCharacterBreakIterator it(s);
+ if (!it)
+ return std::min(stringLength, numGraphemeClusters);
+
+ for (unsigned i = 0; i < numGraphemeClusters; ++i) {
+ if (textBreakNext(it) == TextBreakDone)
+ return stringLength;
+ }
+ return textBreakCurrent(it);
+}
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextTextBreakIteratorhfromrev203037trunkSourceWebCoreplatformtextTextBreakIteratorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/TextBreakIterator.h (from rev 203037, trunk/Source/WebCore/platform/text/TextBreakIterator.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextBreakIterator.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/TextBreakIterator.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,224 @@
</span><ins>+/*
+ * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
+ * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TextBreakIterator_h
+#define TextBreakIterator_h
+
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/StringView.h>
+
+namespace WTF {
+
+class TextBreakIterator;
+
+// Note: The returned iterator is good only until you get another iterator, with the exception of acquireLineBreakIterator.
+
+enum LineBreakIteratorMode {
+ LineBreakIteratorModeUAX14,
+ LineBreakIteratorModeUAX14Loose,
+ LineBreakIteratorModeUAX14Normal,
+ LineBreakIteratorModeUAX14Strict,
+};
+
+// This is similar to character break iterator in most cases, but is subject to
+// platform UI conventions. One notable example where this can be different
+// from character break iterator is Thai prepend characters, see bug 24342.
+// Use this for insertion point and selection manipulations.
+WTF_EXPORT_PRIVATE TextBreakIterator* cursorMovementIterator(StringView);
+
+WTF_EXPORT_PRIVATE TextBreakIterator* wordBreakIterator(StringView);
+WTF_EXPORT_PRIVATE TextBreakIterator* sentenceBreakIterator(StringView);
+
+WTF_EXPORT_PRIVATE TextBreakIterator* acquireLineBreakIterator(StringView, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode, bool isCJK);
+WTF_EXPORT_PRIVATE void releaseLineBreakIterator(TextBreakIterator*);
+TextBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode, bool isCJK);
+void closeLineBreakIterator(TextBreakIterator*&);
+
+WTF_EXPORT_PRIVATE int textBreakFirst(TextBreakIterator*);
+WTF_EXPORT_PRIVATE int textBreakLast(TextBreakIterator*);
+WTF_EXPORT_PRIVATE int textBreakNext(TextBreakIterator*);
+WTF_EXPORT_PRIVATE int textBreakPrevious(TextBreakIterator*);
+WTF_EXPORT_PRIVATE int textBreakCurrent(TextBreakIterator*);
+WTF_EXPORT_PRIVATE int textBreakPreceding(TextBreakIterator*, int);
+WTF_EXPORT_PRIVATE int textBreakFollowing(TextBreakIterator*, int);
+WTF_EXPORT_PRIVATE bool isTextBreak(TextBreakIterator*, int);
+WTF_EXPORT_PRIVATE bool isWordTextBreak(TextBreakIterator*);
+
+const int TextBreakDone = -1;
+
+WTF_EXPORT_PRIVATE bool isCJKLocale(const AtomicString&);
+
+class LazyLineBreakIterator {
+public:
+ LazyLineBreakIterator()
+ : m_iterator(nullptr)
+ , m_cachedPriorContext(nullptr)
+ , m_mode(LineBreakIteratorModeUAX14)
+ , m_cachedPriorContextLength(0)
+ , m_isCJK(false)
+ {
+ resetPriorContext();
+ }
+
+ LazyLineBreakIterator(String string, const AtomicString& locale = AtomicString(), LineBreakIteratorMode mode = LineBreakIteratorModeUAX14)
+ : m_string(string)
+ , m_locale(locale)
+ , m_iterator(nullptr)
+ , m_cachedPriorContext(nullptr)
+ , m_mode(mode)
+ , m_cachedPriorContextLength(0)
+ {
+ resetPriorContext();
+ m_isCJK = isCJKLocale(locale);
+ }
+
+ ~LazyLineBreakIterator()
+ {
+ if (m_iterator)
+ releaseLineBreakIterator(m_iterator);
+ }
+
+ String string() const { return m_string; }
+ bool isLooseCJKMode() const { return m_isCJK && m_mode == LineBreakIteratorModeUAX14Loose; }
+
+ UChar lastCharacter() const
+ {
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ return m_priorContext[1];
+ }
+
+ UChar secondToLastCharacter() const
+ {
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ return m_priorContext[0];
+ }
+
+ void setPriorContext(UChar last, UChar secondToLast)
+ {
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ m_priorContext[0] = secondToLast;
+ m_priorContext[1] = last;
+ }
+
+ void updatePriorContext(UChar last)
+ {
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ m_priorContext[0] = m_priorContext[1];
+ m_priorContext[1] = last;
+ }
+
+ void resetPriorContext()
+ {
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ m_priorContext[0] = 0;
+ m_priorContext[1] = 0;
+ }
+
+ unsigned priorContextLength() const
+ {
+ unsigned priorContextLength = 0;
+ COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
+ if (m_priorContext[1]) {
+ ++priorContextLength;
+ if (m_priorContext[0])
+ ++priorContextLength;
+ }
+ return priorContextLength;
+ }
+
+ // Obtain text break iterator, possibly previously cached, where this iterator is (or has been)
+ // initialized to use the previously stored string as the primary breaking context and using
+ // previously stored prior context if non-empty.
+ TextBreakIterator* get(unsigned priorContextLength)
+ {
+ ASSERT(priorContextLength <= priorContextCapacity);
+ const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;
+ if (!m_iterator) {
+ m_iterator = acquireLineBreakIterator(m_string, m_locale, priorContext, priorContextLength, m_mode, m_isCJK);
+ m_cachedPriorContext = priorContext;
+ m_cachedPriorContextLength = priorContextLength;
+ } else if (priorContext != m_cachedPriorContext || priorContextLength != m_cachedPriorContextLength) {
+ resetStringAndReleaseIterator(m_string, m_locale, m_mode);
+ return this->get(priorContextLength);
+ }
+ return m_iterator;
+ }
+
+ void resetStringAndReleaseIterator(String string, const AtomicString& locale, LineBreakIteratorMode mode)
+ {
+ if (m_iterator)
+ releaseLineBreakIterator(m_iterator);
+ m_string = string;
+ m_locale = locale;
+ m_iterator = nullptr;
+ m_cachedPriorContext = nullptr;
+ m_mode = mode;
+ m_isCJK = isCJKLocale(locale);
+ m_cachedPriorContextLength = 0;
+ }
+
+private:
+ static const unsigned priorContextCapacity = 2;
+ String m_string;
+ AtomicString m_locale;
+ TextBreakIterator* m_iterator;
+ const UChar* m_cachedPriorContext;
+ LineBreakIteratorMode m_mode;
+ unsigned m_cachedPriorContextLength;
+ UChar m_priorContext[priorContextCapacity];
+ bool m_isCJK;
+};
+
+// Iterates over "extended grapheme clusters", as defined in UAX #29.
+// Note that platform implementations may be less sophisticated - e.g. ICU prior to
+// version 4.0 only supports "legacy grapheme clusters".
+// Use this for general text processing, e.g. string truncation.
+
+class NonSharedCharacterBreakIterator {
+ WTF_MAKE_NONCOPYABLE(NonSharedCharacterBreakIterator);
+public:
+ WTF_EXPORT_PRIVATE NonSharedCharacterBreakIterator(StringView);
+ WTF_EXPORT_PRIVATE ~NonSharedCharacterBreakIterator();
+
+ operator TextBreakIterator*() const { return m_iterator; }
+
+private:
+ TextBreakIterator* m_iterator;
+};
+
+// Counts the number of grapheme clusters. A surrogate pair or a sequence
+// of a non-combining character and following combining characters is
+// counted as 1 grapheme cluster.
+WTF_EXPORT_PRIVATE unsigned numGraphemeClusters(const String&);
+// Returns the number of characters which will be less than or equal to
+// the specified grapheme cluster length.
+WTF_EXPORT_PRIVATE unsigned numCharactersInGraphemeClusters(const StringView&, unsigned);
+
+}
+
+using WTF::LineBreakIteratorMode;
+using WTF::LineBreakIteratorModeUAX14;
+using WTF::LazyLineBreakIterator;
+using WTF::NonSharedCharacterBreakIterator;
+using WTF::TextBreakDone;
+using WTF::TextBreakIterator;
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextTextBreakIteratorInternalICUhfromrev203037trunkSourceWebCoreplatformtextTextBreakIteratorInternalICUh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/TextBreakIteratorInternalICU.h (from rev 203037, trunk/Source/WebCore/platform/text/TextBreakIteratorInternalICU.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextBreakIteratorInternalICU.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/TextBreakIteratorInternalICU.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TextBreakIteratorInternalICU_h
+#define TextBreakIteratorInternalICU_h
+
+// FIXME: Now that this handles locales for ICU, not just for text breaking,
+// this file and the various implementation files should be renamed.
+
+namespace WTF {
+
+WTF_EXPORT_PRIVATE const char* currentSearchLocaleID();
+WTF_EXPORT_PRIVATE const char* currentTextBreakLocaleID();
+
+}
+
+using WTF::currentSearchLocaleID;
+using WTF::currentTextBreakLocaleID;
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexteflTextBreakIteratorInternalICUEflcppfromrev203037trunkSourceWebCoreplatformtexteflTextBreakIteratorInternalICUEflcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp (from rev 203037, trunk/Source/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+namespace WTF {
+
+const char* currentSearchLocaleID()
+{
+ // FIXME: Should use system locale.
+ return "";
+}
+
+const char* currentTextBreakLocaleID()
+{
+ return "en_us";
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextgtkTextBreakIteratorInternalICUGtkcppfromrev203037trunkSourceWebCoreplatformtextgtkTextBreakIteratorInternalICUGtkcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp (from rev 203037, trunk/Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+namespace WTF {
+
+const char* currentSearchLocaleID()
+{
+ // FIXME: Should use system locale.
+ return "";
+}
+
+const char* currentTextBreakLocaleID()
+{
+ // FIXME: Should use system locale.
+ return "en_us";
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProvidercppfromrev203037trunkSourceWebCoreplatformtexticuUTextProvidercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProvider.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProvider.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "UTextProvider.h"
+
+#include <algorithm>
+#include <string.h>
+
+namespace WTF {
+
+// Relocate pointer from source into destination as required.
+static inline void fixPointer(const UText* source, UText* destination, const void*& pointer)
+{
+ if (pointer >= source->pExtra && pointer < static_cast<char*>(source->pExtra) + source->extraSize) {
+ // Pointer references source extra buffer.
+ pointer = static_cast<char*>(destination->pExtra) + (static_cast<const char*>(pointer) - static_cast<const char*>(source->pExtra));
+ } else if (pointer >= source && pointer < reinterpret_cast<const char*>(source) + source->sizeOfStruct) {
+ // Pointer references source text structure, but not source extra buffer.
+ pointer = reinterpret_cast<char*>(destination) + (static_cast<const char*>(pointer) - reinterpret_cast<const char*>(source));
+ }
+}
+
+UText* uTextCloneImpl(UText* destination, const UText* source, UBool deep, UErrorCode* status)
+{
+ ASSERT_UNUSED(deep, !deep);
+ if (U_FAILURE(*status))
+ return nullptr;
+ int32_t extraSize = source->extraSize;
+ destination = utext_setup(destination, extraSize, status);
+ if (U_FAILURE(*status))
+ return destination;
+ void* extraNew = destination->pExtra;
+ int32_t flags = destination->flags;
+ int sizeToCopy = std::min(source->sizeOfStruct, destination->sizeOfStruct);
+ memcpy(destination, source, sizeToCopy);
+ destination->pExtra = extraNew;
+ destination->flags = flags;
+ memcpy(destination->pExtra, source->pExtra, extraSize);
+ fixPointer(source, destination, destination->context);
+ fixPointer(source, destination, destination->p);
+ fixPointer(source, destination, destination->q);
+ ASSERT(!destination->r);
+ const void* chunkContents = static_cast<const void*>(destination->chunkContents);
+ fixPointer(source, destination, chunkContents);
+ destination->chunkContents = static_cast<const UChar*>(chunkContents);
+ return destination;
+}
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProviderhfromrev203037trunkSourceWebCoreplatformtexticuUTextProviderh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProvider.h (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProvider.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProvider.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProvider.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UTextProvider_h
+#define UTextProvider_h
+
+#include <unicode/utext.h>
+
+namespace WTF {
+
+enum class UTextProviderContext {
+ NoContext,
+ PriorContext,
+ PrimaryContext
+};
+
+inline UTextProviderContext uTextProviderContext(const UText* text, int64_t nativeIndex, UBool forward)
+{
+ if (!text->b || nativeIndex > text->b)
+ return UTextProviderContext::PrimaryContext;
+ if (nativeIndex == text->b)
+ return forward ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
+ return UTextProviderContext::PriorContext;
+}
+
+inline void initializeContextAwareUTextProvider(UText* text, const UTextFuncs* funcs, const void* string, unsigned length, const UChar* priorContext, int priorContextLength)
+{
+ text->pFuncs = funcs;
+ text->providerProperties = 1 << UTEXT_PROVIDER_STABLE_CHUNKS;
+ text->context = string;
+ text->p = string;
+ text->a = length;
+ text->q = priorContext;
+ text->b = priorContextLength;
+}
+
+// Shared implementation for the UTextClone function on UTextFuncs.
+
+UText* uTextCloneImpl(UText* destination, const UText* source, UBool deep, UErrorCode* status);
+
+
+// Helpers for the UTextAccess function on UTextFuncs.
+
+inline int64_t uTextAccessPinIndex(int64_t& index, int64_t limit)
+{
+ if (index < 0)
+ index = 0;
+ else if (index > limit)
+ index = limit;
+ return index;
+}
+
+inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward, UBool& isAccessible)
+{
+ if (forward) {
+ if (nativeIndex >= text->chunkNativeStart && nativeIndex < text->chunkNativeLimit) {
+ int64_t offset = nativeIndex - text->chunkNativeStart;
+ // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+ isAccessible = TRUE;
+ return true;
+ }
+ if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+ text->chunkOffset = text->chunkLength;
+ isAccessible = FALSE;
+ return true;
+ }
+ } else {
+ if (nativeIndex > text->chunkNativeStart && nativeIndex <= text->chunkNativeLimit) {
+ int64_t offset = nativeIndex - text->chunkNativeStart;
+ // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+ isAccessible = TRUE;
+ return true;
+ }
+ if (nativeIndex <= 0 && !text->chunkNativeStart) {
+ text->chunkOffset = 0;
+ isAccessible = FALSE;
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace WTF
+
+#endif // UTextProvider_h
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProviderLatin1cppfromrev203037trunkSourceWebCoreplatformtexticuUTextProviderLatin1cpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,394 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "UTextProviderLatin1.h"
+
+#include "UTextProvider.h"
+#include <wtf/text/StringImpl.h>
+
+namespace WTF {
+
+// Latin1 provider
+
+static UText* uTextLatin1Clone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextLatin1NativeLength(UText*);
+static UBool uTextLatin1Access(UText*, int64_t, UBool);
+static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static int64_t uTextLatin1MapOffsetToNative(const UText*);
+static int32_t uTextLatin1MapNativeIndexToUTF16(const UText*, int64_t);
+static void uTextLatin1Close(UText*);
+
+static const struct UTextFuncs uTextLatin1Funcs = {
+ sizeof(UTextFuncs),
+ 0,
+ 0,
+ 0,
+ uTextLatin1Clone,
+ uTextLatin1NativeLength,
+ uTextLatin1Access,
+ uTextLatin1Extract,
+ nullptr,
+ nullptr,
+ uTextLatin1MapOffsetToNative,
+ uTextLatin1MapNativeIndexToUTF16,
+ uTextLatin1Close,
+ nullptr,
+ nullptr,
+ nullptr
+};
+
+static UText* uTextLatin1Clone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
+{
+ ASSERT_UNUSED(deep, !deep);
+
+ if (U_FAILURE(*status))
+ return 0;
+
+ UText* result = utext_setup(destination, sizeof(UChar) * UTextWithBufferInlineCapacity, status);
+ if (U_FAILURE(*status))
+ return destination;
+
+ result->providerProperties = source->providerProperties;
+
+ // Point at the same position, but with an empty buffer.
+ result->chunkNativeStart = source->chunkNativeStart;
+ result->chunkNativeLimit = source->chunkNativeStart;
+ result->nativeIndexingLimit = static_cast<int32_t>(source->chunkNativeStart);
+ result->chunkOffset = 0;
+ result->context = source->context;
+ result->a = source->a;
+ result->pFuncs = &uTextLatin1Funcs;
+ result->chunkContents = (UChar*)result->pExtra;
+ memset(const_cast<UChar*>(result->chunkContents), 0, sizeof(UChar) * UTextWithBufferInlineCapacity);
+
+ return result;
+}
+
+static int64_t uTextLatin1NativeLength(UText* uText)
+{
+ return uText->a;
+}
+
+static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+{
+ int64_t length = uText->a;
+
+ if (forward) {
+ if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+ // Already inside the buffer. Set the new offset.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+ return TRUE;
+ }
+ if (index >= length && uText->chunkNativeLimit == length) {
+ // Off the end of the buffer, but we can't get it.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+ return FALSE;
+ }
+ } else {
+ if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+ // Already inside the buffer. Set the new offset.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+ return TRUE;
+ }
+ if (!index && !uText->chunkNativeStart) {
+ // Already at the beginning; can't go any farther.
+ uText->chunkOffset = 0;
+ return FALSE;
+ }
+ }
+
+ if (forward) {
+ uText->chunkNativeStart = index;
+ uText->chunkNativeLimit = uText->chunkNativeStart + UTextWithBufferInlineCapacity;
+ if (uText->chunkNativeLimit > length)
+ uText->chunkNativeLimit = length;
+
+ uText->chunkOffset = 0;
+ } else {
+ uText->chunkNativeLimit = index;
+ if (uText->chunkNativeLimit > length)
+ uText->chunkNativeLimit = length;
+
+ uText->chunkNativeStart = uText->chunkNativeLimit - UTextWithBufferInlineCapacity;
+ if (uText->chunkNativeStart < 0)
+ uText->chunkNativeStart = 0;
+
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+ }
+ uText->chunkLength = static_cast<int32_t>(uText->chunkNativeLimit - uText->chunkNativeStart);
+
+ StringImpl::copyChars(const_cast<UChar*>(uText->chunkContents), static_cast<const LChar*>(uText->context) + uText->chunkNativeStart, static_cast<unsigned>(uText->chunkLength));
+
+ uText->nativeIndexingLimit = uText->chunkLength;
+
+ return TRUE;
+}
+
+static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+{
+ int64_t length = uText->a;
+ if (U_FAILURE(*status))
+ return 0;
+
+ if (destCapacity < 0 || (!dest && destCapacity > 0)) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;
+ }
+
+ if (start < 0 || start > limit || (limit - start) > INT32_MAX) {
+ *status = U_INDEX_OUTOFBOUNDS_ERROR;
+ return 0;
+ }
+
+ if (start > length)
+ start = length;
+ if (limit > length)
+ limit = length;
+
+ length = limit - start;
+
+ if (!length)
+ return 0;
+
+ if (destCapacity > 0 && !dest) {
+ int32_t trimmedLength = static_cast<int32_t>(length);
+ if (trimmedLength > destCapacity)
+ trimmedLength = destCapacity;
+
+ StringImpl::copyChars(dest, static_cast<const LChar*>(uText->context) + start, static_cast<unsigned>(trimmedLength));
+ }
+
+ if (length < destCapacity) {
+ dest[length] = 0;
+ if (*status == U_STRING_NOT_TERMINATED_WARNING)
+ *status = U_ZERO_ERROR;
+ } else if (length == destCapacity)
+ *status = U_STRING_NOT_TERMINATED_WARNING;
+ else
+ *status = U_BUFFER_OVERFLOW_ERROR;
+
+ return static_cast<int32_t>(length);
+}
+
+static int64_t uTextLatin1MapOffsetToNative(const UText* uText)
+{
+ return uText->chunkNativeStart + uText->chunkOffset;
+}
+
+static int32_t uTextLatin1MapNativeIndexToUTF16(const UText* uText, int64_t nativeIndex)
+{
+ ASSERT_UNUSED(uText, uText->chunkNativeStart >= nativeIndex);
+ ASSERT_UNUSED(uText, nativeIndex < uText->chunkNativeLimit);
+ return static_cast<int32_t>(nativeIndex);
+}
+
+static void uTextLatin1Close(UText* uText)
+{
+ uText->context = nullptr;
+}
+
+UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status)
+{
+ if (U_FAILURE(*status))
+ return nullptr;
+ if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return nullptr;
+ }
+ UText* text = utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status);
+ if (U_FAILURE(*status)) {
+ ASSERT(!text);
+ return nullptr;
+ }
+
+ text->context = string;
+ text->a = length;
+ text->pFuncs = &uTextLatin1Funcs;
+ text->chunkContents = (UChar*)text->pExtra;
+ memset(const_cast<UChar*>(text->chunkContents), 0, sizeof(UChar) * UTextWithBufferInlineCapacity);
+
+ return text;
+}
+
+
+// Latin1ContextAware provider
+
+static UText* uTextLatin1ContextAwareClone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextLatin1ContextAwareNativeLength(UText*);
+static UBool uTextLatin1ContextAwareAccess(UText*, int64_t, UBool);
+static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static void uTextLatin1ContextAwareClose(UText*);
+
+static const struct UTextFuncs textLatin1ContextAwareFuncs = {
+ sizeof(UTextFuncs),
+ 0,
+ 0,
+ 0,
+ uTextLatin1ContextAwareClone,
+ uTextLatin1ContextAwareNativeLength,
+ uTextLatin1ContextAwareAccess,
+ uTextLatin1ContextAwareExtract,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ uTextLatin1ContextAwareClose,
+ nullptr,
+ nullptr,
+ nullptr
+};
+
+static inline UTextProviderContext textLatin1ContextAwareGetCurrentContext(const UText* text)
+{
+ if (!text->chunkContents)
+ return UTextProviderContext::NoContext;
+ return text->chunkContents == text->pExtra ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
+}
+
+static void textLatin1ContextAwareMoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(text->chunkContents == text->pExtra);
+ if (forward) {
+ ASSERT(nativeIndex >= text->b && nativeIndex < nativeLength);
+ text->chunkNativeStart = nativeIndex;
+ text->chunkNativeLimit = nativeIndex + text->extraSize / sizeof(UChar);
+ if (text->chunkNativeLimit > nativeLength)
+ text->chunkNativeLimit = nativeLength;
+ } else {
+ ASSERT(nativeIndex > text->b && nativeIndex <= nativeLength);
+ text->chunkNativeLimit = nativeIndex;
+ text->chunkNativeStart = nativeIndex - text->extraSize / sizeof(UChar);
+ if (text->chunkNativeStart < text->b)
+ text->chunkNativeStart = text->b;
+ }
+ int64_t length = text->chunkNativeLimit - text->chunkNativeStart;
+ // Ensure chunk length is well defined if computed length exceeds int32_t range.
+ ASSERT(length < std::numeric_limits<int32_t>::max());
+ text->chunkLength = length < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(length) : 0;
+ text->nativeIndexingLimit = text->chunkLength;
+ text->chunkOffset = forward ? 0 : text->chunkLength;
+ StringImpl::copyChars(const_cast<UChar*>(text->chunkContents), static_cast<const LChar*>(text->p) + (text->chunkNativeStart - text->b), static_cast<unsigned>(text->chunkLength));
+}
+
+static void textLatin1ContextAwareSwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(!text->chunkContents || text->chunkContents == text->q);
+ text->chunkContents = static_cast<const UChar*>(text->pExtra);
+ textLatin1ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
+}
+
+static void textLatin1ContextAwareMoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(text->chunkContents == text->q);
+ ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b);
+ ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
+ ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
+ text->chunkNativeStart = 0;
+ text->chunkNativeLimit = text->b;
+ text->chunkLength = text->b;
+ text->nativeIndexingLimit = text->chunkLength;
+ int64_t offset = nativeIndex - text->chunkNativeStart;
+ // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);
+}
+
+static void textLatin1ContextAwareSwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(!text->chunkContents || text->chunkContents == text->pExtra);
+ text->chunkContents = static_cast<const UChar*>(text->q);
+ textLatin1ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
+}
+
+static UText* uTextLatin1ContextAwareClone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
+{
+ return uTextCloneImpl(destination, source, deep, status);
+}
+
+static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
+{
+ return text->a + text->b;
+}
+
+static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+{
+ if (!text->context)
+ return FALSE;
+ int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+ UBool isAccessible;
+ if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+ return isAccessible;
+ nativeIndex = uTextAccessPinIndex(nativeIndex, nativeLength);
+ UTextProviderContext currentContext = textLatin1ContextAwareGetCurrentContext(text);
+ UTextProviderContext newContext = uTextProviderContext(text, nativeIndex, forward);
+ ASSERT(newContext != UTextProviderContext::NoContext);
+ if (newContext == currentContext) {
+ if (currentContext == UTextProviderContext::PrimaryContext)
+ textLatin1ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
+ else
+ textLatin1ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
+ } else if (newContext == UTextProviderContext::PrimaryContext)
+ textLatin1ContextAwareSwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
+ else {
+ ASSERT(newContext == UTextProviderContext::PriorContext);
+ textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+ }
+ return TRUE;
+}
+
+static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+{
+ // In the present context, this text provider is used only with ICU functions
+ // that do not perform an extract operation.
+ ASSERT_NOT_REACHED();
+ *errorCode = U_UNSUPPORTED_ERROR;
+ return 0;
+}
+
+static void uTextLatin1ContextAwareClose(UText* text)
+{
+ text->context = nullptr;
+}
+
+UText* openLatin1ContextAwareUTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
+{
+ if (U_FAILURE(*status))
+ return 0;
+ if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;
+ }
+ UText* text = utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status);
+ if (U_FAILURE(*status)) {
+ ASSERT(!text);
+ return 0;
+ }
+
+ initializeContextAwareUTextProvider(text, &textLatin1ContextAwareFuncs, string, length, priorContext, priorContextLength);
+ return text;
+}
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProviderLatin1hfromrev203037trunkSourceWebCoreplatformtexticuUTextProviderLatin1h"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.h (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UTextProviderLatin1_h
+#define UTextProviderLatin1_h
+
+#include <unicode/utext.h>
+#include <wtf/text/LChar.h>
+
+namespace WTF {
+
+const int UTextWithBufferInlineCapacity = 16;
+
+struct UTextWithBuffer {
+ UText text;
+ UChar buffer[UTextWithBufferInlineCapacity];
+};
+
+UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status);
+UText* openLatin1ContextAwareUTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status);
+
+} // namespace WTF
+
+#endif // UTextProviderLatin1_h
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProviderUTF16cppfromrev203037trunkSourceWebCoreplatformtexticuUTextProviderUTF16cpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,184 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "UTextProviderUTF16.h"
+
+#include "UTextProvider.h"
+#include <algorithm>
+
+namespace WTF {
+
+// UTF16ContextAware provider
+
+static UText* uTextUTF16ContextAwareClone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextUTF16ContextAwareNativeLength(UText*);
+static UBool uTextUTF16ContextAwareAccess(UText*, int64_t, UBool);
+static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static void uTextUTF16ContextAwareClose(UText*);
+
+static const struct UTextFuncs textUTF16ContextAwareFuncs = {
+ sizeof(UTextFuncs),
+ 0,
+ 0,
+ 0,
+ uTextUTF16ContextAwareClone,
+ uTextUTF16ContextAwareNativeLength,
+ uTextUTF16ContextAwareAccess,
+ uTextUTF16ContextAwareExtract,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ uTextUTF16ContextAwareClose,
+ nullptr,
+ nullptr,
+ nullptr
+};
+
+static inline UTextProviderContext textUTF16ContextAwareGetCurrentContext(const UText* text)
+{
+ if (!text->chunkContents)
+ return UTextProviderContext::NoContext;
+ return text->chunkContents == text->p ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
+}
+
+static void textUTF16ContextAwareMoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(text->chunkContents == text->p);
+ ASSERT_UNUSED(forward, forward ? nativeIndex >= text->b : nativeIndex > text->b);
+ ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
+ text->chunkNativeStart = text->b;
+ text->chunkNativeLimit = nativeLength;
+ int64_t length = text->chunkNativeLimit - text->chunkNativeStart;
+ // Ensure chunk length is well defined if computed length exceeds int32_t range.
+ ASSERT(length < std::numeric_limits<int32_t>::max());
+ text->chunkLength = length < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(length) : 0;
+ text->nativeIndexingLimit = text->chunkLength;
+ int64_t offset = nativeIndex - text->chunkNativeStart;
+ // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);
+}
+
+static void textUTF16ContextAwareSwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(!text->chunkContents || text->chunkContents == text->q);
+ text->chunkContents = static_cast<const UChar*>(text->p);
+ textUTF16ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
+}
+
+static void textUTF16ContextAwareMoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(text->chunkContents == text->q);
+ ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b);
+ ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
+ ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);
+ text->chunkNativeStart = 0;
+ text->chunkNativeLimit = text->b;
+ text->chunkLength = text->b;
+ text->nativeIndexingLimit = text->chunkLength;
+ int64_t offset = nativeIndex - text->chunkNativeStart;
+ // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);
+}
+
+static void textUTF16ContextAwareSwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
+{
+ ASSERT(!text->chunkContents || text->chunkContents == text->p);
+ text->chunkContents = static_cast<const UChar*>(text->q);
+ textUTF16ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
+}
+
+static UText* uTextUTF16ContextAwareClone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
+{
+ return uTextCloneImpl(destination, source, deep, status);
+}
+
+static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
+{
+ return text->a + text->b;
+}
+
+static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+{
+ if (!text->context)
+ return FALSE;
+ int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+ UBool isAccessible;
+ if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+ return isAccessible;
+ nativeIndex = uTextAccessPinIndex(nativeIndex, nativeLength);
+ UTextProviderContext currentContext = textUTF16ContextAwareGetCurrentContext(text);
+ UTextProviderContext newContext = uTextProviderContext(text, nativeIndex, forward);
+ ASSERT(newContext != UTextProviderContext::NoContext);
+ if (newContext == currentContext) {
+ if (currentContext == UTextProviderContext::PrimaryContext)
+ textUTF16ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
+ else
+ textUTF16ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
+ } else if (newContext == UTextProviderContext::PrimaryContext)
+ textUTF16ContextAwareSwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
+ else {
+ ASSERT(newContext == UTextProviderContext::PriorContext);
+ textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+ }
+ return TRUE;
+}
+
+static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+{
+ // In the present context, this text provider is used only with ICU functions
+ // that do not perform an extract operation.
+ ASSERT_NOT_REACHED();
+ *errorCode = U_UNSUPPORTED_ERROR;
+ return 0;
+}
+
+static void uTextUTF16ContextAwareClose(UText* text)
+{
+ text->context = nullptr;
+}
+
+UText* openUTF16ContextAwareUTextProvider(UText* text, const UChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
+{
+ if (U_FAILURE(*status))
+ return 0;
+ if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;
+ }
+ text = utext_setup(text, 0, status);
+ if (U_FAILURE(*status)) {
+ ASSERT(!text);
+ return 0;
+ }
+
+ initializeContextAwareUTextProvider(text, &textUTF16ContextAwareFuncs, string, length, priorContext, priorContextLength);
+ return text;
+}
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWTFwtftexticuUTextProviderUTF16hfromrev203037trunkSourceWebCoreplatformtexticuUTextProviderUTF16h"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.h (from rev 203037, trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.h) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.h         (rev 0)
+++ trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UTextProviderUTF16_h
+#define UTextProviderUTF16_h
+
+#include <unicode/utext.h>
+
+namespace WTF {
+
+UText* openUTF16ContextAwareUTextProvider(UText*, const UChar*, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode*);
+
+} // namespace WTF
+
+#endif // UTextProviderUTF16_h
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextmacTextBreakIteratorInternalICUMacmmfromrev203037trunkSourceWebCoreplatformtextmacTextBreakIteratorInternalICUMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm (from rev 203037, trunk/Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm         (rev 0)
+++ trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+#include <wtf/RetainPtr.h>
+
+namespace WTF {
+
+static const int maxLocaleStringLength = 32;
+
+static inline RetainPtr<CFStringRef> textBreakLocalePreference()
+{
+ RetainPtr<CFPropertyListRef> locale = adoptCF(CFPreferencesCopyValue(CFSTR("AppleTextBreakLocale"),
+ kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
+ if (!locale || CFGetTypeID(locale.get()) != CFStringGetTypeID())
+ return nullptr;
+ return static_cast<CFStringRef>(locale.get());
+}
+
+static RetainPtr<CFStringRef> topLanguagePreference()
+{
+ RetainPtr<CFArrayRef> languagesArray = adoptCF(CFLocaleCopyPreferredLanguages());
+ if (!languagesArray)
+ return nullptr;
+ if (!CFArrayGetCount(languagesArray.get()))
+ return nullptr;
+ return static_cast<CFStringRef>(CFArrayGetValueAtIndex(languagesArray.get(), 0));
+}
+
+static void getLocale(CFStringRef locale, char localeStringBuffer[maxLocaleStringLength])
+{
+ // Empty string means "root locale", and that is what we use if we can't get a preference.
+ localeStringBuffer[0] = 0;
+ if (!locale)
+ return;
+ CFStringGetCString(locale, localeStringBuffer, maxLocaleStringLength, kCFStringEncodingASCII);
+}
+
+static void getSearchLocale(char localeStringBuffer[maxLocaleStringLength])
+{
+ getLocale(topLanguagePreference().get(), localeStringBuffer);
+}
+
+const char* currentSearchLocaleID()
+{
+ static char localeStringBuffer[maxLocaleStringLength];
+ static bool gotSearchLocale = false;
+ if (!gotSearchLocale) {
+ getSearchLocale(localeStringBuffer);
+ gotSearchLocale = true;
+ }
+ return localeStringBuffer;
+}
+
+static void getTextBreakLocale(char localeStringBuffer[maxLocaleStringLength])
+{
+ // If there is no text break locale, use the top language preference.
+ RetainPtr<CFStringRef> locale = textBreakLocalePreference();
+ if (locale) {
+ if (RetainPtr<CFStringRef> canonicalLocale = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, locale.get())))
+ locale = canonicalLocale;
+ } else
+ locale = topLanguagePreference();
+ getLocale(locale.get(), localeStringBuffer);
+}
+
+const char* currentTextBreakLocaleID()
+{
+ static char localeStringBuffer[maxLocaleStringLength];
+ static bool gotTextBreakLocale = false;
+ if (!gotTextBreakLocale) {
+ getTextBreakLocale(localeStringBuffer);
+ gotTextBreakLocale = true;
+ }
+ return localeStringBuffer;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWTFwtftextwinTextBreakIteratorInternalICUWincppfromrev203037trunkSourceWebCoreplatformtextwinTextBreakIteratorInternalICUWincpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WTF/wtf/text/win/TextBreakIteratorInternalICUWin.cpp (from rev 203037, trunk/Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp) (0 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/win/TextBreakIteratorInternalICUWin.cpp         (rev 0)
+++ trunk/Source/WTF/wtf/text/win/TextBreakIteratorInternalICUWin.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+namespace WTF {
+
+const char* currentSearchLocaleID()
+{
+ // FIXME: Should use system locale.
+ return "";
+}
+
+const char* currentTextBreakLocaleID()
+{
+ // Using en_US_POSIX now so word selection in address field works as expected as before (double-clicking
+ // in a URL selects a word delimited by periods rather than selecting the entire URL).
+ // However, this is not entirely correct - we should honor the system locale in the normal case.
+ // FIXME: <rdar://problem/6786703> Should use system locale for text breaking
+ return "en_US_POSIX";
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -2370,7 +2370,6 @@
</span><span class="cx"> platform/text/QuotedPrintable.cpp
</span><span class="cx"> platform/text/SegmentedString.cpp
</span><span class="cx"> platform/text/TextBoundaries.cpp
</span><del>- platform/text/TextBreakIterator.cpp
</del><span class="cx"> platform/text/TextCodec.cpp
</span><span class="cx"> platform/text/TextCodecICU.cpp
</span><span class="cx"> platform/text/TextCodecLatin1.cpp
</span><span class="lines">@@ -2383,10 +2382,6 @@
</span><span class="cx"> platform/text/TextEncodingRegistry.cpp
</span><span class="cx"> platform/text/TextStream.cpp
</span><span class="cx">
</span><del>- platform/text/icu/UTextProvider.cpp
- platform/text/icu/UTextProviderLatin1.cpp
- platform/text/icu/UTextProviderUTF16.cpp
-
</del><span class="cx"> plugins/DOMMimeType.cpp
</span><span class="cx"> plugins/DOMMimeTypeArray.cpp
</span><span class="cx"> plugins/DOMPlugin.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/ChangeLog        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,3 +1,154 @@
</span><ins>+2016-07-10 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Move breaking iterator code to WTF
+ https://bugs.webkit.org/show_bug.cgi?id=159594
+
+ Reviewed by Alex Christensen.
+
+ This is in preparation for giving StringView a GraphemeClusters iterator.
+ Such an interator needs to be implemented on top of our breaking iterator
+ code.
+
+ No new tests because there is no behavior change.
+
+ * CMakeLists.txt:
+ * PlatformEfl.cmake:
+ * PlatformGTK.cmake:
+ * PlatformMac.cmake:
+ * PlatformWin.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/CharacterData.cpp:
+ * editing/TextCheckingHelper.cpp:
+ * editing/TextIterator.cpp:
+ * editing/VisibleUnits.cpp:
+ * html/HTMLInputElement.cpp:
+ * html/HTMLTextAreaElement.cpp:
+ * html/InputType.cpp:
+ * html/TextFieldInputType.cpp:
+ * html/TextInputType.cpp:
+ * platform/LocalizedStrings.cpp:
+ * platform/graphics/StringTruncator.cpp:
+ * platform/graphics/cg/ColorCG.cpp:
+ (WTF::RetainPtr<CGColorRef>>::createValueForKey):
+ (WebCore::RetainPtr<CGColorRef>>::createValueForKey): Deleted.
+ * platform/graphics/mac/ComplexTextController.cpp:
+ * platform/text/LineBreakIteratorPoolICU.h:
+ (WebCore::LineBreakIteratorPool::LineBreakIteratorPool): Deleted.
+ (WebCore::LineBreakIteratorPool::sharedPool): Deleted.
+ (WebCore::LineBreakIteratorPool::makeLocaleWithBreakKeyword): Deleted.
+ (WebCore::LineBreakIteratorPool::take): Deleted.
+ (WebCore::LineBreakIteratorPool::put): Deleted.
+ * platform/text/TextBoundaries.cpp:
+ * platform/text/TextBreakIterator.cpp:
+ (WebCore::initializeIterator): Deleted.
+ (WebCore::initializeIteratorWithRules): Deleted.
+ (WebCore::setTextForIterator): Deleted.
+ (WebCore::setContextAwareTextForIterator): Deleted.
+ (WebCore::wordBreakIterator): Deleted.
+ (WebCore::sentenceBreakIterator): Deleted.
+ (WebCore::cursorMovementIterator): Deleted.
+ (WebCore::acquireLineBreakIterator): Deleted.
+ (WebCore::releaseLineBreakIterator): Deleted.
+ (WebCore::mapLineIteratorModeToRules): Deleted.
+ (WebCore::isCJKLocale): Deleted.
+ (WebCore::openLineBreakIterator): Deleted.
+ (WebCore::closeLineBreakIterator): Deleted.
+ (WebCore::compareAndSwapNonSharedCharacterBreakIterator): Deleted.
+ (WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator): Deleted.
+ (WebCore::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator): Deleted.
+ (WebCore::textBreakFirst): Deleted.
+ (WebCore::textBreakLast): Deleted.
+ (WebCore::textBreakNext): Deleted.
+ (WebCore::textBreakPrevious): Deleted.
+ (WebCore::textBreakPreceding): Deleted.
+ (WebCore::textBreakFollowing): Deleted.
+ (WebCore::textBreakCurrent): Deleted.
+ (WebCore::isTextBreak): Deleted.
+ (WebCore::isWordTextBreak): Deleted.
+ (WebCore::numGraphemeClusters): Deleted.
+ (WebCore::numCharactersInGraphemeClusters): Deleted.
+ * platform/text/TextBreakIterator.h:
+ (WebCore::LazyLineBreakIterator::LazyLineBreakIterator): Deleted.
+ (WebCore::LazyLineBreakIterator::~LazyLineBreakIterator): Deleted.
+ (WebCore::LazyLineBreakIterator::string): Deleted.
+ (WebCore::LazyLineBreakIterator::isLooseCJKMode): Deleted.
+ (WebCore::LazyLineBreakIterator::lastCharacter): Deleted.
+ (WebCore::LazyLineBreakIterator::secondToLastCharacter): Deleted.
+ (WebCore::LazyLineBreakIterator::setPriorContext): Deleted.
+ (WebCore::LazyLineBreakIterator::updatePriorContext): Deleted.
+ (WebCore::LazyLineBreakIterator::resetPriorContext): Deleted.
+ (WebCore::LazyLineBreakIterator::priorContextLength): Deleted.
+ (WebCore::LazyLineBreakIterator::get): Deleted.
+ (WebCore::LazyLineBreakIterator::resetStringAndReleaseIterator): Deleted.
+ (WebCore::NonSharedCharacterBreakIterator::operator TextBreakIterator*): Deleted.
+ * platform/text/cf/HyphenationCF.cpp:
+ * platform/text/efl/TextBreakIteratorInternalICUEfl.cpp:
+ (WebCore::currentSearchLocaleID): Deleted.
+ (WebCore::currentTextBreakLocaleID): Deleted.
+ * platform/text/enchant/TextCheckerEnchant.cpp:
+ * platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp:
+ (WebCore::currentSearchLocaleID): Deleted.
+ (WebCore::currentTextBreakLocaleID): Deleted.
+ * platform/text/icu/UTextProvider.cpp:
+ (WebCore::fixPointer): Deleted.
+ (WebCore::uTextCloneImpl): Deleted.
+ * platform/text/icu/UTextProvider.h:
+ (WebCore::uTextProviderContext): Deleted.
+ (WebCore::initializeContextAwareUTextProvider): Deleted.
+ (WebCore::uTextAccessPinIndex): Deleted.
+ (WebCore::uTextAccessInChunkOrOutOfRange): Deleted.
+ * platform/text/icu/UTextProviderLatin1.cpp:
+ (WebCore::uTextLatin1Clone): Deleted.
+ (WebCore::uTextLatin1NativeLength): Deleted.
+ (WebCore::uTextLatin1Access): Deleted.
+ (WebCore::uTextLatin1Extract): Deleted.
+ (WebCore::uTextLatin1MapOffsetToNative): Deleted.
+ (WebCore::uTextLatin1MapNativeIndexToUTF16): Deleted.
+ (WebCore::uTextLatin1Close): Deleted.
+ (WebCore::openLatin1UTextProvider): Deleted.
+ (WebCore::textLatin1ContextAwareGetCurrentContext): Deleted.
+ (WebCore::textLatin1ContextAwareMoveInPrimaryContext): Deleted.
+ (WebCore::textLatin1ContextAwareSwitchToPrimaryContext): Deleted.
+ (WebCore::textLatin1ContextAwareMoveInPriorContext): Deleted.
+ (WebCore::textLatin1ContextAwareSwitchToPriorContext): Deleted.
+ (WebCore::uTextLatin1ContextAwareClone): Deleted.
+ (WebCore::uTextLatin1ContextAwareNativeLength): Deleted.
+ (WebCore::uTextLatin1ContextAwareAccess): Deleted.
+ (WebCore::uTextLatin1ContextAwareExtract): Deleted.
+ (WebCore::uTextLatin1ContextAwareClose): Deleted.
+ (WebCore::openLatin1ContextAwareUTextProvider): Deleted.
+ * platform/text/icu/UTextProviderUTF16.cpp:
+ (WebCore::textUTF16ContextAwareGetCurrentContext): Deleted.
+ (WebCore::textUTF16ContextAwareMoveInPrimaryContext): Deleted.
+ (WebCore::textUTF16ContextAwareSwitchToPrimaryContext): Deleted.
+ (WebCore::textUTF16ContextAwareMoveInPriorContext): Deleted.
+ (WebCore::textUTF16ContextAwareSwitchToPriorContext): Deleted.
+ (WebCore::uTextUTF16ContextAwareClone): Deleted.
+ (WebCore::uTextUTF16ContextAwareNativeLength): Deleted.
+ (WebCore::uTextUTF16ContextAwareAccess): Deleted.
+ (WebCore::uTextUTF16ContextAwareExtract): Deleted.
+ (WebCore::uTextUTF16ContextAwareClose): Deleted.
+ (WebCore::openUTF16ContextAwareUTextProvider): Deleted.
+ * platform/text/mac/TextBoundaries.mm:
+ * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
+ (WebCore::textBreakLocalePreference): Deleted.
+ (WebCore::topLanguagePreference): Deleted.
+ (WebCore::getLocale): Deleted.
+ (WebCore::getSearchLocale): Deleted.
+ (WebCore::currentSearchLocaleID): Deleted.
+ (WebCore::getTextBreakLocale): Deleted.
+ (WebCore::currentTextBreakLocaleID): Deleted.
+ * platform/text/win/TextBreakIteratorInternalICUWin.cpp:
+ (WebCore::currentSearchLocaleID): Deleted.
+ (WebCore::currentTextBreakLocaleID): Deleted.
+ * rendering/RenderBlock.cpp:
+ * rendering/RenderText.cpp:
+ * rendering/RenderText.h:
+ * rendering/SimpleLineLayoutTextFragmentIterator.h:
+ * rendering/break_lines.cpp:
+ * rendering/break_lines.h:
+ * rendering/line/LineBreaker.h:
+
</ins><span class="cx"> 2016-07-10 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Crash on https://diafygi.github.io/webcrypto-examples with ENABLE_SUBTLE_CRYPTO
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -212,8 +212,6 @@
</span><span class="cx"> platform/text/Hyphenation.cpp
</span><span class="cx"> platform/text/LocaleICU.cpp
</span><span class="cx">
</span><del>- platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
-
</del><span class="cx"> platform/text/enchant/TextCheckerEnchant.cpp
</span><span class="cx">
</span><span class="cx"> platform/text/hyphen/HyphenationLibHyphen.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -182,8 +182,6 @@
</span><span class="cx">
</span><span class="cx"> platform/text/enchant/TextCheckerEnchant.cpp
</span><span class="cx">
</span><del>- platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
-
</del><span class="cx"> platform/text/hyphen/HyphenationLibHyphen.cpp
</span><span class="cx">
</span><span class="cx"> platform/unix/LoggingUnix.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -566,7 +566,6 @@
</span><span class="cx">
</span><span class="cx"> platform/text/mac/LocaleMac.mm
</span><span class="cx"> platform/text/mac/TextBoundaries.mm
</span><del>- platform/text/mac/TextBreakIteratorInternalICUMac.mm
</del><span class="cx"> platform/text/mac/TextCodecMac.cpp
</span><span class="cx">
</span><span class="cx"> rendering/RenderThemeMac.mm
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWin.cmake (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWin.cmake        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/PlatformWin.cmake        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -109,8 +109,6 @@
</span><span class="cx">
</span><span class="cx"> platform/text/cf/HyphenationCF.cpp
</span><span class="cx">
</span><del>- platform/text/win/TextBreakIteratorInternalICUWin.cpp
-
</del><span class="cx"> platform/win/BString.cpp
</span><span class="cx"> platform/win/BitmapInfo.cpp
</span><span class="cx"> platform/win/ClipboardUtilitiesWin.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1518,11 +1518,11 @@
</span><span class="cx">                 37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CA9E131822EC00D12F2A /* AccessibilityARIAGridCell.cpp */; };
</span><span class="cx">                 37F57ABB1A50727300876F98 /* AccessibilityARIAGridRow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CA9F131822EC00D12F2A /* AccessibilityARIAGridRow.cpp */; };
</span><span class="cx">                 37F57ABC1A50727700876F98 /* AccessibilityImageMapLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA0131822EC00D12F2A /* AccessibilityImageMapLink.cpp */; };
</span><ins>+                37F57ABC1A50728400876F98 /* AccessibilityMathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981ABC4131822EC00D12F2A /* AccessibilityMathMLElement.cpp */; };
</ins><span class="cx">                 37F57ABD1A50727A00876F98 /* AccessibilityList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA1131822EC00D12F2A /* AccessibilityList.cpp */; };
</span><span class="cx">                 37F57ABE1A50727E00876F98 /* AccessibilityListBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA2131822EC00D12F2A /* AccessibilityListBox.cpp */; };
</span><span class="cx">                 37F57ABF1A50728100876F98 /* AccessibilityListBoxOption.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA3131822EC00D12F2A /* AccessibilityListBoxOption.cpp */; };
</span><span class="cx">                 37F57AC01A50728400876F98 /* AccessibilityMediaControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA4131822EC00D12F2A /* AccessibilityMediaControls.cpp */; };
</span><del>-                37F57ABC1A50728400876F98 /* AccessibilityMathMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981ABC4131822EC00D12F2A /* AccessibilityMathMLElement.cpp */; };
</del><span class="cx">                 37F57AC11A50728700876F98 /* AccessibilityNodeObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2985709215CC532D006355CD /* AccessibilityNodeObject.cpp */; };
</span><span class="cx">                 37F57AC21A50728B00876F98 /* AccessibilityObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2981CAA5131822EC00D12F2A /* AccessibilityObject.cpp */; };
</span><span class="cx">                 37F57AC31A50728F00876F98 /* AccessibilityProgressIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A409C982116D0DDD007197BD /* AccessibilityProgressIndicator.cpp */; };
</span><span class="lines">@@ -1693,10 +1693,8 @@
</span><span class="cx">                 439046DD12DA25E800AF80A2 /* RenderMathMLMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046C912DA25E800AF80A2 /* RenderMathMLMath.cpp */; };
</span><span class="cx">                 439046DE12DA25E800AF80A2 /* RenderMathMLMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046CA12DA25E800AF80A2 /* RenderMathMLMath.h */; };
</span><span class="cx">                 439046DF12DA25E17BAF80A2 /* MathMLOperatorDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046CB12DA25E17BAF80A2 /* MathMLOperatorDictionary.cpp */; };
</span><del>-                439176DF12DA25E17BAF80A2 /* MathMLStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */; };
</del><span class="cx">                 439046DF12DA25E800AF80A2 /* RenderMathMLOperator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046CB12DA25E800AF80A2 /* RenderMathMLOperator.cpp */; };
</span><span class="cx">                 439046E012DA25E17BAF80A2 /* MathMLOperatorDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046CC12DA25E17BAF80A2 /* MathMLOperatorDictionary.h */; };
</span><del>-                439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */; };
</del><span class="cx">                 439046E012DA25E800AF80A2 /* RenderMathMLOperator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046CC12DA25E800AF80A2 /* RenderMathMLOperator.h */; };
</span><span class="cx">                 439046E112DA25E800AF80A2 /* RenderMathMLRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046CD12DA25E800AF80A2 /* RenderMathMLRoot.cpp */; };
</span><span class="cx">                 439046E212DA25E800AF80A2 /* RenderMathMLRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046CE12DA25E800AF80A2 /* RenderMathMLRoot.h */; };
</span><span class="lines">@@ -1710,6 +1708,8 @@
</span><span class="cx">                 439046EA12DA25E812AF80AC /* MathOperator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E812AF80AC /* MathOperator.h */; };
</span><span class="cx">                 439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */; };
</span><span class="cx">                 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; };
</span><ins>+                439176DF12DA25E17BAF80A2 /* MathMLStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */; };
+                439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */; };
</ins><span class="cx">                 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334013A6911C00C20F4F /* SVGAnimatedType.h */; };
</span><span class="cx">                 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */; };
</span><span class="cx">                 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */; };
</span><span class="lines">@@ -2814,12 +2814,6 @@
</span><span class="cx">                 7C73FB11191EF6F4007DE061 /* JSUserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */; };
</span><span class="cx">                 7C73FB12191EF6F4007DE061 /* JSUserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C73FB10191EF6F4007DE061 /* JSUserMessageHandler.h */; };
</span><span class="cx">                 7C73FB19191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */; };
</span><del>-                7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */; };
-                7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */; };
-                7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43518823B1900E5ED57 /* UTextProvider.cpp */; };
-                7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43618823B1900E5ED57 /* UTextProvider.h */; };
-                7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */; };
-                7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */; };
</del><span class="cx">                 7C7941E41C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */; };
</span><span class="cx">                 7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */; };
</span><span class="cx">                 7C83DE861D04CC5D00FEBCF3 /* SpringSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */; };
</span><span class="lines">@@ -4275,7 +4269,6 @@
</span><span class="cx">                 A5A2AF0B1829734300DE1729 /* PageDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5A2AF091829734300DE1729 /* PageDebuggable.cpp */; };
</span><span class="cx">                 A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A2AF0A1829734300DE1729 /* PageDebuggable.h */; };
</span><span class="cx">                 A5A7AA43132F0ECC00D3A3C2 /* WebAutocapitalize.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
</del><span class="cx">                 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
</span><span class="cx">                 A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
</span><span class="lines">@@ -5110,7 +5103,6 @@
</span><span class="cx">                 B2AFFC800D00A5C10030074D /* FontCascadeCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC780D00A5C10030074D /* FontCascadeCocoa.mm */; };
</span><span class="cx">                 B2AFFC830D00A5C10030074D /* GlyphPageMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7B0D00A5C10030074D /* GlyphPageMac.cpp */; };
</span><span class="cx">                 B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8C0D00A5DF0030074D /* TextBoundaries.mm */; };
</span><del>-                B2AFFC980D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8D0D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm */; };
</del><span class="cx">                 B2AFFC990D00A5DF0030074D /* TextCodecMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8E0D00A5DF0030074D /* TextCodecMac.cpp */; };
</span><span class="cx">                 B2AFFC9A0D00A5DF0030074D /* TextCodecMac.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC8F0D00A5DF0030074D /* TextCodecMac.h */; };
</span><span class="cx">                 B2B1F7160D00CAA8004AEA64 /* PointerEventsHitRules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */; };
</span><span class="lines">@@ -5122,8 +5114,6 @@
</span><span class="cx">                 B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */; };
</span><span class="cx">                 B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                B2C3DA380D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA080D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 B2C3DA390D006C1D00EF6F26 /* TextCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA090D006C1D00EF6F26 /* TextCodec.cpp */; };
</span><span class="cx">                 B2C3DA3A0D006C1D00EF6F26 /* TextCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA0A0D006C1D00EF6F26 /* TextCodec.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA3B0D006C1D00EF6F26 /* TextCodecICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA0B0D006C1D00EF6F26 /* TextCodecICU.cpp */; };
</span><span class="lines">@@ -5807,7 +5797,6 @@
</span><span class="cx">                 BCD0FC4F0DBD720B00B2F630 /* DOMRGBColorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */; };
</span><span class="cx">                 BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; };
</span><span class="cx">                 BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */; };
</span><del>-                BCD8A5F015F56F2C0098D071 /* TextBreakIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */; };
</del><span class="cx">                 BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */; };
</span><span class="cx">                 BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */; };
</span><span class="cx">                 BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */; };
</span><span class="lines">@@ -8691,6 +8680,7 @@
</span><span class="cx">                 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
</span><span class="cx">                 29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextUndoInsertionMarkupMac.mm; sourceTree = "<group>"; };
</span><span class="cx">                 297BE3D916C043D8003316BD /* PlatformSpeechSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizer.cpp; sourceTree = "<group>"; };
</span><ins>+                2981ABC4131822EC00D12F2A /* AccessibilityMathMLElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMathMLElement.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 2981CA9D131822EC00D12F2A /* AccessibilityARIAGrid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGrid.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2981CA9E131822EC00D12F2A /* AccessibilityARIAGridCell.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGridCell.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2981CA9F131822EC00D12F2A /* AccessibilityARIAGridRow.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGridRow.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -8699,7 +8689,6 @@
</span><span class="cx">                 2981CAA2131822EC00D12F2A /* AccessibilityListBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityListBox.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2981CAA3131822EC00D12F2A /* AccessibilityListBoxOption.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityListBoxOption.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2981CAA4131822EC00D12F2A /* AccessibilityMediaControls.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMediaControls.cpp; sourceTree = "<group>"; };
</span><del>-                2981ABC4131822EC00D12F2A /* AccessibilityMathMLElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMathMLElement.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 2981CAA5131822EC00D12F2A /* AccessibilityObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AccessibilityObject.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</span><span class="cx">                 2981CAA6131822EC00D12F2A /* AccessibilityRenderObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityRenderObject.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2981CAA7131822EC00D12F2A /* AccessibilityScrollbar.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityScrollbar.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -9036,8 +9025,8 @@
</span><span class="cx">                 31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEventCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
</span><ins>+                331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLPadded.h; sourceTree = "<group>"; };
</ins><span class="cx">                 331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSpace.h; sourceTree = "<group>"; };
</span><del>-                331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLPadded.h; sourceTree = "<group>"; };
</del><span class="cx">                 333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Notification.idl; sourceTree = "<group>"; };
</span><span class="cx">                 333F704F0FB49CA2008E12A6 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Notification.h; sourceTree = "<group>"; };
</span><span class="cx">                 33503C9910179A74003B47E1 /* NotificationClient.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = NotificationClient.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9311,10 +9300,8 @@
</span><span class="cx">                 439046C912DA25E800AF80A2 /* RenderMathMLMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLMath.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046CA12DA25E800AF80A2 /* RenderMathMLMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLMath.h; sourceTree = "<group>"; };
</span><span class="cx">                 439046CB12DA25E17BAF80A2 /* MathMLOperatorDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLOperatorDictionary.cpp; sourceTree = "<group>"; };
</span><del>-                439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLStyle.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 439046CB12DA25E800AF80A2 /* RenderMathMLOperator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLOperator.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046CC12DA25E17BAF80A2 /* MathMLOperatorDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLOperatorDictionary.h; sourceTree = "<group>"; };
</span><del>-                439176CC12DA25E17BAF80A2 /* MathMLStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLStyle.h; sourceTree = "<group>"; };
</del><span class="cx">                 439046CC12DA25E800AF80A2 /* RenderMathMLOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLOperator.h; sourceTree = "<group>"; };
</span><span class="cx">                 439046CD12DA25E800AF80A2 /* RenderMathMLRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLRoot.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046CE12DA25E800AF80A2 /* RenderMathMLRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLRoot.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9328,6 +9315,8 @@
</span><span class="cx">                 439046D612DA25E812AF80AC /* MathOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathOperator.h; sourceTree = "<group>"; };
</span><span class="cx">                 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLToken.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLToken.h; sourceTree = "<group>"; };
</span><ins>+                439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLStyle.cpp; sourceTree = "<group>"; };
+                439176CC12DA25E17BAF80A2 /* MathMLStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLStyle.h; sourceTree = "<group>"; };
</ins><span class="cx">                 439D334013A6911C00C20F4F /* SVGAnimatedType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedType.h; sourceTree = "<group>"; };
</span><span class="cx">                 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; };
</span><span class="cx">                 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatorFactory.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -10557,12 +10546,6 @@
</span><span class="cx">                 7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUserMessageHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7C73FB10191EF6F4007DE061 /* JSUserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUserMessageHandler.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUserMessageHandlersNamespaceCustom.cpp; sourceTree = "<group>"; };
</span><del>-                7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderLatin1.cpp; sourceTree = "<group>"; };
-                7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderLatin1.h; sourceTree = "<group>"; };
-                7C74D43518823B1900E5ED57 /* UTextProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProvider.cpp; sourceTree = "<group>"; };
-                7C74D43618823B1900E5ED57 /* UTextProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProvider.h; sourceTree = "<group>"; };
-                7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = "<group>"; };
-                7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = "<group>"; };
</del><span class="cx">                 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetectorsCoreSoftLink.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSoftLink.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringSolver.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -12075,7 +12058,6 @@
</span><span class="cx">                 A5A2AF091829734300DE1729 /* PageDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggable.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A5A2AF0A1829734300DE1729 /* PageDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageDebuggable.h; sourceTree = "<group>"; };
</span><span class="cx">                 A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutocapitalize.h; sourceTree = "<group>"; };
</span><del>-                A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
</del><span class="cx">                 A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = "<group>"; };
</span><span class="cx">                 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCocoa.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -13108,7 +13090,6 @@
</span><span class="cx">                 B2AFFC860D00A5DF0030074D /* mac-encodings.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "mac-encodings.txt"; sourceTree = "<group>"; };
</span><span class="cx">                 B2AFFC870D00A5DF0030074D /* make-charset-table.pl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; path = "make-charset-table.pl"; sourceTree = "<group>"; };
</span><span class="cx">                 B2AFFC8C0D00A5DF0030074D /* TextBoundaries.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = TextBoundaries.mm; sourceTree = "<group>"; };
</span><del>-                B2AFFC8D0D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = TextBreakIteratorInternalICUMac.mm; sourceTree = "<group>"; };
</del><span class="cx">                 B2AFFC8E0D00A5DF0030074D /* TextCodecMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecMac.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B2AFFC8F0D00A5DF0030074D /* TextCodecMac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextCodecMac.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PointerEventsHitRules.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -13120,8 +13101,6 @@
</span><span class="cx">                 B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SegmentedString.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SegmentedString.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBoundaries.h; sourceTree = "<group>"; };
</span><del>-                B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; };
-                B2C3DA080D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIteratorInternalICU.h; sourceTree = "<group>"; };
</del><span class="cx">                 B2C3DA090D006C1D00EF6F26 /* TextCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodec.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3DA0A0D006C1D00EF6F26 /* TextCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextCodec.h; sourceTree = "<group>"; };
</span><span class="cx">                 B2C3DA0B0D006C1D00EF6F26 /* TextCodecICU.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecICU.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -13831,7 +13810,6 @@
</span><span class="cx">                 BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRGBColorInternal.h; sourceTree = "<group>"; };
</span><span class="cx">                 BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedScriptSourceProvider.h; sourceTree = "<group>"; };
</span><del>-                BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIterator.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMapCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeCustom.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -18425,19 +18403,6 @@
</span><span class="cx">                         path = cocoa;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><del>-                7C74D43018823A4200E5ED57 /* icu */ = {
-                        isa = PBXGroup;
-                        children = (
-                                7C74D43518823B1900E5ED57 /* UTextProvider.cpp */,
-                                7C74D43618823B1900E5ED57 /* UTextProvider.h */,
-                                7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */,
-                                7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */,
-                                7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */,
-                                7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */,
-                        );
-                        path = icu;
-                        sourceTree = "<group>";
-                };
</del><span class="cx">                 7E4DE10B198B10810051CB02 /* cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -22335,7 +22300,6 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 B2B264590D00A77E000ACC1D /* cf */,
</span><del>-                                7C74D43018823A4200E5ED57 /* icu */,
</del><span class="cx">                                 A516E8B2136E04C00076C3C0 /* ios */,
</span><span class="cx">                                 B2C3D9F90D006C1D00EF6F26 /* mac */,
</span><span class="cx">                                 B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */,
</span><span class="lines">@@ -22347,7 +22311,6 @@
</span><span class="cx">                                 453EB635159C570400001BB7 /* DateTimeFormat.h */,
</span><span class="cx">                                 CECCFC3A141973D5002A0AC1 /* DecodeEscapeSequences.h */,
</span><span class="cx">                                 375CD231119D43C800A2A859 /* Hyphenation.h */,
</span><del>-                                A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */,
</del><span class="cx">                                 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */,
</span><span class="cx">                                 89B5EAA011E8003D00F2367E /* LineEnding.h */,
</span><span class="cx">                                 7633A72413D8B33A008501B6 /* LocaleToScriptMapping.h */,
</span><span class="lines">@@ -22363,9 +22326,6 @@
</span><span class="cx">                                 97C0784F1165D5BE003A32EF /* SuffixTree.h */,
</span><span class="cx">                                 372C00C3129611F1005C9575 /* TextBoundaries.cpp */,
</span><span class="cx">                                 B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */,
</span><del>-                                BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */,
-                                B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */,
-                                B2C3DA080D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h */,
</del><span class="cx">                                 A7151BD712F1558F005A0F64 /* TextCheckerClient.h */,
</span><span class="cx">                                 A77D0011133B0AEB00D6658C /* TextChecking.h */,
</span><span class="cx">                                 B2C3DA090D006C1D00EF6F26 /* TextCodec.cpp */,
</span><span class="lines">@@ -22409,7 +22369,6 @@
</span><span class="cx">                                 B2AFFC860D00A5DF0030074D /* mac-encodings.txt */,
</span><span class="cx">                                 B2AFFC870D00A5DF0030074D /* make-charset-table.pl */,
</span><span class="cx">                                 B2AFFC8C0D00A5DF0030074D /* TextBoundaries.mm */,
</span><del>-                                B2AFFC8D0D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm */,
</del><span class="cx">                                 B2AFFC8E0D00A5DF0030074D /* TextCodecMac.cpp */,
</span><span class="cx">                                 B2AFFC8F0D00A5DF0030074D /* TextCodecMac.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -27400,7 +27359,6 @@
</span><span class="cx">                                 BCFF64920EAD15C200C1D6F7 /* LengthSize.h in Headers */,
</span><span class="cx">                                 84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
</span><span class="cx">                                 B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
</span><del>-                                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */,
</del><span class="cx">                                 AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
</span><span class="cx">                                 89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */,
</span><span class="cx">                                 FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
</span><span class="lines">@@ -28622,8 +28580,6 @@
</span><span class="cx">                                 CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */,
</span><span class="cx">                                 0F54DCE61881051D003EEDBB /* TextAutoSizing.h in Headers */,
</span><span class="cx">                                 B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */,
</span><del>-                                B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */,
-                                B2C3DA380D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h in Headers */,
</del><span class="cx">                                 A7151BD812F1558F005A0F64 /* TextCheckerClient.h in Headers */,
</span><span class="cx">                                 A77D0012133B0AEB00D6658C /* TextChecking.h in Headers */,
</span><span class="cx">                                 A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */,
</span><span class="lines">@@ -28766,9 +28722,6 @@
</span><span class="cx">                                 BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */,
</span><span class="cx">                                 BC8BF15A1058141800A40A07 /* UserStyleSheetTypes.h in Headers */,
</span><span class="cx">                                 BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */,
</span><del>-                                7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */,
-                                7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */,
-                                7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */,
</del><span class="cx">                                 1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */,
</span><span class="cx">                                 2E3BBF081162DA1100B9409A /* UUID.h in Headers */,
</span><span class="cx">                                 F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */,
</span><span class="lines">@@ -32183,8 +32136,6 @@
</span><span class="cx">                                 0F54DCE51881051D003EEDBB /* TextAutoSizing.cpp in Sources */,
</span><span class="cx">                                 372C00C4129611F1005C9575 /* TextBoundaries.cpp in Sources */,
</span><span class="cx">                                 B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */,
</span><del>-                                BCD8A5F015F56F2C0098D071 /* TextBreakIterator.cpp in Sources */,
-                                B2AFFC980D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm in Sources */,
</del><span class="cx">                                 A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */,
</span><span class="cx">                                 B2C3DA390D006C1D00EF6F26 /* TextCodec.cpp in Sources */,
</span><span class="cx">                                 B2C3DA3B0D006C1D00EF6F26 /* TextCodecICU.cpp in Sources */,
</span><span class="lines">@@ -32303,9 +32254,6 @@
</span><span class="cx">                                 7CE68344192143A800F4D928 /* UserMessageHandlerDescriptor.cpp in Sources */,
</span><span class="cx">                                 7C73FB07191EF417007DE061 /* UserMessageHandlersNamespace.cpp in Sources */,
</span><span class="cx">                                 BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */,
</span><del>-                                7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */,
-                                7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */,
-                                7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */,
</del><span class="cx">                                 1FAFBF1815A5FA6E00083A20 /* UTIUtilities.mm in Sources */,
</span><span class="cx">                                 2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */,
</span><span class="cx">                                 F5A154271279534D00D0B0C0 /* ValidationMessage.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> #include "ProcessingInstruction.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/Ref.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextCheckingHelpercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextCheckingHelper.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextCheckingHelper.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/editing/TextCheckingHelper.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "Settings.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextCheckerClient.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> #include "SimpleLineLayout.h"
</span><span class="cx"> #include "SimpleLineLayoutResolver.h"
</span><span class="cx"> #include "TextBoundaries.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> #include "VisibleUnits.h"
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="cx"> #if !UCONFIG_NO_COLLATION
</span><del>-#include "TextBreakIteratorInternalICU.h"
</del><span class="cx"> #include <unicode/usearch.h>
</span><ins>+#include <wtf/text/TextBreakIteratorInternalICU.h>
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> using namespace WTF::Unicode;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> #include "RenderedPosition.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextBoundaries.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "VisibleSelection.h"
</span><span class="cx"> #include "htmlediting.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -60,9 +60,9 @@
</span><span class="cx"> #include "ScopedEventQueue.h"
</span><span class="cx"> #include "SearchInputType.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> #include "TouchEvent.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> #include "RenderTextControlMultiLine.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="cx"> #include "TextNodeTraversal.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/html/InputType.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "SubmitInputType.h"
</span><span class="cx"> #include "TelephoneInputType.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextInputType.h"
</span><span class="cx"> #include "TimeInputType.h"
</span><span class="cx"> #include "URLInputType.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextFieldInputType.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> #include "RenderTextControlSingleLine.h"
</span><span class="cx"> #include "RenderTheme.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include "TextEvent.h"
</span><span class="cx"> #include "TextIterator.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextInputType.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextInputType.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/html/TextInputType.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">
</span><span class="cx"> #include "HTMLInputElement.h"
</span><span class="cx"> #include "InputTypeNames.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LocalizedStrings.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -29,9 +29,9 @@
</span><span class="cx">
</span><span class="cx"> #include "IntSize.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="cx"> #if USE(CF)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsStringTruncatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/StringTruncator.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/StringTruncator.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/graphics/StringTruncator.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include "StringTruncator.h"
</span><span class="cx">
</span><span class="cx"> #include "FontCascade.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextRun.h"
</span><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -40,7 +40,21 @@
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><ins>+static CGColorRef leakCGColor(const Color&);
+}
</ins><span class="cx">
</span><ins>+namespace WTF {
+
+template<>
+RetainPtr<CGColorRef> TinyLRUCachePolicy<WebCore::Color, RetainPtr<CGColorRef>>::createValueForKey(const WebCore::Color& color)
+{
+ return adoptCF(WebCore::leakCGColor(color));
+}
+
+} // namespace WTF
+
+namespace WebCore {
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> static CGColorRef createCGColorWithDeviceRGBA(CGColorRef sourceColor)
</span><span class="cx"> {
</span><span class="lines">@@ -108,12 +122,6 @@
</span><span class="cx"> return CGColorCreate(sRGBColorSpaceRef(), components);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<>
-RetainPtr<CGColorRef> TinyLRUCachePolicy<Color, RetainPtr<CGColorRef>>::createValueForKey(const Color& color)
-{
- return adoptCF(leakCGColor(color));
-}
-
</del><span class="cx"> CGColorRef cachedCGColor(const Color& color)
</span><span class="cx"> {
</span><span class="cx"> switch (color.rgb()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderText.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextRun.h"
</span><span class="cx"> #include <wtf/Optional.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextLineBreakIteratorPoolICUh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,127 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LineBreakIteratorPoolICU_h
-#define LineBreakIteratorPoolICU_h
-
-#include "TextBreakIterator.h"
-#include "TextBreakIteratorInternalICU.h"
-#include <unicode/ubrk.h>
-#include <wtf/Assertions.h>
-#include <wtf/HashMap.h>
-#include <wtf/ThreadSpecific.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-class LineBreakIteratorPool {
- WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool);
-public:
- LineBreakIteratorPool() { }
-
- static LineBreakIteratorPool& sharedPool()
- {
- static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::ThreadSpecific<LineBreakIteratorPool>;
- return **pool;
- }
-
- static String makeLocaleWithBreakKeyword(const AtomicString& locale, LineBreakIteratorMode mode)
- {
- StringBuilder localeWithKeyword;
- localeWithKeyword.append(locale);
- localeWithKeyword.appendLiteral("@break=");
- switch (mode) {
- case LineBreakIteratorModeUAX14:
- ASSERT_NOT_REACHED();
- break;
- case LineBreakIteratorModeUAX14Loose:
- localeWithKeyword.appendLiteral("loose");
- break;
- case LineBreakIteratorModeUAX14Normal:
- localeWithKeyword.appendLiteral("normal");
- break;
- case LineBreakIteratorModeUAX14Strict:
- localeWithKeyword.appendLiteral("strict");
- break;
- }
- return localeWithKeyword.toString();
- }
-
- TextBreakIterator* take(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
- {
- AtomicString localeWithOptionalBreakKeyword;
- if (mode == LineBreakIteratorModeUAX14)
- localeWithOptionalBreakKeyword = locale;
- else
- localeWithOptionalBreakKeyword = makeLocaleWithBreakKeyword(locale, mode);
-
- TextBreakIterator* iterator = 0;
- for (size_t i = 0; i < m_pool.size(); ++i) {
- if (m_pool[i].first == localeWithOptionalBreakKeyword) {
- iterator = m_pool[i].second;
- m_pool.remove(i);
- break;
- }
- }
-
- if (!iterator) {
- iterator = openLineBreakIterator(localeWithOptionalBreakKeyword, mode, isCJK);
- if (!iterator)
- return 0;
- }
-
- ASSERT(!m_vendedIterators.contains(iterator));
- m_vendedIterators.set(iterator, localeWithOptionalBreakKeyword);
- return iterator;
- }
-
- void put(TextBreakIterator* iterator)
- {
- ASSERT_ARG(iterator, m_vendedIterators.contains(iterator));
-
- if (m_pool.size() == capacity) {
- closeLineBreakIterator(m_pool[0].second);
- m_pool.remove(0);
- }
-
- m_pool.append(Entry(m_vendedIterators.take(iterator), iterator));
- }
-
-private:
- static const size_t capacity = 4;
-
- typedef std::pair<AtomicString, TextBreakIterator*> Entry;
- typedef Vector<Entry, capacity> Pool;
- Pool m_pool;
- HashMap<TextBreakIterator*, AtomicString> m_vendedIterators;
-
- friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIteratorPool*();
-};
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBoundariescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextBoundaries.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBoundaries.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/TextBoundaries.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "TextBoundaries.h"
</span><span class="cx">
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/text/StringImpl.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/TextBreakIterator.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIterator.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/TextBreakIterator.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,929 +0,0 @@
</span><del>-/*
- * (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2015 Apple Inc. All rights reserved.
- * Copyright (C) 2007-2009 Torch Mobile, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "TextBreakIterator.h"
-
-#include "LineBreakIteratorPoolICU.h"
-#include "UTextProviderLatin1.h"
-#include "UTextProviderUTF16.h"
-#include <mutex>
-#include <wtf/Atomics.h>
-#include <wtf/text/StringView.h>
-
-// FIXME: This needs a better name
-#define ADDITIONAL_EMOJI_SUPPORT (PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100))
-
-namespace WebCore {
-
-// Iterator initialization
-
-static TextBreakIterator* initializeIterator(UBreakIteratorType type, const char* locale = currentTextBreakLocaleID())
-{
- UErrorCode openStatus = U_ZERO_ERROR;
- TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, locale, 0, 0, &openStatus));
- ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
- return iterator;
-}
-
-#if !PLATFORM(IOS)
-
-static TextBreakIterator* initializeIteratorWithRules(const char* breakRules)
-{
- UParseError parseStatus;
- UErrorCode openStatus = U_ZERO_ERROR;
- unsigned length = strlen(breakRules);
- auto upconvertedCharacters = StringView(reinterpret_cast<const LChar*>(breakRules), length).upconvertedCharacters();
- TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(upconvertedCharacters, length, 0, 0, &parseStatus, &openStatus));
- ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);
- return iterator;
-}
-
-#endif
-
-
-// Iterator text setting
-
-static TextBreakIterator* setTextForIterator(TextBreakIterator& iterator, StringView string)
-{
- if (string.is8Bit()) {
- UTextWithBuffer textLocal;
- textLocal.text = UTEXT_INITIALIZER;
- textLocal.text.extraSize = sizeof(textLocal.buffer);
- textLocal.text.pExtra = textLocal.buffer;
-
- UErrorCode openStatus = U_ZERO_ERROR;
- UText* text = openLatin1UTextProvider(&textLocal, string.characters8(), string.length(), &openStatus);
- if (U_FAILURE(openStatus)) {
- LOG_ERROR("uTextOpenLatin1 failed with status %d", openStatus);
- return nullptr;
- }
-
- UErrorCode setTextStatus = U_ZERO_ERROR;
- ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
- if (U_FAILURE(setTextStatus)) {
- LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
- return nullptr;
- }
-
- utext_close(text);
- } else {
- UErrorCode setTextStatus = U_ZERO_ERROR;
- ubrk_setText(reinterpret_cast<UBreakIterator*>(&iterator), string.characters16(), string.length(), &setTextStatus);
- if (U_FAILURE(setTextStatus))
- return nullptr;
- }
-
- return &iterator;
-}
-
-static TextBreakIterator* setContextAwareTextForIterator(TextBreakIterator& iterator, StringView string, const UChar* priorContext, unsigned priorContextLength)
-{
- if (string.is8Bit()) {
- UTextWithBuffer textLocal;
- textLocal.text = UTEXT_INITIALIZER;
- textLocal.text.extraSize = sizeof(textLocal.buffer);
- textLocal.text.pExtra = textLocal.buffer;
-
- UErrorCode openStatus = U_ZERO_ERROR;
- UText* text = openLatin1ContextAwareUTextProvider(&textLocal, string.characters8(), string.length(), priorContext, priorContextLength, &openStatus);
- if (U_FAILURE(openStatus)) {
- LOG_ERROR("openLatin1ContextAwareUTextProvider failed with status %d", openStatus);
- return nullptr;
- }
-
- UErrorCode setTextStatus = U_ZERO_ERROR;
- ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
- if (U_FAILURE(setTextStatus)) {
- LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
- return nullptr;
- }
-
- utext_close(text);
- } else {
- UText textLocal = UTEXT_INITIALIZER;
-
- UErrorCode openStatus = U_ZERO_ERROR;
- UText* text = openUTF16ContextAwareUTextProvider(&textLocal, string.characters16(), string.length(), priorContext, priorContextLength, &openStatus);
- if (U_FAILURE(openStatus)) {
- LOG_ERROR("openUTF16ContextAwareUTextProvider failed with status %d", openStatus);
- return 0;
- }
-
- UErrorCode setTextStatus = U_ZERO_ERROR;
- ubrk_setUText(reinterpret_cast<UBreakIterator*>(&iterator), text, &setTextStatus);
- if (U_FAILURE(setTextStatus)) {
- LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
- return nullptr;
- }
-
- utext_close(text);
- }
-
- return &iterator;
-}
-
-
-// Static iterators
-
-TextBreakIterator* wordBreakIterator(StringView string)
-{
- static TextBreakIterator* staticWordBreakIterator = initializeIterator(UBRK_WORD);
- if (!staticWordBreakIterator)
- return nullptr;
-
- return setTextForIterator(*staticWordBreakIterator, string);
-}
-
-TextBreakIterator* sentenceBreakIterator(StringView string)
-{
- static TextBreakIterator* staticSentenceBreakIterator = initializeIterator(UBRK_SENTENCE);
- if (!staticSentenceBreakIterator)
- return nullptr;
-
- return setTextForIterator(*staticSentenceBreakIterator, string);
-}
-
-TextBreakIterator* cursorMovementIterator(StringView string)
-{
-#if !PLATFORM(IOS)
- // This rule set is based on character-break iterator rules of ICU 4.0
- // <http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt>.
- // The major differences from the original ones are listed below:
- // * Replaced '[\p{Grapheme_Cluster_Break = SpacingMark}]' with '[\p{General_Category = Spacing Mark} - $Extend]' for ICU 3.8 or earlier;
- // * Removed rules that prevent a cursor from moving after prepend characters (Bug 24342);
- // * Added rules that prevent a cursor from moving after virama signs of Indic languages except Tamil (Bug 15790), and;
- // * Added rules that prevent a cursor from moving before Japanese half-width katakara voiced marks.
- // * Added rules for regional indicator symbols.
- static const char* kRules =
- "$CR = [\\p{Grapheme_Cluster_Break = CR}];"
- "$LF = [\\p{Grapheme_Cluster_Break = LF}];"
- "$Control = [\\p{Grapheme_Cluster_Break = Control}];"
- "$VoiceMarks = [\\uFF9E\\uFF9F];" // Japanese half-width katakana voiced marks
- "$Extend = [\\p{Grapheme_Cluster_Break = Extend} $VoiceMarks - [\\u0E30 \\u0E32 \\u0E45 \\u0EB0 \\u0EB2]];"
- "$SpacingMark = [[\\p{General_Category = Spacing Mark}] - $Extend];"
- "$L = [\\p{Grapheme_Cluster_Break = L}];"
- "$V = [\\p{Grapheme_Cluster_Break = V}];"
- "$T = [\\p{Grapheme_Cluster_Break = T}];"
- "$LV = [\\p{Grapheme_Cluster_Break = LV}];"
- "$LVT = [\\p{Grapheme_Cluster_Break = LVT}];"
- "$Hin0 = [\\u0905-\\u0939];" // Devanagari Letter A,...,Ha
- "$HinV = \\u094D;" // Devanagari Sign Virama
- "$Hin1 = [\\u0915-\\u0939];" // Devanagari Letter Ka,...,Ha
- "$Ben0 = [\\u0985-\\u09B9];" // Bengali Letter A,...,Ha
- "$BenV = \\u09CD;" // Bengali Sign Virama
- "$Ben1 = [\\u0995-\\u09B9];" // Bengali Letter Ka,...,Ha
- "$Pan0 = [\\u0A05-\\u0A39];" // Gurmukhi Letter A,...,Ha
- "$PanV = \\u0A4D;" // Gurmukhi Sign Virama
- "$Pan1 = [\\u0A15-\\u0A39];" // Gurmukhi Letter Ka,...,Ha
- "$Guj0 = [\\u0A85-\\u0AB9];" // Gujarati Letter A,...,Ha
- "$GujV = \\u0ACD;" // Gujarati Sign Virama
- "$Guj1 = [\\u0A95-\\u0AB9];" // Gujarati Letter Ka,...,Ha
- "$Ori0 = [\\u0B05-\\u0B39];" // Oriya Letter A,...,Ha
- "$OriV = \\u0B4D;" // Oriya Sign Virama
- "$Ori1 = [\\u0B15-\\u0B39];" // Oriya Letter Ka,...,Ha
- "$Tel0 = [\\u0C05-\\u0C39];" // Telugu Letter A,...,Ha
- "$TelV = \\u0C4D;" // Telugu Sign Virama
- "$Tel1 = [\\u0C14-\\u0C39];" // Telugu Letter Ka,...,Ha
- "$Kan0 = [\\u0C85-\\u0CB9];" // Kannada Letter A,...,Ha
- "$KanV = \\u0CCD;" // Kannada Sign Virama
- "$Kan1 = [\\u0C95-\\u0CB9];" // Kannada Letter A,...,Ha
- "$Mal0 = [\\u0D05-\\u0D39];" // Malayalam Letter A,...,Ha
- "$MalV = \\u0D4D;" // Malayalam Sign Virama
- "$Mal1 = [\\u0D15-\\u0D39];" // Malayalam Letter A,...,Ha
- "$RI = [\\U0001F1E6-\\U0001F1FF];" // Emoji regional indicators
- "$ZWJ = \\u200D;" // Zero width joiner
- "$EmojiVar = [\\uFE0F];" // Emoji-style variation selector
-#if ADDITIONAL_EMOJI_SUPPORT
- "$EmojiForSeqs = [\\u2764 \\U0001F441 \\U0001F466-\\U0001F469 \\U0001F48B \\U0001F5E8];" // Emoji that participate in ZWJ sequences
- "$EmojiForMods = [\\u261D \\u26F9 \\u270A-\\u270D \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA \\U0001F3CB \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F575 \\U0001F590 \\U0001F595 \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0 \\U0001F918] ;" // Emoji that take Fitzpatrick modifiers
-#else
- "$EmojiForSeqs = [\\u2764 \\U0001F466-\\U0001F469 \\U0001F48B];" // Emoji that participate in ZWJ sequences
- "$EmojiForMods = [\\u261D \\u270A-\\u270C \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3C7 \\U0001F3CA \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0] ;" // Emoji that take Fitzpatrick modifiers
-#endif
- "$EmojiMods = [\\U0001F3FB-\\U0001F3FF];" // Fitzpatrick modifiers
- "!!chain;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "!!RINoChain;"
-#endif
- "!!forward;"
- "$CR $LF;"
- "$L ($L | $V | $LV | $LVT);"
- "($LV | $V) ($V | $T);"
- "($LVT | $T) $T;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$RI $RI $Extend* / $RI;"
- "$RI $RI $Extend*;"
- "[^$Control $CR $LF] $Extend;"
- "[^$Control $CR $LF] $SpacingMark;"
-#else
- "[^$Control $CR $LF] $Extend;"
- "[^$Control $CR $LF] $SpacingMark;"
- "$RI $RI / $RI;"
- "$RI $RI;"
-#endif
- "$Hin0 $HinV $Hin1;" // Devanagari Virama (forward)
- "$Ben0 $BenV $Ben1;" // Bengali Virama (forward)
- "$Pan0 $PanV $Pan1;" // Gurmukhi Virama (forward)
- "$Guj0 $GujV $Guj1;" // Gujarati Virama (forward)
- "$Ori0 $OriV $Ori1;" // Oriya Virama (forward)
- "$Tel0 $TelV $Tel1;" // Telugu Virama (forward)
- "$Kan0 $KanV $Kan1;" // Kannada Virama (forward)
- "$Mal0 $MalV $Mal1;" // Malayalam Virama (forward)
- "$ZWJ $EmojiForSeqs;" // Don't break in emoji ZWJ sequences
- "$EmojiForMods $EmojiVar? $EmojiMods;" // Don't break between relevant emoji (possibly with variation selector) and Fitzpatrick modifier
- "!!reverse;"
- "$LF $CR;"
- "($L | $V | $LV | $LVT) $L;"
- "($V | $T) ($LV | $V);"
- "$T ($LVT | $T);"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$Extend* $RI $RI / $Extend* $RI $RI;"
- "$Extend* $RI $RI;"
- "$Extend [^$Control $CR $LF];"
- "$SpacingMark [^$Control $CR $LF];"
-#else
- "$Extend [^$Control $CR $LF];"
- "$SpacingMark [^$Control $CR $LF];"
- "$RI $RI / $RI $RI;"
- "$RI $RI;"
-#endif
- "$Hin1 $HinV $Hin0;" // Devanagari Virama (backward)
- "$Ben1 $BenV $Ben0;" // Bengali Virama (backward)
- "$Pan1 $PanV $Pan0;" // Gurmukhi Virama (backward)
- "$Guj1 $GujV $Guj0;" // Gujarati Virama (backward)
- "$Ori1 $OriV $Ori0;" // Gujarati Virama (backward)
- "$Tel1 $TelV $Tel0;" // Telugu Virama (backward)
- "$Kan1 $KanV $Kan0;" // Kannada Virama (backward)
- "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward)
- "$EmojiForSeqs $ZWJ;" // Don't break in emoji ZWJ sequences
- "$EmojiMods $EmojiVar? $EmojiForMods;" // Don't break between relevant emoji (possibly with variation selector) and Fitzpatrick modifier
-#if ADDITIONAL_EMOJI_SUPPORT
- "!!safe_reverse;"
- "$RI $RI+;"
- "[$EmojiVar $EmojiMods]+ $EmojiForMods;"
- "!!safe_forward;"
- "$RI $RI+;"
- "$EmojiForMods [$EmojiVar $EmojiMods]+;";
-#else
- "[$EmojiVar $EmojiMods]+ $EmojiForMods;"
- "$EmojiForMods [$EmojiVar $EmojiMods]+;"
- "!!safe_reverse;"
- "!!safe_forward;";
-#endif
- static TextBreakIterator* staticCursorMovementIterator = initializeIteratorWithRules(kRules);
-#else // PLATFORM(IOS)
- // Use the special Thai character break iterator for all locales
- static TextBreakIterator* staticCursorMovementIterator = initializeIterator(UBRK_CHARACTER, "th");
-#endif // !PLATFORM(IOS)
-
- if (!staticCursorMovementIterator)
- return nullptr;
-
- return setTextForIterator(*staticCursorMovementIterator, string);
-}
-
-TextBreakIterator* acquireLineBreakIterator(StringView string, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode mode, bool isCJK)
-{
- TextBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale, mode, isCJK);
- if (!iterator)
- return nullptr;
-
- return setContextAwareTextForIterator(*iterator, string, priorContext, priorContextLength);
-}
-
-void releaseLineBreakIterator(TextBreakIterator* iterator)
-{
- ASSERT_ARG(iterator, iterator);
-
- LineBreakIteratorPool::sharedPool().put(iterator);
-}
-
-static const char* uax14Prologue =
- "!!chain;"
- "!!LBCMNoChain;"
- "!!lookAheadHardBreak;";
-
-static const char* uax14AssignmentsBefore =
- // explicitly enumerate $CJ since ICU versions prior to 49 don't support :LineBreak=Conditional_Japanese_Starter:
- "$CJ = ["
-#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
- ":LineBreak=Conditional_Japanese_Starter:"
-#else
- "\\u3041\\u3043\\u3045\\u3047\\u3049\\u3063\\u3083\\u3085\\u3087\\u308E\\u3095\\u3096\\u30A1\\u30A3\\u30A5\\u30A7"
- "\\u30A9\\u30C3\\u30E3\\u30E5\\u30E7\\u30EE\\u30F5\\u30F6\\u30FC"
- "\\u31F0\\u31F1\\u31F2\\u31F3\\u31F4\\u31F5\\u31F6\\u31F7\\u31F8\\u31F9\\u31FA\\u31FB\\u31FC\\u31FD\\u31FE\\u31FF"
- "\\uFF67\\uFF68\\uFF69\\uFF6A\\uFF6B\\uFF6C\\uFF6D\\uFF6E\\uFF6F\\uFF70"
-#endif
- "];";
-
-static const char* uax14AssignmentsCustomLooseCJK =
- "$BA_SUB = [\\u2010\\u2013];"
- "$EX_SUB = [\\u0021\\u003F\\uFF01\\uFF1F];"
- "$ID_SUB = '';"
- "$IN_SUB = [\\u2025\\u2026];"
- "$IS_SUB = [\\u003A\\u003B];"
- "$NS_SUB = [\\u203C\\u2047\\u2048\\u2049\\u3005\\u301C\\u303B\\u309D\\u309E\\u30A0\\u30FB\\u30FD\\u30FE\\uFF1A\\uFF1B\\uFF65];"
- "$PO_SUB = [\\u0025\\u00A2\\u00B0\\u2030\\u2032\\u2033\\u2103\\uFF05\\uFFE0];"
- "$PR_SUB = [\\u0024\\u00A3\\u00A5\\u20AC\\u2116\\uFF04\\uFFE1\\uFFE5];"
- "$ID_ADD = [$CJ $BA_SUB $EX_SUB $IN_SUB $IS_SUB $NS_SUB $PO_SUB $PR_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomLooseNonCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = [\\u2025\\u2026];"
- "$IS_SUB = '';"
- "$NS_SUB = [\\u3005\\u303B\\u309D\\u309E\\u30FD\\u30FE];"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ $IN_SUB $NS_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomNormalCJK =
- "$BA_SUB = [\\u2010\\u2013];"
- "$EX_SUB = '';"
- "$IN_SUB = '';"
- "$ID_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = [\\u301C\\u30A0];"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ $BA_SUB $NS_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomNormalNonCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = '';"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomStrictCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = '';"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = '';"
- "$NS_ADD = [$CJ];";
-
-#define uax14AssignmentsCustomStrictNonCJK uax14AssignmentsCustomStrictCJK
-#define uax14AssignmentsCustomDefaultCJK uax14AssignmentsCustomNormalCJK
-#define uax14AssignmentsCustomDefaultNonCJK uax14AssignmentsCustomStrictNonCJK
-
-static const char* uax14AssignmentsAfter =
- "$AI = [:LineBreak = Ambiguous:];"
- "$AL = [:LineBreak = Alphabetic:];"
- "$BA = [[:LineBreak = Break_After:] - $BA_SUB];"
- "$BB = [:LineBreak = Break_Before:];"
- "$BK = [:LineBreak = Mandatory_Break:];"
- "$B2 = [:LineBreak = Break_Both:];"
- "$CB = [:LineBreak = Contingent_Break:];"
- "$CL = [:LineBreak = Close_Punctuation:];"
- "$CM = [:LineBreak = Combining_Mark:];"
- "$CP = [:LineBreak = Close_Parenthesis:];"
- "$CR = [:LineBreak = Carriage_Return:];"
- "$EX = [[:LineBreak = Exclamation:] - $EX_SUB];"
- "$GL = [:LineBreak = Glue:];"
-#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
- "$HL = [:LineBreak = Hebrew_Letter:];"
-#else
- "$HL = [[:Hebrew:] & [:Letter:]];"
-#endif
- "$HY = [:LineBreak = Hyphen:];"
- "$H2 = [:LineBreak = H2:];"
- "$H3 = [:LineBreak = H3:];"
- "$ID = [[[[:LineBreak = Ideographic:] - $CJ] $ID_ADD] - $ID_SUB];"
- "$IN = [[:LineBreak = Inseparable:] - $IN_SUB];"
- "$IS = [[:LineBreak = Infix_Numeric:] - $IS_SUB];"
- "$JL = [:LineBreak = JL:];"
- "$JV = [:LineBreak = JV:];"
- "$JT = [:LineBreak = JT:];"
- "$LF = [:LineBreak = Line_Feed:];"
- "$NL = [:LineBreak = Next_Line:];"
- "$NS = [[[[:LineBreak = Nonstarter:] - $CJ] $NS_ADD] - $NS_SUB];"
- "$NU = [:LineBreak = Numeric:];"
- "$OP = [:LineBreak = Open_Punctuation:];"
- "$PO = [[:LineBreak = Postfix_Numeric:] - $PO_SUB];"
- "$PR = [[:LineBreak = Prefix_Numeric:] - $PR_SUB];"
- "$QU = [:LineBreak = Quotation:];"
- "$RI = [\\U0001F1E6-\\U0001F1FF];"
- "$SA = [:LineBreak = Complex_Context:];"
- "$SG = [:LineBreak = Surrogate:];"
- "$SP = [:LineBreak = Space:];"
- "$SY = [:LineBreak = Break_Symbols:];"
- "$WJ = [:LineBreak = Word_Joiner:];"
- "$XX = [:LineBreak = Unknown:];"
- "$ZW = [:LineBreak = ZWSpace:];"
- "$ZWJ = \\u200D;"
- "$EmojiVar = \\uFE0F;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$EmojiForSeqs = [\\u2764 \\U0001F441 \\U0001F466-\\U0001F469 \\U0001F48B \\U0001F5E8];"
- "$EmojiForMods = [\\u261D \\u26F9 \\u270A-\\u270D \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA \\U0001F3CB \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F575 \\U0001F590 \\U0001F595 \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0 \\U0001F918] ;" // Emoji that take Fitzpatrick modifiers
-#else
- "$EmojiForSeqs = [\\u2764 \\U0001F466-\\U0001F469 \\U0001F48B];"
- "$EmojiForMods = [\\u261D \\u270A-\\u270C \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3C7 \\U0001F3CA \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0] ;" // Emoji that take Fitzpatrick modifiers
-#endif
- "$EmojiMods = [\\U0001F3FB-\\U0001F3FF];"
- "$dictionary = [:LineBreak = Complex_Context:];"
- "$ALPlus = [$AL $AI $SA $SG $XX];"
- "$ALcm = $ALPlus $CM*;"
- "$BAcm = $BA $CM*;"
- "$BBcm = $BB $CM*;"
- "$B2cm = $B2 $CM*;"
- "$CLcm = $CL $CM*;"
- "$CPcm = $CP $CM*;"
- "$EXcm = $EX $CM*;"
- "$GLcm = $GL $CM*;"
- "$HLcm = $HL $CM*;"
- "$HYcm = $HY $CM*;"
- "$H2cm = $H2 $CM*;"
- "$H3cm = $H3 $CM*;"
- "$IDcm = $ID $CM*;"
- "$INcm = $IN $CM*;"
- "$IScm = $IS $CM*;"
- "$JLcm = $JL $CM*;"
- "$JVcm = $JV $CM*;"
- "$JTcm = $JT $CM*;"
- "$NScm = $NS $CM*;"
- "$NUcm = $NU $CM*;"
- "$OPcm = $OP $CM*;"
- "$POcm = $PO $CM*;"
- "$PRcm = $PR $CM*;"
- "$QUcm = $QU $CM*;"
- "$RIcm = $QU $CM*;"
- "$SYcm = $SY $CM*;"
- "$WJcm = $WJ $CM*;";
-
-static const char* uax14Forward =
- "!!forward;"
- "$CAN_CM = [^$SP $BK $CR $LF $NL $ZW $CM];"
- "$CANT_CM = [$SP $BK $CR $LF $NL $ZW $CM];"
- "$AL_FOLLOW_NOCM = [$BK $CR $LF $NL $ZW $SP];"
- "$AL_FOLLOW_CM = [$CL $CP $EX $HL $IS $SY $WJ $GL $OP $QU $BA $HY $NS $IN $NU $ALPlus];"
- "$AL_FOLLOW = [$AL_FOLLOW_NOCM $AL_FOLLOW_CM];"
- "$LB4Breaks = [$BK $CR $LF $NL];"
- "$LB4NonBreaks = [^$BK $CR $LF $NL];"
- "$LB8Breaks = [$LB4Breaks $ZW];"
- "$LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]];"
- "$LB18NonBreaks = [$LB8NonBreaks - [$SP]];"
- "$LB18Breaks = [$LB8Breaks $SP];"
- "$LB20NonBreaks = [$LB18NonBreaks - $CB];"
- "$ALPlus $CM+;"
- "$BA $CM+;"
- "$BB $CM+;"
- "$B2 $CM+;"
- "$CL $CM+;"
- "$CP $CM+;"
- "$EX $CM+;"
- "$GL $CM+;"
- "$HL $CM+;"
- "$HY $CM+;"
- "$H2 $CM+;"
- "$H3 $CM+;"
- "$ID $CM+;"
- "$IN $CM+;"
- "$IS $CM+;"
- "$JL $CM+;"
- "$JV $CM+;"
- "$JT $CM+;"
- "$NS $CM+;"
- "$NU $CM+;"
- "$OP $CM+;"
- "$PO $CM+;"
- "$PR $CM+;"
- "$QU $CM+;"
- "$SY $CM+;"
- "$WJ $CM+;"
- "$CR $LF {100};"
- "$LB4NonBreaks? $LB4Breaks {100};"
- "$CAN_CM $CM* $LB4Breaks {100};"
- "$CM+ $LB4Breaks {100};"
- "$LB4NonBreaks [$SP $ZW];"
- "$CAN_CM $CM* [$SP $ZW];"
- "$CM+ [$SP $ZW];"
- "$EmojiForSeqs $EmojiVar? $EmojiMods? $ZWJ $EmojiForSeqs;"
- "$CAN_CM $CM+;"
- "$CM+;"
- "$CAN_CM $CM* $WJcm;"
- "$LB8NonBreaks $WJcm;"
- "$CM+ $WJcm;"
- "$WJcm $CANT_CM;"
- "$WJcm $CAN_CM $CM*;"
- "$GLcm $CAN_CM $CM*;"
- "$GLcm $CANT_CM;"
- "[[$LB8NonBreaks] - [$SP $BA $HY]] $CM* $GLcm;"
- "$CM+ GLcm;"
- "$LB8NonBreaks $CL;"
- "$CAN_CM $CM* $CL;"
- "$CM+ $CL;"
- "$LB8NonBreaks $CP;"
- "$CAN_CM $CM* $CP;"
- "$CM+ $CP;"
- "$LB8NonBreaks $EX;"
- "$CAN_CM $CM* $EX;"
- "$CM+ $EX;"
- "$LB8NonBreaks $IS;"
- "$CAN_CM $CM* $IS;"
- "$CM+ $IS;"
- "$LB8NonBreaks $SY;"
- "$CAN_CM $CM* $SY;"
- "$CM+ $SY;"
- "$OPcm $SP* $CAN_CM $CM*;"
- "$OPcm $SP* $CANT_CM;"
- "$OPcm $SP+ $CM+ $AL_FOLLOW?;"
- "$QUcm $SP* $OPcm;"
- "($CLcm | $CPcm) $SP* $NScm;"
- "$B2cm $SP* $B2cm;"
- "$LB18NonBreaks $CM* $QUcm;"
- "$CM+ $QUcm;"
- "$QUcm .?;"
- "$QUcm $LB18NonBreaks $CM*;"
- "$LB20NonBreaks $CM* ($BAcm | $HYcm | $NScm); "
- "$BBcm [^$CB];"
- "$BBcm $LB20NonBreaks $CM*;"
- "$HLcm ($HYcm | $BAcm) [^$CB]?;"
- "($ALcm | $HLcm) $INcm;"
- "$CM+ $INcm;"
- "$IDcm $INcm;"
- "$INcm $INcm;"
- "$NUcm $INcm;"
- "$IDcm $POcm;"
- "$ALcm $NUcm;"
- "$HLcm $NUcm;"
- "$CM+ $NUcm;"
- "$NUcm $ALcm;"
- "$NUcm $HLcm;"
- "$PRcm $IDcm;"
- "$PRcm ($ALcm | $HLcm);"
- "$POcm ($ALcm | $HLcm);"
- "($PRcm | $POcm)? ($OPcm | $HYcm)? $NUcm ($NUcm | $SYcm | $IScm)* ($CLcm | $CPcm)? ($PRcm | $POcm)?;"
- "$JLcm ($JLcm | $JVcm | $H2cm | $H3cm);"
- "($JVcm | $H2cm) ($JVcm | $JTcm);"
- "($JTcm | $H3cm) $JTcm;"
- "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $INcm;"
- "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $POcm;"
- "$PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm);"
- "($ALcm | $HLcm) ($ALcm | $HLcm);"
- "$CM+ ($ALcm | $HLcm);"
- "$IScm ($ALcm | $HLcm);"
- "($ALcm | $HLcm | $NUcm) $OPcm;"
- "$CM+ $OPcm;"
- "$CPcm ($ALcm | $HLcm | $NUcm);"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$RIcm $RIcm;"
-#endif
- "$EmojiForMods $EmojiVar? $EmojiMods;";
-
-static const char* uax14Reverse =
- "!!reverse;"
- "$CM+ $ALPlus;"
- "$CM+ $BA;"
- "$CM+ $BB;"
- "$CM+ $B2;"
- "$CM+ $CL;"
- "$CM+ $CP;"
- "$CM+ $EX;"
- "$CM+ $GL;"
- "$CM+ $HL;"
- "$CM+ $HY;"
- "$CM+ $H2;"
- "$CM+ $H3;"
- "$CM+ $ID;"
- "$CM+ $IN;"
- "$CM+ $IS;"
- "$CM+ $JL;"
- "$CM+ $JV;"
- "$CM+ $JT;"
- "$CM+ $NS;"
- "$CM+ $NU;"
- "$CM+ $OP;"
- "$CM+ $PO;"
- "$CM+ $PR;"
- "$CM+ $QU;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$CM+ $RI;"
-#endif
- "$CM+ $SY;"
- "$CM+ $WJ;"
- "$CM+;"
- "$AL_FOLLOW $CM+ / ([$BK $CR $LF $NL $ZW {eof}] | $SP+ $CM+ $SP | $SP+ $CM* ([^$OP $CM $SP] | [$AL {eof}]));"
- "[$PR] / $CM+ [$BK $CR $LF $NL $ZW $SP {eof}];"
- "$LB4Breaks [$LB4NonBreaks-$CM];"
- "$LB4Breaks $CM+ $CAN_CM;"
- "$LF $CR;"
- "[$SP $ZW] [$LB4NonBreaks-$CM];"
- "[$SP $ZW] $CM+ $CAN_CM;"
- "$EmojiForSeqs $ZWJ $EmojiMods? $EmojiVar? $EmojiForSeqs;"
- "$CM+ $CAN_CM;"
- "$CM* $WJ $CM* $CAN_CM;"
- "$CM* $WJ [$LB8NonBreaks-$CM];"
- "$CANT_CM $CM* $WJ;"
- "$CM* $CAN_CM $CM* $WJ;"
- "$CM* $GL $CM* [$LB8NonBreaks-[$CM $SP $BA $HY]];"
- "$CANT_CM $CM* $GL;"
- "$CM* $CAN_CM $CM* $GL;"
- "$CL $CM+ $CAN_CM;"
- "$CP $CM+ $CAN_CM;"
- "$EX $CM+ $CAN_CM;"
- "$IS $CM+ $CAN_CM;"
- "$SY $CM+ $CAN_CM;"
- "$CL [$LB8NonBreaks-$CM];"
- "$CP [$LB8NonBreaks-$CM];"
- "$EX [$LB8NonBreaks-$CM];"
- "$IS [$LB8NonBreaks-$CM];"
- "$SY [$LB8NonBreaks-$CM];"
- "[$CL $CP $EX $IS $SY] $CM+ $SP+ $CM* $OP; "
- "$CM* $CAN_CM $SP* $CM* $OP;"
- "$CANT_CM $SP* $CM* $OP;"
- "$AL_FOLLOW? $CM+ $SP $SP* $CM* $OP;"
- "$AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP;"
- "$CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP;"
- "$SY $CM $SP+ $OP;"
- "$CM* $OP $SP* $CM* $QU;"
- "$CM* $NS $SP* $CM* ($CL | $CP);"
- "$CM* $B2 $SP* $CM* $B2;"
- "$CM* $QU $CM* $CAN_CM;"
- "$CM* $QU $LB18NonBreaks;"
- "$CM* $CAN_CM $CM* $QU;"
- "$CANT_CM $CM* $QU;"
- "$CM* ($BA | $HY | $NS) $CM* [$LB20NonBreaks-$CM];"
- "$CM* [$LB20NonBreaks-$CM] $CM* $BB;"
- "[^$CB] $CM* $BB;"
- "[^$CB] $CM* ($HY | $BA) $CM* $HL;"
- "$CM* $IN $CM* ($ALPlus | $HL);"
- "$CM* $IN $CM* $ID;"
- "$CM* $IN $CM* $IN;"
- "$CM* $IN $CM* $NU;"
- "$CM* $PO $CM* $ID;"
- "$CM* $NU $CM* ($ALPlus | $HL);"
- "$CM* ($ALPlus | $HL) $CM* $NU;"
- "$CM* $ID $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* $PO;"
- "($CM* ($PR | $PO))? ($CM* ($CL | $CP))? ($CM* ($NU | $IS | $SY))* $CM* $NU ($CM* ($OP | $HY))? ($CM* ($PR | $PO))?;"
- "$CM* ($H3 | $H2 | $JV | $JL) $CM* $JL;"
- "$CM* ($JT | $JV) $CM* ($H2 | $JV);"
- "$CM* $JT $CM* ($H3 | $JT);"
- "$CM* $IN $CM* ($H3 | $H2 | $JT | $JV | $JL);"
- "$CM* $PO $CM* ($H3 | $H2 | $JT | $JV | $JL);"
- "$CM* ($H3 | $H2 | $JT | $JV | $JL) $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* ($ALPlus | $HL);"
- "$CM* ($ALPlus | $HL) $CM* $IS;"
- "$CM* $OP $CM* ($ALPlus | $HL | $NU);"
- "$CM* ($ALPlus | $HL | $NU) $CM* $CP;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$CM* $RI $CM* $RI;"
-#endif
- "$EmojiMods $EmojiVar? $EmojiForMods;";
-
-static const char* uax14SafeForward =
- "!!safe_forward;"
- "[$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2 $PR $HY $BA $dictionary];"
- "$dictionary $dictionary;";
-
-static const char* uax14SafeReverse =
- "!!safe_reverse;"
- "$CM+ [^$CM $BK $CR $LF $NL $ZW $SP];"
- "$CM+ $SP / .;"
- "$SP+ $CM* $OP;"
- "$SP+ $CM* $QU;"
- "$SP+ $CM* ($CL | $CP);"
- "$SP+ $CM* $B2;"
- "$CM* ($HY | $BA) $CM* $HL;"
- "($CM* ($IS | $SY))+ $CM* $NU;"
- "($CL | $CP) $CM* ($NU | $IS | $SY);"
- "$dictionary $dictionary;";
-
-static String mapLineIteratorModeToRules(LineBreakIteratorMode mode, bool isCJK)
-{
- StringBuilder rulesBuilder;
- rulesBuilder.append(uax14Prologue);
- rulesBuilder.append(uax14AssignmentsBefore);
- switch (mode) {
- case LineBreakIteratorModeUAX14:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomDefaultCJK : uax14AssignmentsCustomDefaultNonCJK);
- break;
- case LineBreakIteratorModeUAX14Loose:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomLooseCJK : uax14AssignmentsCustomLooseNonCJK);
- break;
- case LineBreakIteratorModeUAX14Normal:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomNormalCJK : uax14AssignmentsCustomNormalNonCJK);
- break;
- case LineBreakIteratorModeUAX14Strict:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomStrictCJK : uax14AssignmentsCustomStrictNonCJK);
- break;
- }
- rulesBuilder.append(uax14AssignmentsAfter);
- rulesBuilder.append(uax14Forward);
- rulesBuilder.append(uax14Reverse);
- rulesBuilder.append(uax14SafeForward);
- rulesBuilder.append(uax14SafeReverse);
- return rulesBuilder.toString();
-}
-
-// Recognize BCP47 compliant primary language values of 'zh', 'ja', 'ko'
-// (in any combination of case), optionally followed by subtags. Don't
-// recognize 3-letter variants 'chi'/'zho', 'jpn', or 'kor' since BCP47
-// requires use of shortest language tag.
-bool isCJKLocale(const AtomicString& locale)
-{
- size_t length = locale.length();
- if (length < 2)
- return false;
- auto c1 = locale[0];
- auto c2 = locale[1];
- auto c3 = length == 2 ? 0 : locale[2];
- if (!c3 || c3 == '-' || c3 == '_' || c3 == '@') {
- if (c1 == 'z' || c1 == 'Z')
- return c2 == 'h' || c2 == 'H';
- if (c1 == 'j' || c1 == 'J')
- return c2 == 'a' || c2 == 'A';
- if (c1 == 'k' || c1 == 'K')
- return c2 == 'o' || c2 == 'O';
- }
- return false;
-}
-
-TextBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
-{
- UBreakIterator* ubrkIter;
- UErrorCode openStatus = U_ZERO_ERROR;
- bool localeIsEmpty = locale.isEmpty();
- if (mode == LineBreakIteratorModeUAX14)
- ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), 0, 0, &openStatus);
- else {
- UParseError parseStatus;
- auto rules = mapLineIteratorModeToRules(mode, isCJK);
- ubrkIter = ubrk_openRules(StringView(rules).upconvertedCharacters(), rules.length(), 0, 0, &parseStatus, &openStatus);
- }
- // locale comes from a web page and it can be invalid, leading ICU
- // to fail, in which case we fall back to the default locale.
- if (!localeIsEmpty && U_FAILURE(openStatus)) {
- openStatus = U_ZERO_ERROR;
- ubrkIter = ubrk_open(UBRK_LINE, currentTextBreakLocaleID(), 0, 0, &openStatus);
- }
-
- if (U_FAILURE(openStatus)) {
- LOG_ERROR("ubrk_open failed with status %d", openStatus);
- return nullptr;
- }
-
- return reinterpret_cast<TextBreakIterator*>(ubrkIter);
-}
-
-void closeLineBreakIterator(TextBreakIterator*& iterator)
-{
- UBreakIterator* ubrkIter = reinterpret_cast<UBreakIterator*>(iterator);
- ASSERT(ubrkIter);
- ubrk_close(ubrkIter);
- iterator = nullptr;
-}
-
-static TextBreakIterator* nonSharedCharacterBreakIterator;
-
-static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newValue)
-{
- return WTF::weakCompareAndSwap(&nonSharedCharacterBreakIterator, expected, newValue);
-}
-
-NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(StringView string)
-{
- m_iterator = nonSharedCharacterBreakIterator;
-
- bool createdIterator = m_iterator && compareAndSwapNonSharedCharacterBreakIterator(m_iterator, 0);
- if (!createdIterator)
- m_iterator = initializeIterator(UBRK_CHARACTER);
- if (!m_iterator)
- return;
-
- m_iterator = setTextForIterator(*m_iterator, string);
-}
-
-NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
-{
- if (!compareAndSwapNonSharedCharacterBreakIterator(0, m_iterator))
- ubrk_close(reinterpret_cast<UBreakIterator*>(m_iterator));
-}
-
-
-// Iterator implemenation.
-
-int textBreakFirst(TextBreakIterator* iterator)
-{
- return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator));
-}
-
-int textBreakLast(TextBreakIterator* iterator)
-{
- return ubrk_last(reinterpret_cast<UBreakIterator*>(iterator));
-}
-
-int textBreakNext(TextBreakIterator* iterator)
-{
- return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator));
-}
-
-int textBreakPrevious(TextBreakIterator* iterator)
-{
- return ubrk_previous(reinterpret_cast<UBreakIterator*>(iterator));
-}
-
-int textBreakPreceding(TextBreakIterator* iterator, int pos)
-{
- return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos);
-}
-
-int textBreakFollowing(TextBreakIterator* iterator, int pos)
-{
- return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos);
-}
-
-int textBreakCurrent(TextBreakIterator* iterator)
-{
- return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator));
-}
-
-bool isTextBreak(TextBreakIterator* iterator, int position)
-{
- return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position);
-}
-
-bool isWordTextBreak(TextBreakIterator* iterator)
-{
- int ruleStatus = ubrk_getRuleStatus(reinterpret_cast<UBreakIterator*>(iterator));
- return ruleStatus != UBRK_WORD_NONE;
-}
-
-unsigned numGraphemeClusters(const String& s)
-{
- unsigned stringLength = s.length();
-
- if (!stringLength)
- return 0;
-
- // The only Latin-1 Extended Grapheme Cluster is CR LF
- if (s.is8Bit() && !s.contains('\r'))
- return stringLength;
-
- NonSharedCharacterBreakIterator it(s);
- if (!it)
- return stringLength;
-
- unsigned num = 0;
- while (textBreakNext(it) != TextBreakDone)
- ++num;
- return num;
-}
-
-unsigned numCharactersInGraphemeClusters(const StringView& s, unsigned numGraphemeClusters)
-{
- unsigned stringLength = s.length();
-
- if (!stringLength)
- return 0;
-
- // The only Latin-1 Extended Grapheme Cluster is CR LF
- if (s.is8Bit() && !s.contains('\r'))
- return std::min(stringLength, numGraphemeClusters);
-
- NonSharedCharacterBreakIterator it(s);
- if (!it)
- return std::min(stringLength, numGraphemeClusters);
-
- for (unsigned i = 0; i < numGraphemeClusters; ++i) {
- if (textBreakNext(it) == TextBreakDone)
- return stringLength;
- }
- return textBreakCurrent(it);
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/TextBreakIterator.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIterator.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/TextBreakIterator.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,217 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
- * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TextBreakIterator_h
-#define TextBreakIterator_h
-
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/StringView.h>
-
-namespace WebCore {
-
-class TextBreakIterator;
-
-// Note: The returned iterator is good only until you get another iterator, with the exception of acquireLineBreakIterator.
-
-enum LineBreakIteratorMode {
- LineBreakIteratorModeUAX14,
- LineBreakIteratorModeUAX14Loose,
- LineBreakIteratorModeUAX14Normal,
- LineBreakIteratorModeUAX14Strict,
-};
-
-// This is similar to character break iterator in most cases, but is subject to
-// platform UI conventions. One notable example where this can be different
-// from character break iterator is Thai prepend characters, see bug 24342.
-// Use this for insertion point and selection manipulations.
-TextBreakIterator* cursorMovementIterator(StringView);
-
-TextBreakIterator* wordBreakIterator(StringView);
-TextBreakIterator* sentenceBreakIterator(StringView);
-
-WEBCORE_EXPORT TextBreakIterator* acquireLineBreakIterator(StringView, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode, bool isCJK);
-WEBCORE_EXPORT void releaseLineBreakIterator(TextBreakIterator*);
-TextBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode, bool isCJK);
-void closeLineBreakIterator(TextBreakIterator*&);
-
-int textBreakFirst(TextBreakIterator*);
-int textBreakLast(TextBreakIterator*);
-int textBreakNext(TextBreakIterator*);
-int textBreakPrevious(TextBreakIterator*);
-int textBreakCurrent(TextBreakIterator*);
-int textBreakPreceding(TextBreakIterator*, int);
-WEBCORE_EXPORT int textBreakFollowing(TextBreakIterator*, int);
-bool isTextBreak(TextBreakIterator*, int);
-bool isWordTextBreak(TextBreakIterator*);
-
-const int TextBreakDone = -1;
-
-WEBCORE_EXPORT bool isCJKLocale(const AtomicString&);
-
-class LazyLineBreakIterator {
-public:
- LazyLineBreakIterator()
- : m_iterator(nullptr)
- , m_cachedPriorContext(nullptr)
- , m_mode(LineBreakIteratorModeUAX14)
- , m_cachedPriorContextLength(0)
- , m_isCJK(false)
- {
- resetPriorContext();
- }
-
- LazyLineBreakIterator(String string, const AtomicString& locale = AtomicString(), LineBreakIteratorMode mode = LineBreakIteratorModeUAX14)
- : m_string(string)
- , m_locale(locale)
- , m_iterator(nullptr)
- , m_cachedPriorContext(nullptr)
- , m_mode(mode)
- , m_cachedPriorContextLength(0)
- {
- resetPriorContext();
- m_isCJK = isCJKLocale(locale);
- }
-
- ~LazyLineBreakIterator()
- {
- if (m_iterator)
- releaseLineBreakIterator(m_iterator);
- }
-
- String string() const { return m_string; }
- bool isLooseCJKMode() const { return m_isCJK && m_mode == LineBreakIteratorModeUAX14Loose; }
-
- UChar lastCharacter() const
- {
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- return m_priorContext[1];
- }
-
- UChar secondToLastCharacter() const
- {
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- return m_priorContext[0];
- }
-
- void setPriorContext(UChar last, UChar secondToLast)
- {
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- m_priorContext[0] = secondToLast;
- m_priorContext[1] = last;
- }
-
- void updatePriorContext(UChar last)
- {
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- m_priorContext[0] = m_priorContext[1];
- m_priorContext[1] = last;
- }
-
- void resetPriorContext()
- {
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- m_priorContext[0] = 0;
- m_priorContext[1] = 0;
- }
-
- unsigned priorContextLength() const
- {
- unsigned priorContextLength = 0;
- COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, TextBreakIterator_unexpected_prior_context_length);
- if (m_priorContext[1]) {
- ++priorContextLength;
- if (m_priorContext[0])
- ++priorContextLength;
- }
- return priorContextLength;
- }
-
- // Obtain text break iterator, possibly previously cached, where this iterator is (or has been)
- // initialized to use the previously stored string as the primary breaking context and using
- // previously stored prior context if non-empty.
- TextBreakIterator* get(unsigned priorContextLength)
- {
- ASSERT(priorContextLength <= priorContextCapacity);
- const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;
- if (!m_iterator) {
- m_iterator = acquireLineBreakIterator(m_string, m_locale, priorContext, priorContextLength, m_mode, m_isCJK);
- m_cachedPriorContext = priorContext;
- m_cachedPriorContextLength = priorContextLength;
- } else if (priorContext != m_cachedPriorContext || priorContextLength != m_cachedPriorContextLength) {
- resetStringAndReleaseIterator(m_string, m_locale, m_mode);
- return this->get(priorContextLength);
- }
- return m_iterator;
- }
-
- void resetStringAndReleaseIterator(String string, const AtomicString& locale, LineBreakIteratorMode mode)
- {
- if (m_iterator)
- releaseLineBreakIterator(m_iterator);
- m_string = string;
- m_locale = locale;
- m_iterator = nullptr;
- m_cachedPriorContext = nullptr;
- m_mode = mode;
- m_isCJK = isCJKLocale(locale);
- m_cachedPriorContextLength = 0;
- }
-
-private:
- static const unsigned priorContextCapacity = 2;
- String m_string;
- AtomicString m_locale;
- TextBreakIterator* m_iterator;
- const UChar* m_cachedPriorContext;
- LineBreakIteratorMode m_mode;
- unsigned m_cachedPriorContextLength;
- UChar m_priorContext[priorContextCapacity];
- bool m_isCJK;
-};
-
-// Iterates over "extended grapheme clusters", as defined in UAX #29.
-// Note that platform implementations may be less sophisticated - e.g. ICU prior to
-// version 4.0 only supports "legacy grapheme clusters".
-// Use this for general text processing, e.g. string truncation.
-
-class NonSharedCharacterBreakIterator {
- WTF_MAKE_NONCOPYABLE(NonSharedCharacterBreakIterator);
-public:
- WEBCORE_EXPORT NonSharedCharacterBreakIterator(StringView);
- WEBCORE_EXPORT ~NonSharedCharacterBreakIterator();
-
- operator TextBreakIterator*() const { return m_iterator; }
-
-private:
- TextBreakIterator* m_iterator;
-};
-
-// Counts the number of grapheme clusters. A surrogate pair or a sequence
-// of a non-combining character and following combining characters is
-// counted as 1 grapheme cluster.
-unsigned numGraphemeClusters(const String&);
-// Returns the number of characters which will be less than or equal to
-// the specified grapheme cluster length.
-unsigned numCharactersInGraphemeClusters(const StringView&, unsigned);
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorInternalICUh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/TextBreakIteratorInternalICU.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIteratorInternalICU.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/TextBreakIteratorInternalICU.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TextBreakIteratorInternalICU_h
-#define TextBreakIteratorInternalICU_h
-
-// FIXME: Now that this handles locales for ICU, not just for text breaking,
-// this file and the various implementation files should be renamed.
-
-namespace WebCore {
-
- const char* currentSearchLocaleID();
- const char* currentTextBreakLocaleID();
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextcfHyphenationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -27,13 +27,13 @@
</span><span class="cx"> #include "Hyphenation.h"
</span><span class="cx">
</span><span class="cx"> #include "Language.h"
</span><del>-#include "TextBreakIteratorInternalICU.h"
</del><span class="cx"> #include <wtf/ListHashSet.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx"> #include <wtf/TinyLRUCache.h>
</span><span class="cx"> #include <wtf/text/StringView.h>
</span><ins>+#include <wtf/text/TextBreakIteratorInternalICU.h>
</ins><span class="cx">
</span><del>-namespace WebCore {
</del><ins>+namespace WTF {
</ins><span class="cx">
</span><span class="cx"> template<>
</span><span class="cx"> class TinyLRUCachePolicy<AtomicString, RetainPtr<CFLocaleRef>>
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> {
</span><span class="cx"> // CF hyphenation functions use locale (regional formats) language, which doesn't necessarily match primary UI language,
</span><span class="cx"> // so we can't use default locale here. See <rdar://problem/14897664>.
</span><del>- RetainPtr<CFLocaleRef> locale = adoptCF(CFLocaleCreate(kCFAllocatorDefault, defaultLanguage().createCFString().get()));
</del><ins>+ RetainPtr<CFLocaleRef> locale = adoptCF(CFLocaleCreate(kCFAllocatorDefault, WebCore::defaultLanguage().createCFString().get()));
</ins><span class="cx"> return CFStringIsHyphenationAvailableForLocale(locale.get()) ? locale : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -65,7 +65,10 @@
</span><span class="cx"> return CFStringIsHyphenationAvailableForLocale(locale.get()) ? locale : nullptr;
</span><span class="cx"> }
</span><span class="cx"> };
</span><ins>+}
</ins><span class="cx">
</span><ins>+namespace WebCore {
+
</ins><span class="cx"> bool canHyphenate(const AtomicString& localeIdentifier)
</span><span class="cx"> {
</span><span class="cx"> return TinyLRUCachePolicy<AtomicString, RetainPtr<CFLocaleRef>>::cache().get(localeIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextenchantTextCheckerEnchantcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">
</span><span class="cx"> #include <Language.h>
</span><span class="cx"> #include <glib.h>
</span><del>-#include <text/TextBreakIterator.h>
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtexthyphenHyphenationLibHyphencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -166,13 +166,17 @@
</span><span class="cx"> HyphenDictUniquePtr m_libhyphenDictionary;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+} // namespace WebCore
+
+namespace WTF {
+
</ins><span class="cx"> template<>
</span><del>-class TinyLRUCachePolicy<AtomicString, RefPtr<HyphenationDictionary>>
</del><ins>+class TinyLRUCachePolicy<AtomicString, RefPtr<WebCore::HyphenationDictionary>>
</ins><span class="cx"> {
</span><span class="cx"> public:
</span><del>- static TinyLRUCache<AtomicString, RefPtr<HyphenationDictionary>>& cache()
</del><ins>+ static TinyLRUCache<AtomicString, RefPtr<WebCore::HyphenationDictionary>>& cache()
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<TinyLRUCache<AtomicString, RefPtr<HyphenationDictionary>>> cache;
</del><ins>+ static NeverDestroyed<TinyLRUCache<AtomicString, RefPtr<WebCore::HyphenationDictionary>>> cache;
</ins><span class="cx"> return cache;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -181,17 +185,21 @@
</span><span class="cx"> return localeIdentifier.isNull();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static RefPtr<HyphenationDictionary> createValueForNullKey()
</del><ins>+ static RefPtr<WebCore::HyphenationDictionary> createValueForNullKey()
</ins><span class="cx"> {
</span><del>- return HyphenationDictionary::createNull();
</del><ins>+ return WebCore::HyphenationDictionary::createNull();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- static RefPtr<HyphenationDictionary> createValueForKey(const AtomicString& dictionaryPath)
</del><ins>+ static RefPtr<WebCore::HyphenationDictionary> createValueForKey(const AtomicString& dictionaryPath)
</ins><span class="cx"> {
</span><del>- return HyphenationDictionary::create(fileSystemRepresentation(dictionaryPath.string()));
</del><ins>+ return WebCore::HyphenationDictionary::create(WebCore::fileSystemRepresentation(dictionaryPath.string()));
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+} // namespace WTF
+
+namespace WebCore {
+
</ins><span class="cx"> static void countLeadingSpaces(const CString& utf8String, int32_t& pointerOffset, int32_t& characterOffset)
</span><span class="cx"> {
</span><span class="cx"> pointerOffset = 0;
</span><span class="lines">@@ -233,7 +241,7 @@
</span><span class="cx"> String lowercaseLocaleIdentifier = AtomicString(localeIdentifier.string().convertToASCIILowercase());
</span><span class="cx"> ASSERT(availableLocales().contains(lowercaseLocaleIdentifier));
</span><span class="cx"> for (const auto& dictionaryPath : availableLocales().get(lowercaseLocaleIdentifier)) {
</span><del>- RefPtr<HyphenationDictionary> dictionary = TinyLRUCachePolicy<AtomicString, RefPtr<HyphenationDictionary>>::cache().get(AtomicString(dictionaryPath));
</del><ins>+ RefPtr<HyphenationDictionary> dictionary = WTF::TinyLRUCachePolicy<AtomicString, RefPtr<HyphenationDictionary>>::cache().get(AtomicString(dictionaryPath));
</ins><span class="cx">
</span><span class="cx"> char** replacements = nullptr;
</span><span class="cx"> int* positions = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacTextBoundariesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "TextBoundaries.h"
</span><span class="cx">
</span><del>-#import "TextBreakIterator.h"
-#import "TextBreakIteratorInternalICU.h"
</del><span class="cx"> #import <CoreFoundation/CFStringTokenizer.h>
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><span class="cx"> #import <unicode/ubrk.h>
</span><span class="lines">@@ -36,6 +34,8 @@
</span><span class="cx"> #import <unicode/utypes.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/text/StringView.h>
</span><ins>+#import <wtf/text/TextBreakIterator.h>
+#import <wtf/text/TextBreakIteratorInternalICU.h>
</ins><span class="cx"> #import <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacTextBreakIteratorInternalICUMacmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "TextBreakIteratorInternalICU.h"
-
-#include <wtf/RetainPtr.h>
-
-namespace WebCore {
-
-static const int maxLocaleStringLength = 32;
-
-static inline RetainPtr<CFStringRef> textBreakLocalePreference()
-{
- RetainPtr<CFPropertyListRef> locale = adoptCF(CFPreferencesCopyValue(CFSTR("AppleTextBreakLocale"),
- kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
- if (!locale || CFGetTypeID(locale.get()) != CFStringGetTypeID())
- return nullptr;
- return static_cast<CFStringRef>(locale.get());
-}
-
-static RetainPtr<CFStringRef> topLanguagePreference()
-{
- RetainPtr<CFArrayRef> languagesArray = adoptCF(CFLocaleCopyPreferredLanguages());
- if (!languagesArray)
- return nullptr;
- if (!CFArrayGetCount(languagesArray.get()))
- return nullptr;
- return static_cast<CFStringRef>(CFArrayGetValueAtIndex(languagesArray.get(), 0));
-}
-
-static void getLocale(CFStringRef locale, char localeStringBuffer[maxLocaleStringLength])
-{
- // Empty string means "root locale", and that is what we use if we can't get a preference.
- localeStringBuffer[0] = 0;
- if (!locale)
- return;
- CFStringGetCString(locale, localeStringBuffer, maxLocaleStringLength, kCFStringEncodingASCII);
-}
-
-static void getSearchLocale(char localeStringBuffer[maxLocaleStringLength])
-{
- getLocale(topLanguagePreference().get(), localeStringBuffer);
-}
-
-const char* currentSearchLocaleID()
-{
- static char localeStringBuffer[maxLocaleStringLength];
- static bool gotSearchLocale = false;
- if (!gotSearchLocale) {
- getSearchLocale(localeStringBuffer);
- gotSearchLocale = true;
- }
- return localeStringBuffer;
-}
-
-static void getTextBreakLocale(char localeStringBuffer[maxLocaleStringLength])
-{
- // If there is no text break locale, use the top language preference.
- RetainPtr<CFStringRef> locale = textBreakLocalePreference();
- if (locale) {
- if (RetainPtr<CFStringRef> canonicalLocale = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, locale.get())))
- locale = canonicalLocale;
- } else
- locale = topLanguagePreference();
- getLocale(locale.get(), localeStringBuffer);
-}
-
-const char* currentTextBreakLocaleID()
-{
- static char localeStringBuffer[maxLocaleStringLength];
- static bool gotTextBreakLocale = false;
- if (!gotTextBreakLocale) {
- getTextBreakLocale(localeStringBuffer);
- gotTextBreakLocale = true;
- }
- return localeStringBuffer;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformtextwinTextBreakIteratorInternalICUWincpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "TextBreakIteratorInternalICU.h"
-
-namespace WebCore {
-
-const char* currentSearchLocaleID()
-{
- // FIXME: Should use system locale.
- return "";
-}
-
-const char* currentTextBreakLocaleID()
-{
- // Using en_US_POSIX now so word selection in address field works as expected as before (double-clicking
- // in a URL selects a word delimited by periods rather than selecting the entire URL).
- // However, this is not entirely correct - we should honor the system locale in the normal case.
- // FIXME: <rdar://problem/6786703> Should use system locale for text breaking
- return "en_US_POSIX";
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TransformState.h"
</span><span class="cx">
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SimpleLineLayoutFunctions.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "VisiblePosition.h"
</span><span class="cx"> #include "break_lines.h"
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/RenderText.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> #include "RenderTextLineBoxes.h"
</span><span class="cx"> #include "SimpleLineLayout.h"
</span><span class="cx"> #include "Text.h"
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "RenderLineBreak.h"
</span><span class="cx"> #include "SimpleLineLayoutFlowContents.h"
</span><del>-#include "TextBreakIterator.h"
</del><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include "break_lines.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingbreak_linescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/break_lines.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/break_lines.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/break_lines.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "break_lines.h"
</span><span class="cx">
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/ASCIICType.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingbreak_linesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/break_lines.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/break_lines.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/break_lines.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -22,9 +22,9 @@
</span><span class="cx"> #ifndef break_lines_h
</span><span class="cx"> #define break_lines_h
</span><span class="cx">
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/ASCIICType.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineBreaker.h (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.h        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.h        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx"> #include "InlineIterator.h"
</span><span class="cx"> #include "LineInfo.h"
</span><span class="cx"> #include "LineInlineHeaders.h"
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include <wtf/Vector.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitiosMiscWebUIKitSupportmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -36,11 +36,11 @@
</span><span class="cx"> #import <WebCore/PathUtilities.h>
</span><span class="cx"> #import <WebCore/ResourceRequest.h>
</span><span class="cx"> #import <WebCore/Settings.h>
</span><del>-#import <WebCore/TextBreakIterator.h>
</del><span class="cx"> #import <WebCore/WebCoreSystemInterface.h>
</span><span class="cx"> #import <WebCore/WebCoreThreadSystemInterface.h>
</span><span class="cx"> #import <WebCore/break_lines.h>
</span><span class="cx"> #import <wtf/spi/darwin/dyldSPI.h>
</span><ins>+#import <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> #import <runtime/InitializeThreading.h>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflTextCheckerEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -32,9 +32,9 @@
</span><span class="cx"> #include "TextCheckerState.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SPELLCHECK)
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include "TextCheckerClientEfl.h"
</span><span class="cx"> #include "WebTextChecker.h"
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkTextCheckerGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp (203037 => 203038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp        2016-07-10 08:24:18 UTC (rev 203037)
+++ trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp        2016-07-10 17:15:05 UTC (rev 203038)
</span><span class="lines">@@ -28,12 +28,12 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "TextChecker.h"
</span><span class="cx">
</span><del>-#include "TextBreakIterator.h"
</del><span class="cx"> #include "TextCheckerState.h"
</span><span class="cx"> #include "WebProcessPool.h"
</span><span class="cx"> #include <WebCore/NotImplemented.h>
</span><span class="cx"> #include <WebCore/TextCheckerEnchant.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><ins>+#include <wtf/text/TextBreakIterator.h>
</ins><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>