Last modified: 2014-08-14 13:57:41 UTC
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.
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)