Title: [199150] trunk
Revision 199150
Author mmaxfi...@apple.com
Date 2016-04-06 22:19:52 -0700 (Wed, 06 Apr 2016)
Log Message
REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
https://bugs.webkit.org/show_bug.cgi?id=156241
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.
Modified Paths
trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Added Paths
trunk/LayoutTests/fast/text/zero-sized-fonts-expected.txt
trunk/LayoutTests/fast/text/zero-sized-fonts.html
Diff
Modified: trunk/LayoutTests/ChangeLog (199149 => 199150)
--- trunk/LayoutTests/ChangeLog 2016-04-07 04:59:55 UTC (rev 199149)
+++ trunk/LayoutTests/ChangeLog 2016-04-07 05:19:52 UTC (rev 199150)
@@ -1,3 +1,14 @@
+2016-04-06 Myles C. Maxfield
+
+REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
+https://bugs.webkit.org/show_bug.cgi?id=156241
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/zero-sized-fonts-expected.txt: Added.
+* fast/text/zero-sized-fonts.html: Added.
+
2016-04-06 Matt Baker
Web Inspector: Improve filtering in OpenResourceDialog
Added: trunk/LayoutTests/fast/text/zero-sized-fonts-expected.txt (0 => 199150)
--- trunk/LayoutTests/fast/text/zero-sized-fonts-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/text/zero-sized-fonts-expected.txt 2016-04-07 05:19:52 UTC (rev 199150)
@@ -0,0 +1,6 @@
+PASS document.getElementById('sample').getBoundingClientRect().height < 30 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+This test makes sure that 0-sized fonts have 0-sized advances. The green rectangle below's height should be less than 30 pixels.
+
Property changes on: trunk/LayoutTests/fast/text/zero-sized-fonts-expected.txt
___
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/fast/text/zero-sized-fonts.html (0 => 199150)
--- trunk/LayoutTests/fast/text/zero-sized-fonts.html (rev 0)
+++ trunk/LayoutTests/fast/text/zero-sized-fonts.html 2016-04-07 05:19:52 UTC (rev 199150)
@@ -0,0 +1,14 @@
+
+
+
+
+
+This test makes sure that 0-sized fonts have 0-sized advances. The green rectangle below's height should be less than 30 pixels.
+
+