Open Bug 1765884 Opened 2 years ago Updated 2 years ago

Fire <link rel=preload> error events if and only if network errors

Categories

(Core :: Networking, task, P2)

Firefox 101
task

Tracking

()

UNCONFIRMED

People

(Reporter: hiroshige, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

Steps to reproduce:

Preload resources using <link rel=preload> with various as values and responses.

WPT: https://github.com/web-platform-tests/wpt/pull/33382

According to the discussion on https://github.com/whatwg/html/issues/1142
(Spec PR https://github.com/whatwg/html/pull/7799),
error events on <link rel=preload> should be fired only for network errors.

Actual results:

See below.

Expected results:

load events should be fired for responses that are not network errors (actual: error events):

  • <link rel=preload as=style/script> + HTTP 404 (all browsers)
  • <link rel=preload as=image> + broken images (all browsers)
  • <link rel=preload as=fetch> + HTTP 404 (Firefox only after Chrome is fixed soon by https://crbug.com/1318618)
  • <link rel=preload as=style> + non-text/CSS MIME (Firefox only)

error events should be fired for network errors (actual: load events):

  • <link rel=preload as=image/style/script/fetch crossorigin=anonymous> + CORS failure (Firefox only)

For complete summary including other browsers' behavior, see
https://github.com/whatwg/html/issues/1142#issuecomment-1092298830

The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking
Product: Firefox → Core

Note: the events described are on <link rel=preload>, which can be different from events fired on main requests e.g. <img>.

Blocks: 1222633
Severity: -- → S3
Type: defect → task
Priority: -- → P2

Hmm, off-hand I find Firefox's behavior a bit more useful? The error event indicates whether the preload failed for any reason... Which seems likely to be what you want as an author? But anyways I need to read all that discussion linked in comment 0 :)

Whiteboard: [necko-triaged]
You need to log in before you can comment on or make changes to this bug.