Open Bug 361380 Opened 18 years ago Updated 2 years ago

Scroll position not restored when going back after document.open()

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: gugurete, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

By pressing the back button, Firefox navigates to the top of the previous page instead of the original location on that page.
The same behavior applies to javascript:history.go(-1).

(IE and Opera perform as expected)

Reproducible: Always

Steps to Reproduce:
For Firefox back button take the following steps

1. Open http://www.valamit.com/2006/Island/index.html
2. Scroll down to the end of the page.
2. Click on the last photo on the page.
3. The photo will be opened.
4. Press the Firefox back button.
5. The index page will be shown, but not scrolled to the end as described in step number 2.



For javascript:history.go(-1) follow the following steps:

1. Open http://www.valamit.com/2006/Island/index.html
2. Scroll down to the end of the page.
2. Click on the last photo on the page.
3. The photo will be opened in large size.
4. Click on the enlarged photo. (this triggers javascript:history.go(-1))
5. The index page will be shown, but not scrolled to the end as described in step number 2.



Actual Results:  
Backward navigation will load the previous page, but the position within the previous page is not remembered.

Expected Results:  
By pressing the back button the previous page should be shown and also the position within that page should be remembered.

IE and Opera perform as expected.

For plain static HTML page navigation, Firefox also works correctly. The problem
appears only within dynamically generated HTML through JavaScript.
Dupe of bug# 215405?
No.  This page doesn't use cache-control: no-store.  It's a different bug, involving document.open().
Status: UNCONFIRMED → NEW
Component: History → History: Session
Ever confirmed: true
Keywords: testcase
OS: Windows XP → All
Product: Firefox → Core
QA Contact: history → history.session
Hardware: PC → All
Summary: the back button and javascript.history.go(-1) does not work as expected → Scroll position not restored when going back after document.open()
Version: unspecified → Trunk
Attached file testcase (deleted) —
Blocks: 251784
CCing Hideo Saito, who fixed bug 47350, to see if he's interested in fixing this as well.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1) Gecko/20061121 BonEcho/2.0 ID:2006112105

I see the problem the reporter sees at the URL, but Jesse's testcase WFM.
Interesting.. want to try making a new testcase?
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20061121 Minefield/3.0a1

With Trunk Jesse's testcase does indeed show the bug where going back one step in history looses the vertical scroll position.

I could try and make a testcase for Branch, sure. It would likely lack finesse and not be minimal mind.
I couldn't reproduce the bad results as described in the first post using 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a3pre) Gecko/20070322 SeaMonkey/1.5a
> Steps to Reproduce:
> For Firefox back button take the following steps
> 
> 1. Open http://www.valamit.com/2006/Island/index.html
> 2. Scroll down to the end of the page.
> 2. Click on the last photo on the page.
> 3. The photo will be opened.
> 4. Press the Firefox back button.
> 5. The index page will be shown, but not scrolled to the end as described in
> step number 2.

This and the testcase WFM with
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a8) Gecko/2007091211 GranParadiso/3.0a8

Can we close this bug?
Component: History: Session → Document Navigation
QA Contact: history.session → docshell
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: