Bug 20926

Summary: Reload of page with an iframe does not refresh iframe content, even if iframe src url changed
Product: WebKit Reporter: Antony Sargent <antony>
Component: FramesAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, aroben, bdakin, erikkay, mike.tsao, mmoss, ojan
Priority: P2 Keywords: HasReduction, InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://asargent.com/tests/iframe.php
Attachments:
Description Flags
proposed fix (sync with related Mac code) eric: review+

Description Antony Sargent 2008-09-18 17:07:31 PDT
Navigate to an html page with some content followed by an iframe tag. Now make a change to the contents and make the iframe src attribute point to a different url. Hit browser reload button, notice that the "outer" content is refreshed but the iframe content still points to the content at the old url. This problem happens with Safari 3.1.2 (525.21), the latest WebKit nightly build (36446), and Chrome 0.2.149.30. It does not happen in Firefox 3.0.1 or IE 7.0.7530.13.


Here is the source to two example php files to reproduce the problem:

iframe.php
----------
<?php
$ts = date('U');
?>
<html>
<body>
<p>
Timestamp is <?= $ts ?>
</p>
<iframe src="report_url.php?foo=<?= $ts ?>"
        width="75%" frameborder="1"></iframe>
</body>
</html>


report_url.php
--------------
<html>
<body>
<?php echo $_SERVER['REQUEST_URI'] . "\n"; ?>
</body>
</html>


While this example just changes the value of the foo get parameter, the problem also happens if you change the iframe src url to another path on the same server or another server alltogether.
Comment 1 Dave Hyatt 2008-09-18 18:29:55 PDT
Can you put those on a server and give us a test URL?
Comment 2 Antony Sargent 2008-09-18 19:53:03 PDT
(In reply to comment #1)
> Can you put those on a server and give us a test URL?
> 

http://asargent.com/tests/iframe.php

Hit reload a few times in firefox/ie and then in a webkit browser and you should see the difference in behavior. 
Comment 3 Mark Rowe (bdash) 2008-09-19 03:11:26 PDT
As far as I can tell this works correctly in the latest nightly of WebKit on Mac OS X at this time: r36640.  It definitely fails with Safari 3.1.2 on Mac OS X.
Comment 4 Mark Rowe (bdash) 2008-09-19 03:15:09 PDT
On Windows with the latest nightly (r36647), reloading the page via Ctrl-R shows the bug while loading the page again via Ctrl-L, Return does not.
Comment 5 Mark Rowe (bdash) 2008-09-19 03:15:45 PDT
<rdar://problem/6231953>
Comment 6 Mike Tsao 2008-09-23 10:08:48 PDT
This affects iframe-based social networking applications, particularly those using either Facebook or OAuth authentication schemes. The credentials are contained in the iframe src URL, and by their own terms they expire after some number of minutes.

Upshot is many social-networking applications die after a few minutes, and for some users it's a hard state for them to get out of (F5 and "just clicking around") don't fix the problem.
Comment 7 Beth Dakin 2008-10-02 13:17:24 PDT
So, let me get this straight. This is fixed on TOT on the Mac, but on Windows TOT we only do the right thing with a Ctrl-L and not Ctrl-R. And so the remaining bug is that we want this behavior with Ctrl-R as well as Ctrl-L on Windows? Or is our current behavior correct?
Comment 8 Michael Moss 2008-11-03 12:27:58 PST
Created attachment 24861 [details]
proposed fix (sync with related Mac code)
Comment 9 Eric Seidel (no email) 2008-11-25 16:52:58 PST
Comment on attachment 24861 [details]
proposed fix (sync with related Mac code)

You should consider setting the CHANGE_LOG_NAME environment variable to your full name.  It seems on google systems the prepare-ChangeLog code is picking up teh username instead:

my $name = $ENV{CHANGE_LOG_NAME}
  || $ENV{REAL_NAME}
  || gitConfig("user.name")
  || (split /\s*,\s*/, (getpwuid $<)[6])[0]
  || "set REAL_NAME environment variable";

This looks identical to http://trac.webkit.org/changeset/31264 which would suggest to me it's right.  I'm going to r+ this, but I don't have a working tree on this box atm, so I can't land it immediately.
Comment 10 Eric Seidel (no email) 2008-12-02 12:35:25 PST
Comment on attachment 24861 [details]
proposed fix (sync with related Mac code)

About to land.  ChangeLog entries should also include a link to the original bugzilla bug as well.
Comment 11 Eric Seidel (no email) 2008-12-02 12:36:29 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	M	LayoutTests/platform/win/Skipped
	M	WebKit/win/ChangeLog
	M	WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Committed r38912