Changeset 199150 in webkit


Ignore:
Timestamp:
Apr 6, 2016 10:19:52 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
https://bugs.webkit.org/show_bug.cgi?id=156241
<rdar://problem/25262213>

Reviewed by Simon Fraser.

Source/WebCore:

When creating a CoreText font with a size of 0, the CoreText docs say that it will
interpret this as a missing argument, and create a font of size 12 instead. However,
this doesn't cause a problem (at least on this particular website) because we will
use CGFontGetGlyphAdvancesForStyle(), which gets scaled by the supplied font
size (which is 0). However, if you turn on text-rendering: optimizeLegibility, we
will use CTFontGetAdvancesForGlyphs() instead, which does not scale by the font size.
The solution is to detect this case, and force the advance to 0.

Test: fast/text/zero-sized-fonts.html

  • platform/graphics/cocoa/FontCocoa.mm:

(WebCore::Font::platformWidthForGlyph):

LayoutTests:

  • fast/text/zero-sized-fonts-expected.txt: Added.
  • fast/text/zero-sized-fonts.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r199143 r199150  
     12016-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
     4        https://bugs.webkit.org/show_bug.cgi?id=156241
     5        <rdar://problem/25262213>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/text/zero-sized-fonts-expected.txt: Added.
     10        * fast/text/zero-sized-fonts.html: Added.
     11
    1122016-04-06  Matt Baker  <mattbaker@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r199149 r199150  
     12016-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
     4        https://bugs.webkit.org/show_bug.cgi?id=156241
     5        <rdar://problem/25262213>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When creating a CoreText font with a size of 0, the CoreText docs say that it will
     10        interpret this as a missing argument, and create a font of size 12 instead. However,
     11        this doesn't cause a problem (at least on this particular website) because we will
     12        use CGFontGetGlyphAdvancesForStyle(), which gets scaled by the supplied font
     13        size (which is 0). However, if you turn on text-rendering: optimizeLegibility, we
     14        will use CTFontGetAdvancesForGlyphs() instead, which does not scale by the font size.
     15        The solution is to detect this case, and force the advance to 0.
     16
     17        Test: fast/text/zero-sized-fonts.html
     18
     19        * platform/graphics/cocoa/FontCocoa.mm:
     20        (WebCore::Font::platformWidthForGlyph):
     21
    1222016-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm

    r194551 r199150  
    695695            advance.width = 0;
    696696        }
    697     } else if (!populatedAdvance)
     697    } else if (!populatedAdvance && platformData().m_size)
    698698        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), horizontal ? kCTFontOrientationHorizontal : kCTFontOrientationVertical, &glyph, &advance, 1);
    699699
Note: See TracChangeset for help on using the changeset viewer.