| Differences between
and this patch
- a/Source/WebCore/ChangeLog +21 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2016-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 NOBODY (OOPS!).
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
1
2016-04-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
22
2016-04-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
23
3
        Avoid context save/restore in GraphicsContext::drawNativeImage 
24
        Avoid context save/restore in GraphicsContext::drawNativeImage 
- a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm -1 / +1 lines
Lines 694-700 float Font::platformWidthForGlyph(Glyph glyph) const a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm_sec1
694
            LOG_ERROR("Unable to cache glyph widths for %@ %f", fullName.get(), pointSize);
694
            LOG_ERROR("Unable to cache glyph widths for %@ %f", fullName.get(), pointSize);
695
            advance.width = 0;
695
            advance.width = 0;
696
        }
696
        }
697
    } else if (!populatedAdvance)
697
    } else if (!populatedAdvance && platformData().m_size)
698
        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), horizontal ? kCTFontOrientationHorizontal : kCTFontOrientationVertical, &glyph, &advance, 1);
698
        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), horizontal ? kCTFontOrientationHorizontal : kCTFontOrientationVertical, &glyph, &advance, 1);
699
699
700
    return advance.width + m_syntheticBoldOffset;
700
    return advance.width + m_syntheticBoldOffset;
- a/LayoutTests/ChangeLog +11 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2016-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 NOBODY (OOPS!).
8
9
        * fast/text/zero-sized-fonts-expected.txt: Added.
10
        * fast/text/zero-sized-fonts.html: Added.
11
1
2016-04-04  Filip Pizlo  <fpizlo@apple.com>
12
2016-04-04  Filip Pizlo  <fpizlo@apple.com>
2
13
3
        PolymorphicAccess should have a MegamorphicLoad case
14
        PolymorphicAccess should have a MegamorphicLoad case
- a/LayoutTests/fast/text/zero-sized-fonts-expected.txt +6 lines
Line 0 a/LayoutTests/fast/text/zero-sized-fonts-expected.txt_sec1
1
PASS document.getElementById('sample').getBoundingClientRect().height < 30 is true
2
PASS successfullyParsed is true
3
4
TEST COMPLETE
5
This test makes sure that 0-sized fonts have 0-sized advances. The green rectangle below's height should be less than 30 pixels.
6
 
- a/LayoutTests/fast/text/zero-sized-fonts.html +14 lines
Line 0 a/LayoutTests/fast/text/zero-sized-fonts.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
</head>
6
<body style="text-rendering: optimizeLegibility;">
7
This test makes sure that 0-sized fonts have 0-sized advances. The green rectangle below's height should be less than 30 pixels.
8
<div id="sample" style="font-size: 0; width: 970px; background: green;"><div style="display: inline-block; width: 320px; height: 20px; font-size: 16px; background: green;"></div> <div style="display: inline-block; width: 648px; height: 10px; font-size: 16px; background: green;"></div></div>
9
<script>
10
shouldBeTrue("document.getElementById('sample').getBoundingClientRect().height < 30");
11
</script>
12
<script src="../../resources/js-test-post.js"></script>
13
</body>
14
</html>

Return to Bug 156241