gecko-dev/docshell/shistory
Jan Henning 0e575681dc Bug 1265818 - Part 2 - Add scriptable methods for getting and setting PresStates from JS. r=jst
This will allow the session store to store and restore scroll positions (and pinch zoom on Android) for past session history entries as well, whereas today only the scroll position of the current page is saved.

As a LayoutHistoryState saves its PresStates in a hash table that doesn't allow direct access to its contents if you don't already know the entry's key, we provide a function to iterate over all stored PresStates and retrieve their keys, which can then be used to get access to each individual PresState in turn. Since nsPresState is little more than a fancy struct and we don't want to have to turn it into a full-blown XPCOM-compatible interface, we just pass the scroll/zoom-related values we're interested in as in/out parameters from/to JS via the LayoutHistoryState.

We also require a helper method for initialising an SHEntry's LayoutHistoryState, since normally this doesn't happen until the PresShell wants to capture the history state in it. We on the other hand require a LayoutHistoryState to be present immediately after creation of a fresh SHEntry object, so we can feed it the session store data during history restoration.

MozReview-Commit-ID: FfZf8KDsVWl
***

--HG--
extra : rebase_source : 0b3f729bff3ac24680d6fe8a0fb796979886170b
2017-03-25 14:01:29 +01:00
..
moz.build Bug 1276553 - Part 1: Make nsISHistory support partial mode. r=smaug 2016-10-14 15:18:29 +08:00
nsIBFCacheEntry.idl Bug 1164706 - Flatten docshell/shistory/public/ directory. r=smaug 2015-05-14 20:52:05 -07:00
nsIGroupedSHistory.idl Bug 1323651 - Rename Partial/GroupedSessionHistory to Partial/GroupedSHistory. r=ehsan 2016-12-22 16:06:50 +08:00
nsIPartialSHistory.idl Bug 1323651 - Rename Partial/GroupedSessionHistory to Partial/GroupedSHistory. r=ehsan 2016-12-22 16:06:50 +08:00
nsIPartialSHistoryListener.idl Bug 1276553 - Part 1: Make nsISHistory support partial mode. r=smaug 2016-10-14 15:18:29 +08:00
nsISHContainer.idl Bug 1164706 - Flatten docshell/shistory/public/ directory. r=smaug 2015-05-14 20:52:05 -07:00
nsISHEntry.idl Bug 1265818 - Part 2 - Add scriptable methods for getting and setting PresStates from JS. r=jst 2017-03-25 14:01:29 +01:00
nsISHTransaction.idl Bug 1164706 - Flatten docshell/shistory/public/ directory. r=smaug 2015-05-14 20:52:05 -07:00
nsISHistory.idl Bug 1323651 - Rename Partial/GroupedSessionHistory to Partial/GroupedSHistory. r=ehsan 2016-12-22 16:06:50 +08:00
nsISHistoryInternal.idl Bug 1326251 - Part 1: Remove dynamic entries on unloading & evicting bfcache. r=smaug 2017-01-24 14:56:37 +08:00
nsISHistoryListener.idl Bug 1320391 - Part 1: Clean up PartialSHistories which are keeping old SHEntries alive, r=ehsan 2016-12-15 13:28:40 +08:00
nsSHEntry.cpp Bug 1265818 - Part 2 - Add scriptable methods for getting and setting PresStates from JS. r=jst 2017-03-25 14:01:29 +01:00
nsSHEntry.h Backed out changeset 00312b136937 (bug 968273) for causing regressions 2016-06-28 10:03:25 +02:00
nsSHEntryShared.cpp Bug 1339707 - Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method and set nsITimer target. r=smaug 2017-03-07 16:58:59 +08:00
nsSHEntryShared.h Bug 944694 - Part 1: Use globally unique UUIDs for docshellID, r=smaug 2016-11-17 16:50:48 -05:00
nsSHTransaction.cpp Bug 1164706 - Flatten docshell/shistory/src/ directory. r=smaug 2015-05-15 15:25:39 -07:00
nsSHTransaction.h Bug 1164706 - Flatten docshell/shistory/src/ directory. r=smaug 2015-05-15 15:25:39 -07:00
nsSHistory.cpp Bug 1339707 - Replace NS_DispatchToCurrentThread to DocGroup / TabGroup dispatch method and set nsITimer target. r=smaug 2017-03-07 16:58:59 +08:00
nsSHistory.h Bug 1326251 - Part 1: Remove dynamic entries on unloading & evicting bfcache. r=smaug 2017-01-24 14:56:37 +08:00