ASSERTION FAILED: markFontData in FontCascade::emphasisMarkHeight
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 12:52:17 +0000 (12:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 12:52:17 +0000 (12:52 +0000)
commit50304532133eee2445eb4648d4bbf466a1e1892b
tree48f9eba770356902becabd3b1dad9f728eb50190
parent2a97dd9e7295cee21d7e8d3e84188d7abe9ccddc
ASSERTION FAILED: markFontData in FontCascade::emphasisMarkHeight
https://bugs.webkit.org/show_bug.cgi?id=150171

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2015-10-21
Reviewed by Myles C. Maxfield.

It happens with several tests like fast/ruby/text-emphasis.html in
the GTK Debug bot. The tests seem to pass in Release and the rendering
looks correct as well removing the assert. The thing is that
for some reason we can get an empty GlyphData from
FontCascade::getEmphasisMarkGlyphData() when it ends up falling
back to system (FontCascadeFonts::glyphDataForSystemFallback).

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::getEmphasisMarkGlyphData): Return
Optional<GlyphData> instead of returning a boolean and an out
parameter. If we get an invalid GlyphData, Nullopt is
returned. Also use a SurrogatePairAwareTextIterator to handle
surrogate pairs.
(WebCore::FontCascade::emphasisMarkAscent):
(WebCore::FontCascade::emphasisMarkDescent):
(WebCore::FontCascade::emphasisMarkHeight):
(WebCore::FontCascade::drawEmphasisMarks):
* platform/graphics/FontCascade.h:
* platform/graphics/GlyphPage.h:
(WebCore::GlyphData::isValid): Return whether the GlyphData is valid.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/FontCascade.h
Source/WebCore/platform/graphics/GlyphPage.h