Bug 235656 - Blocked link to font source does not emit error event
Summary: Blocked link to font source does not emit error event
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 246663
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-26 10:49 PST by Patrick Griffis
Modified: 2022-11-16 09:28 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Griffis 2022-01-26 10:49:07 PST
There are a couple of WPT tests that rely on the onerror handler being called when a font source is blocked by CSP.

They can be seen here: https://wpt.fyi/results/content-security-policy/font-src?label=master&label=experimental&product=safari&product=webkitgtk

But a snippet is:

      var link = document.createElement('link');
      link.rel="preload";
      link.as="font";
      link.href="http://{{hosts[alt][]}}:{{ports[http][0]}}/fonts/Ahem.ttf?font-none-blocked";
      link.onload = t.unreached_func("Should not have loaded the font.");
      link.onerror = t.step_func_done();
      document.getElementsByTagName('head')[0].appendChild(link);
Comment 1 Radar WebKit Bug Importer 2022-02-02 10:50:18 PST
<rdar://problem/88389961>
Comment 2 Ryan Reno 2022-11-16 09:28:20 PST
This was fixed by https://bugs.webkit.org/show_bug.cgi?id=246663