Page MenuHomePhabricator

Page scrolls to the top when using the browsers history
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Open a longer article, e.g. https://en.wikipedia.org/wiki/London
  2. Click a section in the table of contents, e.g. https://en.wikipedia.org/wiki/London#Air
  3. Click an image to open the viewer.
  4. Go back in your browsers history (usually Alt+Left).
  5. Go forward.
  6. Go back again.

Result: The page scrolls to the top.

Expected: Focus should stay on the section.


Version: master
Severity: normal

Details

Reference
bz69467

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:43 AM
bzimport added a project: MediaViewer.
bzimport set Reference to bz69467.
bzimport added a subscriber: Unknown Object (MLST).

Confirmed in FF 31. Setting breakpoints in Firebug in debug=true mode shows that if you click "forward" to close MMV and return to the article, MMVB.setupOverlay() is called while the overlay is still present, which wipes bootstrap.savedScroll. Then shortly afterward, MMVB.cleanupOverlay() is executed, but now bootstrap.savedScroll has {0,0} in it.

Here is the stack of the erroneous setupOverlay() call:

MMVB.setupOverlay() mmv.bootstrap.js (line 405)
MMVB.loadViewer() mmv.bootstrap.js (line 86)
MMVB.hash(initialHash=undefined) mmv.bootstrap.js (line 318)
MMVB.setupEventHandlers/<() mmv.bootstrap.js (line 380)
jQuery.event.dispatch(event=Object { originalEvent=Event popstate, type="popstate", timeStamp=1408023881479371, more...}) load.ph...180219Z (line 4641)
jQuery.event.add/elemData.handle(e=popstate ) load.ph...180219Z (line 4309)

That is to say, the stack trace was from step 4 of the similar sequence:

  1. open MMV
  2. close MMV by clicking the close button
  3. back (to MMV)
  4. forward (to article)
Gilles triaged this task as Medium priority.Nov 24 2014, 2:27 PM
Gilles subscribed.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

thiemowmde claimed this task.

I can not reproduce this any more.