mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 851485 - Restoring scroll position from history should only suppress one scroll-to-anchor. r=bzbarsky
This commit is contained in:
parent
d9494408fd
commit
7709c39887
@ -2890,6 +2890,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll)
|
||||
if (rootScroll && rootScroll->DidHistoryRestore()) {
|
||||
// Scroll position restored from history trumps scrolling to anchor.
|
||||
aScroll = false;
|
||||
rootScroll->ClearDidHistoryRestore();
|
||||
}
|
||||
|
||||
if (content) {
|
||||
|
@ -537,6 +537,9 @@ public:
|
||||
virtual bool DidHistoryRestore() MOZ_OVERRIDE {
|
||||
return mInner.mDidHistoryRestore;
|
||||
}
|
||||
virtual void ClearDidHistoryRestore() MOZ_OVERRIDE {
|
||||
mInner.mDidHistoryRestore = false;
|
||||
}
|
||||
|
||||
// nsIStatefulFrame
|
||||
NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE {
|
||||
@ -790,6 +793,9 @@ public:
|
||||
virtual bool DidHistoryRestore() MOZ_OVERRIDE {
|
||||
return mInner.mDidHistoryRestore;
|
||||
}
|
||||
virtual void ClearDidHistoryRestore() MOZ_OVERRIDE {
|
||||
mInner.mDidHistoryRestore = false;
|
||||
}
|
||||
|
||||
// nsIStatefulFrame
|
||||
NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE {
|
||||
|
@ -237,6 +237,12 @@ public:
|
||||
* Was the current presentation state for this frame restored from history?
|
||||
*/
|
||||
virtual bool DidHistoryRestore() = 0;
|
||||
/**
|
||||
* Clear the flag so that DidHistoryRestore() returns false until the next
|
||||
* RestoreState call.
|
||||
* @see nsIStatefulFrame::RestoreState
|
||||
*/
|
||||
virtual void ClearDidHistoryRestore() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user