WebKit Bugzilla
Attachment 362519 Details for
Bug 191368
: Layout Test fast/text/international/khmer-selection.html is crashing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-191368-20190220113304.patch (text/plain), 6.55 KB, created by
Per Arne Vollan
on 2019-02-20 11:33:05 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2019-02-20 11:33:05 PST
Size:
6.55 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 241825) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2019-02-20 Per Arne Vollan <pvollan@apple.com> >+ >+ Layout Test fast/text/international/khmer-selection.html is crashing >+ https://bugs.webkit.org/show_bug.cgi?id=191368 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ GlyphBuffer's offset array wasn't getting filled by UniscribeController. >+ Our underlining code requires this array. >+ >+ Uniscribe gives us a character -> glyph mapping, so we just have to compute >+ the inverse and give it to the GlyphBuffer. >+ >+ This patch is written by Myles C. Maxfield. >+ >+ Test: fast/text/international/khmer-selection.html. >+ >+ * platform/graphics/GlyphBuffer.h: >+ (WebCore::GlyphBuffer::add): >+ * platform/graphics/displaylists/DisplayListItems.cpp: >+ (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): >+ * platform/graphics/win/UniscribeController.cpp: >+ (WebCore::UniscribeController::advance): >+ (WebCore::UniscribeController::itemizeShapeAndPlace): >+ (WebCore::UniscribeController::shapeAndPlaceItem): >+ > 2019-02-20 Timothy Hatcher <timothy@apple.com> > > RenderThemeIOS should use RenderTheme's color cache instead of its own. >Index: Source/WebCore/platform/graphics/GlyphBuffer.h >=================================================================== >--- Source/WebCore/platform/graphics/GlyphBuffer.h (revision 241817) >+++ Source/WebCore/platform/graphics/GlyphBuffer.h (working copy) >@@ -117,7 +117,7 @@ public: > add(glyph, font, advance, offsetInString); > } > >- void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString = noOffset) >+ void add(Glyph glyph, const Font* font, GlyphBufferAdvance advance, unsigned offsetInString) > { > m_font.append(font); > m_glyphs.append(glyph); >Index: Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >=================================================================== >--- Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (revision 241817) >+++ Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (working copy) >@@ -364,7 +364,7 @@ inline GlyphBuffer DrawGlyphs::generateG > { > GlyphBuffer result; > for (size_t i = 0; i < m_glyphs.size(); ++i) { >- result.add(m_glyphs[i], &m_font.get(), m_advances[i]); >+ result.add(m_glyphs[i], &m_font.get(), m_advances[i], GlyphBuffer::noOffset); > } > return result; > } >Index: Source/WebCore/platform/graphics/win/UniscribeController.cpp >=================================================================== >--- Source/WebCore/platform/graphics/win/UniscribeController.cpp (revision 241817) >+++ Source/WebCore/platform/graphics/win/UniscribeController.cpp (working copy) >@@ -171,7 +171,7 @@ void UniscribeController::advance(unsign > int itemStart = m_run.rtl() ? index + 1 : indexOfFontTransition; > int itemLength = m_run.rtl() ? indexOfFontTransition - index : index - indexOfFontTransition; > m_currentCharacter = baseCharacter + itemStart; >- itemizeShapeAndPlace((isSmallCaps ? smallCapsBuffer.data() : cp) + itemStart, itemLength, fontData, glyphBuffer); >+ itemizeShapeAndPlace((isSmallCaps ? smallCapsBuffer.data() : cp) + itemStart, itemStart, itemLength, fontData, glyphBuffer); > indexOfFontTransition = index; > } > } >@@ -183,13 +183,13 @@ void UniscribeController::advance(unsign > > int itemStart = m_run.rtl() ? 0 : indexOfFontTransition; > m_currentCharacter = baseCharacter + itemStart; >- itemizeShapeAndPlace((nextIsSmallCaps ? smallCapsBuffer.data() : cp) + itemStart, itemLength, nextFontData, glyphBuffer); >+ itemizeShapeAndPlace((nextIsSmallCaps ? smallCapsBuffer.data() : cp) + itemStart, itemStart, itemLength, nextFontData, glyphBuffer); > } > > m_currentCharacter = baseCharacter + length; > } > >-void UniscribeController::itemizeShapeAndPlace(const UChar* cp, unsigned length, const Font* fontData, GlyphBuffer* glyphBuffer) >+void UniscribeController::itemizeShapeAndPlace(const UChar* cp, unsigned stringOffset, unsigned length, const Font* fontData, GlyphBuffer* glyphBuffer) > { > // ScriptItemize (in Windows XP versions prior to SP2) can overflow by 1. This is why there is an extra empty item > // hanging out at the end of the array >@@ -208,12 +208,12 @@ void UniscribeController::itemizeShapeAn > > if (m_run.rtl()) { > for (int i = m_items.size() - 2; i >= 0; i--) { >- if (!shapeAndPlaceItem(cp, i, fontData, glyphBuffer)) >+ if (!shapeAndPlaceItem(cp, stringOffset, i, fontData, glyphBuffer)) > return; > } > } else { > for (unsigned i = 0; i < m_items.size() - 1; i++) { >- if (!shapeAndPlaceItem(cp, i, fontData, glyphBuffer)) >+ if (!shapeAndPlaceItem(cp, stringOffset, i, fontData, glyphBuffer)) > return; > } > } >@@ -231,7 +231,7 @@ void UniscribeController::resetControlAn > m_state.fOverrideDirection = m_run.directionalOverride(); > } > >-bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned i, const Font* fontData, GlyphBuffer* glyphBuffer) >+bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned stringOffset, unsigned i, const Font* fontData, GlyphBuffer* glyphBuffer) > { > // Determine the string for this item. > const UChar* str = cp + m_items[i].iCharPos; >@@ -253,6 +253,14 @@ bool UniscribeController::shapeAndPlaceI > if (!shape(str, len, item, fontData, glyphs, clusters, visualAttributes)) > return true; > >+ Vector<Optional<unsigned>> stringOffsets(glyphs.size()); >+ for (size_t i = 0; i < len; ++i) { >+ if (stringOffsets[clusters[i]]) >+ stringOffsets[clusters[i]] = std::min(*stringOffsets[clusters[i]], i); >+ else >+ stringOffsets[clusters[i]] = i; >+ } >+ > // We now have a collection of glyphs. > Vector<GOFFSET> offsets; > Vector<int> advances; >@@ -367,7 +375,7 @@ bool UniscribeController::shapeAndPlaceI > else > glyphBuffer->expandLastAdvance(origin); > GlyphBufferAdvance glyphAdvance(-origin.width() + advance, -origin.height()); >- glyphBuffer->add(glyph, fontData, glyphAdvance); >+ glyphBuffer->add(glyph, fontData, glyphAdvance, stringOffsets[k].value_or(0) + stringOffset); > } > > FloatRect glyphBounds = fontData->boundsForGlyph(glyph);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191368
:
362192
|
362361
|
362519
|
362533
|
362552
|
362558
|
362613