Bug 1531173 - Drop nsIContentViewer.scrollToNode. r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 28 Feb 2019 01:31:47 +0000
changeset 519463 bb37a041dbebaf73746e0ba8822eadd27945ec67
parent 519462 03d6fa61c83594e678952a3f8bc275e9b5e3a614
child 519464 1d1443507be4aedaa6a868acf08e5086d607a9e0
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1531173
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531173 - Drop nsIContentViewer.scrollToNode. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D21458
docshell/base/nsIContentViewer.idl
layout/base/nsDocumentViewer.cpp
--- a/docshell/base/nsIContentViewer.idl
+++ b/docshell/base/nsIContentViewer.idl
@@ -227,20 +227,16 @@ interface nsIContentViewer : nsISupports
    * case, if mParentWidget is null then this document should not even
    * be displayed.
    */
   [noscript,notxpcom,nostdcall] nsViewPtr findContainerView();
   /**
    * 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;
 
   /** The actual text zoom in effect, as modified by the system font scale. */
   readonly attribute float effectiveTextZoom;
 
   /** The amount by which to scale all lengths. Default is 1.0. */
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2667,38 +2667,16 @@ NS_IMETHODIMP nsDocumentViewer::SetComma
 
   nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
   NS_ENSURE_STATE(root);
 
   root->SetPopupNode(aNode);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDocumentViewer::ScrollToNode(nsINode* aNode) {
-  NS_ENSURE_ARG(aNode);
-  NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
-  nsCOMPtr<nsIPresShell> presShell = GetPresShell();
-
-  // Get the nsIContent interface, because that's what we need to
-  // get the primary frame
-
-  nsCOMPtr<nsIContent> 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<nsIDocShell> docShell(mContainer);
   if (docShell) {
     int32_t i;
     int32_t n;
     docShell->GetChildCount(&n);
     for (i = 0; i < n; i++) {
       nsCOMPtr<nsIDocShellTreeItem> child;