Closed Bug 614909 Opened 13 years ago Closed 4 years ago

Page does not scroll down to anchor link destination


(Core :: Layout, defect, P3)






(Reporter: DavidCognito, Assigned: bzbarsky)



User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:2.0b8pre) Gecko/20101125 Firefox/4.0b8pre
Build Identifier: Mozilla/5.0 (Windows NT 6.1; rv:2.0b8pre) Gecko/20101125 Firefox/4.0b8pre

Visiting e.g. does not scroll the page down to the anchor link destination.

Reproducible: Always

Steps to Reproduce:
1. open URL
Actual Results:  
Page remains at top.

Expected Results:  
Page should go down to comment #4 which beings "Great coverage of the testimony Joe."
Ever confirmed: true
This WFM with Javascript off; With Javascript on it scrolls to correct place and then almost immediately (I have a slow machine) scrolls back to top.

Now that you mention that I did think I saw a 'jump' once when testing, but it was too quick to see what had happened. I cleared my cache and saw it again now - barely detectable but it's there.
The first bad revision is:
changeset:   28215:b43f2b9e0c32
user:        Boris Zbarsky <>
date:        Mon May 11 22:04:58 2009 -0400
summary:     Bug 78070. When the root element is removed, remove all frames except the viewport; when it's reinserted, recreate them as needed.  r=roc,dbaron sr=roc
Blocks: 78070
Component: General → Layout
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → layout
Hardware: x86 → All
Version: unspecified → Trunk
Yeah, this page reframes the root at some point (why, I dunno).

That said, this is generally supposed to preserve the scroll position...

But I just tested, and while going from block to inline display for the <body> on, say, this bug page does preserve the scroll position, going from inline display to block display does not.  And the page the bug is on has the <body> styled display:inline.

Timothy, you want me to take this and look into what's going on with scroll state restoration here?
If you want. I wasn't planning on working on it anytime soon since it's not a regression from 3.6.
Assignee: nobody → bzbarsky
Priority: -- → P3
Blocks: 666718
No longer blocks: 666718

Here's a great example of how it scrolls instantly to the right content and when the page finishes loading it jumps to end.

Usually a reload scrolls to the correct anchor.

OK, initial testcase in this bug is gone, but a testcase based on comment 5, like so:

<!DOCTYPE html>
  <body style="display: inline">
    <div style="height: 200vh; border: 1px solid black">A tall div; scroll past
    <div onclick=" = ''">
      Click me to change the body display to block.

Preserves the scroll position when clicking on the text below the tall div. Marking worksforme.

Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.