Changeset 171561 in webkit


Ignore:
Timestamp:
Jul 24, 2014 5:27:09 PM (10 years ago)
Author:
mmaxfield@apple.com
Message:

Crash when measuring a glyphs from a fallback SVG font
https://bugs.webkit.org/show_bug.cgi?id=135264

Reviewed by Simon Fraser.

Source/WebCore:
We can't realize font data for all fallback fonts ahead
of time, but we don't have all the necessary context to
realize SVG fallback data when it's needed. For now, we
can just bail; however, a larger, more invasive fix is
in order.

Test: svg/text/svg-fallback-font-crash.html

  • platform/graphics/WidthIterator.cpp:

(WebCore::applyFontTransforms):

LayoutTests:
Render some text with a fallback SVG Font including a glyph which
only exists in that fallback font. Make sure there is no crash.

  • svg/text/resources/Litherum.svg:
  • svg/text/svg-fallback-font-crash-expected.txt: Added.
  • svg/text/svg-fallback-font-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r171511 r171561  
     12014-07-24  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Crash when measuring a glyphs from a fallback SVG font
     4        https://bugs.webkit.org/show_bug.cgi?id=135264
     5
     6        Reviewed by Simon Fraser.
     7
     8        Render some text with a fallback SVG Font including a glyph which
     9        only exists in that fallback font. Make sure there is no crash.
     10
     11        * svg/text/resources/Litherum.svg:
     12        * svg/text/svg-fallback-font-crash-expected.txt: Added.
     13        * svg/text/svg-fallback-font-crash.html: Added.
     14
    1152014-07-24  Mihnea Ovidenie  <mihnea@adobe.com>
    216
  • trunk/LayoutTests/svg/text/resources/Litherum.svg

    r166603 r171561  
    77<font-face units-per-em="14" ascent="14" descent="-7"/>
    88<glyph unicode="|" horiz-adv-x="14" d="M5 -7v21h4v-21z"/>
     9<glyph unicode="&#x20001;" horiz-adv-x="14" d="M5 -7v21h4v-21z"/>
    910</font>
    1011</defs>
  • trunk/Source/WebCore/ChangeLog

    r171559 r171561  
     12014-07-24  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Crash when measuring a glyphs from a fallback SVG font
     4        https://bugs.webkit.org/show_bug.cgi?id=135264
     5
     6        Reviewed by Simon Fraser.
     7
     8        We can't realize font data for all fallback fonts ahead
     9        of time, but we don't have all the necessary context to
     10        realize SVG fallback data when it's needed. For now, we
     11        can just bail; however, a larger, more invasive fix is
     12        in order.
     13
     14        Test: svg/text/svg-fallback-font-crash.html
     15
     16        * platform/graphics/WidthIterator.cpp:
     17        (WebCore::applyFontTransforms):
     18
    1192014-07-24  Daniel Bates  <dabates@apple.com>
    220            And Alexey Proskuryakov  <ap@apple.com>
  • trunk/Source/WebCore/platform/graphics/WidthIterator.cpp

    r170947 r171561  
    124124    // We need to handle transforms on SVG fonts internally, since they are rendered internally.
    125125    if (fontData->isSVGFont()) {
    126         ASSERT(iterator.run().renderingContext());
    127126        // SVG font ligatures are handled during glyph selection, only kerning remaining.
    128         if (typesettingFeatures & Kerning)
     127        if (iterator.run().renderingContext() && (typesettingFeatures & Kerning)) {
     128            // FIXME: We could pass the necessary context down to this level so we can lazily create rendering contexts at this point.
     129            // However, a larger refactoring of SVG fonts might necessary to sidestep this problem completely.
    129130            iterator.run().renderingContext()->applySVGKerning(fontData, iterator, glyphBuffer, lastGlyphCount);
     131        }
    130132    } else
    131133#endif
Note: See TracChangeset for help on using the changeset viewer.