Backed out 3 changesets (bug 1543786) for browser_storageAccessRemovalNavigateTopframe.js failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Sat, 13 Apr 2019 05:14:11 +0300
changeset 469330 846d7680d2de2f8ae3cc55f8a448d4e8fff7f688
parent 469329 4f63311e6f00d31dae05a35aa49b63c34ba3ae33
child 469331 d9ee5458ce46d43e760fe81dffe866673080b78e
push id112784
push userbtara@mozilla.com
push dateSat, 13 Apr 2019 02:14:52 +0000
treeherdermozilla-inbound@846d7680d2de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1543786
milestone68.0a1
backs out4f63311e6f00d31dae05a35aa49b63c34ba3ae33
757b729752e0e01f6b3f2b2d49f043a1e88e31ff
6aabad91d9803f4458c8154f0634cbedec40cf94
first release with
nightly linux32
846d7680d2de / 68.0a1 / 20190413095252 / files
nightly linux64
846d7680d2de / 68.0a1 / 20190413095252 / files
nightly mac
846d7680d2de / 68.0a1 / 20190413095252 / files
nightly win32
846d7680d2de / 68.0a1 / 20190413095252 / files
nightly win64
846d7680d2de / 68.0a1 / 20190413095252 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 3 changesets (bug 1543786) for browser_storageAccessRemovalNavigateTopframe.js failures CLOSED TREE Backed out changeset 4f63311e6f00 (bug 1543786) Backed out changeset 757b729752e0 (bug 1543786) Backed out changeset 6aabad91d980 (bug 1543786)
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
dom/base/nsFrameLoader.cpp
dom/ipc/TabChild.cpp
toolkit/components/antitracking/test/browser/antitracking_head.js
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2639,42 +2639,26 @@ nsresult nsDocShell::SetDocLoaderParent(
   if (parentURIListener) {
     mContentListener->SetParentContentListener(parentURIListener);
   }
 
   // Our parent has changed. Recompute scriptability.
   RecomputeCanExecuteScripts();
 
   // Inform windows when they're being removed from their parent.
-  if (!aParent) {
-    MaybeClearStorageAccessFlag();
+  if (!aParent && mScriptGlobal) {
+    mScriptGlobal->ParentWindowChanged();
   }
 
   NS_ASSERTION(mInheritPrivateBrowsingId || wasPrivate == UsePrivateBrowsing(),
                "Private browsing state changed while inheritance was disabled");
 
   return NS_OK;
 }
 
-void nsDocShell::MaybeClearStorageAccessFlag() {
-  if (mScriptGlobal) {
-    // Tell our window that the parent has now changed.
-    mScriptGlobal->ParentWindowChanged();
-
-    // Tell all of our children about the change recursively as well.
-    nsTObserverArray<nsDocLoader*>::ForwardIterator iter(mChildList);
-    while (iter.HasMore()) {
-      nsCOMPtr<nsIDocShell> child = do_QueryObject(iter.GetNext());
-      if (child) {
-        static_cast<nsDocShell*>(child.get())->MaybeClearStorageAccessFlag();
-      }
-    }
-  }
-}
-
 NS_IMETHODIMP
 nsDocShell::GetSameTypeParent(nsIDocShellTreeItem** aParent) {
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nullptr;
 
   if (nsIDocShell::GetIsMozBrowser()) {
     return NS_OK;
   }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -394,19 +394,16 @@ class nsDocShell final : public nsDocLoa
   /**
    * Loads the given URI. See comments on nsDocShellLoadState members for more
    * information on information used. aDocShell and aRequest come from
    * onLinkClickSync, which is triggered during form submission.
    */
   nsresult InternalLoad(nsDocShellLoadState* aLoadState,
                         nsIDocShell** aDocShell, nsIRequest** aRequest);
 
-  // Clear the document's storage access flag if needed.
-  void MaybeClearStorageAccessFlag();
-
  private:  // member functions
   friend class nsDSURIContentListener;
   friend class FramingChecker;
   friend class OnLinkClickEvent;
   friend class nsIDocShell;
   friend class mozilla::dom::BrowsingContext;
 
   // It is necessary to allow adding a timeline marker wherever a docshell
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -420,22 +420,16 @@ nsresult nsFrameLoader::ReallyStartLoadi
     if (!mRemoteBrowserShown) {
       // This can fail if it's too early to show the frame, we will retry later.
       Unused << ShowRemoteFrame(ScreenIntSize(0, 0));
     }
 
     return NS_OK;
   }
 
-  if (mDocShell) {
-    // If we already have a docshell, ensure that the docshell's storage access
-    // flag is cleared.
-    mDocShell->MaybeClearStorageAccessFlag();
-  }
-
   nsresult rv = MaybeCreateDocShell();
   if (NS_FAILED(rv)) {
     return rv;
   }
   NS_ASSERTION(mDocShell,
                "MaybeCreateDocShell succeeded with a null mDocShell");
 
   // Just to be safe, recheck uri.
@@ -943,18 +937,16 @@ void nsFrameLoader::Hide() {
   }
   if (mInShow) {
     mHideCalled = true;
     return;
   }
 
   if (!mDocShell) return;
 
-  mDocShell->MaybeClearStorageAccessFlag();
-
   nsCOMPtr<nsIContentViewer> contentViewer;
   mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
   if (contentViewer) contentViewer->SetSticky(false);
 
   RefPtr<nsDocShell> baseWin = mDocShell;
   baseWin->SetVisibility(false);
   baseWin->SetParentWidget(nullptr);
 }
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1046,29 +1046,24 @@ mozilla::ipc::IPCResult TabChild::RecvLo
   }
 
   LoadURIOptions loadURIOptions;
   loadURIOptions.mTriggeringPrincipal = nsContentUtils::GetSystemPrincipal();
   loadURIOptions.mLoadFlags =
       nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
       nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
 
-  nsIWebNavigation* webNav = WebNavigation();
-  nsresult rv = webNav->LoadURI(NS_ConvertUTF8toUTF16(aURI), loadURIOptions);
+  nsresult rv =
+      WebNavigation()->LoadURI(NS_ConvertUTF8toUTF16(aURI), loadURIOptions);
   if (NS_FAILED(rv)) {
     NS_WARNING(
         "WebNavigation()->LoadURI failed. Eating exception, what else can I "
         "do?");
   }
 
-  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
-  if (docShell) {
-    nsDocShell::Cast(docShell)->MaybeClearStorageAccessFlag();
-  }
-
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, aURI);
 
   return IPC_OK();
 }
 
 void TabChild::DoFakeShow(const ShowInfo& aShowInfo) {
   RecvShow(ScreenIntSize(0, 0), aShowInfo, mParentIsActive, nsSizeMode_Normal);
   mDidFakeShow = true;
--- a/toolkit/components/antitracking/test/browser/antitracking_head.js
+++ b/toolkit/components/antitracking/test/browser/antitracking_head.js
@@ -330,17 +330,17 @@ this.AntiTracking = {
                                   options.blockingByContentBlockingRTUI &&
                                   !options.allowList;
       let thirdPartyPage;
       if (typeof options.thirdPartyPage == "string") {
         thirdPartyPage = options.thirdPartyPage;
       } else {
         thirdPartyPage = TEST_3RD_PARTY_PAGE;
       }
-      let id = await ContentTask.spawn(browser,
+      await ContentTask.spawn(browser,
                               { page: thirdPartyPage,
                                 nextPage: TEST_4TH_PARTY_PAGE,
                                 callback: options.callback.toString(),
                                 callbackAfterRemoval: options.callbackAfterRemoval ?
                                   options.callbackAfterRemoval.toString() : null,
                                 accessRemoval: options.accessRemoval,
                                 iframeSandbox: options.iframeSandbox,
                                 allowList: options.allowList,
@@ -415,68 +415,24 @@ this.AntiTracking = {
                   return;
                 }
 
                 ok(false, "Unknown message");
               });
 
               ifr.src = obj.nextPage;
             });
-          case "navigate-topframe":
-            // pass-through
             break;
           default:
             ok(false, "Unexpected accessRemoval code passed: " + obj.accessRemoval);
             break;
           }
         }
-
-        return id;
       });
 
-      if (doAccessRemovalChecks &&
-          options.accessRemoval == "navigate-topframe") {
-        await BrowserTestUtils.loadURI(browser, TEST_4TH_PARTY_PAGE);
-        await BrowserTestUtils.browserLoaded(browser);
-
-        let pageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
-        gBrowser.goBack();
-        await pageshow;
-
-        await ContentTask.spawn(browser,
-                                { id,
-                                  callbackAfterRemoval: options.callbackAfterRemoval ?
-                                    options.callbackAfterRemoval.toString() : null,
-                                },
-                                async function(obj) {
-          let ifr = content.document.getElementById(obj.id);
-                                  content.alert(ifr);
-          ifr.contentWindow.postMessage(obj.callbackAfterRemoval, "*");
-
-          content.addEventListener("message", function msg(event) {
-            if (event.data.type == "finish") {
-              content.removeEventListener("message", msg);
-              return;
-            }
-
-            if (event.data.type == "ok") {
-              ok(event.data.what, event.data.msg);
-              return;
-            }
-
-            if (event.data.type == "info") {
-              info(event.data.msg);
-              return;
-            }
-
-            ok(false, "Unknown message");
-          });
-        });
-      }
-
       if (options.allowList) {
         info("Enabling content blocking for this page");
         win.ContentBlocking.enableForCurrentPage();
 
         // The previous function reloads the browser, so wait for it to load again!
         await BrowserTestUtils.browserLoaded(browser);
       }
 
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -74,18 +74,16 @@ support-files = tracker.js
 [browser_userInteraction.js]
 [browser_storageAccessDoorHanger.js]
 [browser_storageAccessPrivateWindow.js]
 skip-if = serviceworker_e10s
 [browser_storageAccessPromiseRejectHandlerUserInteraction.js]
 [browser_storageAccessPromiseResolveHandlerUserInteraction.js]
 [browser_storageAccessRemovalNavigateSubframe.js]
 skip-if = serviceworker_e10s
-[browser_storageAccessRemovalNavigateTopframe.js]
-skip-if = serviceworker_e10s
 [browser_storageAccessSandboxed.js]
 skip-if = serviceworker_e10s
 [browser_storageAccessWithHeuristics.js]
 [browser_allowPermissionForTracker.js]
 [browser_denyPermissionForTracker.js]
 [browser_localStorageEvents.js]
 support-files = localStorage.html
 [browser_partitionedLocalStorage.js]
deleted file mode 100644
--- a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js
+++ /dev/null
@@ -1,40 +0,0 @@
-AntiTracking.runTest("Storage Access is removed when topframe navigates",
-  // blocking callback
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-  },
-
-  // non-blocking callback
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    if (allowListed) {
-      await hasStorageAccessInitially();
-    } else {
-      await noStorageAccessInitially();
-    }
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    let [threw, rejected] = await callRequestStorageAccess();
-    ok(!threw, "requestStorageAccess should not throw");
-    ok(!rejected, "requestStorageAccess should be available");
-  },
-  // cleanup function
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  null, // extra prefs
-  false, // no window open test
-  false, // no user-interaction test
-  0, // no blocking notifications
-  false, // run in normal window
-  null, // no iframe sandbox
-  "navigate-topframe", // access removal type
-  // after-removal callback
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-  }
-);