whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.16k stars 2.68k forks source link

Which status codes are allowed for various tags such as script, video, audio? #9763

Open JannisBush opened 1 year ago

JannisBush commented 1 year ago

Does the HTML standard specifies which status codes are allowed for the different tags? I.e., responses with which codes should result in a "load" event and processing of the response?

Currently, browser behavior diverges for several tags and the behavior for various tags is different as well:

annevk commented 1 year ago

For images it seems that Gecko is correct:

Whether the image is fetched successfully or not (e.g. whether the response status was an ok status) must be ignored when determining the image's type and whether it is a valid image.

Though for cross-origin images this will soon depend on ORB as well.

For media responses Chromium/WebKit appear correct per https://html.spec.whatwg.org/#verify-a-media-response. Though Gecko's behavior might be preferable if we generally want to hide 2xx vs 200.

I think script and link-stylesheet are also defined to match Gecko.