Backed out changeset 36bb09c4b28e (bug 1373672)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 01 Aug 2017 12:38:20 +0200
changeset 420913 896709cd1daf82ebe88f444e90ea3f2c995d49b9
parent 420912 f2e435cfffbb19a1dc79f934c02405490b26e200
child 420914 6da77209f66bc33af8a22905bb75007ef59e0abb
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1373672
milestone56.0a1
backs out36bb09c4b28edaefacb7199cd1d73e010753ecb9
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
Backed out changeset 36bb09c4b28e (bug 1373672)
browser/components/sessionstore/nsSessionStoreUtils.cpp
browser/components/sessionstore/test/browser_frametree.js
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
--- a/browser/components/sessionstore/nsSessionStoreUtils.cpp
+++ b/browser/components/sessionstore/nsSessionStoreUtils.cpp
@@ -84,36 +84,31 @@ nsSessionStoreUtils::ForEachNonDynamicCh
 
   nsCOMPtr<nsIDocShell> docShell = outer->GetDocShell();
   NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
 
   int32_t length;
   nsresult rv = docShell->GetChildCount(&length);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  for (int32_t i = 0; i < length; ++i) {
+  for (int32_t i = 0, idx = 0; i < length; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> item;
     docShell->GetChildAt(i, getter_AddRefs(item));
     NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsIDocShell> childDocShell(do_QueryInterface(item));
     NS_ENSURE_TRUE(childDocShell, NS_ERROR_FAILURE);
 
     bool isDynamic = false;
     nsresult rv = childDocShell->GetCreatedDynamically(&isDynamic);
     if (NS_SUCCEEDED(rv) && isDynamic) {
       continue;
     }
 
-    int32_t childOffset = 0;
-    rv = childDocShell->GetChildOffset(&childOffset);
-    NS_ENSURE_SUCCESS(rv, rv);
-    MOZ_ASSERT(childOffset > 0);
-
-    aCallback->HandleFrame(item->GetWindow(), childOffset);
+    aCallback->HandleFrame(item->GetWindow(), idx++);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSessionStoreUtils::CreateDynamicFrameEventFilter(nsIDOMEventListener* aListener,
                                                    nsIDOMEventListener** aResult)
--- a/browser/components/sessionstore/test/browser_frametree.js
+++ b/browser/components/sessionstore/test/browser_frametree.js
@@ -83,25 +83,16 @@ add_task(async function test_frametree_d
     content.document.body.appendChild(frame);
     return ContentTaskUtils.waitForEvent(frame, "load");
   });
 
   // The page still has two iframes.
   is(await countNonDynamicFrames(browser), 2, "two non-dynamic child frames");
   is(await enumerateIndexes(browser), "0,1", "correct indexes 0 and 1");
 
-  // Remopve a non-dynamic iframe.
-  await ContentTask.spawn(browser, URL, async ([url]) => {
-    // Remove the first iframe, which should be a non-dynamic iframe.
-    content.document.body.removeChild(content.document.getElementsByTagName("iframe")[0]);
-  });
-
-  is(await countNonDynamicFrames(browser), 1, "one non-dynamic child frame");
-  is(await enumerateIndexes(browser), "1", "correct index 1");
-
   // Cleanup.
   await promiseRemoveTab(tab);
 });
 
 async function countNonDynamicFrames(browser) {
   return await ContentTask.spawn(browser, null, async () => {
     const ssu = Cc["@mozilla.org/browser/sessionstore/utils;1"]
                   .getService(Ci.nsISessionStoreUtils);
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -4085,23 +4085,16 @@ nsDocShell::SetTreeOwner(nsIDocShellTree
 NS_IMETHODIMP
 nsDocShell::SetChildOffset(int32_t aChildOffset)
 {
   mChildOffset = aChildOffset;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetChildOffset(int32_t* aChildOffset)
-{
-  *aChildOffset = mChildOffset;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsDocShell::GetHistoryID(nsID** aID)
 {
   *aID = static_cast<nsID*>(nsMemory::Clone(&mHistoryID, sizeof(nsID)));
   return NS_OK;
 }
 
 const nsID
 nsDocShell::HistoryID()
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -544,20 +544,19 @@ interface nsIDocShell : nsIDocShellTreeI
   /**
    * Gets the channel for the currently loaded document, if any.
    * For a new document load, this will be the channel of the previous document
    * until after OnLocationChange fires.
    */
   readonly attribute nsIChannel currentDocumentChannel;
 
   /**
-   * The original offset of this child in its container. This property is -1 for
-   * dynamically added docShells.
+   * Set the offset of this child in its container.
    */
-  [noscript] attribute long childOffset;
+  [noscript] void setChildOffset(in long offset);
 
   /**
    * Find out whether the docshell is currently in the middle of a page
    * transition. This is set just before the pagehide/unload events fire.
    */
   readonly attribute boolean isInUnload;
 
   /**