Last Comment Bug 565008 - back button doesn't take you to original anchor (even though url changes) - "css frames" are used
: back button doesn't take you to original anchor (even though url changes) - "...
Status: NEW
:
Product: Core
Classification: Components
Component: Document Navigation (show other bugs)
: unspecified
: x86 All
: P2 major with 9 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 597987 (view as bug list)
Depends on: 43114
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-11 01:56 PDT by Lubos Kosco
Modified: 2012-10-12 23:43 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
ziped page which is used to reproducing the problem (50.29 KB, application/zip)
2010-05-11 01:57 PDT, Lubos Kosco
no flags Details
This does work to fix the bug, but is all sorts of inefficient and hacky (9.30 KB, patch)
2010-05-12 00:15 PDT, Boris Zbarsky [:bz]
no flags Details | Diff | Review

Description Lubos Kosco 2010-05-11 01:56:21 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a4) Gecko/20100407 MozillaDeveloperPreview/3.7a4 ( .NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a4) Gecko/20100407 MozillaDeveloperPreview/3.7a4 ( .NET CLR 3.5.30729)

attached a zip file with a sample html+css combination
- click on numbers on left side (scroll down a page and click on new ones) and press back button - it will not take you(scroll to) to original anchor

fwiw Chrome and Safari work here, so I think this is a prob with the engine

Reproducible: Always

Steps to Reproduce:
1. unzip attached page
2. open it in any firefox/mozilla browser
3. click on a line # on left side
4. scroll down a page or two
5. click on new line # anchor
6. press BACK button


Actual Results:  
then URL changes, but content will not scroll to old anchor :(

Expected Results:  
URL changes, you will scroll to old anchor and be happy :)

Chrome and Safari back buttons work properly with the same page and navigate(scroll) you to proper anchor
Comment 1 Lubos Kosco 2010-05-11 01:57:14 PDT
Created attachment 444618 [details]
ziped page which is used to reproducing the problem
Comment 2 Boris Zbarsky [:bz] 2010-05-11 22:13:42 PDT
The problem is that on history navigation people don't actually want to go back to the anchor they had loaded when they first loaded that page; they want to go back to wherever in the document they were.  So on history navigation we restore the scroll position we used to be at.  The problem is that we only do this for the toplevel scrollbars on the page (which this page suppresses) and we don't perform anchor scrolls at all on history loads.
Comment 3 Boris Zbarsky [:bz] 2010-05-11 22:15:27 PDT
Oh, and there's no layout history state in the shentry here.
Comment 4 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2010-05-11 22:44:51 PDT
Fixing issues with restoring subframes might be part of the work I plan (sometime, I hope) in bug 43114, although not necessarily.
Comment 5 Boris Zbarsky [:bz] 2010-05-11 22:47:08 PDT
This isn't a subframe.  It's just an abs pos overflow:auto div (with the body set to overflow:hidden).

One obvious option here is to perform the anchor scroll on history load before restoring the toplevel scrollbar.  That would give us behavior similar to webkit on this testcase.  Better would be to properly restore scroll state, of course.
Comment 6 Boris Zbarsky [:bz] 2010-05-12 00:15:32 PDT
Created attachment 444837 [details] [diff] [review]
This does work to fix the bug, but is all sorts of inefficient and hacky
Comment 7 Lubos Kosco 2010-05-12 11:09:45 PDT
cool, nice to see people working this out ;)
will this be able to propagate to some near future firefox release ? 
(if yes, then which release ?)
if no, what can I do to make firefox adopt this fix(file a bug against them too)?

thnx
L
Comment 8 Boris Zbarsky [:bz] 2010-05-12 11:49:55 PDT
> will this be able to propagate to some near future firefox release ? 

Not in the state I attached. It'd need a good bit of work to be ok to check in.

If something gets checked in for this bug, the next non-branch Firefox release would pick it up automatically.
Comment 9 O. Atsushi (Torisugari) 2012-10-12 23:43:18 PDT
*** Bug 597987 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.