From 163a45f49546cac1c914a049f884cde914e10e5c Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 28 Feb 2019 01:31:47 +0000 Subject: [PATCH] Bug 1531173 - Drop nsIContentViewer.scrollToNode. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D21458 --HG-- extra : moz-landing-system : lando --- docshell/base/nsIContentViewer.idl | 4 ---- layout/base/nsDocumentViewer.cpp | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/docshell/base/nsIContentViewer.idl b/docshell/base/nsIContentViewer.idl index 70b0af53e4e8..cdf052efdb18 100644 --- a/docshell/base/nsIContentViewer.idl +++ b/docshell/base/nsIContentViewer.idl @@ -232,10 +232,6 @@ interface nsIContentViewer : nsISupports * Set collector for navigation timing data (load, unload events). */ [noscript,notxpcom,nostdcall] void setNavigationTiming(in nsDOMNavigationTimingPtr aTiming); - /* - Scrolls to a given DOM content node. - */ - void scrollToNode(in Node node); /** The amount by which to scale all text. Default is 1.0. */ attribute float textZoom; diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 410bb95febbf..341793c2dc10 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2672,28 +2672,6 @@ NS_IMETHODIMP nsDocumentViewer::SetCommandNode(nsINode* aNode) { return NS_OK; } -NS_IMETHODIMP nsDocumentViewer::ScrollToNode(nsINode* aNode) { - NS_ENSURE_ARG(aNode); - NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE); - nsCOMPtr presShell = GetPresShell(); - - // Get the nsIContent interface, because that's what we need to - // get the primary frame - - nsCOMPtr content(do_QueryInterface(aNode)); - NS_ENSURE_TRUE(content, NS_ERROR_FAILURE); - - // Tell the PresShell to scroll to the primary frame of the content. - NS_ENSURE_SUCCESS( - presShell->ScrollContentIntoView( - content, - nsIPresShell::ScrollAxis(nsIPresShell::SCROLL_TOP, - nsIPresShell::SCROLL_ALWAYS), - nsIPresShell::ScrollAxis(), nsIPresShell::SCROLL_OVERFLOW_HIDDEN), - NS_ERROR_FAILURE); - return NS_OK; -} - void nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure) { nsCOMPtr docShell(mContainer); if (docShell) {