Bug 262030

Summary: Link-stylesheet elements fire load events for non-2XX responses (e.g., 3XX responses that do not redirect)
Product: WebKit Reporter: jannis.rautenstrauch
Component: DOMAssignee: sideshowbarker <mike>
Status: RESOLVED FIXED    
Severity: Normal CC: karlcow, mike, twisniewski, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/42288
Bug Depends on: 262927    
Bug Blocks:    

Comment 1 sideshowbarker 2023-09-26 11:05:20 PDT
I suspect the same behavior would be observed in WebKit for any other type of subresource request; that is, the behavior isn’t special or specific to <link rel=stylesheet> elements — instead, the load event will also fire for any other type of subresource request with a 3XX response that doesn’t redirect.

And in that case, https://fetch.spec.whatwg.org/ would be the place where the relevant requirements are given.

At least there’s nothing in the HTML spec that states any requirements about what UAs must do in the case where the response for a <link rel=stylesheet> request is a 3XX response that doesn’t redirect. (In contrast to the https://bugs.webkit.org/show_bug.cgi?id=261811 case, where the spec does explicitly state requirements for what UAs must do when the MIME type isn’t text/css.)
Comment 2 sideshowbarker 2023-09-29 04:02:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18404
Comment 3 Radar WebKit Bug Importer 2023-10-02 00:21:13 PDT
<rdar://problem/116331826>
Comment 4 sideshowbarker 2023-10-02 10:16:15 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/42288
Comment 5 EWS 2023-10-03 08:19:03 PDT
Committed 268779@main (d84fa2dfd249): <https://commits.webkit.org/268779@main>

Reviewed commits have been landed. Closing PR #18404 and removing active labels.
Comment 6 Thomas Wisniewski [:twisniewski] 2024-03-06 10:27:26 PST
It looks like the WPT pull request was never merged. Could you please check if it's still good to merge and do so? It would be nice to have this test up on wpt.live and wpt.fyi.
Comment 7 Karl Dubost 2024-03-06 16:59:42 PST
hmm, thanks again Thomas.