Closed Bug 441104 Opened 16 years ago Closed 16 years ago

following an anchor link in the background doesn't scroll the page to the proper position if it is zoomed

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 386835

People

(Reporter: 36485df0da, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0

When you click on an anchor link, the resulting page is supposed to be scrolled so as to display the anchor at the top of the page.

If both of these conditions are satisfied:
- the anchor link is middle-clicked so as to open in a new tab
- the zoom level is not the default
Then the new page will not have the anchor at the top.

If the anchor link is opened in the same page, or if the zoom level has been reset, it works as expected.

One site that exhibits the problem is en.wikipedia.org with the anchor links for citations.

Obviously, if the anchor is too close to the bottom of the page, the page will be scrolled to the bottom and the problem will not be apparent.


Reproducible: Always

Steps to Reproduce:
1. Set the zoom level to something other than the default
2. Open http://en.wikipedia.org/wiki/2006_definition_of_planet 
3. middle-click on a anchor link. (links of the form [1], [2], ...)
Actual Results:  
The target of the link is not at the top of the page.

Expected Results:  
The target of the link should be at the top of the page.
If the problem doesn't occur you might have to change the zoom level after you load the page and before you click on an anchor link. i.e. between steps 2 and 3.
http://freepages.history.rootsweb.ancestry.com/~dav4is/people/index.html#S-WIKI

Failure of above link doesn't seem to depend on zoom level in FF3. Positions several centimeters beyond the anchor on new page. 
I don't see what the problem is with the link in comment #2 (Dav4is), but from the comment itself I infer that it's not the same issue.

I experience the same vexing bug as reported in the beginning of this ticket--and Wikipedia makes it especially obvious.
I should also mention that unlike the original reporter, I'm using Windows (Vista SP1).  Firefox 3.0.5 now, though previous 3.0.x versions exhibited the same bug.
Fails in FF Safe Mode.
Fails in FF 3.1 Beta 2.

Interesting (but perhaps meaningless) notes: 
<ol>
<li>After failure of target positioning, if the zoom level is reset (CTL+0), you will find the positioning is then correct.
<li>Ordinary left click on a link (e.g. one of the [n] links) in with zoom level advanced will position correctly, but subsequent reset of the zoom level (CTL+0) will reposition incorrectly.
</ol>
I can reproduce this on WinXP FF 3.1, Vista FF 3.2 nightly, Ubuntu 8.04 FF 3.2 nightly, but only if the page is completely loaded in the background.

What it looks like is that, the page isn't zoomed before the tab has focus. But the anchor if followed when the page is completely loaded. This means that the anchor is followed BEFORE the page is zoomed, then when the page is zoomed the focus is the center of the screen meaning that the page will move further down the page then intended.

This can easily be reproduced here on this page:
1. Reset the zoom on this page.
1. Zoom this page 5 times.
2. Right click the #1 in the first comment on this page and open it in a new tab.
3. Let the page load completely in the background before focusing it.
4. When you change to the new tab, the page will have focused on the #2 comment, not the first one.
Confirmed in:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121821 Gentoo Firefox/3.0.5

as well as:

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090110 Minefield/3.2a1pre

by zooming in on this bug page a few steps, opening one of the comment links (https://bugzilla.mozilla.org/show_bug.cgi?id=441104#c1) in the background by middle-clicking and waiting for it to load. When switching to that tab the scrolling position was off. Hitting ctrl+0 (reset page zoom) puts things at exactly the correct position, which can be confirmed by left-clicking the comment link (doing this does not change the page at all).

Marking NEW and changing platform to ALL based on this. Also editing summary to include "zoom". Comment #2 is probably not quite the same bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
Summary: following an anchor link doesn't scroll the page to the proper position in certain cases → following an anchor link in the background doesn't scroll the page to the proper position if it is zoomed
This is actually a duplicate of bug 386835, which I should have found before confirming this. Sorry about that :(
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.