Bug 113715

Summary: @font-face downloads all external fonts of same name, regardless of weight
Product: WebKit Reporter: Tom Genoni <tom>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, bjonesbe, bradavogel, fantasai.bugs, glenn, jonlee, leviw, mmaxfield, rniwa, simon.fraser, vitor.roriz, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.8   
Attachments:
Description Flags
Shows webkit downloading all external fonts
none
HTML example. none

Description Tom Genoni 2013-04-01 12:19:12 PDT
Created attachment 196003 [details]
Shows webkit downloading all external fonts

Given the following CSS:

body {
  font-family: "Source Sans Pro";
  font-weight: 200;
}

@font-face {
  font-family: 'Source Sans Pro';
  src: url("SourceSansPro-ExtraLight.woff") format("woff");
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans Pro';
  src: url("SourceSansPro-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
}

...the expected behavior is that the browser only downloads "SourceSansPro-ExtraLight.woff" but both "SourceSansPro-ExtraLight.woff" and "SourceSansPro-Light.woff" are downloaded. Mozilla only downloads the "SourceSansPro-ExtraLight.woff" font.
Comment 1 Tom Genoni 2013-04-01 12:23:43 PDT
Created attachment 196005 [details]
HTML example.
Comment 2 Glenn Adams 2013-04-01 13:00:50 PDT
Could you point out the spec text the defines the "correct" behavior?
Comment 3 Tom Genoni 2013-04-01 14:18:17 PDT
(In reply to comment #2)
> Could you point out the spec text the defines the "correct" behavior?

http://www.w3.org/TR/css3-fonts/#font-face-loading
"User agents that download all fonts defined in @font-face rules without considering whether those fonts are in fact used within a page are considered non-conformant."
Comment 4 Brad Vogel 2013-04-04 16:39:57 PDT
Cross-filed for blink - https://code.google.com/p/chromium/issues/detail?id=226849
Comment 5 Radar WebKit Bug Importer 2015-09-08 10:55:29 PDT
<rdar://problem/22612942>
Comment 6 Myles C. Maxfield 2015-09-08 11:05:12 PDT
See also: https://bugs.webkit.org/show_bug.cgi?id=42154
Comment 7 Ahmad Saleem 2022-07-24 11:10:07 PDT
All browsers differ - I look into Chrome Bug mentioned in Comment 04, which got fixed in the past and then took the tests and changed them into following JSFiddles:

Link - https://jsfiddle.net/t9qrmnhs/show

Link - https://jsfiddle.net/o1hnL89a/show

Link - https://jsfiddle.net/8gp0h1d4/show

I am getting different behaviour across all browsers and not sure, which is aligned with web-spec but just wanted to share updated results. Thanks!