Bug 17627 - Endless reloads on http://space.cweb.nl
Summary: Endless reloads on http://space.cweb.nl
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://space.cweb.nl/iss_pass_predict...
Keywords: NeedsReduction
Depends on:
Reported: 2008-03-01 02:39 PST by Jur Kuipers
Modified: 2008-07-01 01:08 PDT (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jur Kuipers 2008-03-01 02:39:34 PST
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

Best regards,
Jur Kuipers, The Netherlands

iMac iSight G5
OSX 10.5.2
Comment 1 Matt Lilek 2008-03-01 11:04:08 PST
Confirmed with r30692 - the site keeps reloading.
Comment 2 Jubal Kessler 2008-04-06 09:47:51 PDT
(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")

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.
Comment 3 Jubal Kessler 2008-04-06 10:01:37 PDT
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?
Comment 4 Jubal Kessler 2008-04-06 10:12:40 PDT
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.
Comment 5 Alexey Proskuryakov 2008-04-06 23:09:12 PDT
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.
Comment 6 Jubal Kessler 2008-04-07 10:04:22 PDT
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:


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.)
Comment 7 Cameron Zwarich (cpst) 2008-06-30 11:39:45 PDT

*** This bug has been marked as a duplicate of 19822 ***
Comment 8 Cameron Zwarich (cpst) 2008-07-01 01:08:04 PDT
This bug is not actually a duplicate of bug 19822, because my fix for that bug does not fix this one.