Bug 1406161 - Part 3: Remove a dead member function. r?smaug draft
authorSamael Wang <freesamael@gmail.com>
Fri, 15 Dec 2017 17:15:02 -0600
changeset 716073 fe6a3a6e0fec765fdc896934a99c14eefde01517
parent 716072 a89e0fbfed39bb2acc78c2e64de1b561986ed80d
child 716074 c132ca0c0f7800f749382163f8d10f834652837b
push id94319
push userbmo:sawang@mozilla.com
push dateFri, 05 Jan 2018 03:38:14 +0000
reviewerssmaug
bugs1406161
milestone59.0a1
Bug 1406161 - Part 3: Remove a dead member function. r?smaug MozReview-Commit-ID: LYNUZhvnAdm
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13734,44 +13734,16 @@ nsDocShell::GetPromptAndStringBundle(nsI
 
   NS_ENSURE_SUCCESS(
     stringBundleService->CreateBundle(kAppstringsBundleURL, aStringBundle),
     NS_ERROR_FAILURE);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsDocShell::GetChildOffset(nsIDOMNode* aChild, nsIDOMNode* aParent,
-                           int32_t* aOffset)
-{
-  NS_ENSURE_ARG_POINTER(aChild || aParent);
-
-  nsCOMPtr<nsIDOMNodeList> childNodes;
-  NS_ENSURE_SUCCESS(aParent->GetChildNodes(getter_AddRefs(childNodes)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_TRUE(childNodes, NS_ERROR_FAILURE);
-
-  int32_t i = 0;
-
-  for (; true; i++) {
-    nsCOMPtr<nsIDOMNode> childNode;
-    NS_ENSURE_SUCCESS(childNodes->Item(i, getter_AddRefs(childNode)),
-                      NS_ERROR_FAILURE);
-    NS_ENSURE_TRUE(childNode, NS_ERROR_FAILURE);
-
-    if (childNode.get() == aChild) {
-      *aOffset = i;
-      return NS_OK;
-    }
-  }
-
-  return NS_ERROR_FAILURE;
-}
-
 nsIScrollableFrame*
 nsDocShell::GetRootScrollFrame()
 {
   nsCOMPtr<nsIPresShell> shell = GetPresShell();
   NS_ENSURE_TRUE(shell, nullptr);
 
   return shell->GetRootScrollFrameAsScrollable();
 }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -904,19 +904,16 @@ private: // member functions
   // children docshells.
   void FirePageHideNotificationInternal(bool aIsUnload,
                                         bool aSkipCheckingDynEntries);
 
   // Dispatch a runnable to the TabGroup associated to this docshell.
   nsresult DispatchToTabGroup(mozilla::TaskCategory aCategory,
                               already_AddRefed<nsIRunnable>&& aRunnable);
 
-  NS_IMETHOD GetChildOffset(nsIDOMNode* aChild, nsIDOMNode* aParent,
-                            int32_t* aOffset);
-
   void SetupReferrerFromChannel(nsIChannel* aChannel);
   void SetReferrerURI(nsIURI* aURI);
   void SetReferrerPolicy(uint32_t aReferrerPolicy);
   void ReattachEditorToWindow(nsISHEntry* aSHEntry);
   void RecomputeCanExecuteScripts();
   void ClearFrameHistory(nsISHEntry* aEntry);
   void UpdateGlobalHistoryTitle(nsIURI* aURI);
   bool IsFrame();