Sorry... I'm not a developer-guy... I noticed the website with this URL keeps 'blinking' in Safari 3.0.4 and Webkit In Firefox it is OK URL: http://space.cweb.nl/iss_pass_prediction.html Hope you can look into this... It's very annoying Best regards, Jur Kuipers, The Netherlands iMac iSight G5 OSX 10.5.2
Confirmed with r30692 - the site keeps reloading.
(simplified test case) The URL calls an IFRAME that points to another site's page: <iframe src="http://otherdomain.com/B.html"></iframe> On that other site's page, there is some JavaScript: <script type="text/javascript"> if (top.location.host != "http://somedomain.com/A.html") top.location.href="http://somedomain.com/A.html"; </script> In r31667, going to http://somedomain.com/A.html will load the IFRAME, which in turn checks if the URL location is in fact http://somedomain.com/A.html, and failing that check, loads that URL. In FF2/Mac the original URL works fine but the test reduction above doesn't. In Safari both fail.
To be clear, the IFRAME on the original URL is calling a PHP page, not a straight HTML one. Without contacting the author of the original website, it's impossible (I think) to know what is in this PHP code. Without this knowledge, the mystery of why the original URL works in Firefox cannot be explained. On another topic: Is this JavaScript routine broken? Shouldn't the top.location.host check actually work, e.g. not attempt to reload the page because the location of the calling page is, in fact, the correct location?
Answered my own question. top.location.host returns the bare hostname -- not the 'http://' prefix or the '/page.html' path. So the check always fails because top.location.host != 'space.cweb.nl', and the constant reloading happens. Except in Firefox, apparently.
This code is definitely broken - location.host doesn't return the complete URL in either Safari or Firefox. The reason the page doesn't misbehave in Firefox is that an exception is raised for an attempt of cross-domain access to top.location.host, so the test is simply bypassed. In WebKit, an undefined value is returned for this attempt, and no exception is raised.
Mr Kuipers: Please contact the owner of the space.cweb.nl site and inform him that the code on this page (which the main page's IFRAME points to) needs its JavaScript fixed according to comment #4: http://sts.ontwikkel.net/phplocos.php Re: bug status. Should WebKit emulate Firefox in this instance or should it retain strict interpretation? (I'd favor the latter as this type of erroneous JS coding isn't all that common, I'd hope.)
*** This bug has been marked as a duplicate of 19822 ***
This bug is not actually a duplicate of bug 19822, because my fix for that bug does not fix this one.