Line
Link Here
|
0 |
-- webkitgtk-2.28.4/Source/WebCore/platform/text/TextCodecICU.cpp |
0 |
++ webkitgtk-2.28.4/Source/WebCore/platform/text/TextCodecICU.cpp |
Lines 239-245
Link Here
|
239 |
UErrorCode error = U_ZERO_ERROR; |
239 |
UErrorCode error = U_ZERO_ERROR; |
240 |
m_converter = ICUConverterPtr { ucnv_open(m_canonicalConverterName, &error), ucnv_close }; |
240 |
m_converter = ICUConverterPtr { ucnv_open(m_canonicalConverterName, &error), ucnv_close }; |
241 |
if (m_converter) |
241 |
if (m_converter) |
242 |
ucnv_setFallback(m_converter.get(), TRUE); |
242 |
ucnv_setFallback(m_converter.get(), true); |
243 |
} |
243 |
} |
244 |
|
244 |
|
245 |
int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& error) |
245 |
int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& error) |
246 |
-- webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProvider.h |
246 |
++ webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProvider.h |
Lines 79-90
Link Here
|
79 |
// Ensure chunk offset is well formed if computed offset exceeds int32_t range. |
79 |
// Ensure chunk offset is well formed if computed offset exceeds int32_t range. |
80 |
ASSERT(offset < std::numeric_limits<int32_t>::max()); |
80 |
ASSERT(offset < std::numeric_limits<int32_t>::max()); |
81 |
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0; |
81 |
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0; |
82 |
isAccessible = TRUE; |
82 |
isAccessible = true; |
83 |
return true; |
83 |
return true; |
84 |
} |
84 |
} |
85 |
if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) { |
85 |
if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) { |
86 |
text->chunkOffset = text->chunkLength; |
86 |
text->chunkOffset = text->chunkLength; |
87 |
isAccessible = FALSE; |
87 |
isAccessible = false; |
88 |
return true; |
88 |
return true; |
89 |
} |
89 |
} |
90 |
} else { |
90 |
} else { |
Lines 93-104
Link Here
|
93 |
// Ensure chunk offset is well formed if computed offset exceeds int32_t range. |
93 |
// Ensure chunk offset is well formed if computed offset exceeds int32_t range. |
94 |
ASSERT(offset < std::numeric_limits<int32_t>::max()); |
94 |
ASSERT(offset < std::numeric_limits<int32_t>::max()); |
95 |
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0; |
95 |
text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0; |
96 |
isAccessible = TRUE; |
96 |
isAccessible = true; |
97 |
return true; |
97 |
return true; |
98 |
} |
98 |
} |
99 |
if (nativeIndex <= 0 && !text->chunkNativeStart) { |
99 |
if (nativeIndex <= 0 && !text->chunkNativeStart) { |
100 |
text->chunkOffset = 0; |
100 |
text->chunkOffset = 0; |
101 |
isAccessible = FALSE; |
101 |
isAccessible = false; |
102 |
return true; |
102 |
return true; |
103 |
} |
103 |
} |
104 |
} |
104 |
} |
105 |
-- webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp |
105 |
++ webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp |
Lines 100-122
Link Here
|
100 |
if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) { |
100 |
if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) { |
101 |
// Already inside the buffer. Set the new offset. |
101 |
// Already inside the buffer. Set the new offset. |
102 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
102 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
103 |
return TRUE; |
103 |
return true; |
104 |
} |
104 |
} |
105 |
if (index >= length && uText->chunkNativeLimit == length) { |
105 |
if (index >= length && uText->chunkNativeLimit == length) { |
106 |
// Off the end of the buffer, but we can't get it. |
106 |
// Off the end of the buffer, but we can't get it. |
107 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
107 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
108 |
return FALSE; |
108 |
return false; |
109 |
} |
109 |
} |
110 |
} else { |
110 |
} else { |
111 |
if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) { |
111 |
if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) { |
112 |
// Already inside the buffer. Set the new offset. |
112 |
// Already inside the buffer. Set the new offset. |
113 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
113 |
uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart); |
114 |
return TRUE; |
114 |
return true; |
115 |
} |
115 |
} |
116 |
if (!index && !uText->chunkNativeStart) { |
116 |
if (!index && !uText->chunkNativeStart) { |
117 |
// Already at the beginning; can't go any farther. |
117 |
// Already at the beginning; can't go any farther. |
118 |
uText->chunkOffset = 0; |
118 |
uText->chunkOffset = 0; |
119 |
return FALSE; |
119 |
return false; |
120 |
} |
120 |
} |
121 |
} |
121 |
} |
122 |
|
122 |
|
Lines 144-150
Link Here
|
144 |
|
144 |
|
145 |
uText->nativeIndexingLimit = uText->chunkLength; |
145 |
uText->nativeIndexingLimit = uText->chunkLength; |
146 |
|
146 |
|
147 |
return TRUE; |
147 |
return true; |
148 |
} |
148 |
} |
149 |
|
149 |
|
150 |
static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status) |
150 |
static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status) |
Lines 337-343
Link Here
|
337 |
static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward) |
337 |
static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward) |
338 |
{ |
338 |
{ |
339 |
if (!text->context) |
339 |
if (!text->context) |
340 |
return FALSE; |
340 |
return false; |
341 |
int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text); |
341 |
int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text); |
342 |
UBool isAccessible; |
342 |
UBool isAccessible; |
343 |
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible)) |
343 |
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible)) |
Lines 357-363
Link Here
|
357 |
ASSERT(newContext == UTextProviderContext::PriorContext); |
357 |
ASSERT(newContext == UTextProviderContext::PriorContext); |
358 |
textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward); |
358 |
textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward); |
359 |
} |
359 |
} |
360 |
return TRUE; |
360 |
return true; |
361 |
} |
361 |
} |
362 |
|
362 |
|
363 |
static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode) |
363 |
static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode) |
364 |
-- webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp |
364 |
++ webkitgtk-2.28.4/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp |
Lines 126-132
Link Here
|
126 |
static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward) |
126 |
static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward) |
127 |
{ |
127 |
{ |
128 |
if (!text->context) |
128 |
if (!text->context) |
129 |
return FALSE; |
129 |
return false; |
130 |
int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text); |
130 |
int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text); |
131 |
UBool isAccessible; |
131 |
UBool isAccessible; |
132 |
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible)) |
132 |
if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible)) |
Lines 146-152
Link Here
|
146 |
ASSERT(newContext == UTextProviderContext::PriorContext); |
146 |
ASSERT(newContext == UTextProviderContext::PriorContext); |
147 |
textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward); |
147 |
textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward); |
148 |
} |
148 |
} |
149 |
return TRUE; |
149 |
return true; |
150 |
} |
150 |
} |
151 |
|
151 |
|
152 |
static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode) |
152 |
static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode) |