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: | DOM | Assignee: | 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: | |||
jannis.rautenstrauch
Link-stylesheet elements fire load events for 3XX responses that do not redirect (e.g., no location header).
- 300, text/css, image body: https://observer.sectec.rocks/opg/link-stylesheet/?url=https://echo.sectec.rocks/echo/?content-type=text/css&ecohd_status=300&ecocnt_img=width=200,height=300,type=png
- 302, text/css, css body: https://observer.sectec.rocks/opg/link-stylesheet/?url=https://echo.sectec.rocks/echo/?content-type=text/css&ecohd_status=302&ecocnt_css=p%20{color:%20red;}
- 307, text/html, empty: https://observer.sectec.rocks/opg/link-stylesheet/?url=https://echo.sectec.rocks/echo/?content-type=text/html&echd_status=307
Refer: https://bugs.webkit.org/show_bug.cgi?id=261811
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
sideshowbarker
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.)
sideshowbarker
Pull request: https://github.com/WebKit/WebKit/pull/18404
Radar WebKit Bug Importer
<rdar://problem/116331826>
sideshowbarker
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/42288
EWS
Committed 268779@main (d84fa2dfd249): <https://commits.webkit.org/268779@main>
Reviewed commits have been landed. Closing PR #18404 and removing active labels.
Thomas Wisniewski [:twisniewski]
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.
Karl Dubost
hmm, thanks again Thomas.