| Index: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
|
| diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
|
| index 4a3512485dde4a463beb0dcbfd11d824560bade1..133ee97afbf26cebc70bcbff2199ba07b4bf499e 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
|
| +++ b/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShapeIterator.h
|
| @@ -53,6 +53,10 @@ public:
|
| // use the cache or if the font doesn't support word by word shaping
|
| // fall back on shaping the entire run.
|
| m_shapeByWord = m_font->canShapeWordByWord();
|
| +
|
| + // Minified JS/CSS and hex/base64 data have extraordinary long "words".
|
| + m_limitWordLength = m_shapeByWord && m_textRun.is8Bit()
|
| + && !m_font->getFontDescription().getTypesettingFeatures();
|
| }
|
|
|
| bool next(RefPtr<ShapeResult>* wordResult)
|
| @@ -148,10 +152,13 @@ private:
|
| }
|
| }
|
|
|
| + const unsigned limit = m_limitWordLength
|
| + ? std::min(length, m_startIndex + ShapeCache::maxLengthToCache())
|
| + : length;
|
| for (unsigned i = m_startIndex + 1; ; i++) {
|
| - if (i == length || isWordDelimiter(m_textRun[i])) {
|
| + if (i == limit || isWordDelimiter(m_textRun[i]))
|
| return i;
|
| - }
|
| +
|
| if (!m_textRun.is8Bit()) {
|
| UChar32 nextChar;
|
| U16_GET(m_textRun.characters16(), 0, i, length, nextChar);
|
| @@ -220,8 +227,9 @@ private:
|
| const Font* m_font;
|
| ShapeResultSpacing m_spacing;
|
| float m_widthSoFar; // Used only when allowTabs()
|
| - unsigned m_startIndex : 31;
|
| + unsigned m_startIndex : 30;
|
| unsigned m_shapeByWord : 1;
|
| + unsigned m_limitWordLength : 1;
|
| };
|
|
|
| } // namespace blink
|
|
|