BrowserView keeps a BrowserViewportState on each browser element that has been set via setBrowser, but this prevents state from persisting if the browser element is removed, and also makes it difficult to restore viewport state on tab switch (e.g. scrolling to the visible position). BrowserViewportState should live at the Tab level, be initialized upon the creation of the Tab's browser, and proper scrolling should be done on tab switch. I fixed these in the attached patch. There is still a minor bug in scrolling to the correct visible X position on tab switch caused by the fact that sideways chrome scrolling is incorrect in that, if a sidebar is open and the content viewport is large enough (e.g. content is zoomed), then scrolling the content viewport sideways doesn't move the sidebars off as it should, so Browser.getVisibleRect().left is not the most correct value always. This will fix itself as soon as Browser.MainDragger is fixed. Restoring visible Y works.
To clarify, the issue with restoring the X position can be seen by opening a new tab, zooming in on content, scrolling to make sure a sidebar is in view (e.g. the tabs sidebar), switching to another tab, switching back, and the content should be slightly offset horizontally from expected location.
Created attachment 393857 [details] [diff] [review] patch I should probably attach the patch. Sorry for bugspam.
Created attachment 393862 [details] [diff] [review] bvs_lift Attaching patch with edits per review from Stuart.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.