зеркало из https://github.com/mozilla/gecko-dev.git
Bug 851485 - Restoring scroll position from history should only suppress one scroll-to-anchor. r=bzbarsky
This commit is contained in:
Родитель
d9494408fd
Коммит
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче