Skip to content
  • allan.jensen@digia.com's avatar
    Font’s fast code path doesn’t handle partial runs correctly when kerning or ligatures are enabled · 52ea0c9f
    allan.jensen@digia.com authored
    https://bugs.webkit.org/show_bug.cgi?id=100050
    
    Reviewed by Antti Koivisto.
    
    Source/WebCore:
    
    Always let WidthIterator iterate over an entire TextRun to avoid problems
    with pixel rounding or shaping on partial runs.
    
    This fix is necessary for Qt because the complex font-path can not disable
    shaping, leading to the complex path painting slighly different from the
    fast path, which messes up selection painting.
    
    No change in functionality, no new tests.
    
    * platform/graphics/Font.cpp:
    (WebCore::Font::drawText):
    (WebCore::Font::drawEmphasisMarks):
    (WebCore::Font::selectionRectForText):
    (WebCore::Font::offsetForPosition):
    * platform/graphics/FontFastPath.cpp:
    (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
    (WebCore::Font::selectionRectForSimpleText):
    (WebCore::Font::offsetForPositionForSimpleText):
    * platform/graphics/GlyphBuffer.h:
    (WebCore::GlyphBuffer::add):
    (GlyphBuffer):
    * platform/graphics/WidthIterator.cpp:
    (WebCore::WidthIterator::advanceInternal):
    * platform/graphics/WidthIterator.h:
    (WidthIterator): Removed now unused advanceOneCharacter method.
    
    LayoutTests:
    
    * fast/text/resources/PTS55F-webfont.ttf: Added.
    * fast/text/partial-textruns-expected.html: Added.
    * fast/text/partial-textruns.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    52ea0c9f