Fire <link rel=preload> error events if and only if network errors
Categories
(Core :: Networking, task, P2)
Tracking
()
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
Comment 1•2 years ago
|
||
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.
Note: the events described are on <link rel=preload>, which can be different from events fired on main requests e.g. <img>.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
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 :)
Updated•2 years ago
|
Description
•