Bug 17085

Summary: REGRESSION (r29839): All remote fonts are treated as SVG fonts (Acid3 Ahem test font no longer loads)
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://www.hixie.ch/tests/evil/acid/003/
Bug Depends on:    
Bug Blocks: 17086    
Attachments:
Description Flags
Patch hyatt: review+

Description Eric Seidel (no email) 2008-01-29 16:25:47 PST
Acid3 Ahem test font no longer loads

the @font-face in acid3 used to work.  But now I just see lots of logs to the console (possibly related to other failed @font-face loads for SVG font testing):

This is the CSS:
  @font-face { font-family: "AcidAhemTest"; src: url(font.ttf); }
  map::after { position: absolute; top: 20px; left: 640px; content: "X"; background: fuchsia; color: white; font: 20px/1 AcidAhemTest; }
Comment 1 Eric Seidel (no email) 2008-01-29 16:26:49 PST
These are the logs:

ERROR: unable to initialize with font (null) at not known
(/Stuff/Projects/WebKit/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:147 void WebCore::SimpleFontData::platformInit())
ERROR: Corrupt font detected, using (null) in place of (null) located at "not known".
(/Stuff/Projects/WebKit/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:154 void WebCore::SimpleFontData::platformInit())
ERROR: failed to set up font, using system font ?kx?
(/Stuff/Projects/WebKit/WebCore/platform/graphics/mac/SimpleFontDataMac.mm:161 void WebCore::SimpleFontData::platformInit())

Comment 2 Eric Seidel (no email) 2008-01-29 16:47:28 PST
I'm not certain if WebKit changed or if Acid3 changed.  Either way, I don't think we've shipped a version of WebKit which supported this @font-face, so I'm not going to mark this a regression.
Comment 3 mitz 2008-01-29 18:12:32 PST
All font data is parsed as SVG.
Comment 4 mitz 2008-01-29 18:13:48 PST
<rdar://problem/5714136>
Comment 5 mitz 2008-01-29 18:17:33 PST
The problem is CSSFontFaceSource::getFontData() always going the SVG path first (thus creating an SVG document with garbage data, that ends up not containing any fonts). It should only take that path for SVG data.
Comment 6 mitz 2008-01-29 19:31:33 PST
Created attachment 18787 [details]
Patch
Comment 7 Dave Hyatt 2008-01-29 19:42:59 PST
Comment on attachment 18787 [details]
Patch

r=me

How was this not caught by regression tests?
Comment 8 mitz 2008-01-29 19:49:40 PST
(In reply to comment #7)
> (From update of attachment 18787 [details] [edit])
> r=me
> 
> How was this not caught by regression tests?
> 

Whoever implemented @font-face did not check in regression tests for remote (or any) fonts :-)
Comment 9 mitz 2008-01-29 19:52:25 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/29864>.