Changeset 161817 in webkit
- Timestamp:
- Jan 12, 2014 11:24:29 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/Platform/GNUmakefile.am
r160444 r161817 58 58 -I$(srcdir)/Source/WebCore/platform/network/soup \ 59 59 -I$(srcdir)/Source/WebCore/platform/text \ 60 -I$(srcdir)/Source/WebCore/platform/text/icu \ 60 61 -I$(srcdir)/Source/WebCore/platform/text/transcoder 61 62 -
trunk/Source/WebCore/CMakeLists.txt
r161783 r161817 78 78 "${WEBCORE_DIR}/platform/sql" 79 79 "${WEBCORE_DIR}/platform/text" 80 "${WEBCORE_DIR}/platform/text/icu" 80 81 "${WEBCORE_DIR}/plugins" 81 82 "${WEBCORE_DIR}/rendering" … … 2802 2803 if (WTF_USE_ICU_UNICODE) 2803 2804 list(APPEND WebCore_SOURCES 2805 platform/text/icu/UTextProvider.cpp 2806 platform/text/icu/UTextProviderLatin1.cpp 2807 platform/text/icu/UTextProviderUTF16.cpp 2804 2808 platform/text/TextBreakIteratorICU.cpp 2805 2809 platform/text/TextCodecICU.cpp -
trunk/Source/WebCore/ChangeLog
r161816 r161817 1 2014-01-11 Sam Weinig <sam@webkit.org> 2 3 Split ICU UText providers out into their own files 4 https://bugs.webkit.org/show_bug.cgi?id=126834 5 6 Reviewed by Anders Carlsson. 7 8 Moves the implementation of our custom UText providers out into 9 their own files. 10 - UTextProviderLatin1.h/cpp contains the Latin-1 provider. 11 - UTextProviderUTF16.h/cpp contains the UTF-16 provider. 12 - UTextProvider.h/cpp contains code common to all the providers. 13 14 * CMakeLists.txt: 15 * GNUmakefile.list.am: 16 * PlatformGTK.cmake: 17 * WebCore.vcxproj/WebCoreCommon.props: 18 * WebCore.vcxproj/copyForwardingHeaders.cmd: 19 * WebCore.xcodeproj/project.pbxproj: 20 * platform/text/TextAllInOne.cpp: 21 * platform/text/TextBreakIteratorICU.cpp: 22 (WebCore::setUpIterator): 23 (WebCore::wordBreakIterator): 24 (WebCore::acquireLineBreakIterator): 25 (WebCore::sentenceBreakIterator): 26 (WebCore::setUpIteratorWithRules): 27 * platform/text/icu: Added. 28 * platform/text/icu/UTextProvider.cpp: Added. 29 (WebCore::fixPointer): 30 (WebCore::uTextCloneImpl): 31 * platform/text/icu/UTextProvider.h: Added. 32 (WebCore::uTextProviderContext): 33 (WebCore::uTextInitialize): 34 (WebCore::uTextAccessPinIndex): 35 (WebCore::uTextAccessInChunkOrOutOfRange): 36 * platform/text/icu/UTextProviderLatin1.cpp: Added. 37 * platform/text/icu/UTextProviderLatin1.h: Added. 38 * platform/text/icu/UTextProviderUTF16.cpp: Added. 39 * platform/text/icu/UTextProviderUTF16.h: Added. 40 1 41 2014-01-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 42 -
trunk/Source/WebCore/GNUmakefile.am
r161808 r161817 91 91 -I$(srcdir)/Source/WebCore/platform/sql \ 92 92 -I$(srcdir)/Source/WebCore/platform/text \ 93 -I$(srcdir)/Source/WebCore/platform/text/icu \ 93 94 -I$(srcdir)/Source/WebCore/platform/win \ 94 95 -I$(srcdir)/Source/WebCore/plugins \ -
trunk/Source/WebCore/GNUmakefile.list.am
r161816 r161817 5979 5979 Source/WebCore/platform/text/enchant/TextCheckerEnchant.h \ 5980 5980 Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp \ 5981 Source/WebCore/platform/text/icu/UTextProvider.cpp \ 5982 Source/WebCore/platform/text/icu/UTextProvider.h \ 5983 Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp \ 5984 Source/WebCore/platform/text/icu/UTextProviderLatin1.h \ 5985 Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp \ 5986 Source/WebCore/platform/text/icu/UTextProviderUTF16.h \ 5981 5987 Source/WebCore/platform/text/BidiContext.cpp \ 5982 5988 Source/WebCore/platform/text/BidiContext.h \ -
trunk/Source/WebCore/PlatformGTK.cmake
r161389 r161817 21 21 "${WEBCORE_DIR}/platform/network/soup" 22 22 "${WEBCORE_DIR}/platform/text/gtk" 23 "${WEBCORE_DIR}/platform/text/icu" 23 24 "${WEBCORE_DIR}/plugins/gtk" 24 25 ) … … 129 130 platform/soup/SharedBufferSoup.cpp 130 131 132 platform/text/icu/UTextProvider.cpp 133 platform/text/icu/UTextProviderLatin1.cpp 134 platform/text/icu/UTextProviderUTF16.cpp 131 135 platform/text/LocaleICU.cpp 132 136 platform/text/TextBreakIteratorICU.cpp … … 256 260 platform/soup/SharedBufferSoup.cpp 257 261 262 platform/text/icu/UTextProvider.cpp 263 platform/text/icu/UTextProviderLatin1.cpp 264 platform/text/icu/UTextProviderUTF16.cpp 258 265 platform/text/LocaleICU.cpp 259 266 platform/text/TextBreakIteratorICU.cpp -
trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props
r161108 r161817 8 8 <ItemDefinitionGroup> 9 9 <ClCompile> 10 <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\ transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>10 <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\icu;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 11 11 <PreprocessorDefinitions>DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 12 12 <PrecompiledHeader>Use</PrecompiledHeader> -
trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd
r161506 r161817 59 59 xcopy /y /d "%ProjectDir%..\platform\mock\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" 60 60 xcopy /y /d "%ProjectDir%..\platform\text\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" 61 xcopy /y /d "%ProjectDir%..\platform\text\icu\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" 61 62 xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" 62 63 xcopy /y /d "%ProjectDir%..\platform\win\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r161813 r161817 2294 2294 7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; }; 2295 2295 7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; }; 2296 7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */; }; 2297 7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */; }; 2298 7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D43518823B1900E5ED57 /* UTextProvider.cpp */; }; 2299 7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43618823B1900E5ED57 /* UTextProvider.h */; }; 2300 7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */; }; 2301 7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */; }; 2296 2302 7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */; }; 2297 2303 7CE6CBFB187F370700D46BF5 /* FormatConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */; }; … … 9267 9273 7C6136F81710C35200FF4A57 /* InFilesParser.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = InFilesParser.pm; path = scripts/InFilesParser.pm; sourceTree = "<group>"; }; 9268 9274 7C6136F91710C35200FF4A57 /* StaticString.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = StaticString.pm; path = scripts/StaticString.pm; sourceTree = "<group>"; }; 9275 7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderLatin1.cpp; sourceTree = "<group>"; }; 9276 7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderLatin1.h; sourceTree = "<group>"; }; 9277 7C74D43518823B1900E5ED57 /* UTextProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProvider.cpp; sourceTree = "<group>"; }; 9278 7C74D43618823B1900E5ED57 /* UTextProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProvider.h; sourceTree = "<group>"; }; 9279 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = "<group>"; }; 9280 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = "<group>"; }; 9269 9281 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDNScriptWhiteList.txt; sourceTree = "<group>"; }; 9270 9282 7CE6CBFA187F370700D46BF5 /* FormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormatConverter.h; sourceTree = "<group>"; }; … … 16274 16286 usesTabs = 0; 16275 16287 }; 16288 7C74D43018823A4200E5ED57 /* icu */ = { 16289 isa = PBXGroup; 16290 children = ( 16291 7C74D43118823A9300E5ED57 /* UTextProviderLatin1.cpp */, 16292 7C74D43218823A9300E5ED57 /* UTextProviderLatin1.h */, 16293 7C74D4391882400400E5ED57 /* UTextProviderUTF16.cpp */, 16294 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */, 16295 7C74D43518823B1900E5ED57 /* UTextProvider.cpp */, 16296 7C74D43618823B1900E5ED57 /* UTextProvider.h */, 16297 ); 16298 path = icu; 16299 sourceTree = "<group>"; 16300 }; 16276 16301 7E474E1912494DA900235364 /* ios */ = { 16277 16302 isa = PBXGroup; … … 20015 20040 A516E8B2136E04C00076C3C0 /* ios */, 20016 20041 B2C3D9F90D006C1D00EF6F26 /* mac */, 20042 7C74D43018823A4200E5ED57 /* icu */, 20017 20043 37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */, 20018 20044 B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */, … … 25191 25217 51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */, 25192 25218 973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */, 25219 7C74D43418823A9300E5ED57 /* UTextProviderLatin1.h in Headers */, 25193 25220 E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */, 25194 25221 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */, 25195 25222 07C59B7617F7D0DB000FBCBB /* CapabilityRange.h in Headers */, 25196 25223 8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */, 25224 7C74D43818823B1900E5ED57 /* UTextProvider.h in Headers */, 25197 25225 7EE6846D12D26E3800E79415 /* ResourceRequest.h in Headers */, 25198 25226 514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */, … … 25427 25455 A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */, 25428 25456 A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */, 25457 7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */, 25429 25458 BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */, 25430 25459 BC2273040E82F1E600E7F975 /* StyleInheritedData.h in Headers */, … … 26729 26758 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */, 26730 26759 97BC6A271505F081001B74AC /* DatabaseContext.cpp in Sources */, 26760 7C74D43318823A9300E5ED57 /* UTextProviderLatin1.cpp in Sources */, 26731 26761 FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */, 26732 26762 FEB26D28167A8F2A00FDD26B /* DatabaseServer.cpp in Sources */, … … 26839 26869 2D9A247315B9C2D100D34527 /* DOMDOMSecurityPolicy.mm in Sources */, 26840 26870 7694565C1214DB630007CBAE /* DOMDOMTokenList.mm in Sources */, 26871 7C74D43B1882400400E5ED57 /* UTextProviderUTF16.cpp in Sources */, 26841 26872 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */, 26842 26873 85ACA9C10A9B5FA500671E90 /* DOMElement.mm in Sources */, … … 28950 28981 A14832C8187F673F00DA63A6 /* WebCoreThread.mm in Sources */, 28951 28982 B2227AC40D00BF220071B782 /* SVGTests.cpp in Sources */, 28983 7C74D43718823B1900E5ED57 /* UTextProvider.cpp in Sources */, 28952 28984 B2227AC70D00BF220071B782 /* SVGTextContentElement.cpp in Sources */, 28953 28985 07969DBB17D14151007FF842 /* JSRTCSessionDescription.cpp in Sources */, -
trunk/Source/WebCore/platform/text/TextAllInOne.cpp
r127525 r161817 39 39 #include "TextEncodingRegistry.cpp" 40 40 #include "TextStream.cpp" 41 #include "UTextProvider.cpp" 42 #include "UTextProviderLatin1.cpp" 43 #include "UTextProviderUTF16.cpp" -
trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp
r161589 r161817 24 24 25 25 #include "LineBreakIteratorPoolICU.h" 26 #include "UTextProviderLatin1.h" 27 #include "UTextProviderUTF16.h" 26 28 #include <wtf/Atomics.h> 27 29 #include <wtf/text/WTFString.h> … … 31 33 namespace WebCore { 32 34 33 static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator, 34 UBreakIteratorType type, const UChar* string, int length) 35 static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator, UBreakIteratorType type, const UChar* string, int length) 35 36 { 36 37 if (!string) … … 54 55 } 55 56 56 enum TextContext { NoContext, PriorContext, PrimaryContext };57 58 const int textBufferCapacity = 16;59 60 typedef struct {61 UText text;62 UChar buffer[textBufferCapacity];63 } UTextWithBuffer;64 65 static inline int64_t textPinIndex(int64_t& index, int64_t limit)66 {67 if (index < 0)68 index = 0;69 else if (index > limit)70 index = limit;71 return index;72 }73 74 static inline int64_t textNativeLength(UText* text)75 {76 return text->a + text->b;77 }78 79 // Relocate pointer from source into destination as required.80 static void textFixPointer(const UText* source, UText* destination, const void*& pointer)81 {82 if (pointer >= source->pExtra && pointer < static_cast<char*>(source->pExtra) + source->extraSize) {83 // Pointer references source extra buffer.84 pointer = static_cast<char*>(destination->pExtra) + (static_cast<const char*>(pointer) - static_cast<const char*>(source->pExtra));85 } else if (pointer >= source && pointer < reinterpret_cast<const char*>(source) + source->sizeOfStruct) {86 // Pointer references source text structure, but not source extra buffer.87 pointer = reinterpret_cast<char*>(destination) + (static_cast<const char*>(pointer) - reinterpret_cast<const char*>(source));88 }89 }90 91 static UText* textClone(UText* destination, const UText* source, UBool deep, UErrorCode* status)92 {93 ASSERT_UNUSED(deep, !deep);94 if (U_FAILURE(*status))95 return 0;96 int32_t extraSize = source->extraSize;97 destination = utext_setup(destination, extraSize, status);98 if (U_FAILURE(*status))99 return destination;100 void* extraNew = destination->pExtra;101 int32_t flags = destination->flags;102 int sizeToCopy = std::min(source->sizeOfStruct, destination->sizeOfStruct);103 memcpy(destination, source, sizeToCopy);104 destination->pExtra = extraNew;105 destination->flags = flags;106 memcpy(destination->pExtra, source->pExtra, extraSize);107 textFixPointer(source, destination, destination->context);108 textFixPointer(source, destination, destination->p);109 textFixPointer(source, destination, destination->q);110 ASSERT(!destination->r);111 const void * chunkContents = static_cast<const void*>(destination->chunkContents);112 textFixPointer(source, destination, chunkContents);113 destination->chunkContents = static_cast<const UChar*>(chunkContents);114 return destination;115 }116 117 static int32_t textExtract(UText* text, int64_t start, int64_t limit, UChar* destination, int32_t destinationCapacity, UErrorCode* errorCode)118 {119 UNUSED_PARAM(text);120 UNUSED_PARAM(start);121 UNUSED_PARAM(limit);122 UNUSED_PARAM(destination);123 UNUSED_PARAM(destinationCapacity);124 // In the present context, this text provider is used only with ICU functions125 // that do not perform an extract operation.126 ASSERT_NOT_REACHED();127 *errorCode = U_UNSUPPORTED_ERROR;128 return 0;129 }130 131 static void textClose(UText* text)132 {133 text->context = 0;134 }135 136 static inline TextContext textGetContext(const UText* text, int64_t nativeIndex, UBool forward)137 {138 if (!text->b || nativeIndex > text->b)139 return PrimaryContext;140 if (nativeIndex == text->b)141 return forward ? PrimaryContext : PriorContext;142 return PriorContext;143 }144 145 static inline TextContext textLatin1GetCurrentContext(const UText* text)146 {147 if (!text->chunkContents)148 return NoContext;149 return text->chunkContents == text->pExtra ? PrimaryContext : PriorContext;150 }151 152 static void textLatin1MoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)153 {154 ASSERT(text->chunkContents == text->pExtra);155 if (forward) {156 ASSERT(nativeIndex >= text->b && nativeIndex < nativeLength);157 text->chunkNativeStart = nativeIndex;158 text->chunkNativeLimit = nativeIndex + text->extraSize / sizeof(UChar);159 if (text->chunkNativeLimit > nativeLength)160 text->chunkNativeLimit = nativeLength;161 } else {162 ASSERT(nativeIndex > text->b && nativeIndex <= nativeLength);163 text->chunkNativeLimit = nativeIndex;164 text->chunkNativeStart = nativeIndex - text->extraSize / sizeof(UChar);165 if (text->chunkNativeStart < text->b)166 text->chunkNativeStart = text->b;167 }168 int64_t length = text->chunkNativeLimit - text->chunkNativeStart;169 // Ensure chunk length is well defined if computed length exceeds int32_t range.170 ASSERT(length < std::numeric_limits<int32_t>::max());171 text->chunkLength = length < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(length) : 0;172 text->nativeIndexingLimit = text->chunkLength;173 text->chunkOffset = forward ? 0 : text->chunkLength;174 StringImpl::copyChars(const_cast<UChar*>(text->chunkContents), static_cast<const LChar*>(text->p) + (text->chunkNativeStart - text->b), static_cast<unsigned>(text->chunkLength));175 }176 177 static void textLatin1SwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)178 {179 ASSERT(!text->chunkContents || text->chunkContents == text->q);180 text->chunkContents = static_cast<const UChar*>(text->pExtra);181 textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);182 }183 184 static void textLatin1MoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)185 {186 ASSERT(text->chunkContents == text->q);187 ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b);188 ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);189 ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);190 text->chunkNativeStart = 0;191 text->chunkNativeLimit = text->b;192 text->chunkLength = text->b;193 text->nativeIndexingLimit = text->chunkLength;194 int64_t offset = nativeIndex - text->chunkNativeStart;195 // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.196 ASSERT(offset < std::numeric_limits<int32_t>::max());197 text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);198 }199 200 static void textLatin1SwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)201 {202 ASSERT(!text->chunkContents || text->chunkContents == text->pExtra);203 text->chunkContents = static_cast<const UChar*>(text->q);204 textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);205 }206 207 static inline bool textInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward, UBool& isAccessible)208 {209 if (forward) {210 if (nativeIndex >= text->chunkNativeStart && nativeIndex < text->chunkNativeLimit) {211 int64_t offset = nativeIndex - text->chunkNativeStart;212 // Ensure chunk offset is well formed if computed offset exceeds int32_t range.213 ASSERT(offset < std::numeric_limits<int32_t>::max());214 text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;215 isAccessible = TRUE;216 return true;217 }218 if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {219 text->chunkOffset = text->chunkLength;220 isAccessible = FALSE;221 return true;222 }223 } else {224 if (nativeIndex > text->chunkNativeStart && nativeIndex <= text->chunkNativeLimit) {225 int64_t offset = nativeIndex - text->chunkNativeStart;226 // Ensure chunk offset is well formed if computed offset exceeds int32_t range.227 ASSERT(offset < std::numeric_limits<int32_t>::max());228 text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;229 isAccessible = TRUE;230 return true;231 }232 if (nativeIndex <= 0 && !text->chunkNativeStart) {233 text->chunkOffset = 0;234 isAccessible = FALSE;235 return true;236 }237 }238 return false;239 }240 241 static UBool textLatin1Access(UText* text, int64_t nativeIndex, UBool forward)242 {243 if (!text->context)244 return FALSE;245 int64_t nativeLength = textNativeLength(text);246 UBool isAccessible;247 if (textInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))248 return isAccessible;249 nativeIndex = textPinIndex(nativeIndex, nativeLength);250 TextContext currentContext = textLatin1GetCurrentContext(text);251 TextContext newContext = textGetContext(text, nativeIndex, forward);252 ASSERT(newContext != NoContext);253 if (newContext == currentContext) {254 if (currentContext == PrimaryContext)255 textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);256 else257 textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);258 } else if (newContext == PrimaryContext)259 textLatin1SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);260 else {261 ASSERT(newContext == PriorContext);262 textLatin1SwitchToPriorContext(text, nativeIndex, nativeLength, forward);263 }264 return TRUE;265 }266 267 static const struct UTextFuncs textLatin1Funcs = {268 sizeof(UTextFuncs),269 0, 0, 0,270 textClone,271 textNativeLength,272 textLatin1Access,273 textExtract,274 0, 0, 0, 0,275 textClose,276 0, 0, 0,277 };278 279 static void textInit(UText* text, const UTextFuncs* funcs, const void* string, unsigned length, const UChar* priorContext, int priorContextLength)280 {281 text->pFuncs = funcs;282 text->providerProperties = 1 << UTEXT_PROVIDER_STABLE_CHUNKS;283 text->context = string;284 text->p = string;285 text->a = length;286 text->q = priorContext;287 text->b = priorContextLength;288 }289 290 static UText* textOpenLatin1(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)291 {292 if (U_FAILURE(*status))293 return 0;294 if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {295 *status = U_ILLEGAL_ARGUMENT_ERROR;296 return 0;297 }298 UText* text = utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status);299 if (U_FAILURE(*status)) {300 ASSERT(!text);301 return 0;302 }303 textInit(text, &textLatin1Funcs, string, length, priorContext, priorContextLength);304 return text;305 }306 307 static inline TextContext textUTF16GetCurrentContext(const UText* text)308 {309 if (!text->chunkContents)310 return NoContext;311 return text->chunkContents == text->p ? PrimaryContext : PriorContext;312 }313 314 static void textUTF16MoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)315 {316 ASSERT(text->chunkContents == text->p);317 ASSERT_UNUSED(forward, forward ? nativeIndex >= text->b : nativeIndex > text->b);318 ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);319 text->chunkNativeStart = text->b;320 text->chunkNativeLimit = nativeLength;321 int64_t length = text->chunkNativeLimit - text->chunkNativeStart;322 // Ensure chunk length is well defined if computed length exceeds int32_t range.323 ASSERT(length < std::numeric_limits<int32_t>::max());324 text->chunkLength = length < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(length) : 0;325 text->nativeIndexingLimit = text->chunkLength;326 int64_t offset = nativeIndex - text->chunkNativeStart;327 // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.328 ASSERT(offset < std::numeric_limits<int32_t>::max());329 text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);330 }331 332 static void textUTF16SwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)333 {334 ASSERT(!text->chunkContents || text->chunkContents == text->q);335 text->chunkContents = static_cast<const UChar*>(text->p);336 textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);337 }338 339 static void textUTF16MoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)340 {341 ASSERT(text->chunkContents == text->q);342 ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b);343 ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);344 ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength : nativeIndex <= nativeLength);345 text->chunkNativeStart = 0;346 text->chunkNativeLimit = text->b;347 text->chunkLength = text->b;348 text->nativeIndexingLimit = text->chunkLength;349 int64_t offset = nativeIndex - text->chunkNativeStart;350 // Ensure chunk offset is well defined if computed offset exceeds int32_t range or chunk length.351 ASSERT(offset < std::numeric_limits<int32_t>::max());352 text->chunkOffset = std::min(offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0, text->chunkLength);353 }354 355 static void textUTF16SwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)356 {357 ASSERT(!text->chunkContents || text->chunkContents == text->p);358 text->chunkContents = static_cast<const UChar*>(text->q);359 textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward);360 }361 362 static UBool textUTF16Access(UText* text, int64_t nativeIndex, UBool forward)363 {364 if (!text->context)365 return FALSE;366 int64_t nativeLength = textNativeLength(text);367 UBool isAccessible;368 if (textInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))369 return isAccessible;370 nativeIndex = textPinIndex(nativeIndex, nativeLength);371 TextContext currentContext = textUTF16GetCurrentContext(text);372 TextContext newContext = textGetContext(text, nativeIndex, forward);373 ASSERT(newContext != NoContext);374 if (newContext == currentContext) {375 if (currentContext == PrimaryContext)376 textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);377 else378 textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward);379 } else if (newContext == PrimaryContext)380 textUTF16SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);381 else {382 ASSERT(newContext == PriorContext);383 textUTF16SwitchToPriorContext(text, nativeIndex, nativeLength, forward);384 }385 return TRUE;386 }387 388 static const struct UTextFuncs textUTF16Funcs = {389 sizeof(UTextFuncs),390 0, 0, 0,391 textClone,392 textNativeLength,393 textUTF16Access,394 textExtract,395 0, 0, 0, 0,396 textClose,397 0, 0, 0,398 };399 400 static UText* textOpenUTF16(UText* text, const UChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)401 {402 if (U_FAILURE(*status))403 return 0;404 if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) {405 *status = U_ILLEGAL_ARGUMENT_ERROR;406 return 0;407 }408 text = utext_setup(text, 0, status);409 if (U_FAILURE(*status)) {410 ASSERT(!text);411 return 0;412 }413 textInit(text, &textUTF16Funcs, string, length, priorContext, priorContextLength);414 return text;415 }416 417 57 TextBreakIterator* wordBreakIterator(const UChar* string, int length) 418 58 { 419 59 static bool createdWordBreakIterator = false; 420 60 static TextBreakIterator* staticWordBreakIterator; 421 return setUpIterator(createdWordBreakIterator, 422 staticWordBreakIterator, UBRK_WORD, string, length); 61 return setUpIterator(createdWordBreakIterator, staticWordBreakIterator, UBRK_WORD, string, length); 423 62 } 424 63 … … 437 76 438 77 UErrorCode openStatus = U_ZERO_ERROR; 439 UText* text = textOpenLatin1(&textLocal, string, length, priorContext, priorContextLength, &openStatus);78 UText* text = uTextOpenLatin1(&textLocal, string, length, priorContext, priorContextLength, &openStatus); 440 79 if (U_FAILURE(openStatus)) { 441 80 LOG_ERROR("textOpenUTF16 failed with status %d", openStatus); … … 464 103 465 104 UErrorCode openStatus = U_ZERO_ERROR; 466 UText* text = textOpenUTF16(&textLocal, string, length, priorContext, priorContextLength, &openStatus);105 UText* text = uTextOpenUTF16(&textLocal, string, length, priorContext, priorContextLength, &openStatus); 467 106 if (U_FAILURE(openStatus)) { 468 107 LOG_ERROR("textOpenUTF16 failed with status %d", openStatus); … … 522 161 static bool createdSentenceBreakIterator = false; 523 162 static TextBreakIterator* staticSentenceBreakIterator; 524 return setUpIterator(createdSentenceBreakIterator, 525 staticSentenceBreakIterator, UBRK_SENTENCE, string, length); 163 return setUpIterator(createdSentenceBreakIterator, staticSentenceBreakIterator, UBRK_SENTENCE, string, length); 526 164 } 527 165 … … 573 211 574 212 #if !PLATFORM(IOS) 575 static TextBreakIterator* setUpIteratorWithRules(bool& createdIterator, TextBreakIterator*& iterator, 576 const char* breakRules, const UChar* string, int length) 213 static TextBreakIterator* setUpIteratorWithRules(bool& createdIterator, TextBreakIterator*& iterator, const char* breakRules, const UChar* string, int length) 577 214 { 578 215 if (!string)
Note: See TracChangeset
for help on using the changeset viewer.