<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>262030</bug_id>
          
          <creation_ts>2023-09-25 00:20:29 -0700</creation_ts>
          <short_desc>Link-stylesheet elements fire load events for non-2XX responses (e.g., 3XX responses that do not redirect)</short_desc>
          <delta_ts>2024-03-06 16:59:42 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://github.com/web-platform-tests/wpt/pull/42288</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>262927</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter>jannis.rautenstrauch</reporter>
          <assigned_to name="sideshowbarker">mike</assigned_to>
          <cc>karlcow</cc>
    
    <cc>mike</cc>
    
    <cc>twisniewski</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1979740</commentid>
    <comment_count>0</comment_count>
    <who name="">jannis.rautenstrauch</who>
    <bug_when>2023-09-25 00:20:29 -0700</bug_when>
    <thetext>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&amp;ecohd_status=300&amp;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&amp;ecohd_status=302&amp;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&amp;echd_status=307


Refer: https://bugs.webkit.org/show_bug.cgi?id=261811</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980227</commentid>
    <comment_count>1</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-09-26 11:05:20 -0700</bug_when>
    <thetext>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 &lt;link rel=stylesheet&gt; 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 &lt;link rel=stylesheet&gt; 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.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1981241</commentid>
    <comment_count>2</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-09-29 04:02:26 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/18404</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1981703</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-02 00:21:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/116331826&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1981781</commentid>
    <comment_count>4</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2023-10-02 10:16:15 -0700</bug_when>
    <thetext>Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/42288</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1982078</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-03 08:19:03 -0700</bug_when>
    <thetext>Committed 268779@main (d84fa2dfd249): &lt;https://commits.webkit.org/268779@main&gt;

Reviewed commits have been landed. Closing PR #18404 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2019099</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Wisniewski [:twisniewski]">twisniewski</who>
    <bug_when>2024-03-06 10:27:26 -0800</bug_when>
    <thetext>It looks like the WPT pull request was never merged. Could you please check if it&apos;s still good to merge and do so? It would be nice to have this test up on wpt.live and wpt.fyi.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2019232</commentid>
    <comment_count>7</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-03-06 16:59:42 -0800</bug_when>
    <thetext>hmm, thanks again Thomas.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>