Last Comment Bug 702983 - Opening a new tab doesn't reset scroll position
: Opening a new tab doesn't reset scroll position
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: P1 major (vote)
: ---
Assigned To: away[Nov24,Dec5) Kartikaya Gupta (
: Sebastian Kaspari (:sebastian)
: 703756 705450 (view as bug list)
Depends on:
Blocks: native_droid_panning
  Show dependency treegraph
Reported: 2011-11-16 09:26 PST by Tony Chung [:tchung]
Modified: 2016-07-29 14:20 PDT (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Right justified content screenshot (52.66 KB, image/png)
2011-11-16 09:26 PST, Tony Chung [:tchung]
no flags Details
Ensure viewport is correct for new tab (2.27 KB, patch)
2011-11-28 19:26 PST, away[Nov24,Dec5) Kartikaya Gupta ( review+
Details | Diff | Splinter Review

Description Tony Chung [:tchung] 2011-11-16 09:26:50 PST
Created attachment 574915 [details]
Right justified content screenshot

Summary could probably use a clearer description.  Basically, if i launch a page that exceeds the viewport, and pan the content all the way to the right, then opening a new tab for a different site, the new tab loads the content right-justified.

See screenshot and repro steps

1) install nightly birch, SGS2: Mozilla/5.0 (Android; Linux armv7l; rv:10.0a1) Gecko/20111116 Firefox/10.0a1 Fennec/10.0a1
2) visit a website that overflows viewport (eg. see URL)
3) when page loads, pan the content to the right to view the content there
4) click the tabbar arrow and open a New Tab
5) Type in another site that has overflow viewport (eg.
6) Verify new tab loads any sites with the page scaled over to the right

- new tab content should always load left-justified

- it persisted my panning to the right, so new loaded pages start right -justified
Comment 1 Tony Chung [:tchung] 2011-11-16 09:34:15 PST
updating title.  it's not just right-ustified, its whatever the last state the panning of that page was left in.   so if you had it at 25% or 75% view, a new tab will start the next page in that last state.
Comment 2 Doug Turner (:dougt) 2011-11-17 09:52:34 PST
This sounds alot like 702950.
Comment 3 Kevin Brosnan [:kbrosnan] 2011-11-18 23:37:00 PST
*** Bug 703756 has been marked as a duplicate of this bug. ***
Comment 4 Armen Zambrano [:armenzg] (EDT/UTC-4) 2011-11-21 07:05:46 PST
You don't have to be switching tabs. You can just load another page on the same tab and it will keep the state.

This is quite bad specially when you are at the bottom of a long page and you go to or where the height of the page is short.
It is bad specially in such case because suddenly your page is loaded up but you see nothing. You are just too far down from the top of the page but you think that the page never loaded as all you can see is nothing even though the page has loaded up.
Comment 5 away[Nov24,Dec5) Kartikaya Gupta ( 2011-11-25 10:48:31 PST
See also bug 704950, which is very related; both bugs will probably be fixed with the same patch.
Comment 6 Kevin Brosnan [:kbrosnan] 2011-11-26 11:27:11 PST
*** Bug 705450 has been marked as a duplicate of this bug. ***
Comment 7 away[Nov24,Dec5) Kartikaya Gupta ( 2011-11-28 19:26:18 PST
Created attachment 577468 [details] [diff] [review]
Ensure viewport is correct for new tab

This follows on from patch 3 on bug 704950 (
Comment 8 Chris Lord [:cwiiis] 2011-11-29 01:05:06 PST
Comment on attachment 577468 [details] [diff] [review]
Ensure viewport is correct for new tab

Review of attachment 577468 [details] [diff] [review]:

Looks good - is this necessary to fix this problem beyond what your patches already do on bug #704950?
Comment 9 away[Nov24,Dec5) Kartikaya Gupta ( 2011-11-29 06:42:54 PST
> Looks good - is this necessary to fix this problem beyond what your patches
> already do on bug #704950?

Yeah, because with just the other patches the tab dimensions (1x1) get sent to Java in the selectedTab setter when the tab is created, and Java never updates them unless the surface changes, so you end up with a 1x1 viewport. Since Java keeps the "one true viewport size" I tried a different approach where I ignored the JS-provided viewport size and always kept the ones in Java but propagating that information between all the Java viewport objects made it pretty messy.
Comment 10 away[Nov24,Dec5) Kartikaya Gupta ( 2011-11-29 07:00:54 PST
Comment 11 Aaron Train [:aaronmt] 2011-11-30 07:05:26 PST
Samsung Nexus S (Android 4.0.1)

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