Bug 137176

Summary: [test-case] window.location not updated properly on back button when using anchors
Product: [Applications] konqueror Reporter: Nikola Kovacs <nx.devnull>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: maksim
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Test page

Description Nikola Kovacs 2006-11-10 23:27:24 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
OS:                Linux

How to reproduce:
1. Click on a link pointing to an anchor on the same page
2. Click on another link pointing to a different anchor on the same page
2. Click Back

Result:
- The URL in the location bar is updated correctly (shows the first fragment identifier) and the page also returns to the previous state.
- Window.location and document.location still contain the URL with the second fragment identifier instead of the first

4. Click Back

Result:
- The URL in the location bar is updated correctly (shows second fragment identifier) and the page also returns to the previous state.
- Window.location and document.location contain the URL with the first fragment identifier instead of the original URL

Expected behavior:
window.location and document.location are correctly updated and match the URL in the location bar after clicking Back
Comment 1 Nikola Kovacs 2006-11-10 23:30:12 UTC
Created attachment 18495 [details]
Test page
Comment 2 Martin Fitzpatrick 2007-01-12 23:26:44 UTC
Nice test case.

Confirmed this behaviour on KDE 3.5.5 / Kubuntu 6.10.
Comment 3 Martin Fitzpatrick 2008-04-05 21:54:32 UTC
Confirmed in Konqueror 4.0.3/Kubuntu... and once again, nice test case ;).
Comment 4 Maksim Orlovich 2008-04-05 22:16:51 UTC
Retitling to make it easier to notice when looking for bugs in this area..
Comment 5 Maksim Orlovich 2008-06-29 00:09:17 UTC
SVN commit 825638 by orlovich:

Fix a number of issues related to redirections:
- Strip leading # if given to location.hash, as other browsers do (part of #159192); avoids
doubling it with various history frameworks, and stops confusing facebook's
photo view (#165221)
- Properly handle in-place redirects such as anchor jumps completely synchronously (part of #159192)
- More importantly, don't handle in-place redirects as changing pages, which aborts parsing.
Fixes some Wikipedia pages showing up blank.
- Properly update history on anchor jumps, including honoring locking (#159279, #137176)

Also, cleanup some of the handling of JavaScript URLs --- use the helpers I needed for above and not 10
different copies of string munging.

BUG:165221
BUG:159192
BUG:159279
BUG:137176


 M  +14 -15    ecma/kjs_window.cpp  
 M  +72 -38    khtml_part.cpp  
 M  +23 -1     khtmlpart_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=825638