<?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>3593</bug_id>
          
          <creation_ts>2005-06-17 11:50:35 -0700</creation_ts>
          <short_desc>iFrame Doesn&apos;t seem to Respect a local &quot;file://&quot; src</short_desc>
          <delta_ts>2005-11-11 09:02:36 -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>Frames</component>
          <version>412</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Wheeler">david</reporter>
          <assigned_to name="Maciej Stachowiak">mjs</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12475</commentid>
    <comment_count>0</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-06-17 11:50:36 -0700</bug_when>
    <thetext>* SUMMARY

When I load a page from my local file system, and point a frame to another file on my file system, the 
frame will not load the local page. This makes local testing difficult.

* STEPS TO REPRODUCE
1. Open the test case in a text editor, and point the frame source to another file on your local file 
system. 
2. Open the test case from your local hard drive.
3. Note how the local file does not load in the iframe, even if you use file://
4. Change the iframe source to a page served by a Web server (e.g., http://www.apple.com/).
5. Note how the iframe now loads the page.

* RESULTS
Locale files do not load in iframes, while remote files served by a Web server do.

* EXPECTED RESULTS
I expect local files to load in iframes just like remote files do. Such is the case in Firefox. This also has 
ramifications for my JavaScript work, wherein I attempt to assign to frames[0].location.href and nothing 
happens unless the URL I assign to location is served by a Web server.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12476</commentid>
    <comment_count>1</comment_count>
      <attachid>2446</attachid>
    <who name="David Wheeler">david</who>
    <bug_when>2005-06-17 11:51:09 -0700</bug_when>
    <thetext>Created attachment 2446
Test Case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12524</commentid>
    <comment_count>2</comment_count>
    <who name="Joost de Valk (AlthA)">joost</who>
    <bug_when>2005-06-18 01:10:34 -0700</bug_when>
    <thetext>Confirmed, but renamed. Safari doens&apos;t take file:// for iframe src, it DOES however take http://localhost/ 
sources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12525</commentid>
    <comment_count>3</comment_count>
      <attachid>2455</attachid>
    <who name="Joost de Valk (AlthA)">joost</who>
    <bug_when>2005-06-18 01:16:33 -0700</bug_when>
    <thetext>Created attachment 2455
Improved and reduced testcase

Same procedure as for the first testcase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16451</commentid>
    <comment_count>4</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-08-11 14:07:34 -0700</bug_when>
    <thetext>FYI, this is also an issue with XMLHttpRequest objects, too: They don&apos;t respect a local &quot;file://&quot; src, either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16469</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-08-11 21:44:28 -0700</bug_when>
    <thetext>Wouldn&apos;t this allow &quot;stealing&quot; local documents, thus opening a security hole?

For local testing, I use relative URLs, seem to work fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16470</commentid>
    <comment_count>6</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-08-11 22:27:40 -0700</bug_when>
    <thetext>No, relative URLs don&apos;t work, either. That was my original report. It didn&apos;t even occur to me that file:// 
overall was the problem until Joost de Valk renamed this bug report.

One should be able to use file:// locations (relative or absolute) if the refering document is also local.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16490</commentid>
    <comment_count>7</comment_count>
      <attachid>3354</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-08-12 09:07:29 -0700</bug_when>
    <thetext>Created attachment 3354
A similar case that works</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16491</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-08-12 09:10:21 -0700</bug_when>
    <thetext>Indeed, I was speaking about &quot;improved and reduced testcase&quot; by Joost de Valk. In that case, 
document-relative paths DO work: simply change &quot;file://Users/jdevalk/webkit/testcases/font-
hover.html&quot; to just &quot;font-hover.html&quot; (assuming you have such file in the same directory).

As for your original testcase, looks like it is the first frames[0].location that really fails - both &lt;iframe 
src=&quot;test.html&quot;&gt; and the timer work fine. This is probably a bug. Please the the attached test case &quot;A 
similar case that works&quot; for an example of what works for me.

I do not think that the location of the document should affect security restrictions anyhow. Otherwise, 
someone could file a bug with an archived malicious testcase in WebKit bugzilla...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16492</commentid>
    <comment_count>9</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-08-12 09:13:54 -0700</bug_when>
    <thetext>FYI, I retract my comment about XMLHttpRequest not respecting file://. It seems like Safari just sets the 
status to null when it&apos;s a local file. I&apos;m not sure that&apos;s an appropriate status, but it&apos;s easy enough to check 
for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16493</commentid>
    <comment_count>10</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-08-12 09:19:19 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Created an attachment (id=3354) [edit]
&gt; A similar case that works

Does not work for me in Safari 2.0 (412.2). Maybe you&apos;re using a build from CVS?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16494</commentid>
    <comment_count>11</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-08-12 10:19:33 -0700</bug_when>
    <thetext>&gt; Does not work for me in Safari 2.0 (412.2). Maybe you&apos;re using a build from CVS?

Works for me in 312, 412.2 and ToT (open try.html; &quot;test.html&quot; is displayed, to be replaced with &quot;foo.html&quot; 
a few seconds later)... Some timing/caching issue? My Mac is a G4/1.25DP.

Regardless, something strange is certainly happening to local files. Perhaps, this issue should be renamed 
in a more general manner, and wait for someone to seriously look into it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16643</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2005-08-14 05:13:08 -0700</bug_when>
    <thetext>BTW, the primary reason for the reduced testcase to fail is that it lacks a slash in the URL: &quot;file://Users...&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16656</commentid>
    <comment_count>13</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-08-14 17:36:23 -0700</bug_when>
    <thetext>As far as I can tell, the sole problem with the test case given is that it&apos;s missing a slash - it should be 
file:///Users/... or file://localhost/Users... (or for convenience file:/Users/...), not file://Users/...

The two slashes make WebKit interpret Users as a hostname, so the path is not found. Please reopen if a 
syntactically correct test case shows a problem, or if there is evidence that two slashes before a path is 
accepted by other browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16928</commentid>
    <comment_count>14</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-08-18 08:34:56 -0700</bug_when>
    <thetext>Well, if you look at my original test case (http://bugzilla.opendarwin.org/attachment.cgi?id=2446), you&apos;ll 
see that it&apos;s not explicitly using file:// or a URL ending in a slash. It&apos;s just using a file name, such as 
&quot;foo.html&quot;. It&apos;s a relative path. And for me, it does not load the local file in the iframe. I&apos;m using Safari 2.0 
(412.2.2).

If this is fixed in CVS, then cool. I look forward to the next release!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23909</commentid>
    <comment_count>15</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-11-10 19:16:40 -0800</bug_when>
    <thetext>I can&apos;t reproduce a problem with the original test case, either in the cvs version or the version shipped in 
Denver. A &quot;test.html&quot; in the same directory loads fine as a relative reference to a local file. The absolute 
URLs work fine too, when I change them to paths that exist.

The &quot;improved and reduced&quot; test case uses &quot;file://Users&quot; and so is buggy. I don&apos;t see a bug here that I can 
reproduce.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23920</commentid>
    <comment_count>16</comment_count>
    <who name="David Wheeler">david</who>
    <bug_when>2005-11-11 09:02:36 -0800</bug_when>
    <thetext>It does seem to be fixed in 2.0.2 (416.12). Thanks.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2446</attachid>
            <date>2005-06-17 11:51:09 -0700</date>
            <delta_ts>2005-06-18 01:16:33 -0700</delta_ts>
            <desc>Test Case</desc>
            <filename>try.html</filename>
            <type>text/plain</type>
            <size>764</size>
            <attacher name="David Wheeler">david</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8L2hlYWQ+Cjxib2R5Pgo8aWZyYW1lIHNyYz0idGVzdC5odG1sIj48L2lm
cmFtZT4KPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgovLyAgICBub2RlID0gZG9jdW1l
bnQuY3JlYXRlRWxlbWVudCgiaWZyYW1lIik7Ci8vICAgIGRvY3VtZW50LmJvZHkuYXBwZW5kQ2hp
bGQobm9kZSk7CmZyYW1lc1swXS5sb2NhdGlvbiA9ICdmaWxlOi8vL1VzZXJzL2RhdmlkL0Rlc2t0
b3AvdGVzdC5odG1sJzsKd2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24gKCkgeyBmcmFtZXNbMF0u
bG9jYXRpb24gPSAnZmlsZTovLy9Vc2Vycy9kYXZpZC9EZXNrdG9wL2Zvby5odG1sJzsgfSwgMzAw
MCk7CgovL2ZyYW1lc1swXS5sb2NhdGlvbiA9ICdodHRwOi8vd3d3LmFwcGxlLmNvbS8nOwovL3dp
bmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsgZnJhbWVzWzBdLmxvY2F0aW9uID0gJ2h0dHA6
Ly93d3cuZ29vZ2xlLmNvbS8nOyB9LCAzMDAwKTsKPC9zY3JpcHQ+CjwvYm9keT4KPC9odG1sPgo8
c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+Ci8vIGh0dHA6Ly93d3cucXVpcmtzbW9kZS5v
cmcvanMvaWZyYW1lLmh0bWwKLy8gICAgbm9kZS5jb250ZW50V2luZG93LmxvY2F0aW9uLmhyZWYg
PSAidGVzdC5odG1sIjsKLy8gICAgdmFyIGlmcmFtZSA9IHdpbmRvdy5mcmFtZXNbMF07Ci8vICAg
IGRvY3VtZW50Lm9ubG9hZCA9ICdpZnJhbWUubG9jYXRpb24uaHJlZiA9ICJodHRwOi8vd3d3Lmdv
b2dsZS5jb20iOyc7Cjwvc2NyaXB0Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2455</attachid>
            <date>2005-06-18 01:16:33 -0700</date>
            <delta_ts>2005-06-18 01:16:33 -0700</delta_ts>
            <desc>Improved and reduced testcase</desc>
            <filename>iframe-testcase.html</filename>
            <type>text/html</type>
            <size>134</size>
            <attacher name="Joost de Valk (AlthA)">joost</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8L2hlYWQ+Cjxib2R5Pgo8aWZyYW1lIHNyYz0iZmlsZTovL1VzZXJzL2pk
ZXZhbGsvd2Via2l0L3Rlc3RjYXNlcy9mb250LWhvdmVyLmh0bWwiPjwvaWZyYW1lPgo8L3Njcmlw
dD4KPC9ib2R5Pgo8L2h0bWw+Cgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3354</attachid>
            <date>2005-08-12 09:07:29 -0700</date>
            <delta_ts>2005-08-12 09:07:29 -0700</delta_ts>
            <desc>A similar case that works</desc>
            <filename>works.zip</filename>
            <type>application/octet-stream</type>
            <size>1329</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">UEsDBBQACAAIAISeDDMAAAAAAAAAAAAAAAAIABAAZm9vLmh0bWxVWAwA5sb8QqfF/EL1ARQAs/EI
8fWx40rLz9fLKMnN4bLRhwgAAFBLBwhexgcbFgAAABgAAABQSwMECgAAAAAA0qAMMwAAAAAAAAAA
AAAAAAkAEABfX01BQ09TWC9VWAwADMn8QgzJ/EL1ARQAUEsDBBQACAAIAISeDDMAAAAAAAAAAAAA
AAATABAAX19NQUNPU1gvLl9mb28uaHRtbFVYDADmxvxCp8X8QvUBFABjYBVjZ2BiwAQgMU4gNgJi
BSg/CCQR4hoRAqIZGRje/P+IqREAUEsHCKrCQI8lAAAAUgAAAFBLAwQUAAgACAB9ngwzAAAAAAAA
AAAAAAAACQAQAHRlc3QuaHRtbFVYDADmxvxCncX8QvUBFACz8Qjx9bHjLUktLtHLKMnN4bXRh4gA
AFBLBwiPr+UIFwAAABkAAABQSwMEFAAIAAgAfZ4MMwAAAAAAAAAAAAAAABQAEABfX01BQ09TWC8u
X3Rlc3QuaHRtbFVYDADmxvxCncX8QvUBFABjYBVjZ2BiwAQgMU4gNgJiBSg/CCQR4hoRgkU9HAAA
UEsHCMHNZYUfAAAAUgAAAFBLAwQUAAgACADKoAwzAAAAAAAAAAAAAAAACAAQAHRyeS5odG1sVVgM
APvI/EL7yPxC9QEUAG2PywqDMBBF937F4EaFYgJd+viK7koXaUwwRTNixlop/fcmRrrq6sLM4c6c
uqdxaJO6V6LzwY68Y7f5MHoWowI3yyYl5agMdNrWLC484eRsJgLaJhWQF7GHeIo4TduEsR10V34r
B5SCDFpoIPuVZVWyGtvhWjpFFzMqXCjXi5U7mRfwhv8NGvEogM8JzpzzovL/x8vB5FBgUfALUEsH
CKphXq6bA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