Bug 24578

Summary: Changing location hash on a frameset causes reload
Product: WebKit Reporter: Jonathan Hurshman <jhurshman>
Component: FramesAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal CC: ap, beidson, chaylock, gabor.kormany, japhet, sezginm, trmsw
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://pilgrimwebdesign.com/changehash.html
Attachments:
Description Flags
Reduction
none
Display the reload event when the location.hash is changed. none

Description Jonathan Hurshman 2009-03-13 10:43:50 PDT
Changing the location hash on a frameset causes the frameset to reload. This occurs whether the hash is changed manually or programmatically by setting window.location.hash.

Firefox and IE do not exhibit this behavior; neither non-frameset pages nor frameset pages reload when the hash is changed.

This is troublesome for trying to maintain state by setting the hash.

Reduction is available at http://pilgrimwebdesign.com/changehash.html. This is a frameset containing only one frame. That frame displays new Date().getSeconds(). It also kicks off a timeout for 5 seconds to set the top's hash value. The result in WebKit is that the whole page reloads every 5 seconds, and one can observe the value displayed in the frame changing. In Firefox and IE, no reload happens.

I have reproduced this in the current nightly, in Safari 3.1.2, and in Chrome.
Comment 1 Jonathan Hurshman 2009-03-13 10:44:58 PDT
Created attachment 28585 [details]
Reduction
Comment 2 Tolga Arican 2009-04-01 02:38:12 PDT
http://www.dxenia.com/hash/
Comment 3 Sezgin 2009-04-01 02:50:02 PDT
I have same problem too, waiting for immediate action...
Comment 4 Gabor Kormany 2009-09-16 02:09:07 PDT
Hi

Same problem here. Frameset based page, using hash to navigate. Safari and chrome doesn't work properly. Though sometimes there is a workaround but overall it increases the development and maintenance time.

Best Regards
Comment 5 Tolga Arican 2009-09-16 02:18:34 PDT
Example page: http://www.utopicfarm.com/tolga/hash/
Comment 6 Marc Bonnier 2010-04-07 23:05:30 PDT
Created attachment 52828 [details]
Display the reload event when the location.hash is changed.

Same bug here.
Is it possible to assign this light bug to somebody ?

Thanks.
Comment 7 TomSW 2011-12-17 08:40:00 PST
The current behaviour is caused by FrameLoader::shouldScrollToAnchor
in WebCore/loader/FrameLoader.cpp.

Scrolling to an anchor is explicitly excluded for a frameset, the reason is given in the comments: "we don't want to just scroll if a link from within a frameset is trying to reload the frameset into _top."

In Firefox a link from within the frameset can reload the frameset, but only as long as the link contains no hash.

ie   <a href="index.html" target="_top">Reload!</a>
will reload the frameset

but  <a href="index.html#" target="_top">Reload!</a>
will not.