Changeset 131995 in webkit


Ignore:
Timestamp:
Oct 20, 2012 6:57:13 PM (12 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/12512710> [mac] Text with zero font size renders as 12px sometimes
https://bugs.webkit.org/show_bug.cgi?id=99918

Reviewed by Geoff Garen.

Source/WebCore:

-[NSFont fontWithName:size:] returns an NSFont of size 12 (the default User Font size) when
asked for size 0, and this is what Font::drawGlyphs uses to draw the text.

Test: fast/text/zero-font-size-2.html

  • platform/graphics/mac/FontMac.mm:

(WebCore::Font::drawGlyphs): Added an early return if the size is zero.

LayoutTests:

  • fast/text/zero-font-size-2-expected.html: Added.
  • fast/text/zero-font-size-2.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r131994 r131995  
     12012-10-20  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/12512710> [mac] Text with zero font size renders as 12px sometimes
     4        https://bugs.webkit.org/show_bug.cgi?id=99918
     5
     6        Reviewed by Geoff Garen.
     7
     8        * fast/text/zero-font-size-2-expected.html: Added.
     9        * fast/text/zero-font-size-2.html: Added.
     10
    1112012-10-20  Florin Malita  <fmalita@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r131993 r131995  
     12012-10-20  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/12512710> [mac] Text with zero font size renders as 12px sometimes
     4        https://bugs.webkit.org/show_bug.cgi?id=99918
     5
     6        Reviewed by Geoff Garen.
     7
     8        -[NSFont fontWithName:size:] returns an NSFont of size 12 (the default User Font size) when
     9        asked for size 0, and this is what Font::drawGlyphs uses to draw the text.
     10
     11        Test: fast/text/zero-font-size-2.html
     12
     13        * platform/graphics/mac/FontMac.mm:
     14        (WebCore::Font::drawGlyphs): Added an early return if the size is zero.
     15
    1162012-10-20  Andreas Kling  <kling@webkit.org>
    217
  • trunk/Source/WebCore/platform/graphics/mac/FontMac.mm

    r131365 r131995  
    140140void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const
    141141{
     142    if (!font->platformData().size())
     143        return;
     144
    142145    CGContextRef cgContext = context->platformContext();
    143146
Note: See TracChangeset for help on using the changeset viewer.