Bug 1368712 - Get rid of nsIBrowserElementAPI.{set,get}Visible, r=kanru
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 31 May 2017 21:15:23 +0200
changeset 409771 78a9d7baaf8bf0073e06d8369ca33bd5134b92f9
parent 409770 16af57faa3e09019e7b69786e55c7c941e099836
child 409772 313abe9e730ed46ac008d9867cc1e9619eb881c8
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskanru
bugs1368712
milestone55.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 1368712 - Get rid of nsIBrowserElementAPI.{set,get}Visible, r=kanru
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/base/nsIFrameLoader.idl
dom/base/test/mozbrowser_api_utils.js
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/BrowserElementParent.js
dom/browser-element/mochitest/browserElement_SetVisible.js
dom/browser-element/mochitest/browserElement_SetVisibleFrames.js
dom/browser-element/mochitest/browserElement_SetVisibleFrames2.js
dom/browser-element/mochitest/browserElement_VisibilityChange.js
dom/browser-element/mochitest/chrome.ini
dom/browser-element/mochitest/file_browserElement_SetVisibleFrames2_Outer.html
dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html
dom/browser-element/mochitest/mochitest-oop.ini
dom/browser-element/mochitest/priority/chrome.ini
dom/browser-element/mochitest/priority/file_MultipleFrames.html
dom/browser-element/mochitest/priority/file_NestedFramesOuter.html
dom/browser-element/mochitest/priority/file_WebGLContextLost.html
dom/browser-element/mochitest/priority/mochitest.ini
dom/browser-element/mochitest/priority/silence.ogg
dom/browser-element/mochitest/priority/test_Background.html
dom/browser-element/mochitest/priority/test_MultipleFrames.html
dom/browser-element/mochitest/priority/test_NestedFrames.html
dom/browser-element/mochitest/priority/test_Simple.html
dom/browser-element/mochitest/priority/test_Visibility.html
dom/browser-element/mochitest/priority/test_WebGLContextLost.html
dom/browser-element/mochitest/test_browserElement_inproc_SetVisible.html
dom/browser-element/mochitest/test_browserElement_inproc_SetVisibleFrames.html
dom/browser-element/mochitest/test_browserElement_inproc_SetVisibleFrames2.html
dom/browser-element/mochitest/test_browserElement_inproc_VisibilityChange.html
dom/browser-element/mochitest/test_browserElement_oop_SetVisible.html
dom/browser-element/mochitest/test_browserElement_oop_SetVisibleFrames.html
dom/browser-element/mochitest/test_browserElement_oop_SetVisibleFrames2.html
dom/browser-element/mochitest/test_browserElement_oop_VisibilityChange.html
dom/browser-element/moz.build
dom/browser-element/nsIBrowserElementAPI.idl
dom/html/nsBrowserElement.cpp
dom/html/nsBrowserElement.h
dom/ipc/ProcessPriorityManager.cpp
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/webidl/BrowserElement.webidl
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -173,17 +173,16 @@ nsFrameLoader::nsFrameLoader(Element* aO
   , mInShow(false)
   , mHideCalled(false)
   , mNetworkCreated(aNetworkCreated)
   , mRemoteBrowserShown(false)
   , mRemoteFrame(false)
   , mClipSubdocument(true)
   , mClampScrollPosition(true)
   , mObservingOwnerContent(false)
-  , mVisible(true)
 {
   mRemoteFrame = ShouldUseRemoteProcess();
   MOZ_ASSERT(!mRemoteFrame || !aOpener,
              "Cannot pass aOpener for a remote frame!");
 }
 
 nsFrameLoader::~nsFrameLoader()
 {
@@ -3490,39 +3489,16 @@ nsFrameLoader::Print(uint64_t aOuterWind
     return NS_ERROR_FAILURE;
   }
 
   return webBrowserPrint->Print(aPrintSettings, aProgressListener);
 #endif
   return NS_OK;
 }
 
-/* [infallible] */ NS_IMETHODIMP
-nsFrameLoader::SetVisible(bool aVisible)
-{
-  if (mVisible == aVisible) {
-    return NS_OK;
-  }
-
-  mVisible = aVisible;
-  nsCOMPtr<nsIObserverService> os = services::GetObserverService();
-  if (os) {
-    os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this),
-                        "frameloader-visible-changed", nullptr);
-  }
-  return NS_OK;
-}
-
-/* [infallible] */ NS_IMETHODIMP
-nsFrameLoader::GetVisible(bool* aVisible)
-{
-  *aVisible = mVisible;
-  return NS_OK;
-}
-
 NS_IMETHODIMP
 nsFrameLoader::GetTabParent(nsITabParent** aTabParent)
 {
   nsCOMPtr<nsITabParent> tp = mRemoteBrowser;
   tp.forget(aTabParent);
   return NS_OK;
 }
 
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -370,16 +370,12 @@ private:
   bool mNetworkCreated : 1;
 
   bool mRemoteBrowserShown : 1;
   bool mRemoteFrame : 1;
   bool mClipSubdocument : 1;
   bool mClampScrollPosition : 1;
   bool mObservingOwnerContent : 1;
 
-  // Backs nsIFrameLoader::{Get,Set}Visible.  Visibility state here relates to
-  // whether this frameloader's <iframe mozbrowser> is setVisible(true)'ed, and
-  // doesn't necessarily correlate with docshell/document visibility.
-  bool mVisible : 1;
   bool mFreshProcess : 1;
 };
 
 #endif
--- a/dom/base/nsIFrameLoader.idl
+++ b/dom/base/nsIFrameLoader.idl
@@ -218,25 +218,16 @@ interface nsIFrameLoader : nsISupports
 
   /**
    * Cached childID of the ContentParent owning the TabParent in this frame
    * loader. This can be used to obtain the childID after the TabParent died.
    */
   readonly attribute unsigned long long childID;
 
   /**
-   * Get or set this frame loader's visibility.
-   *
-   * The notion of "visibility" here is separate from the notion of a
-   * window/docshell's visibility.  This field is mostly here so that we can
-   * have a notion of visibility in the parent process when frames are OOP.
-   */
-  [infallible] attribute boolean visible;
-
-  /**
    * Find out whether the owner content really is a mozbrowser. <xul:browser>
    * is not considered to be a mozbrowser frame.
    */
   readonly attribute boolean ownerIsMozBrowserFrame;
 
   /**
    * The last known width of the frame. Reading this property will not trigger
    * a reflow, and therefore may not reflect the current state of things. It
--- a/dom/base/test/mozbrowser_api_utils.js
+++ b/dom/base/test/mozbrowser_api_utils.js
@@ -1,15 +1,11 @@
 const FRAME_URL = "http://example.org/";
 
 const METHODS = {
-  setVisible: {},
-  getVisible: {},
-  setActive: {},
-  getActive: {},
   addNextPaintListener: {},
   removeNextPaintListener: {},
   sendMouseEvent: {},
   sendTouchEvent: {},
   goBack: {},
   goForward: {},
   reload: {},
   stop: {},
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -111,25 +111,16 @@ var LISTENED_SYSTEM_EVENTS = [
  */
 
 var global = this;
 
 function BrowserElementChild() {
   // Maps outer window id --> weak ref to window.  Used by modal dialog code.
   this._windowIDDict = {};
 
-  // _forcedVisible corresponds to the visibility state our owner has set on us
-  // (via iframe.setVisible).  ownerVisible corresponds to whether the docShell
-  // whose window owns this element is visible.
-  //
-  // Our docShell is visible iff _forcedVisible and _ownerVisible are both
-  // true.
-  this._forcedVisible = true;
-  this._ownerVisible = true;
-
   this._nextPaintHandler = null;
 
   this._isContentWindowCreated = false;
 
   this._init();
 };
 
 BrowserElementChild.prototype = {
@@ -281,18 +272,16 @@ BrowserElementChild.prototype = {
 
   receiveMessage: function(message) {
     let self = this;
 
     let mmCalls = {
       "purge-history": this._recvPurgeHistory,
       "get-screenshot": this._recvGetScreenshot,
       "get-contentdimensions": this._recvGetContentDimensions,
-      "set-visible": this._recvSetVisible,
-      "get-visible": this._recvVisible,
       "send-mouse-event": this._recvSendMouseEvent,
       "send-touch-event": this._recvSendTouchEvent,
       "get-can-go-back": this._recvCanGoBack,
       "get-can-go-forward": this._recvCanGoForward,
       "go-back": this._recvGoBack,
       "go-forward": this._recvGoForward,
       "reload": this._recvReload,
       "stop": this._recvStop,
@@ -1226,45 +1215,23 @@ BrowserElementChild.prototype = {
     // "Copy Image" menu item
     if (copyableElements.image) {
       menuObj.items.push({id: 'copy-image'});
     }
 
     return menuObj;
   },
 
-  _recvSetVisible: function(data) {
-    debug("Received setVisible message: (" + data.json.visible + ")");
-    if (this._forcedVisible == data.json.visible) {
-      return;
-    }
-
-    this._forcedVisible = data.json.visible;
-    this._updateVisibility();
-  },
-
-  _recvVisible: function(data) {
-    sendAsyncMsg('got-visible', {
-      id: data.json.id,
-      successRv: docShell.isActive
-    });
-  },
-
   /**
    * Called when the window which contains this iframe becomes hidden or
    * visible.
    */
   _recvOwnerVisibilityChange: function(data) {
     debug("Received ownerVisibilityChange: (" + data.json.visible + ")");
-    this._ownerVisible = data.json.visible;
-    this._updateVisibility();
-  },
-
-  _updateVisibility: function() {
-    var visible = this._forcedVisible && this._ownerVisible;
+    var visible = data.json.visible;
     if (docShell && docShell.isActive !== visible) {
       docShell.isActive = visible;
       sendAsyncMsg('visibilitychange', {visible: visible});
 
       // Ensure painting is not frozen if the app goes visible.
       if (visible && this._paintFrozenTimer) {
         this.notify();
       }
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -523,36 +523,16 @@ BrowserElementParent.prototype = {
     }
     else {
       debug("Got error in gotDOMRequestResult.");
       Services.DOMRequest.fireErrorAsync(req,
         Cu.cloneInto(data.json.errorMsg, this._window));
     }
   },
 
-  setVisible: defineNoReturnMethod(function(visible) {
-    this._sendAsyncMsg('set-visible', {visible: visible});
-    this._frameLoader.visible = visible;
-  }),
-
-  getVisible: defineDOMRequestMethod('get-visible'),
-
-  setActive: defineNoReturnMethod(function(active) {
-    this._frameLoader.visible = active;
-  }),
-
-  getActive: function() {
-    if (!this._isAlive()) {
-      throw Components.Exception("Dead content process",
-                                 Cr.NS_ERROR_DOM_INVALID_STATE_ERR);
-    }
-
-    return this._frameLoader.visible;
-  },
-
   getChildProcessOffset: function() {
     let offset = { x: 0, y: 0 };
     let tabParent = this._frameLoader.tabParent;
     if (tabParent) {
       let offsetX = {};
       let offsetY = {};
       tabParent.getChildProcessOffset(offsetX, offsetY);
       offset.x = offsetX.value;
@@ -879,21 +859,16 @@ BrowserElementParent.prototype = {
    */
   _ownerVisibilityChange: function() {
     this._sendAsyncMsg('owner-visibility-change',
                        {visible: !this._window.document.hidden});
   },
 
   /*
    * Called when the child notices that its visibility has changed.
-   *
-   * This is sometimes redundant; for example, the child's visibility may
-   * change in response to a setVisible request that we made here!  But it's
-   * not always redundant; for example, the child's visibility may change in
-   * response to its parent docshell being hidden.
    */
   _childVisibilityChange: function(data) {
     debug("_childVisibilityChange(" + data.json.visible + ")");
     this._frameLoader.visible = data.json.visible;
 
     this._fireEventFromMsg(data);
   },
 
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_SetVisible.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test the setVisible property for mozbrowser
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-browserElementTestHelpers.setEnabledPref(true);
-
-var iframeScript = function() {
-  content.document.addEventListener("visibilitychange", function() {
-    sendAsyncMessage('test:visibilitychange', {
-      hidden: content.document.hidden
-    });
-  });
-}
-
-function runTest() {
-  var mm;
-  var numEvents = 0;
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
-  iframe1.src = 'data:text/html,1';
-
-  document.body.appendChild(iframe1);
-
-  function recvVisibilityChanged(msg) {
-    msg = SpecialPowers.wrap(msg);
-    numEvents++;
-    if (numEvents === 1) {
-      ok(true, 'iframe recieved visibility changed');
-      ok(msg.json.hidden === true, 'hidden attribute correctly set');
-      iframe1.setVisible(false);
-      iframe1.setVisible(true);
-    } else if (numEvents === 2) {
-      ok(msg.json.hidden === false, 'hidden attribute correctly set');
-      // Allow some time in case we generate too many events
-      setTimeout(function() {
-        mm.removeMessageListener('test:visibilitychange', recvVisibilityChanged);
-        SimpleTest.finish();
-      }, 100);
-    } else {
-      ok(false, 'Too many visibilitychange events');
-    }
-  }
-
-  function iframeLoaded() {
-    testGetVisible();
-  }
-
-  function testGetVisible() {
-    iframe1.setVisible(false);
-    iframe1.getVisible().onsuccess = function(evt) {
-      ok(evt.target.result === false, 'getVisible() responds false after setVisible(false)');
-
-      iframe1.setVisible(true);
-      iframe1.getVisible().onsuccess = function(evt) {
-        ok(evt.target.result === true, 'getVisible() responds true after setVisible(true)');
-        testVisibilityChanges();
-      };
-    };
-  }
-
-  function testVisibilityChanges() {
-    mm = SpecialPowers.getBrowserFrameMessageManager(iframe1);
-    mm.addMessageListener('test:visibilitychange', recvVisibilityChanged);
-    mm.loadFrameScript('data:,(' + iframeScript.toString() + ')();', false);
-    iframe1.setVisible(false);
-  }
-
-  iframe1.addEventListener('mozbrowserloadend', iframeLoaded);
-}
-
-addEventListener('testready', runTest);
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_SetVisibleFrames.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Bug 762939 - Test that visibility propagates down properly through
-// hierarchies of <iframe mozbrowser>.
-//
-// In this test, we modify the parent's visibility and check that the child's
-// visibility is changed as appopriate.  We test modifying the child's
-// visibility in a separate testcase.
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-
-var iframe;
-
-function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-
-  // Our test involves three <iframe mozbrowser>'s, parent, child1, and child2.
-  // child1 and child2 are contained inside parent.  child1 is visibile, and
-  // child2 is not.
-  //
-  // For the purposes of this test, we want there to be a process barrier
-  // between child{1,2} and parent.  Therefore parent must be a non-remote
-  // <iframe mozbrowser>, until bug 761935 is resolved and we can have nested
-  // content processes.
-  iframe.remote = false;
-
-  iframe.addEventListener('mozbrowsershowmodalprompt', checkMessage);
-  expectMessage('parent:ready', test1);
-
-  document.body.appendChild(iframe);
-  iframe.src = 'file_browserElement_SetVisibleFrames_Outer.html';
-}
-
-function test1() {
-  expectMessage('child1:hidden', getVisibleTest1);
-  iframe.setVisible(false);
-}
-
-function getVisibleTest1() {
-  iframe.getVisible().onsuccess = function(evt) {
-    ok(evt.target.result === false, 'getVisible shows a hidden frame');
-    test2();
-  };
-}
-
-function test2() {
-  expectMessage('child1:visible', getVisibleTest2);
-  iframe.setVisible(true);
-}
-
-function getVisibleTest2() {
-  iframe.getVisible().onsuccess = function(evt) {
-    ok(evt.target.result === true, 'getVisible shows a displayed frame');
-    finish();
-  };
-}
-
-function finish() {
-  // We need to remove this listener because when this test finishes and the
-  // iframe containing this document is navigated, we'll fire a
-  // visibilitychange(false) event on all child iframes.  That's OK and
-  // expected, but if we don't remove our listener, then we'll end up causing
-  // the /next/ test to fail!
-  iframe.removeEventListener('mozbrowsershowmodalprompt', checkMessage);
-  SimpleTest.finish();
-}
-
-var expectedMsg = null;
-var expectedMsgCallback = null;
-function expectMessage(msg, next) {
-  expectedMsg = msg;
-  expectedMsgCallback = next;
-}
-
-function checkMessage(e) {
-  var msg = e.detail.message;
-  is(msg, expectedMsg);
-  if (msg == expectedMsg) {
-    expectedMsg = null;
-    SimpleTest.executeSoon(function() { expectedMsgCallback() });
-  }
-}
-
-addEventListener('testready', runTest);
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_SetVisibleFrames2.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Bug 762939 - Test that setting a <iframe mozbrowser> to invisible / visible
-// inside an invisible <iframe mozbrowser> doesn't trigger any events.
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-
-function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-
-  // We need remote = false here until bug 761935 is fixed; see
-  // SetVisibleFrames.js for an explanation.
-  iframe.remote = false;
-
-  iframe.addEventListener('mozbrowserloadend', function(e) {
-    iframe.setVisible(false);
-    iframe.src = 'file_browserElement_SetVisibleFrames2_Outer.html';
-  }, {once: true});
-
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    if (e.detail.message == 'parent:finish') {
-      ok(true, "Got parent:finish");
-
-      // Give any extra events a chance to fire, then end the test.
-      SimpleTest.executeSoon(function() {
-        SimpleTest.executeSoon(function() {
-          SimpleTest.executeSoon(function() {
-            SimpleTest.executeSoon(function() {
-              SimpleTest.executeSoon(function() {
-                finish();
-              });
-            });
-          });
-        });
-      });
-    }
-    else {
-      ok(false, "Got unexpected message: " + e.detail.message);
-    }
-  });
-
-  document.body.appendChild(iframe);
-}
-
-function finish() {
-  SimpleTest.finish();
-}
-
-addEventListener('testready', runTest);
deleted file mode 100644
--- a/dom/browser-element/mochitest/browserElement_VisibilityChange.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Any copyright is dedicated to the public domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that the onmozbrowservisibilitychange event works.
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-
-var iframe1 = null;
-function runTest() {
-  iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
-  document.body.appendChild(iframe1);
-
-  iframe1.src = 'data:text/html,<html><head><title>Title</title></head><body></body></html>';
-  checkVisibilityFalse();
-}
-
-function checkVisibilityFalse() {
-  iframe1.addEventListener('mozbrowservisibilitychange', function onvisibilitychange(e) {
-    iframe1.removeEventListener(e.type, onvisibilitychange);
-
-    is(e.detail.visible, false, 'Visibility should be false');
-    checkVisibilityTrue();
-  });
-
-  iframe1.setVisible(false);
-}
-
-function checkVisibilityTrue() {
-  iframe1.addEventListener('mozbrowservisibilitychange', function onvisibilitychange(e) {
-    iframe1.removeEventListener(e.type, onvisibilitychange);
-
-    is(e.detail.visible, true, 'Visibility should be true');
-    SimpleTest.finish();
-  });
-
-  iframe1.setVisible(true);
-}
-
-addEventListener('testready', runTest);
--- a/dom/browser-element/mochitest/chrome.ini
+++ b/dom/browser-element/mochitest/chrome.ini
@@ -15,27 +15,20 @@ support-files =
   browserElement_GetContentDimensions.js
   browserElement_GetScreenshot.js
   browserElement_GetScreenshotDppx.js
   browserElement_getWebManifest.js
   browserElement_NextPaint.js
   browserElement_PurgeHistory.js
   browserElement_ReloadPostRequest.js
   browserElement_SendEvent.js
-  browserElement_SetVisible.js
-  browserElement_SetVisibleFrames.js
-  browserElement_SetVisibleFrames2.js
   browserElement_Stop.js
-  browserElement_VisibilityChange.js
   file_browserElement_ExecuteScript.html
   file_browserElement_NextPaint.html
   file_browserElement_SendEvent.html
-  file_browserElement_SetVisibleFrames2_Outer.html
-  file_browserElement_SetVisibleFrames_Inner.html
-  file_browserElement_SetVisibleFrames_Outer.html
   file_bug709759.sjs
   file_empty.html
   file_post_request.html
   file_web_manifest.html
   file_web_manifest.json
   file_illegal_web_manifest.html
 
 [test_browserElement_inproc_AudioPlayback.html]
@@ -50,13 +43,9 @@ skip-if = true # bug 1332850, bug 133286
 [test_browserElement_inproc_GetScreenshot.html]
 [test_browserElement_inproc_GetScreenshotDppx.html]
 [test_browserElement_inproc_getWebManifest.html]
 [test_browserElement_inproc_NextPaint.html]
 [test_browserElement_inproc_PurgeHistory.html]
 [test_browserElement_inproc_ReloadPostRequest.html]
 disabled = no modal prompt on POST reload for chrome window
 [test_browserElement_inproc_SendEvent.html]
-[test_browserElement_inproc_SetVisible.html]
-[test_browserElement_inproc_SetVisibleFrames.html]
-[test_browserElement_inproc_SetVisibleFrames2.html]
 [test_browserElement_inproc_Stop.html]
-[test_browserElement_inproc_VisibilityChange.html]
deleted file mode 100644
--- a/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames2_Outer.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<html>
-<body>
-<script>
-
-var iframe = document.createElement('iframe');
-iframe.setAttribute("mozbrowser", "true");
-
-iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-  if (e.detail.message == 'child:ready') {
-    setTimeout(function() {
-      iframe.setVisible(false);
-      iframe.setVisible(true);
-      setTimeout(function() {
-        alert('parent:finish');
-      }, 0);
-    }, 0);
-  }
-});
-
-document.body.appendChild(iframe);
-iframe.src = 'file_browserElement_SetVisibleFrames_Inner.html?child';
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>
-<body>
-
-<script>
-
-var numPrompts = 0;
-function handlePrompt(e) {
-  numPrompts++;
-
-  // The first two prompts should be "child1:ready" and "child2:ready".  Once
-  // we get both of these, forward the child's prompt up to our parent.
-  if (numPrompts == 2) {
-    // This has to happen here, because setVisibile doesn't exist on the iframe
-    // until BrowserElementChild.js is loaded in it.  (That's pretty broken...)
-    iframe2.setVisible(false);
-  }
-  else if (numPrompts == 3) {
-    if (e.detail.message != 'child2:hidden') {
-      alert("parent:fail Didn't get expected 'child2:hidden'.");
-    }
-
-    alert('parent:ready');
-  }
-  else if (numPrompts == 4 || numPrompts == 5) {
-    alert(e.detail.message);
-  }
-}
-
-var iframe1 = document.createElement('iframe');
-iframe1.setAttribute("mozbrowser", "true");
-iframe1.addEventListener('mozbrowsershowmodalprompt', handlePrompt);
-
-var iframe2 = document.createElement('iframe');
-iframe2.setAttribute("mozbrowser", "true");
-iframe2.addEventListener('mozbrowsershowmodalprompt', handlePrompt);
-
-iframe1.src = 'file_browserElement_SetVisibleFrames_Inner.html?child1';
-iframe2.src = 'file_browserElement_SetVisibleFrames_Inner.html?child2';
-document.body.appendChild(iframe1);
-document.body.appendChild(iframe2);
-
-</script>
-
-</body>
-</html>
--- a/dom/browser-element/mochitest/mochitest-oop.ini
+++ b/dom/browser-element/mochitest/mochitest-oop.ini
@@ -75,30 +75,22 @@ disabled = Disabling some OOP tests for 
 [test_browserElement_oop_ReloadPostRequest.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_RemoveBrowserElement.html]
 [test_browserElement_oop_ScrollEvent.html]
 [test_browserElement_oop_SecurityChange.html]
 skip-if = toolkit == 'android' #TIMED_OUT, bug 766586
 [test_browserElement_oop_SendEvent.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
-[test_browserElement_oop_SetVisible.html]
-disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
-[test_browserElement_oop_SetVisibleFrames.html]
-disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
-[test_browserElement_oop_SetVisibleFrames2.html]
-disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_Stop.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_TargetBlank.html]
 [test_browserElement_oop_TargetTop.html]
 [test_browserElement_oop_Titlechange.html]
 [test_browserElement_oop_TopBarrier.html]
-[test_browserElement_oop_VisibilityChange.html]
-disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_XFrameOptions.html]
 [test_browserElement_oop_XFrameOptionsAllowFrom.html]
 #skip-if = asan # bug 1189592 - should be OK when ASAN mochitests are on Ubuntu 16.04
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_XFrameOptionsDeny.html]
 disabled = Disabling some OOP tests for WebIDL scope changes (bug 1310706 for re-enabling)
 [test_browserElement_oop_XFrameOptionsSameOrigin.html]
 [test_browserElement_oop_ContextmenuEvents.html]
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/chrome.ini
+++ /dev/null
@@ -1,16 +0,0 @@
-[DEFAULT]
-# Good luck running these tests on anything but desktop Linux.
-run-if = os == 'linux' && buildapp == 'browser' && !e10s
-support-files =
-  file_MultipleFrames.html
-  file_NestedFramesOuter.html
-  file_WebGLContextLost.html
-  silence.ogg
-  !/dom/browser-element/mochitest/browserElementTestHelpers.js
-  !/dom/browser-element/mochitest/file_empty.html
-
-[test_Activity.html]
-[test_Background.html]
-[test_MultipleFrames.html]
-[test_NestedFrames.html]
-[test_Visibility.html]
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/file_MultipleFrames.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-<body>
-<p>file_MultipleFrames.html</p>
-
-<script>
-addEventListener('load', function() {
-  setTimeout(function() {
-    window.open('../file_empty.html');
-  }, 0);
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/file_NestedFramesOuter.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<html>
-<body>
-<p>file_NestedFramesOuter.html</p>
-<script>
-
-addEventListener('load', function() {
-  setTimeout(createIframe, 0);
-});
-
-function createIframe()
-{
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.src = location.hash.substr(1);
-  document.body.appendChild(iframe);
-}
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/file_WebGLContextLost.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<body>
-file_WebGLContextLost.html
-<canvas id='canvas'></canvas>
-
-<script>
-function runTest()
-{
-  var canvas = document.getElementById('canvas');
-  canvas.addEventListener('webglcontextlost', function() {
-    alert('webglcontextlost');
-  });
-
-  var context = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
-  context.viewport(0, 0, 10, 10);
-  alert('ready');
-}
-
-addEventListener('load', function() { setTimeout(runTest, 0) });
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/mochitest.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-# Good luck running these tests on anything but desktop Linux.
-run-if = os == 'linux' && buildapp == 'browser' && !e10s
-support-files =
-  silence.ogg
-  !/dom/browser-element/mochitest/browserElementTestHelpers.js
-  !/dom/browser-element/mochitest/file_empty.html
-
-# Note: ../browserElementTestHelpers.js makes all tests in this directory OOP,
-# because testing the process-priority manager without OOP frames does not make
-# much sense.
-
-[test_Simple.html]
-[test_WebGLContextLost.html]
-disabled = bug 865844
deleted file mode 100644
index 6e0b352a321ae89cc2f41a008c660c8bf421afc2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_Background.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test that calling setVisible('false') on an iframe causes its visibility to
-change.
--->
-<head>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.enableProcessPriorityManager();
-
-function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-
-  iframe.src = browserElementTestHelpers.emptyPage1;
-
-  var childID = null;
-  Promise.all([
-    expectOnlyOneProcessCreated('FOREGROUND').then(function(chid) {
-      childID = chid;
-    }),
-    expectMozbrowserEvent(iframe, 'loadend')
-  ]).then(function() {
-    var p = expectPriorityChange(childID, 'BACKGROUND');
-
-    // We wait until mozbrowserloadend before calling setVisible, because
-    // setVisible isn't available until mozbrowser has loaded.  In practice, that
-    // means we can call setVisible once we've gotten /any/ mozbrowser event.
-    iframe.setVisible(false);
-    return p;
-  }).then(function() {
-    var p = expectPriorityChange(childID, 'FOREGROUND');
-    iframe.setVisible(true);
-  }).then(SimpleTest.finish);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', runTest);
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_MultipleFrames.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test that when we remove one of a process's frames from the DOM, the process's
-priority is recomputed.
--->
-<head>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.enableProcessPriorityManager();
-
-function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.src = 'file_MultipleFrames.html';
-
-  var childID = null;
-  var iframe2;
-  Promise.all([
-    expectProcessCreated('FOREGROUND').then(function(chid) {
-      childID = chid;
-    }),
-    new Promise(function(resolve, reject) {
-      iframe.addEventListener('mozbrowseropenwindow', function(e) {
-        iframe2 = e.detail.frameElement;
-        var p = expectMozbrowserEvent(iframe2, 'loadend');
-        document.body.appendChild(iframe2);
-        resolve(p);
-      });
-    })
-  ]).then(function() {
-    // At this point, the child process has been set to FOREGROUND, and the popup
-    // opened by file_MultipleFrames has finished loading.
-    //
-    // Now setVisible(false) the popup frame and remove the popup frame from the
-    // DOM.  This should cause the process to take on BACKGROUND priority.
-    var p = expectPriorityChange(childID, 'BACKGROUND');
-    iframe.setVisible(false);
-    document.body.removeChild(iframe2);
-    return p;
-  }).then(SimpleTest.finish);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', runTest);
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_NestedFrames.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test changing the visibility of an <iframe mozbrowser> changes the visibility
-(and thus the priority) of any <iframe mozbrowser>s it contains.
--->
-<head>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.enableProcessPriorityManager();
-
-function runTest() {
-  // Set up the following hierarchy of frames:
-  //
-  //   <iframe mozbrowser remote=false src='file_NestedFramesOuter.html'>
-  //     <iframe mozbrowser remote=true src='file_empty.html'>
-  //
-  // When we change the visibility of the outer iframe, it should change the
-  // priority of the inner one.
-
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.setAttribute('remote', false);
-  iframe.src = 'file_NestedFramesOuter.html#' + browserElementTestHelpers.emptyPage1;
-
-  // Note that this is the process corresponding to the /inner/ iframe.  The
-  // outer iframe runs in-process (because it has remote=false).
-  var childID = null;
-  Promise.all(
-    [expectOnlyOneProcessCreated('FOREGROUND').then(function(child) {
-       childID = child;
-     }),
-     expectMozbrowserEvent(iframe, 'loadend')]
-  ).then(function() {
-    // Send the outer iframe into the background.  This should change the
-    // priority of the inner frame's process to BACKGROUND.
-    var p = expectPriorityChange(childID, 'BACKGROUND');
-    iframe.setVisible(false);
-    return p;
-  }).then(function() {
-    var p = expectPriorityChange(childID, 'FOREGROUND');
-    iframe.setVisible(true);
-    return p;
-  }).then(SimpleTest.finish);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', runTest);
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_Simple.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-A simple test of the process priority manager.
-
-https://bugzilla.mozilla.org/show_bug.cgi?id=844323
-
-Note: If you run this test alone (i.e. not as part of the larger mochitest
-suite), you may see some IPC assertions, e.g. "Can't allocate graphics
-resources."
-
-What appears to be happening is that we close the Firefox window before the
-frame we create in this tab finishes starting up.  Then the frame finishes
-loading, and it tries to show itself.  But it's too late to show a remote frame
-at that point, so we kill the child process.
-
-In other words, I think these errors are nothing to worry about.
--->
-<head>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.addPermission();
-browserElementTestHelpers.enableProcessPriorityManager();
-
-var allCompleted = 0;
-var allExpected  = 2;
-function finish() {
-  allCompleted++;
-  if (allCompleted === allExpected) {
-    SimpleTest.finish();
-  }
-}
-
-function runTest() {
-  var iframeLoaded = false;
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.src = browserElementTestHelpers.emptyPage1;
-
-  iframe.addEventListener('mozbrowserloadend', finish);
-  expectProcessCreated('FOREGROUND').then(finish);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', runTest);
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_Visibility.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test that setVisible() changes a process's priority.
--->
-<head>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.enableProcessPriorityManager();
-
-function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.src = browserElementTestHelpers.emptyPage1;
-
-  var childID = null;
-  Promise.all([
-    expectOnlyOneProcessCreated('FOREGROUND').then(function(chid) {
-      childID = chid;
-    }),
-    expectMozbrowserEvent(iframe, 'loadend')
-  ]).then(function() {
-    // Mark the frame as not visible.  This should cause its priority to drop
-    // to BACKGROUND.
-    var p = expectPriorityChange(childID, 'BACKGROUND');
-    iframe.setVisible(false);
-    return p;
-  }).then(function() {
-    // Mark the frame as visible again.  This should cause its priority change
-    // back to FOREGROUND.
-    var p = expectPriorityChange(childID, 'FOREGROUND');
-    iframe.setVisible(true);
-    return p;
-  }).then(SimpleTest.finish);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', runTest);
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/priority/test_WebGLContextLost.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-Test that calling setVisible('false') and then sending a low-memory
-notification causes a WebGL context loss event.
--->
-<head>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="../browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-browserElementTestHelpers.setEnabledPref(true);
-browserElementTestHelpers.addPermission();
-browserElementTestHelpers.enableProcessPriorityManager();
-
-function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', true);
-  iframe.src = 'file_WebGLContextLost.html';
-
-  // We use this to ensure that we don't call SimpleTest.finish() twice.
-  var finished = false;
-  function finishOnce() {
-    if (!finished) {
-      SimpleTest.finish();
-      finished = true;
-    }
-  }
-
-  expectMozbrowserEvent(iframe, 'error').then(function(e) {
-    if (finished) {
-      // We don't care if the frame dies after the test finishes.
-      return;
-    }
-    todo(false, "child process is crashing; this probably indicates that " +
-         "something is wrong with WebGL in child processes on your machine.");
-    is(e.detail.type, 'fatal');
-  }).then(finishOnce);
-
-  var childID = null;
-  Promise.all([
-    expectOnlyOneProcessCreated('FOREGROUND').then(function(chid) {
-      childID = chid;
-    }),
-    expectMozbrowserEvent(iframe, 'loadend'),
-    expectMozbrowserEvent(iframe, 'showmodalprompt').then(function(e) {
-      is(e.detail.message, 'ready');
-    })
-  ]).then(function() {
-    // Fire a low-memory notification once the process goes into the background
-    // due to the setVisible(false) call below.
-    expectPriorityChange(childID, 'BACKGROUND').then(function() {
-      SimpleTest.executeSoon(function() {
-        var os = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
-                              .getService(SpecialPowers.Ci.nsIObserverService);
-        os.notifyObservers(null, "memory-pressure", "low-memory");
-        ok(true, 'Successfully notified observers.');
-      });
-    });
-
-    // This test isn't the only possible source of a low-memory notification; the
-    // browser can fire one whenever it likes.  So it's fine if we lose the
-    // WebGL context before we fire the low-memory notification ourself.
-
-    var p = expectMozbrowserEvent(iframe, 'showmodalprompt').then(function(e) {
-      is(e.detail.message, 'webglcontextlost');
-    });
-
-    iframe.setVisible(false);
-    return p;
-  }).then(finishOnce);
-
-  document.body.appendChild(iframe);
-}
-
-addEventListener('testready', function() {
-  // At the time this test was written, webgl was blocklisted inside child
-  // processes on desktop Linux.  The issue is that we spawn a child process to
-  // read driver info, but we only did this on the main prrocess.  Child
-  // processes never read the driver info themselves, nor do they get it from
-  // their parent, so they refuse to start up WebGL.
-  //
-  // This isn't a problem on B2G because we force WebGL on there.  But it
-  // obviously makes this test difficult.  bjacob says forcing WebGL on here
-  // shouldn't hurt things, and anyway this setting mirrors what we do on B2G,
-  // which is what we're trying to test!
-  SpecialPowers.pushPrefEnv({set: [["webgl.force-enabled", true]]},
-                            runTest);
-});
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_SetVisible.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=702880
--->
- <head>
-  <title>Test for Bug 702880</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753595">Mozilla Bug 702880</a>
-
-<script type="application/javascript" src='browserElement_SetVisible.js'>
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_SetVisibleFrames.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Bug 762939</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<script type="application/javascript" src="browserElement_SetVisibleFrames.js">
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_SetVisibleFrames2.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Bug 762939</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<script type="application/javascript" src="browserElement_SetVisibleFrames2.js">
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_inproc_VisibilityChange.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=868816
--->
-<head>
-  <title>Test for Bug 868816</title>
-  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868816">Mozilla Bug 868816</a>
-
-<script type="application/javascript" src='browserElement_VisibilityChange.js'>
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_SetVisible.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=702880
--->
- <head>
-  <title>Test for Bug 702880</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=753595">Mozilla Bug 702880</a>
-
-<script type="application/javascript" src='browserElement_SetVisible.js'>
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_SetVisibleFrames.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Bug 762939</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<script type="application/javascript" src="browserElement_SetVisibleFrames.js">
-</script>
-</body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_SetVisibleFrames2.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Bug 762939</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<script type="application/javascript" src="browserElement_SetVisibleFrames2.js">
-</script>
-</body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/dom/browser-element/mochitest/test_browserElement_oop_VisibilityChange.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=868816
--->
-<head>
-  <title>Test for Bug 868816</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="browserElementTestHelpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868816">Mozilla Bug 868816</a>
-
-<script type="application/javascript" src='browserElement_VisibilityChange.js'>
-</script>
-
-</body>
-</html>
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -42,15 +42,13 @@ LOCAL_INCLUDES += [
     '/dom/',
     '/dom/base',
     '/dom/ipc',
 ]
 
 MOCHITEST_MANIFESTS += [
     'mochitest/mochitest-oop.ini',
     'mochitest/mochitest.ini',
-    'mochitest/priority/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'mochitest/chrome.ini',
-    'mochitest/priority/chrome.ini',
 ]
--- a/dom/browser-element/nsIBrowserElementAPI.idl
+++ b/dom/browser-element/nsIBrowserElementAPI.idl
@@ -37,21 +37,16 @@ interface nsIBrowserElementAPI : nsISupp
 
   /**
    * Notify frame scripts that support the API to destroy.
    */
   void destroyFrameScripts();
 
   void setFrameLoader(in nsIFrameLoader frameLoader);
 
-  void setVisible(in boolean visible);
-  nsIDOMDOMRequest getVisible();
-  void setActive(in boolean active);
-  boolean getActive();
-
   void sendMouseEvent(in DOMString type,
                       in uint32_t x,
                       in uint32_t y,
                       in uint32_t button,
                       in uint32_t clickCount,
                       in uint32_t mifiers);
   void sendTouchEvent(in DOMString aType,
                       [const, array, size_is(count)] in uint32_t aIdentifiers,
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -62,72 +62,16 @@ nsBrowserElement::DestroyBrowserElementF
 {
   if (!mBrowserElementAPI) {
     return;
   }
   mBrowserElementAPI->DestroyFrameScripts();
 }
 
 void
-nsBrowserElement::SetVisible(bool aVisible, ErrorResult& aRv)
-{
-  NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
-
-  nsresult rv = mBrowserElementAPI->SetVisible(aVisible);
-
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-  }
-}
-
-already_AddRefed<DOMRequest>
-nsBrowserElement::GetVisible(ErrorResult& aRv)
-{
-  NS_ENSURE_TRUE(IsBrowserElementOrThrow(aRv), nullptr);
-
-  nsCOMPtr<nsIDOMDOMRequest> req;
-  nsresult rv = mBrowserElementAPI->GetVisible(getter_AddRefs(req));
-
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return nullptr;
-  }
-
-  return req.forget().downcast<DOMRequest>();
-}
-
-void
-nsBrowserElement::SetActive(bool aVisible, ErrorResult& aRv)
-{
-  NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
-
-  nsresult rv = mBrowserElementAPI->SetActive(aVisible);
-
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-  }
-}
-
-bool
-nsBrowserElement::GetActive(ErrorResult& aRv)
-{
-  NS_ENSURE_TRUE(IsBrowserElementOrThrow(aRv), false);
-
-  bool isActive;
-  nsresult rv = mBrowserElementAPI->GetActive(&isActive);
-
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
-    return false;
-  }
-
-  return isActive;
-}
-
-void
 nsBrowserElement::SendMouseEvent(const nsAString& aType,
                                  uint32_t aX,
                                  uint32_t aY,
                                  uint32_t aButton,
                                  uint32_t aClickCount,
                                  uint32_t aModifiers,
                                  ErrorResult& aRv)
 {
--- a/dom/html/nsBrowserElement.h
+++ b/dom/html/nsBrowserElement.h
@@ -31,21 +31,16 @@ class ErrorResult;
  * A helper class for browser-element frames
  */
 class nsBrowserElement
 {
 public:
   nsBrowserElement() {}
   virtual ~nsBrowserElement() {}
 
-  void SetVisible(bool aVisible, ErrorResult& aRv);
-  already_AddRefed<dom::DOMRequest> GetVisible(ErrorResult& aRv);
-  void SetActive(bool aActive, ErrorResult& aRv);
-  bool GetActive(ErrorResult& aRv);
-
   void SendMouseEvent(const nsAString& aType,
                       uint32_t aX,
                       uint32_t aY,
                       uint32_t aButton,
                       uint32_t aClickCount,
                       uint32_t aModifiers,
                       ErrorResult& aRv);
   void SendTouchEvent(const nsAString& aType,
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -256,17 +256,16 @@ public:
    * destroyed, whichever comes first.
    */
   const nsAutoCString& NameWithComma();
 
   bool IsExpectingSystemMessage();
 
   void OnRemoteBrowserFrameShown(nsISupports* aSubject);
   void OnTabParentDestroyed(nsISupports* aSubject);
-  void OnFrameloaderVisibleChanged(nsISupports* aSubject);
   void OnActivityOpened(const char16_t* aData);
   void OnActivityClosed(const char16_t* aData);
 
   ProcessPriority CurrentPriority();
   ProcessPriority ComputePriority();
 
   enum TimeoutPref {
     BACKGROUND_PERCEIVABLE_GRACE_PERIOD,
@@ -587,17 +586,16 @@ void
 ParticularProcessPriorityManager::Init()
 {
   RegisterWakeLockObserver(this);
 
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   if (os) {
     os->AddObserver(this, "remote-browser-shown", /* ownsWeak */ true);
     os->AddObserver(this, "ipc:browser-destroyed", /* ownsWeak */ true);
-    os->AddObserver(this, "frameloader-visible-changed", /* ownsWeak */ true);
     os->AddObserver(this, "activity-opened", /* ownsWeak */ true);
     os->AddObserver(this, "activity-closed", /* ownsWeak */ true);
   }
 
   // This process may already hold the CPU lock; for example, our parent may
   // have acquired it on our behalf.
   WakeLockInformation info1, info2;
   GetWakeLockInfo(NS_LITERAL_STRING("cpu"), &info1);
@@ -661,18 +659,16 @@ ParticularProcessPriorityManager::Observ
   }
 
   nsDependentCString topic(aTopic);
 
   if (topic.EqualsLiteral("remote-browser-shown")) {
     OnRemoteBrowserFrameShown(aSubject);
   } else if (topic.EqualsLiteral("ipc:browser-destroyed")) {
     OnTabParentDestroyed(aSubject);
-  } else if (topic.EqualsLiteral("frameloader-visible-changed")) {
-    OnFrameloaderVisibleChanged(aSubject);
   } else if (topic.EqualsLiteral("activity-opened")) {
     OnActivityOpened(aData);
   } else if (topic.EqualsLiteral("activity-closed")) {
     OnActivityClosed(aData);
   } else {
     MOZ_ASSERT(false);
   }
 
@@ -751,48 +747,16 @@ ParticularProcessPriorityManager::OnTabP
   if (TabParent::GetFrom(tp)->Manager() != mContentParent) {
     return;
   }
 
   ResetPriority();
 }
 
 void
-ParticularProcessPriorityManager::OnFrameloaderVisibleChanged(nsISupports* aSubject)
-{
-  nsCOMPtr<nsIFrameLoader> fl = do_QueryInterface(aSubject);
-  NS_ENSURE_TRUE_VOID(fl);
-
-  TabParent* tp = TabParent::GetFrom(fl);
-  if (!tp) {
-    return;
-  }
-
-  MOZ_ASSERT(XRE_IsParentProcess());
-  if (tp->Manager() != mContentParent) {
-    return;
-  }
-
-  // Most of the time when something changes in a process we call
-  // ResetPriority(), giving a grace period before downgrading its priority.
-  // But notice that here don't give a grace period: We call ResetPriorityNow()
-  // instead.
-  //
-  // We do this because we're reacting here to a setVisibility() call, which is
-  // an explicit signal from the process embedder that we should re-prioritize
-  // a process.  If we gave a grace period in response to setVisibility()
-  // calls, it would be impossible for the embedder to explicitly prioritize
-  // processes and prevent e.g. the case where we switch which process is in
-  // the foreground and, during the old fg processs's grace period, it OOMs the
-  // new fg process.
-
-  ResetPriorityNow();
-}
-
-void
 ParticularProcessPriorityManager::OnActivityOpened(const char16_t* aData)
 {
   uint64_t childID = nsCRT::atoll(NS_ConvertUTF16toUTF8(aData).get());
 
   if (ChildID() == childID) {
     LOGP("Marking as activity opener");
     mIsActivityOpener = true;
     ResetPriority();
@@ -894,29 +858,18 @@ ProcessPriority
 ParticularProcessPriorityManager::CurrentPriority()
 {
   return mPriority;
 }
 
 ProcessPriority
 ParticularProcessPriorityManager::ComputePriority()
 {
-  bool isVisible = false;
-  const ManagedContainer<PBrowserParent>& browsers =
-    mContentParent->ManagedPBrowserParent();
-  for (auto iter = browsers.ConstIter(); !iter.Done(); iter.Next()) {
-    if (TabParent::GetFrom(iter.Get()->GetKey())->IsVisible()) {
-      isVisible = true;
-      break;
-    }
-  }
-
-  if (isVisible) {
-    return PROCESS_PRIORITY_FOREGROUND;
-  }
+  // TODO...
+  return PROCESS_PRIORITY_FOREGROUND;
 
   if ((mHoldsCPUWakeLock || mHoldsHighPriorityWakeLock) &&
       IsExpectingSystemMessage()) {
     return PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE;
   }
 
   return mIsActivityOpener ? PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE
                            : PROCESS_PRIORITY_BACKGROUND;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -315,27 +315,16 @@ TabParent::RemoveWindowListeners()
     nsCOMPtr<EventTarget> eventTarget = window->GetTopWindowRoot();
     if (eventTarget) {
       eventTarget->RemoveEventListener(NS_LITERAL_STRING("MozUpdateWindowPos"),
                                        this, false);
     }
   }
 }
 
-bool
-TabParent::IsVisible() const
-{
-  RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
-  if (!frameLoader) {
-    return false;
-  }
-
-  return frameLoader->GetVisible();
-}
-
 void
 TabParent::DestroyInternal()
 {
   IMEStateManager::OnTabParentDestroying(this);
 
   RemoveWindowListeners();
 
 #ifdef ACCESSIBILITY
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -113,24 +113,16 @@ public:
 
   Element* GetOwnerElement() const { return mFrameElement; }
   already_AddRefed<nsPIDOMWindowOuter> GetParentWindowOuter();
 
   void SetOwnerElement(Element* aElement);
 
   void CacheFrameLoader(nsFrameLoader* aFrameLoader);
 
-  /**
-   * Returns true iff this TabParent's nsIFrameLoader is visible.
-   *
-   * The frameloader's visibility can be independent of e.g. its docshell's
-   * visibility.
-   */
-  bool IsVisible() const;
-
   nsIBrowserDOMWindow *GetBrowserDOMWindow() const { return mBrowserDOMWindow; }
 
   void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow)
   {
     mBrowserDOMWindow = aBrowserDOMWindow;
   }
 
   void SetHasContentOpener(bool aHasContentOpener);
--- a/dom/webidl/BrowserElement.webidl
+++ b/dom/webidl/BrowserElement.webidl
@@ -26,36 +26,16 @@ interface BrowserElement {
 BrowserElement implements BrowserElementCommon;
 BrowserElement implements BrowserElementPrivileged;
 
 [NoInterfaceObject]
 interface BrowserElementCommon {
   [Throws,
    Pref="dom.mozBrowserFramesEnabled",
    ChromeOnly]
-  void setVisible(boolean visible);
-
-  [Throws,
-   Pref="dom.mozBrowserFramesEnabled",
-   ChromeOnly]
-  DOMRequest getVisible();
-
-  [Throws,
-   Pref="dom.mozBrowserFramesEnabled",
-   ChromeOnly]
-  void setActive(boolean active);
-
-  [Throws,
-   Pref="dom.mozBrowserFramesEnabled",
-   ChromeOnly]
-  boolean getActive();
-
-  [Throws,
-   Pref="dom.mozBrowserFramesEnabled",
-   ChromeOnly]
   void addNextPaintListener(BrowserElementNextPaintEventCallback listener);
 
   [Throws,
    Pref="dom.mozBrowserFramesEnabled",
    ChromeOnly]
   void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
 };