<?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>15242</bug_id>
          
          <creation_ts>2007-09-19 17:30:46 -0700</creation_ts>
          <short_desc>Needs test: Improperly Linked CSS document (404) still loads contained styles</short_desc>
          <delta_ts>2024-05-30 19:09:33 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Peterson">petey31</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>b30r4</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>eric</cc>
    
    <cc>mal</cc>
    
    <cc>mitz</cc>
    
    <cc>petey31</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>278</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Peterson">petey31</who>
    <bug_when>2007-09-19 17:30:46 -0700</bug_when>
    <thetext>Observed behavior:
A CSS file is included on a page with an invalid path. A 404 html page is given in response by the server. The CSS styles on the 404 html page will be used on the original page.

Expected behavior: 
The contents of the returned 404 page are ignored.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276</commentid>
    <comment_count>1</comment_count>
      <attachid>16329</attachid>
    <who name="Peter Peterson">petey31</who>
    <bug_when>2007-09-19 17:34:18 -0700</bug_when>
    <thetext>Created attachment 16329
Example of improper loading of css styles from 404 document

A 404 page is loaded as a CSS document. 

Observed behavior: 
&quot;Normal&quot; link is blue (browser default), &quot;u link&quot; is green, &quot;l link&quot; is grey

Expected behavior:
All links are the browser default color</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-09-20 02:06:26 -0700</bug_when>
    <thetext>Confirmed with r25667 (and with shipping Safari/WebKit).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>247</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-20 06:36:36 -0700</bug_when>
    <thetext>&lt;rdar://problem/5494250&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>231</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-09-20 12:51:51 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Created an attachment (id=16329) [edit]
&gt; Example of improper loading of css styles from 404 document
&gt; 
&gt; A 404 page is loaded as a CSS document. 
&gt; 
&gt; Observed behavior: 
&gt; &quot;Normal&quot; link is blue (browser default), &quot;u link&quot; is green, &quot;l link&quot; is grey

Note that this test only works if http://webkit.org/ is not in your browser history!  You&apos;ll either need to change the &quot;http://webkit.org/&quot; URL in the test to a URL that isn&apos;t in your browser history, or you need to clear your browser history through &quot;Reset Safari&quot; in the &quot;Safari&quot; menu.


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>228</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-09-20 13:02:27 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; You&apos;ll either need to change the &quot;http://webkit.org/&quot; URL in the test
&gt; to a URL that isn&apos;t in your browser history, or you need to clear your browser
&gt; history through &quot;Reset Safari&quot; in the &quot;Safari&quot; menu.

You can delete individual history items in Safari&apos;s bookmarks viewer.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64969</commentid>
    <comment_count>6</comment_count>
      <attachid>18035</attachid>
    <who name="Mark Larson (Google)">mal</who>
    <bug_when>2007-12-21 10:53:33 -0800</bug_when>
    <thetext>Created attachment 18035
Another test case for interpreting styles in a 404 page

I confirmed this on Windows (Safari 3.0.4 523/13). I created a test case before finding this bug already filed. I&apos;ve attached it FWIW (it uses a span.nav instead of an A, so it doesn&apos;t depend on your visited link history).

Curiously, the body{} style in the 404 response does not seem to get applied. Google&apos;s 404 reponse contains

&lt;style&gt;&lt;!--
body {font-family: arial,sans-serif}
div.nav {margin-top: 1ex}
div.nav A {font-size: 10pt; font-family: arial,sans-serif}
span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}
div.nav A,span.big {font-size: 12pt; color: #0000cc}
div.nav A {font-size: 10pt; color: black}
A.l:link {color: #6f6f6f}
A.u:link {color: green}
//--&gt;&lt;/style&gt;

I haven&apos;t tested all the rules, but I&apos;ve confirmed that span.nav gets applied but body does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69401</commentid>
    <comment_count>7</comment_count>
      <attachid>18920</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-02-04 15:05:01 -0800</bug_when>
    <thetext>Created attachment 18920
Patch that fixes this bug

Not really sure if it is a good way to do it or not.  I just stop the feeding of data to the CachedResource when a 404 happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69404</commentid>
    <comment_count>8</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-02-04 15:10:15 -0800</bug_when>
    <thetext>Should probably apply to other 4xx and 5xx codes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69405</commentid>
    <comment_count>9</comment_count>
      <attachid>18920</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-02-04 15:11:06 -0800</bug_when>
    <thetext>Comment on attachment 18920
Patch that fixes this bug

Why handle 404 different from other 4xx errors? What about 3xx and 5xx?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69410</commentid>
    <comment_count>10</comment_count>
      <attachid>18920</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-02-04 15:30:09 -0800</bug_when>
    <thetext>Comment on attachment 18920
Patch that fixes this bug

I think the approach in this patch is OK, but it should be for all 4xx and 5xx, not specifically 404.

I also think that instead of calling data() and finish(), you should call error().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82736</commentid>
    <comment_count>11</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-06-09 04:54:52 -0700</bug_when>
    <thetext>I&apos;ve tested the bug in Webkit r34382 on OS X and, to my surprise, the issue is not replicable in this build. This test https://bugs.webkit.org/attachment.cgi?id=18035 passes in the Webkit but still fails in stock Safari 3.1.1 for OS X. 

Any confirmations?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82739</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-06-09 06:14:59 -0700</bug_when>
    <thetext>I also cannot reproduce with this nightly. I think that it would make sense to isolate the revision that fixed this, and possibly to land a test case, if there isn&apos;t one already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82749</commentid>
    <comment_count>13</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-06-09 07:55:05 -0700</bug_when>
    <thetext>I think this was fixed by Hyatt for Acid3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82820</commentid>
    <comment_count>14</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-06-10 03:14:58 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; I think this was fixed by Hyatt for Acid3.
&gt; 

Indeed, it was fixed in http://trac.webkit.org/changeset/30438 as part of fixing a bug: https://bugs.webkit.org/show_bug.cgi?id=16760

For LayoutTests I suggest to import these tests: http://biesi.damowmow.com/object/ </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118484</commentid>
    <comment_count>15</comment_count>
    <who name="Andrew Kulinich">b30r4</who>
    <bug_when>2009-04-23 01:58:21 -0700</bug_when>
    <thetext>*** Bug 25326 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038941</commentid>
    <comment_count>16</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-05-30 19:09:33 -0700</bug_when>
    <thetext>This started passing in 2008 and also from Comment 14, we only have this copy available:

https://web.archive.org/web/20050924094554/http://biesi.damowmow.com:80/object/002.html

Do we still want to add these test or they might be already covered one?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>16329</attachid>
            <date>2007-09-19 17:34:18 -0700</date>
            <delta_ts>2007-09-19 17:34:18 -0700</delta_ts>
            <desc>Example of improper loading of css styles from 404 document</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>289</size>
            <attacher name="Peter Peterson">petey31</attacher>
            
              <data encoding="base64">PGh0bWw+Cgk8aGVhZD4KCQk8dGl0bGU+dGVzdCBjc3MgZXJyb3I8L3RpdGxlPgoJCTxsaW5rIHR5
cGU9InRleHQvY3NzIiBocmVmPSJodHRwOi8vd3d3Lmdvb2dsZS5jb20vYXNkYXNmYXNmIiAvPgoJ
PC9oZWFkPgoJPGJvZHk+CgkJPGEgaHJlZj0iaHR0cDovL3dlYmtpdC5vcmciPk5vcm1hbDwvYT4K
CQk8YSBjbGFzcz0idSIgaHJlZj0iaHR0cDovL3dlYmtpdC5vcmciPnUgbGluazwvYT4KCQk8YSBj
bGFzcz0ibCIgaHJlZj0iaHR0cDovL3dlYmtpdC5vcmciPmwgbGluazwvYT4KCTwvYm9keT4KPC9o
dG1sPg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>18035</attachid>
            <date>2007-12-21 10:53:33 -0800</date>
            <delta_ts>2007-12-21 10:53:33 -0800</delta_ts>
            <desc>Another test case for interpreting styles in a 404 page</desc>
            <filename>404test.html</filename>
            <type>text/html</type>
            <size>1749</size>
            <attacher name="Mark Larson (Google)">mal</attacher>
            
              <data encoding="base64">PGh0bWw+IA0KPGhlYWQ+IA0KICA8bGluayByZWw9c3R5bGVzaGVldCBocmVmPSJodHRwOi8vd3d3
Lmdvb2dsZS5jb20vbWlzc2luZy5jc3MiIHR5cGU9InRleHQvY3NzIj4NCiAgPHNjcmlwdD4NCiAg
dmFyIHBhc3NlZCA9IHRydWU7DQogIGZ1bmN0aW9uIHNob3dSZXN1bHRzKCkgew0KICAgIHZhciBl
bCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdzdHlsZWQnKTsNCiAgICB2YXIgY1N0eWxlID0g
ZG9jdW1lbnQuZGVmYXVsdFZpZXcuZ2V0Q29tcHV0ZWRTdHlsZShlbCxudWxsKTsNCiAgICB2YXIg
YlN0eWxlID0gZG9jdW1lbnQuZGVmYXVsdFZpZXcuZ2V0Q29tcHV0ZWRTdHlsZShkb2N1bWVudC5i
b2R5LCBudWxsKQ0KDQogICAgdmFyIHJlcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdyZXN1
bHRzJyk7DQogICAgdmFyIHJlc3RhYmxlID0gIjxicj48dGFibGUgYm9yZGVyPTEgY2VsbHBhZGRp
bmc9NCBjZWxsc3BhY2luZz0wPiI7DQogICAgcmVzdGFibGUgKz0gIjx0ciBzdHlsZT0nYmFja2dy
b3VuZDogcmdiKDI0MCwyNDAsMjQwKSc+PHRkPlByb3BlcnR5PC90ZD48dGQ+Q29tcHV0ZWQ8L3Rk
Pjx0ZD5FeHBlY3RlZDwvdGQ+PC90cj4iOw0KICAgIHJlc3RhYmxlICs9IHRhYmxlUm93KGJTdHls
ZSwgY1N0eWxlLCAiRm9udCIsICJmb250LWZ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g0KICA8c3BhbiBpZD0ic3R5bGVkIiBjbGFz
cz0ibmF2Ij5UaGVzZSBsaW5lcyBzaG91bGQgYmUgaWRlbnRpY2FsLiBJZiBhIGNvbXB1dGVkIHN0
eWxlIGlzIHJlZCwgdGhlIHRlc3QgZmFpbGVkLjwvc3Bhbj4NCiAgPGJyLz4NCiAgPHNwYW4gaWQ9
InVuc3R5bGVkIj5UaGVzZSBsaW5lcyBzaG91bGQgYmUgaWRlbnRpY2FsLiBJZiBhIGNvbXB1dGVk
IHN0eWxlIGlzIHJlZCwgdGhlIHRlc3QgZmFpbGVkLjwvc3Bhbj4NCiAgPGJyLz4NCiAgPGRpdiBp
ZD0ncmVzdWx0cyc+PC9kaXY+DQo8L2JvZHk+DQo8L2h0bWw+IA0K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18920</attachid>
            <date>2008-02-04 15:05:01 -0800</date>
            <delta_ts>2010-06-11 14:44:11 -0700</delta_ts>
            <desc>Patch that fixes this bug</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1080</size>
            <attacher name="Dave Hyatt">hyatt</attacher>
            
              <data encoding="base64">SW5kZXg6IGxvYWRlci9sb2FkZXIuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxvYWRlci9sb2FkZXIuY3Bw
CShyZXZpc2lvbiAyOTk0MykKKysrIGxvYWRlci9sb2FkZXIuY3BwCSh3b3JraW5nIGNvcHkpCkBA
IC0xMTIsOCArMTEyLDEyIEBAIHZvaWQgTG9hZGVyOjpkaWRGaW5pc2hMb2FkaW5nKFN1YnJlc291
cmMKIAogICAgIENhY2hlZFJlc291cmNlKiBvYmplY3QgPSByZXEtPmNhY2hlZFJlc291cmNlKCk7
CiAKKyAgICAvLyBOZXZlciBkZWxpdmVyIDQwNCBkYXRhIHRvIENhY2hlZFJlc291cmNlcy4KICAg
ICBkb2NMb2FkZXItPnNldExvYWRJblByb2dyZXNzKHRydWUpOwotICAgIG9iamVjdC0+ZGF0YShs
b2FkZXItPnJlc291cmNlRGF0YSgpLCB0cnVlKTsKKyAgICBpZiAob2JqZWN0LT5yZXNwb25zZSgp
Lmh0dHBTdGF0dXNDb2RlKCkgIT0gNDA0KQorICAgICAgICBvYmplY3QtPmRhdGEobG9hZGVyLT5y
ZXNvdXJjZURhdGEoKSwgdHJ1ZSk7CisgICAgZWxzZQorICAgICAgICBvYmplY3QtPmRhdGEoMCwg
dHJ1ZSk7CiAgICAgZG9jTG9hZGVyLT5zZXRMb2FkSW5Qcm9ncmVzcyhmYWxzZSk7CiAgICAgb2Jq
ZWN0LT5maW5pc2goKTsKIApAQCAtMTk3LDcgKzIwMSwxMSBAQCB2b2lkIExvYWRlcjo6ZGlkUmVj
ZWl2ZURhdGEoU3VicmVzb3VyY2VMCiAgICAgICAgIHJldHVybjsKIAogICAgIENhY2hlZFJlc291
cmNlKiBvYmplY3QgPSByZXF1ZXN0LT5jYWNoZWRSZXNvdXJjZSgpOyAgICAKLQorICAgIAorICAg
IC8vIE5ldmVyIGRlbGl2ZXIgNDA0IGVycm9yIHBhZ2VzIHRvIGFueSBDYWNoZWRSZXNvdXJjZXMu
CisgICAgaWYgKG9iamVjdC0+cmVzcG9uc2UoKS5odHRwU3RhdHVzQ29kZSgpID09IDQwNCkKKyAg
ICAgICAgcmV0dXJuOworICAgICAgICAKICAgICAvLyBTZXQgdGhlIGRhdGEuCiAgICAgaWYgKHJl
cXVlc3QtPmlzTXVsdGlwYXJ0KCkpIHsKICAgICAgICAgLy8gVGhlIGxvYWRlciBkZWxpdmVycyB0
aGUgZGF0YSBpbiBhIG11bHRpcGFydCBzZWN0aW9uIGFsbCBhdCBvbmNlLCBzZW5kIGVvZi4K
</data>
<flag name="review"
          id="8264"
          type_id="1"
          status="-"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>