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
Hope you can look into this...
It's very annoying
Jur Kuipers, The Netherlands
iMac iSight G5
Confirmed with r30692 - the site keeps reloading.
(simplified test case)
The URL calls an IFRAME that points to another site's page:
if (top.location.host != "http://somedomain.com/A.html")
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:
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.
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.