RESOLVED FIXED 3400
setting the .src of an iframe to the same value does not reload page
https://bugs.webkit.org/show_bug.cgi?id=3400
Summary setting the .src of an iframe to the same value does not reload page
Mark McCray
Reported 2005-06-09 17:37:17 PDT
When setting the .src of an iframe using .src = url, safari will not reload the iframe if the current url is the same as the new url. However, using contentWindow.location.href and setting it to the same value to force a reload will work. Is this correct behaviour? The link above shows a page with two buttons to reload the frame using both methods listed above. The default link that the page should reload a page that shows the current time with seconds. Clicking on the "src" button will load the page initially, but not refresh after that. Clicking on the "contentWindow" button will continually reload the iframe. Thanks!
Attachments
proposed fix (450 bytes, patch)
2006-02-08 14:21 PST, Alexey Proskuryakov
darin: review-
proposed fix (14.28 KB, patch)
2006-02-09 14:02 PST, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2006-02-08 14:21:15 PST
Created attachment 6349 [details] proposed fix I don't see how to make an automated test for this.
Eric Seidel (no email)
Comment 2 2006-02-08 15:19:22 PST
Comment on attachment 6349 [details] proposed fix We could extend DumpRenderTree to allow for an exposed JavaScript object which is shared between page loads within a test.
Darin Adler
Comment 3 2006-02-08 18:48:57 PST
Comment on attachment 6349 [details] proposed fix It's clear that this change will affect only the handling of the location and src attributes of frame and iframe objects. That's good, so I think the change is fine. I think that we might also want to rename the updateForNewURL function to clarify that it can be used even when the URL is not changing. It should be straightforward to make a test for this, using the onload handler for the frame element. We'd want to test both location and src for both frames and iframes. Setting review- just because we need the test.
Alexey Proskuryakov
Comment 4 2006-02-09 14:02:25 PST
Created attachment 6369 [details] proposed fix Making tests wasn't exactly straightforward because of bugs like 7161, 3609 and 3580, but here they are :) I couldn't come up with a new name for updateForNewURL(), but getting rid of this function by moving its code into setLocation() appears to be a better thing to do anyway.
Darin Adler
Comment 5 2006-02-09 15:49:19 PST
Comment on attachment 6369 [details] proposed fix Looks fine. r=me I'd like the test case slightly more if it was a dumpAsText one.
Alexey Proskuryakov
Comment 6 2006-02-11 02:51:18 PST
The IFrame tests use dumpAsText. As for the other two tests- frame text isn't dumped by DumpRenderTree, so instead of hacking around it I just did what other fast/frames test do...
Note You need to log in before you can comment on or make changes to this bug.