Bug 17627
Summary: | Endless reloads on http://space.cweb.nl | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jur Kuipers <jurkuipers> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, frances_c, jubal-webkit-20111123, zwarich |
Priority: | P2 | Keywords: | NeedsReduction |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 | ||
URL: | http://space.cweb.nl/iss_pass_prediction.html |
Jur Kuipers
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
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Matt Lilek
Confirmed with r30692 - the site keeps reloading.
Jubal Kessler
(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.
Jubal Kessler
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?
Jubal Kessler
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.
Alexey Proskuryakov
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.
Jubal Kessler
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.)
Cameron Zwarich (cpst)
*** This bug has been marked as a duplicate of 19822 ***
Cameron Zwarich (cpst)
This bug is not actually a duplicate of bug 19822, because my fix for that bug does not fix this one.
Frances Cornwall
This pr fixed the bug: https://github.com/WebKit/WebKit/commit/7d3367d1c0bf3f67a4f88f87db0b5d3aae951fc9.
Frances Cornwall
*** This bug has been marked as a duplicate of bug 164907 ***