From 45a19c261ddfc4aedef2b868eb23c1b6da68de25 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Thu, 16 Dec 1999 22:48:02 +0000 Subject: [PATCH] Precursor change to akkana and hyatts fix for platform dependent key-bindings. HOME and END will now implement the scroll to top and scroll to bottom for mac. Scroll and Move for pageup/pagedown and CTRL-HOME and CTRL-END on windows will not work until m13. This is ok for now and will hurry up completion of M12. r=akkana. simple fix like 10 lines really. git-svn-id: svn://10.0.0.236/trunk@56105 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 19 +++++++++++++++++-- mozilla/layout/html/base/src/nsPresShell.cpp | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 628e3add963..be23d61d525 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1349,6 +1349,9 @@ PresShell::IntraLineMove(PRBool aForward, PRBool aExtend) NS_IMETHODIMP PresShell::PageMove(PRBool aForward, PRBool aExtend) { + return ScrollPage(aForward); +#if 0 + nsCOMPtr viewManager; nsresult result = GetViewManager(getter_AddRefs(viewManager)); if (NS_SUCCEEDED(result) && viewManager) @@ -1361,6 +1364,7 @@ PresShell::PageMove(PRBool aForward, PRBool aExtend) } } return result; +#endif //0 } NS_IMETHODIMP @@ -1422,13 +1426,24 @@ PresShell::ScrollHorizontal(PRBool aLeft) NS_IMETHODIMP PresShell::CompleteScroll(PRBool aForward) { - return NS_ERROR_NOT_IMPLEMENTED; + nsCOMPtr viewManager; + nsresult result = GetViewManager(getter_AddRefs(viewManager)); + if (NS_SUCCEEDED(result) && viewManager) + { + nsIScrollableView *scrollView; + result = viewManager->GetRootScrollableView(&scrollView); + if (NS_SUCCEEDED(result) && scrollView) + { + scrollView->ScrollByWhole(!aForward);//TRUE = top, aForward TRUE=bottom + } + } + return result; } NS_IMETHODIMP PresShell::CompleteMove(PRBool aForward, PRBool aExtend) { - return NS_ERROR_NOT_IMPLEMENTED; + return CompleteScroll(aForward); } NS_IMETHODIMP diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 628e3add963..be23d61d525 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1349,6 +1349,9 @@ PresShell::IntraLineMove(PRBool aForward, PRBool aExtend) NS_IMETHODIMP PresShell::PageMove(PRBool aForward, PRBool aExtend) { + return ScrollPage(aForward); +#if 0 + nsCOMPtr viewManager; nsresult result = GetViewManager(getter_AddRefs(viewManager)); if (NS_SUCCEEDED(result) && viewManager) @@ -1361,6 +1364,7 @@ PresShell::PageMove(PRBool aForward, PRBool aExtend) } } return result; +#endif //0 } NS_IMETHODIMP @@ -1422,13 +1426,24 @@ PresShell::ScrollHorizontal(PRBool aLeft) NS_IMETHODIMP PresShell::CompleteScroll(PRBool aForward) { - return NS_ERROR_NOT_IMPLEMENTED; + nsCOMPtr viewManager; + nsresult result = GetViewManager(getter_AddRefs(viewManager)); + if (NS_SUCCEEDED(result) && viewManager) + { + nsIScrollableView *scrollView; + result = viewManager->GetRootScrollableView(&scrollView); + if (NS_SUCCEEDED(result) && scrollView) + { + scrollView->ScrollByWhole(!aForward);//TRUE = top, aForward TRUE=bottom + } + } + return result; } NS_IMETHODIMP PresShell::CompleteMove(PRBool aForward, PRBool aExtend) { - return NS_ERROR_NOT_IMPLEMENTED; + return CompleteScroll(aForward); } NS_IMETHODIMP