Backout due to mobile failures these changesets: 9f451a1901dd, e99f86ba7278, 447b48b79e6a, cef046665c53, c9237cc1fae0, d77a331a6d5a, f8f3afb95355, a050168887ee, 3ec4303ebf4d, 671b7c0d99f0, 56b17efbb62b, beceddeee3f4 on a CLOSED TREE
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 01 Jul 2011 16:28:07 +0200
changeset 72641 317d287b6db82c4ce8cb79e2d2b171cb4e08b8b9
parent 72629 9f451a1901ddec8f5d3e4003845f5ca3683ab0a7
child 72642 71fce8f097f507e45e7b0efc477c88ef4117ac09
push idunknown
push userunknown
push dateunknown
milestone7.0a1
Backout due to mobile failures these changesets: 9f451a1901dd, e99f86ba7278, 447b48b79e6a, cef046665c53, c9237cc1fae0, d77a331a6d5a, f8f3afb95355, a050168887ee, 3ec4303ebf4d, 671b7c0d99f0, 56b17efbb62b, beceddeee3f4 on a CLOSED TREE
browser/app/profile/firefox.js
browser/base/content/browser.js
browser/base/content/content.js
browser/base/content/tabbrowser.xml
browser/base/jar.mn
configure.in
content/base/public/nsIFrameLoader.idl
content/base/src/nsFrameLoader.cpp
content/base/src/nsFrameLoader.h
content/events/src/nsEventStateManager.cpp
content/events/src/nsEventStateManager.h
content/html/content/reftests/autofocus/input-load.html
content/xbl/crashtests/crashtests.list
dom/base/nsFocusManager.cpp
dom/base/nsFocusManager.h
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/test.xul
mobile/chrome/content/bindings/browser.xml
mobile/chrome/content/browser.js
mobile/chrome/tests/Makefile.in
mobile/chrome/tests/browser_focus.html
mobile/chrome/tests/browser_focus.js
mobile/chrome/tests/remote_focus.js
modules/libpref/src/init/all.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
toolkit/content/widgets/browser.xml
widget/public/nsGUIEvent.h
widget/public/nsGUIEventIPC.h
widget/src/xpwidgets/PuppetWidget.cpp
widget/src/xpwidgets/PuppetWidget.h
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -894,20 +894,16 @@ pref("dom.ipc.plugins.enabled.i386.flash
 pref("dom.ipc.plugins.enabled.i386.javaplugin2_npapi.plugin", true);
 pref("dom.ipc.plugins.enabled.i386.javaappletplugin.plugin", true);
 // x86_64 ipc preferences
 pref("dom.ipc.plugins.enabled.x86_64", true);
 #else
 pref("dom.ipc.plugins.enabled", true);
 #endif
 
-#ifdef MOZ_E10S_COMPAT
-pref("browser.tabs.remote", true);
-#endif
-
 // This pref governs whether we attempt to work around problems caused by
 // plugins using OS calls to manipulate the cursor while running out-of-
 // process.  These workarounds all involve intercepting (hooking) certain
 // OS calls in the plugin process, then arranging to make certain OS calls
 // in the browser process.  Eventually plugins will be required to use the
 // NPAPI to manipulate the cursor, and these workarounds will be removed.
 // See bug 621117.
 #ifdef XP_MACOSX
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1410,18 +1410,16 @@ function prepareForStartup() {
     if (!webNavigation)
       throw "no XBL binding for browser";
   } catch (e) {
     alert("Error launching browser window:" + e);
     window.close(); // Give up.
     return;
   }
 
-  messageManager.loadFrameScript("chrome://browser/content/content.js", true);
-
   // initialize observers and listeners
   // and give C++ access to gBrowser
   gBrowser.init();
   XULBrowserWindow.init();
   window.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(nsIWebNavigation)
         .QueryInterface(Ci.nsIDocShellTreeItem).treeOwner
         .QueryInterface(Ci.nsIInterfaceRequestor)
@@ -1456,23 +1454,19 @@ function prepareForStartup() {
 
   // enable global history
   try {
     gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
   } catch(ex) {
     Components.utils.reportError("Places database may be locked: " + ex);
   }
 
-#ifdef MOZ_E10S_COMPAT
-  // Bug 666801 - WebProgress support for e10s
-#else
   // hook up UI through progress listener
   gBrowser.addProgressListener(window.XULBrowserWindow);
   gBrowser.addTabsProgressListener(window.TabsProgressListener);
-#endif
 
   // setup our common DOMLinkAdded listener
   gBrowser.addEventListener("DOMLinkAdded", DOMLinkHandler, false);
 
   // setup our MozApplicationManifest listener
   gBrowser.addEventListener("MozApplicationManifest",
                             OfflineApps, false);
 
@@ -1584,23 +1578,19 @@ function delayedStartup(isLoadingBlank, 
   // apply full zoom settings to tabs restored by the session restore service.
   try {
     FullZoom.init();
   }
   catch(ex) {
     Components.utils.reportError("Failed to init content pref service:\n" + ex);
   }
 
-#ifdef MOZ_E10S_COMPAT
-  // Bug 666804 - NetworkPrioritizer support for e10s
-#else
   let NP = {};
   Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
   NP.trackBrowserWindow(window);
-#endif
 
   // initialize the session-restore service (in case it's not already running)
   try {
     Cc["@mozilla.org/browser/sessionstore;1"]
       .getService(Ci.nsISessionStore)
       .init(window);
   } catch (ex) {
     dump("nsSessionStore could not be initialized: " + ex + "\n");
@@ -1641,22 +1631,18 @@ function delayedStartup(isLoadingBlank, 
   placesContext.addEventListener("popupshowing", updateEditUIVisibility, false);
   placesContext.addEventListener("popuphiding", updateEditUIVisibility, false);
 #endif
 
   gBrowser.mPanelContainer.addEventListener("InstallBrowserTheme", LightWeightThemeWebInstaller, false, true);
   gBrowser.mPanelContainer.addEventListener("PreviewBrowserTheme", LightWeightThemeWebInstaller, false, true);
   gBrowser.mPanelContainer.addEventListener("ResetBrowserThemePreview", LightWeightThemeWebInstaller, false, true);
 
-#ifdef MOZ_E10S_COMPAT
-  // Bug 666808 - AeroPeek support for e10s
-#else
   if (Win7Features)
     Win7Features.onOpenWindow();
-#endif
 
   // called when we go into full screen, even if it is
   // initiated by a web page script
   window.addEventListener("fullscreen", onFullScreen, true);
   if (window.fullScreen)
     onFullScreen();
 
 #ifdef MOZ_SERVICES_SYNC
@@ -4167,25 +4153,21 @@ var XULBrowserWindow = {
     delete this._uriFixup;
     return this._uriFixup = Cc["@mozilla.org/docshell/urifixup;1"]
                               .getService(Ci.nsIURIFixup);
   },
 
   init: function () {
     this.throbberElement = document.getElementById("navigator-throbber");
 
-#ifdef MOZ_E10S_COMPAT
-    // Bug 666809 - SecurityUI support for e10s
-#else
     // Initialize the security button's state and tooltip text.  Remember to reset
     // _hostChanged, otherwise onSecurityChange will short circuit.
     var securityUI = gBrowser.securityUI;
     this._hostChanged = true;
     this.onSecurityChange(null, null, securityUI.state);
-#endif
   },
 
   destroy: function () {
     // XXXjag to avoid leaks :-/, see bug 60729
     delete this.throbberElement;
     delete this.stopCommand;
     delete this.reloadCommand;
     delete this.statusTextField;
deleted file mode 100644
--- a/browser/base/content/content.js
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is multi-process front-end code.
-#
-# The Initial Developer of the Original Code is
-# the Mozilla Foundation
-# Portions created by the Initial Developer are Copyright (C) 2011
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Felipe Gomes <felipc@gmail.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-const webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
-
-addMessageListener("WebNavigation:LoadURI", function(message) {
-  let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
-
-  webNavigation.loadURI(message.json.uri, flags, null, null, null);
-});
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -772,20 +772,22 @@
         </body>
       </method>
 
       <method name="getWindowTitleForBrowser">
         <parameter name="aBrowser"/>
         <body>
           <![CDATA[
             var newTitle = "";
+            var docTitle;
             var docElement = this.ownerDocument.documentElement;
             var sep = docElement.getAttribute("titlemenuseparator");
 
-            var docTitle = aBrowser.contentTitle;
+            if (aBrowser.docShell.contentViewer)
+              docTitle = aBrowser.contentTitle;
 
             if (!docTitle)
               docTitle = docElement.getAttribute("titledefault");
 
             var modifier = docElement.getAttribute("titlemodifier");
             if (docTitle) {
               newTitle += docElement.getAttribute("titlepreface");
               newTitle += docTitle;
@@ -852,68 +854,59 @@
               if (this._lastRelatedTab != this.selectedTab)
                 this._lastRelatedTab.owner = null;
               this._lastRelatedTab = null;
             }
 
             var oldBrowser = this.mCurrentBrowser;
             if (oldBrowser) {
               oldBrowser.setAttribute("type", "content-targetable");
-              oldBrowser.docShellIsActive = false;
+              oldBrowser.docShell.isActive = false;
             }
 
             var updatePageReport = false;
             if (!oldBrowser ||
                 (oldBrowser.pageReport && !newBrowser.pageReport) ||
                 (!oldBrowser.pageReport && newBrowser.pageReport))
               updatePageReport = true;
 
             newBrowser.setAttribute("type", "content-primary");
-            newBrowser.docShellIsActive = true;
+            newBrowser.docShell.isActive = true;
             this.mCurrentBrowser = newBrowser;
             this.mCurrentTab = this.selectedTab;
             this.showTab(this.mCurrentTab);
 
             if (updatePageReport)
               this.mCurrentBrowser.updatePageReport();
 
             // Update the URL bar.
             var loc = this.mCurrentBrowser.currentURI;
 
-#ifdef MOZ_E10S_COMPAT
-            // Bug 666801 - WebProgress support for e10s and
-            // Bug 666809 - SecurityUI support for e10s
-#else
             var webProgress = this.mCurrentBrowser.webProgress;
             var securityUI = this.mCurrentBrowser.securityUI;
 
             this._callProgressListeners(null, "onLocationChange",
                                         [webProgress, null, loc], true, false);
 
             if (securityUI) {
               this._callProgressListeners(null, "onSecurityChange",
                                           [webProgress, null, securityUI.state], true, false);
             }
-#endif
 
             var listener = this.mTabListeners[this.tabContainer.selectedIndex] || null;
             if (listener && listener.mStateFlags) {
               this._callProgressListeners(null, "onUpdateCurrentBrowser",
                                           [listener.mStateFlags, listener.mStatus,
                                            listener.mMessage, listener.mTotalProgress],
                                           true, false);
             }
 
             // Don't switch the fast find or update the titlebar (bug 540248) - this tab switch is temporary
             if (!this._previewMode) {
-#ifdef MOZ_E10S_COMPAT
-              // Bug 666816 - TypeAheadFind support for e10s
-#else
               this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
-#endif
 
               this.updateTitlebar();
 
               this.mCurrentTab.removeAttribute("titlechanged");
             }
 
             // If the new tab is busy, and our current state is not busy, then
             // we need to fire a start to all progress listeners.
@@ -1258,21 +1251,16 @@
             var b = document.createElementNS(
               "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
                                              "browser");
             b.setAttribute("type", "content-targetable");
             b.setAttribute("message", "true");
             b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
             b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
 
-            if (Services.prefs.getPrefType("browser.tabs.remote") == Services.prefs.PREF_BOOL &&
-                Services.prefs.getBoolPref("browser.tabs.remote")) {
-              b.setAttribute("remote", "true");
-            }
-
             if (window.gShowPageResizers && document.getElementById("addon-bar").collapsed &&
                 window.windowState == window.STATE_NORMAL) {
               b.setAttribute("showresizer", "true");
             }
 
             if (this.hasAttribute("autocompletepopup"))
               b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
             b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
@@ -1310,21 +1298,17 @@
 
             this.tabContainer.updateVisibility();
 
             // wire up a progress listener for the new browser object.
             var tabListener = this.mTabProgressListener(t, b, blank);
             const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
                                      .createInstance(Components.interfaces.nsIWebProgress);
             filter.addProgressListener(tabListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
-#ifdef MOZ_E10S_COMPAT
-            // Bug 666801 - WebProgress support for e10s
-#else
             b.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
-#endif
             this.mTabListeners[position] = tabListener;
             this.mTabFilters[position] = filter;
 
             b._fastFind = this.fastFind;
             b.droppedLinkHandler = handleDroppedLink;
 
             // Dispatch a new tab notification.  We do this once we're
             // entirely done, so that things are in a consistent state
@@ -1352,17 +1336,17 @@
                 b.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset, aPostData);
               } catch (ex) {
                 Cu.reportError(ex);
               }
             }
 
             // We start our browsers out as inactive, and then maintain
             // activeness in the tab switcher.
-            b.docShellIsActive = false;
+            b.docShell.isActive = false;
 
             // Check if we're opening a tab related to the current tab and
             // move it to after the current tab.
             // aReferrerURI is null or undefined if the tab is opened from
             // an external application or bookmark, i.e. somewhere other
             // than the current tab.
             if ((aRelatedToCurrent == null ? aReferrerURI : aRelatedToCurrent) &&
                 Services.prefs.getBoolPref("browser.tabs.insertRelatedAfterCurrent")) {
@@ -1571,21 +1555,17 @@
             // We dispatch it before any teardown so that event listeners can
             // inspect the tab that's about to close.
             var evt = document.createEvent("UIEvent");
             evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
             aTab.dispatchEvent(evt);
 
             // Remove the tab's filter and progress listener.
             const filter = this.mTabFilters[aTab._tPos];
-#ifdef MOZ_E10S_COMPAT
-            // Bug 666801 - WebProgress support for e10s
-#else 
             browser.webProgress.removeProgressListener(filter);
-#endif
             filter.removeProgressListener(this.mTabListeners[aTab._tPos]);
             this.mTabListeners[aTab._tPos].destroy();
 
             if (browser.registeredOpenURI && !aTabWillBeMoved) {
               this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
               delete browser.registeredOpenURI;
             }
 
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -24,17 +24,16 @@ browser.jar:
         content/browser/aboutHome-snippet1.png        (content/aboutHome-snippet1.png)
         content/browser/aboutHome-snippet2.png        (content/aboutHome-snippet2.png)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
 *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
-*       content/browser/content.js                    (content/content.js)
 *       content/browser/fullscreen-video.xhtml        (content/fullscreen-video.xhtml)
         content/browser/highlighter.xhtml             (content/highlighter.xhtml)
 *       content/browser/inspector.html                (content/inspector.html)
 *       content/browser/scratchpad.xul                (content/scratchpad.xul)
 *       content/browser/scratchpad.js                 (content/scratchpad.js)
 *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
 *       content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
 *       content/browser/pageinfo/pageInfo.css         (content/pageinfo/pageInfo.css)
--- a/configure.in
+++ b/configure.in
@@ -5679,33 +5679,16 @@ MOZ_ARG_ENABLE_BOOL(ipdl-tests,
 
 if test -n "$MOZ_IPDL_TESTS"; then
     AC_DEFINE(MOZ_IPDL_TESTS)
 fi
 
 AC_SUBST(MOZ_IPDL_TESTS)
 
 dnl ========================================================
-dnl = Turns off code necessary for e10s compatibility
-dnl ========================================================
-dnl This is a temporary flag to be removed in bug 662601 when
-dnl it's no longer needed
-
-MOZ_E10S_COMPAT=
-
-MOZ_ARG_ENABLE_BOOL(e10s-compat,
-[  --enable-e10s-compat     Turns off code for e10s compat],
-    MOZ_E10S_COMPAT=1,
-    MOZ_E10S_COMPAT=)
-
-if test -n "$MOZ_E10S_COMPAT"; then
-    AC_DEFINE(MOZ_E10S_COMPAT)
-fi
-
-dnl ========================================================
 dnl = Disable building dbm
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(dbm,
 [  --disable-dbm           Disable building dbm],
     NSS_DISABLE_DBM=1,
     NSS_DISABLE_DBM=)
 
 dnl bi-directional support always on
--- a/content/base/public/nsIFrameLoader.idl
+++ b/content/base/public/nsIFrameLoader.idl
@@ -136,17 +136,17 @@ interface nsIContentViewManager : nsISup
                          [retval, array, size_is(aLength)] out nsIContentView aResult);
 
   /**
    * The root content view.
    */
   readonly attribute nsIContentView rootContentView;
 };
 
-[scriptable, uuid(12905a29-4246-475a-81d4-fc389197df02)]
+[scriptable, uuid(13c512d6-fba0-402a-9244-fe7941c43965)]
 interface nsIFrameLoader : nsISupports
 {
   /**
    * Get the docshell from the frame loader.
    */
   readonly attribute nsIDocShell docShell;
 
   /**
@@ -183,22 +183,16 @@ interface nsIFrameLoader : nsISupports
 
   /**
    * Activate remote frame.
    * Throws an exception with non-remote frames.
    */
   void activateRemoteFrame();
 
   /**
-   * Deactivate remote frame.
-   * Throws an exception with non-remote frames.
-   */
-  void deactivateRemoteFrame();
-
-  /**
    * @see nsIDOMWindowUtils sendMouseEvent.
    */
   void sendCrossProcessMouseEvent(in AString aType,
                                   in float aX,
                                   in float aY,
                                   in long aButton,
                                   in long aClickCount,
                                   in long aModifiers,
@@ -235,34 +229,16 @@ interface nsIFrameLoader : nsISupports
    *
    * NB: when async scrolling is enabled, it's the *user's*
    * responsibility to update the target scroll offset.  In effect,
    * the platform hands over control of scroll offset to the user.
    */
   const unsigned long RENDER_MODE_ASYNC_SCROLL   = 0x00000001;
 
   attribute unsigned long renderMode;
-
-  /**
-   * The default event mode automatically forwards the events
-   * handled in nsEventStateManager::HandleCrossProcessEvent to
-   * the child content process when these events are targeted to
-   * the remote browser element.
-   *
-   * Used primarly for input events (mouse, keyboard)
-   */
-  const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
-
-  /**
-   * With this event mode, it's the application's responsability to 
-   * convert and forward events to the content process
-   */
-  const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
-
-  attribute unsigned long eventMode;
 };
 
 native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
 
 [scriptable, uuid(5879040e-83e9-40e3-b2bb-5ddf43b76e47)]
 interface nsIFrameLoaderOwner : nsISupports
 {
   /**
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -322,17 +322,16 @@ nsFrameLoader::nsFrameLoader(nsIContent 
   , mHideCalled(PR_FALSE)
   , mNetworkCreated(aNetworkCreated)
   , mDelayRemoteDialogs(PR_FALSE)
   , mRemoteBrowserShown(PR_FALSE)
   , mRemoteFrame(false)
   , mCurrentRemoteFrame(nsnull)
   , mRemoteBrowser(nsnull)
   , mRenderMode(RENDER_MODE_DEFAULT)
-  , mEventMode(EVENT_MODE_NORMAL_DISPATCH)
 {
 }
 
 nsFrameLoader*
 nsFrameLoader::Create(nsIContent* aOwner, PRBool aNetworkCreated)
 {
   NS_ENSURE_TRUE(aOwner, nsnull);
   nsIDocument* doc = aOwner->GetOwnerDoc();
@@ -533,37 +532,36 @@ nsFrameLoader::CheckURILoad(nsIURI* aURI
   }
   return CheckForRecursiveLoad(aURI);
 }
 
 NS_IMETHODIMP
 nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
 {
   *aDocShell = nsnull;
-  nsresult rv = NS_OK;
 
   // If we have an owner, make sure we have a docshell and return
   // that. If not, we're most likely in the middle of being torn down,
   // then we just return null.
   if (mOwnerContent) {
     nsresult rv = MaybeCreateDocShell();
     if (NS_FAILED(rv))
       return rv;
     if (mRemoteFrame) {
       NS_WARNING("No docshells for remote frames!");
-      return rv;
+      return NS_ERROR_NOT_AVAILABLE;
     }
     NS_ASSERTION(mDocShell,
                  "MaybeCreateDocShell succeeded, but null mDocShell");
   }
 
   *aDocShell = mDocShell;
   NS_IF_ADDREF(*aDocShell);
 
-  return rv;
+  return NS_OK;
 }
 
 void
 nsFrameLoader::Finalize()
 {
   nsCOMPtr<nsIBaseWindow> base_win(do_QueryInterface(mDocShell));
   if (base_win) {
     base_win->Destroy();
@@ -1337,29 +1335,46 @@ nsFrameLoader::SetOwnerContent(nsIConten
   if (RenderFrameParent* rfp = GetCurrentRemoteFrame()) {
     rfp->OwnerContentChanged(aContent);
   }
 }
 
 bool
 nsFrameLoader::ShouldUseRemoteProcess()
 {
-  // Check for *disabled* multi-process first: environment, pref
-  // Then check for *enabled* multi-process attribute
+  // Check for *disabled* multi-process first: environment, prefs, attribute
+  // Then check for *enabled* multi-process pref: attribute, prefs
   // Default is not-remote.
 
-  if (PR_GetEnv("MOZ_DISABLE_OOP_TABS") ||
-      Preferences::GetBool("dom.ipc.tabs.disabled", PR_FALSE)) {
+  if (PR_GetEnv("MOZ_DISABLE_OOP_TABS")) {
+    return false;
+  }
+
+  PRBool remoteDisabled =
+    Preferences::GetBool("dom.ipc.tabs.disabled", PR_FALSE);
+  if (remoteDisabled) {
     return false;
   }
 
-  return (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None,
-                                           nsGkAtoms::Remote,
-                                           nsGkAtoms::_true,
-                                           eCaseMatters);
+  static nsIAtom* const *const remoteValues[] = {
+    &nsGkAtoms::_false,
+    &nsGkAtoms::_true,
+    nsnull
+  };
+
+  switch (mOwnerContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::Remote,
+                                         remoteValues, eCaseMatters)) {
+  case 0:
+    return false;
+  case 1:
+    return true;
+  }
+
+  PRBool remoteEnabled = Preferences::GetBool("dom.ipc.tabs.enabled", PR_FALSE);
+  return (bool) remoteEnabled;
 }
 
 nsresult
 nsFrameLoader::MaybeCreateDocShell()
 {
   if (mDocShell) {
     return NS_OK;
   }
@@ -1656,30 +1671,16 @@ nsFrameLoader::SetRenderMode(PRUint32 aR
     return NS_OK;
   }
 
   mRenderMode = aRenderMode;
   InvalidateFrame(GetPrimaryFrameOfOwningContent());
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsFrameLoader::GetEventMode(PRUint32* aEventMode)
-{
-  *aEventMode = mEventMode;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::SetEventMode(PRUint32 aEventMode)
-{
-  mEventMode = aEventMode;
-  return NS_OK;
-}
-
 nsIntSize
 nsFrameLoader::GetSubDocumentSize(const nsIFrame *aIFrame)
 {
   nsSize docSizeAppUnits;
   nsPresContext* presContext = aIFrame->PresContext();
   nsCOMPtr<nsIDOMHTMLFrameElement> frameElem = 
     do_QueryInterface(aIFrame->GetContent());
   if (frameElem) {
@@ -1782,25 +1783,16 @@ nsFrameLoader::ActivateRemoteFrame() {
   if (mRemoteBrowser) {
     mRemoteBrowser->Activate();
     return NS_OK;
   }
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
-nsFrameLoader::DeactivateRemoteFrame() {
-  if (mRemoteBrowser) {
-    mRemoteBrowser->Deactivate();
-    return NS_OK;
-  }
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
 nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType,
                                           float aX,
                                           float aY,
                                           PRInt32 aButton,
                                           PRInt32 aClickCount,
                                           PRInt32 aModifiers,
                                           PRBool aIgnoreRootScrollFrame)
 {
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -337,15 +337,11 @@ private:
   nsCOMPtr<nsIObserver> mChildHost;
   RenderFrameParent* mCurrentRemoteFrame;
   TabParent* mRemoteBrowser;
 
   // See nsIFrameLoader.idl.  Short story, if !(mRenderMode &
   // RENDER_MODE_ASYNC_SCROLL), all the fields below are ignored in
   // favor of what content tells.
   PRUint32 mRenderMode;
-
-  // See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
-  // forwards some input events to out-of-process content.
-  PRUint32 mEventMode;
 };
 
 #endif
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -1652,103 +1652,16 @@ nsEventStateManager::HandleAccessKey(nsP
 
       if (esm)
         esm->HandleAccessKey(parentPC, aEvent, aStatus, docShell,
                              eAccessKeyProcessingUp, aModifierMask);
     }
   }// if end. bubble up process
 }// end of HandleAccessKey
 
-void
-nsEventStateManager::DispatchCrossProcessEvent(nsEvent* aEvent, nsIFrameLoader* frameLoader) {
-  nsFrameLoader* fml = static_cast<nsFrameLoader*>(frameLoader);
-  PBrowserParent* remoteBrowser = fml->GetRemoteBrowser();
-  TabParent* remote = static_cast<TabParent*>(remoteBrowser);
-  if (!remote) {
-    return;
-  }
-
-  if (aEvent->eventStructType == NS_MOUSE_EVENT) {
-    nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
-    remote->SendRealMouseEvent(*mouseEvent);
-  }
-
-  if (aEvent->eventStructType == NS_KEY_EVENT) {
-    nsKeyEvent* keyEvent = static_cast<nsKeyEvent*>(aEvent);
-    remote->SendRealKeyEvent(*keyEvent);
-  }
-
-  if (aEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
-    nsMouseScrollEvent* scrollEvent = static_cast<nsMouseScrollEvent*>(aEvent);
-    remote->SendMouseScrollEvent(*scrollEvent);
-  }
-}
-
-PRBool
-nsEventStateManager::IsRemoteTarget(nsIContent* target) {
-  return target &&
-         target->Tag() == nsGkAtoms::browser &&
-         target->IsXUL() &&
-         target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
-                             nsGkAtoms::_true, eIgnoreCase);
-}
-
-
-PRBool
-nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
-                                             nsIFrame* aTargetFrame,
-                                             nsEventStatus *aStatus) {
-
-  switch (aEvent->eventStructType) {
-    case NS_KEY_EVENT:
-    case NS_MOUSE_SCROLL_EVENT:
-      break;
-    case NS_MOUSE_EVENT:
-      if (aEvent->message == NS_MOUSE_BUTTON_DOWN ||
-          aEvent->message == NS_MOUSE_BUTTON_UP ||
-          aEvent->message == NS_MOUSE_MOVE) {
-        break;
-      }
-    default:
-      return PR_FALSE;
-  }
-
-  nsIContent* target = mCurrentTargetContent;
-  if (!target && aTargetFrame) {
-    target = aTargetFrame->GetContent();
-  }
-
-  if (*aStatus == nsEventStatus_eConsumeNoDefault ||
-      !target ||
-      !IsRemoteTarget(target)) {
-    return PR_FALSE;
-  }
-
-  nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(target);
-  if (!loaderOwner) {
-    return PR_FALSE;
-  }
-
-  nsRefPtr<nsFrameLoader> frameLoader = loaderOwner->GetFrameLoader();
-  if (!frameLoader) {
-    return PR_FALSE;
-  }
-
-  PRUint32 eventMode;
-  frameLoader->GetEventMode(&eventMode);
-  if (eventMode == nsIFrameLoader::EVENT_MODE_DONT_FORWARD_TO_CHILD) {
-    return PR_FALSE;
-  }
-
-  nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, aTargetFrame);
-  aEvent->refPoint = pt.ToNearestPixels(mPresContext->AppUnitsPerDevPixel());
-
-  DispatchCrossProcessEvent(aEvent, frameLoader);
-  return PR_TRUE;
-}
 
 //
 // CreateClickHoldTimer
 //
 // Fire off a timer for determining if the user wants click-hold. This timer
 // is a one-shot that will be cancelled when the user moves enough to fire
 // a drag.
 //
@@ -2987,18 +2900,16 @@ nsEventStateManager::PostHandleEvent(nsP
                                      nsEvent *aEvent,
                                      nsIFrame* aTargetFrame,
                                      nsEventStatus* aStatus,
                                      nsIView* aView)
 {
   NS_ENSURE_ARG(aPresContext);
   NS_ENSURE_ARG_POINTER(aStatus);
 
-  HandleCrossProcessEvent(aEvent, aTargetFrame, aStatus);
-
   mCurrentTarget = aTargetFrame;
   mCurrentTargetContent = nsnull;
 
   // Most of the events we handle below require a frame.
   // Add special cases here.
   if (!mCurrentTarget && aEvent->message != NS_MOUSE_BUTTON_UP &&
       aEvent->message != NS_MOUSE_BUTTON_DOWN) {
     return NS_OK;
@@ -3504,20 +3415,16 @@ nsEventStateManager::ClearFrameRefs(nsIF
   }
 }
 
 void
 nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
                                   nsEvent* aEvent, nsIFrame* aTargetFrame,
                                   nsEventStatus* aStatus)
 {
-  if (aTargetFrame && IsRemoteTarget(aTargetFrame->GetContent())) {
-    return;
-  }
-
   PRInt32 cursor = NS_STYLE_CURSOR_DEFAULT;
   imgIContainer* container = nsnull;
   PRBool haveHotspot = PR_FALSE;
   float hotspotX = 0.0f, hotspotY = 0.0f;
 
   //If cursor is locked just use the locked one
   if (mLockCursor) {
     cursor = mLockCursor;
--- a/content/events/src/nsEventStateManager.h
+++ b/content/events/src/nsEventStateManager.h
@@ -44,17 +44,16 @@
 #include "nsIContent.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsHashtable.h"
 #include "nsITimer.h"
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
 #include "nsCOMArray.h"
-#include "nsIFrameLoader.h"
 #include "nsIFrame.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIMarkupDocumentViewer.h"
 #include "nsIScrollableFrame.h"
 #include "nsFocusManager.h"
 #include "nsIDocument.h"
 #include "nsEventStates.h"
 
@@ -423,22 +422,16 @@ protected:
 
   void DoQueryScrollTargetInfo(nsQueryContentEvent* aEvent,
                                nsIFrame* aTargetFrame);
 
   PRBool RemoteQueryContentEvent(nsEvent *aEvent);
   mozilla::dom::TabParent *GetCrossProcessTarget();
   PRBool IsTargetCrossProcess(nsGUIEvent *aEvent);
 
-  void DispatchCrossProcessEvent(nsEvent* aEvent, nsIFrameLoader* remote);
-  PRBool IsRemoteTarget(nsIContent* target);
-  PRBool HandleCrossProcessEvent(nsEvent *aEvent,
-                                 nsIFrame* aTargetFrame,
-                                 nsEventStatus *aStatus);
-
 private:
   static inline void DoStateChange(mozilla::dom::Element* aElement,
                                    nsEventStates aState, PRBool aAddState);
   static inline void DoStateChange(nsIContent* aContent, nsEventStates aState,
                                    PRBool aAddState);
   static void UpdateAncestorState(nsIContent* aStartNode,
                                   nsIContent* aStopBefore,
                                   nsEventStates aState,
--- a/content/html/content/reftests/autofocus/input-load.html
+++ b/content/html/content/reftests/autofocus/input-load.html
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
   <link rel='stylesheet' type='text/css' href='style.css'>
   <script>
     function focusHandler()
     {
-      document.documentElement.removeAttribute('class');
+      setTimeout(document.documentElement.removeAttribute('class'), 0);
     }
   </script>
   <body>
     <input><input autofocus onfocus="focusHandler();"><input autofocus onfocus="focusHandler();">
   </body>
 </html>
--- a/content/xbl/crashtests/crashtests.list
+++ b/content/xbl/crashtests/crashtests.list
@@ -1,15 +1,15 @@
 load 205735-1.xhtml
 load 223799-1.xul
 load 226744-1.xhtml
 load 232095-1.xul
 load 277523-1.xhtml
 load 277950-1.xhtml
-skip-if(browserIsRemote) load 336744-1.html # no remote support for xul popups, bug 617653
+load 336744-1.html
 asserts(0-1) load 336960-1.html # maybe bug 429586
 load 342954-1.xhtml
 load 342954-2.xhtml
 load 368276-1.xhtml
 load 368641-1.xhtml
 load 378521-1.xhtml
 load 382376-1.xhtml
 load 382376-2.xhtml
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -29,18 +29,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "mozilla/dom/TabParent.h"
-
 #include "nsFocusManager.h"
 
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsIEnumerator.h"
 #include "nsTPtrArray.h"
 #include "nsGkAtoms.h"
@@ -1528,43 +1526,34 @@ nsFocusManager::Blur(nsPIDOMWindow* aWin
   // Don't fire blur event on the root content which isn't editable.
   PRBool sendBlurEvent =
     content && content->IsInDoc() && !IsNonFocusableRoot(content);
   if (content) {
     if (sendBlurEvent) {
       NotifyFocusStateChange(content, shouldShowFocusRing, PR_FALSE);
     }
 
-    // if an object/plug-in/remote browser is being blurred, move the system focus
-    // to the parent window, otherwise events will still get fired at the plugin.
+    // if an object/plug-in is being blurred, move the system focus to the
+    // parent window, otherwise events will still get fired at the plugin.
     // But don't do this if we are blurring due to the window being lowered,
     // otherwise, the parent window can get raised again.
-    if (mActiveWindow) {
+    if (mActiveWindow && aAdjustWidgets) {
       nsIFrame* contentFrame = content->GetPrimaryFrame();
       nsIObjectFrame* objectFrame = do_QueryFrame(contentFrame);
-      if (aAdjustWidgets && objectFrame) {
+      if (objectFrame) {
         // note that the presshell's widget is being retrieved here, not the one
         // for the object frame.
         nsIViewManager* vm = presShell->GetViewManager();
         if (vm) {
           nsCOMPtr<nsIWidget> widget;
           vm->GetRootWidget(getter_AddRefs(widget));
           if (widget)
             widget->SetFocus(PR_FALSE);
         }
       }
-
-      // if the object being blurred is a remote browser, deactivate remote content
-      TabParent* remote = GetRemoteForContent(content);
-      if (remote) {
-        remote->Deactivate();
-  #ifdef DEBUG_FOCUS
-      printf("*Remote browser deactivated\n");
-  #endif
-      }
     }
   }
 
   PRBool result = PR_TRUE;
   if (sendBlurEvent) {
     // if there is an active window, update commands. If there isn't an active
     // window, then this was a blur caused by the active window being lowered,
     // so there is no need to update the commands
@@ -1752,31 +1741,22 @@ nsFocusManager::Focus(nsPIDOMWindow* aWi
     nsPresContext* presContext = presShell->GetPresContext();
     if (sendFocusEvent) {
       // if the focused element changed, scroll it into view
       if (aFocusChanged)
         ScrollIntoView(presShell, aContent, aFlags);
 
       NotifyFocusStateChange(aContent, aWindow->ShouldShowFocusRing(), PR_TRUE);
 
-      // if this is an object/plug-in/remote browser, focus its widget.  Note that we might
+      // if this is an object/plug-in, focus the plugin's widget.  Note that we might
       // no longer be in the same document, due to the events we fired above when
       // aIsNewDocument.
-      if (presShell->GetDocument() == aContent->GetDocument()) {
-        if (aAdjustWidgets && objectFrameWidget)
+      if (aAdjustWidgets && presShell->GetDocument() == aContent->GetDocument()) {
+        if (objectFrameWidget)
           objectFrameWidget->SetFocus(PR_FALSE);
-
-        // if the object being focused is a remote browser, activate remote content
-        TabParent* remote = GetRemoteForContent(aContent);
-        if (remote) {
-          remote->Activate();
-#ifdef DEBUG_FOCUS
-          printf("*Remote browser activated\n");
-#endif
-        }
       }
 
       PRUint32 reason = GetFocusMoveReason(aFlags);
       nsIMEStateManager::OnChangeFocus(presContext, aContent, reason);
 
       // as long as this focus wasn't because a window was raised, update the
       // commands
       // XXXndeakin P2 someone could adjust the focus during the update
@@ -2963,38 +2943,16 @@ nsFocusManager::GetRootForFocus(nsPIDOMW
           return nsnull;
       }
     }
   }
 
   return rootElement;
 }
 
-TabParent*
-nsFocusManager::GetRemoteForContent(nsIContent* aContent) {
-  if (!aContent ||
-      aContent->Tag() != nsGkAtoms::browser ||
-      !aContent->IsXUL() ||
-      !aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
-                             nsGkAtoms::_true, eIgnoreCase))
-    return nsnull;
-
-  nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aContent);
-  if (!loaderOwner)
-    return nsnull;
-
-  nsRefPtr<nsFrameLoader> frameLoader = loaderOwner->GetFrameLoader();
-  if (!frameLoader)
-    return nsnull;
-
-  PBrowserParent* remoteBrowser = frameLoader->GetRemoteBrowser();
-  TabParent* remote = static_cast<TabParent*>(remoteBrowser);
-  return remote;
-}
-
 void
 nsFocusManager::GetLastDocShell(nsIDocShellTreeItem* aItem,
                                 nsIDocShellTreeItem** aResult)
 {
   *aResult = nsnull;
 
   nsCOMPtr<nsIDocShellTreeItem> curItem = aItem;
   while (curItem) {
--- a/dom/base/nsFocusManager.h
+++ b/dom/base/nsFocusManager.h
@@ -44,23 +44,16 @@
 
 #define FOCUSMETHOD_MASK 0xF000
 #define FOCUSMETHODANDRING_MASK 0xF0F000
 
 #define FOCUSMANAGER_CONTRACTID "@mozilla.org/focus-manager;1"
 
 class nsIDocShellTreeItem;
 class nsPIDOMWindow;
-
-namespace mozilla {
-namespace dom {
-  class TabParent;
-}
-}
-
 struct nsDelayedBlurOrFocusEvent;
 
 /**
  * The focus manager keeps track of where the focus is, that is, the node
  * which receives key events.
  */
 
 class nsFocusManager : public nsIFocusManager,
@@ -427,22 +420,16 @@ protected:
    * - if aDocument is a frameset document.
    */
   nsIContent* GetRootForFocus(nsPIDOMWindow* aWindow,
                               nsIDocument* aDocument,
                               PRBool aIsForDocNavigation,
                               PRBool aCheckVisibility);
 
   /**
-   * Get the TabParent associated with aContent if it is a remote browser,
-   * or null in all other cases.
-   */
-  mozilla::dom::TabParent* GetRemoteForContent(nsIContent* aContent);
-
-  /**
    * Get the last docshell child of aItem and return it in aResult.
    */
   void GetLastDocShell(nsIDocShellTreeItem* aItem,
                        nsIDocShellTreeItem** aResult);
 
   /**
    * Get the next docshell child of aItem and return it in aResult.
    */
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -53,19 +53,16 @@ using gfxMatrix;
 using IPC::URI;
 using nsCompositionEvent;
 using nsIMEUpdatePreference;
 using nsIntSize;
 using nsQueryContentEvent;
 using nsRect;
 using nsSelectionEvent;
 using nsTextEvent;
-using nsMouseEvent;
-using nsMouseScrollEvent;
-using nsKeyEvent;
 using RemoteDOMEvent;
 
 namespace mozilla {
 namespace dom {
 
 rpc protocol PBrowser
 {
     manager PContent;
@@ -178,18 +175,16 @@ parent:
 
     SetIMEOpenState(PRBool value);
 
     /**
      * Gets the DPI of the screen corresponding to this browser.
      */
     sync GetDPI() returns (float value);
 
-    SetCursor(PRUint32 value);
-
     PContentPermissionRequest(nsCString aType, URI uri);
 
     PContentDialog(PRUint32 aType, nsCString aName, nsCString aFeatures,
                    PRInt32[] aIntParams, nsString[] aStringParams);
 
     /**
      * Create a layout frame (encapsulating a remote layer tree) for
      * the page that is currently loaded in the <browser>.
@@ -241,33 +236,27 @@ child:
 
     Move(nsIntSize size);
 
     /**
      * Sending an activate message moves focus to the child.
      */
     Activate();
 
-    Deactivate();
-
     /**
      * @see nsIDOMWindowUtils sendMouseEvent.
      */
     MouseEvent(nsString aType,
                float aX,
                float aY,
                PRInt32 aButton,
                PRInt32 aClickCount,
                PRInt32 aModifiers,
                bool aIgnoreRootScrollFrame);
 
-    RealMouseEvent(nsMouseEvent event);
-    RealKeyEvent(nsKeyEvent event);
-    MouseScrollEvent(nsMouseScrollEvent event);
-
     /**
      * @see nsIDOMWindowUtils sendKeyEvent.
      */
     KeyEvent(nsString aType,
              PRInt32 aKeyCode,
              PRInt32 aCharCode,
              PRInt32 aModifiers,
              bool aPreventDefault);
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -279,18 +279,19 @@ TabChild::GetVisibility(PRBool* aVisibil
 {
   *aVisibility = PR_TRUE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabChild::SetVisibility(PRBool aVisibility)
 {
-  // should the platform support this? Bug 666365
-  return NS_OK;
+  NS_NOTREACHED("TabChild::SetVisibility not supported in TabChild");
+
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 TabChild::GetTitle(PRUnichar** aTitle)
 {
   NS_NOTREACHED("TabChild::GetTitle not supported in TabChild");
 
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -550,23 +551,16 @@ TabChild::RecvMove(const nsIntSize& size
 bool
 TabChild::RecvActivate()
 {
   nsCOMPtr<nsIWebBrowserFocus> browser = do_QueryInterface(mWebNav);
   browser->Activate();
   return true;
 }
 
-bool TabChild::RecvDeactivate()
-{
-  nsCOMPtr<nsIWebBrowserFocus> browser = do_QueryInterface(mWebNav);
-  browser->Deactivate();
-  return true;
-}
-
 bool
 TabChild::RecvMouseEvent(const nsString& aType,
                          const float&    aX,
                          const float&    aY,
                          const PRInt32&  aButton,
                          const PRInt32&  aClickCount,
                          const PRInt32&  aModifiers,
                          const bool&     aIgnoreRootScrollFrame)
@@ -575,41 +569,16 @@ TabChild::RecvMouseEvent(const nsString&
   nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
   NS_ENSURE_TRUE(utils, true);
   utils->SendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers,
                         aIgnoreRootScrollFrame);
   return true;
 }
 
 bool
-TabChild::RecvRealMouseEvent(const nsMouseEvent& event)
-{
-  nsMouseEvent localEvent(event);
-  DispatchWidgetEvent(localEvent);
-  return true;
-}
-
-bool
-TabChild::RecvMouseScrollEvent(const nsMouseScrollEvent& event)
-{
-  nsMouseScrollEvent localEvent(event);
-  DispatchWidgetEvent(localEvent);
-  return true;
-}
-
-
-bool
-TabChild::RecvRealKeyEvent(const nsKeyEvent& event)
-{
-  nsKeyEvent localEvent(event);
-  DispatchWidgetEvent(localEvent);
-  return true;
-}
-
-bool
 TabChild::RecvKeyEvent(const nsString& aType,
                        const PRInt32& aKeyCode,
                        const PRInt32& aCharCode,
                        const PRInt32& aModifiers,
                        const bool& aPreventDefault)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mWebNav);
   nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -175,27 +175,23 @@ public:
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NSIWINDOWPROVIDER
     NS_DECL_NSIDIALOGCREATOR
 
     virtual bool RecvLoadURL(const nsCString& uri);
     virtual bool RecvShow(const nsIntSize& size);
     virtual bool RecvMove(const nsIntSize& size);
     virtual bool RecvActivate();
-    virtual bool RecvDeactivate();
     virtual bool RecvMouseEvent(const nsString& aType,
                                 const float&    aX,
                                 const float&    aY,
                                 const PRInt32&  aButton,
                                 const PRInt32&  aClickCount,
                                 const PRInt32&  aModifiers,
                                 const bool&     aIgnoreRootScrollFrame);
-    virtual bool RecvRealMouseEvent(const nsMouseEvent& event);
-    virtual bool RecvRealKeyEvent(const nsKeyEvent& event);
-    virtual bool RecvMouseScrollEvent(const nsMouseScrollEvent& event);
     virtual bool RecvKeyEvent(const nsString& aType,
                               const PRInt32&  aKeyCode,
                               const PRInt32&  aCharCode,
                               const PRInt32&  aModifiers,
                               const bool&     aPreventDefault);
     virtual bool RecvCompositionEvent(const nsCompositionEvent& event);
     virtual bool RecvTextEvent(const nsTextEvent& event);
     virtual bool RecvSelectionEvent(const nsSelectionEvent& event);
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -62,17 +62,16 @@
 #include "nsContentUtils.h"
 #include "nsContentPermissionHelper.h"
 #include "nsIDOMNSHTMLFrameElement.h"
 #include "nsIDialogCreator.h"
 #include "nsThreadUtils.h"
 #include "nsSerializationHelper.h"
 #include "nsIPromptFactory.h"
 #include "nsIContent.h"
-#include "nsIWidget.h"
 #include "mozilla/unused.h"
 #include "nsDebug.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 using namespace mozilla::layout;
 
 // The flags passed by the webProgress notifications are 16 bits shifted
@@ -215,22 +214,16 @@ TabParent::Move(const nsIntSize& size)
 }
 
 void
 TabParent::Activate()
 {
     unused << SendActivate();
 }
 
-void
-TabParent::Deactivate()
-{
-  unused << SendDeactivate();
-}
-
 NS_IMETHODIMP
 TabParent::Init(nsIDOMWindow *window)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetState(PRUint32 *aState)
@@ -295,57 +288,32 @@ TabParent::SendKeyEvent(const nsAString&
                         PRInt32 aCharCode,
                         PRInt32 aModifiers,
                         PRBool aPreventDefault)
 {
   unused << PBrowserParent::SendKeyEvent(nsString(aType), aKeyCode, aCharCode,
                                          aModifiers, aPreventDefault);
 }
 
-bool TabParent::SendRealMouseEvent(nsMouseEvent& event)
-{
-  return PBrowserParent::SendRealMouseEvent(event);
-}
-
-bool TabParent::SendMouseScrollEvent(nsMouseScrollEvent& event)
-{
-  return PBrowserParent::SendMouseScrollEvent(event);
-}
-
-bool TabParent::SendRealKeyEvent(nsKeyEvent& event)
-{
-  return PBrowserParent::SendRealKeyEvent(event);
-}
-
 bool
 TabParent::RecvSyncMessage(const nsString& aMessage,
                            const nsString& aJSON,
                            InfallibleTArray<nsString>* aJSONRetVal)
 {
   return ReceiveMessage(aMessage, PR_TRUE, aJSON, aJSONRetVal);
 }
 
 bool
 TabParent::RecvAsyncMessage(const nsString& aMessage,
                             const nsString& aJSON)
 {
   return ReceiveMessage(aMessage, PR_FALSE, aJSON, nsnull);
 }
 
 bool
-TabParent::RecvSetCursor(const PRUint32& aCursor)
-{
-  nsCOMPtr<nsIWidget> widget = GetWidget();
-  if (widget) {
-    widget->SetCursor((nsCursor) aCursor);
-  }
-  return true;
-}
-
-bool
 TabParent::RecvNotifyIMEFocus(const PRBool& aFocus,
                               nsIMEUpdatePreference* aPreference,
                               PRUint32* aSeqno)
 {
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget)
     return true;
 
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -102,17 +102,16 @@ public:
                                         const PRUint32& aFocus);
     virtual bool RecvNotifyIMETextHint(const nsString& aText);
     virtual bool RecvEndIMEComposition(const PRBool& aCancel,
                                        nsString* aComposition);
     virtual bool RecvGetIMEEnabled(PRUint32* aValue);
     virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction, const PRUint32& aReason);
     virtual bool RecvGetIMEOpenState(PRBool* aValue);
     virtual bool RecvSetIMEOpenState(const PRBool& aValue);
-    virtual bool RecvSetCursor(const PRUint32& aValue);
     virtual bool RecvGetDPI(float* aValue);
     virtual PContentDialogParent* AllocPContentDialog(const PRUint32& aType,
                                                       const nsCString& aName,
                                                       const nsCString& aFeatures,
                                                       const InfallibleTArray<int>& aIntParams,
                                                       const InfallibleTArray<nsString>& aStringParams);
     virtual bool DeallocPContentDialog(PContentDialogParent* aDialog)
     {
@@ -123,26 +122,22 @@ public:
 
     void LoadURL(nsIURI* aURI);
     // XXX/cjones: it's not clear what we gain by hiding these
     // message-sending functions under a layer of indirection and
     // eating the return values
     void Show(const nsIntSize& size);
     void Move(const nsIntSize& size);
     void Activate();
-    void Deactivate();
     void SendMouseEvent(const nsAString& aType, float aX, float aY,
                         PRInt32 aButton, PRInt32 aClickCount,
                         PRInt32 aModifiers, PRBool aIgnoreRootScrollFrame);
     void SendKeyEvent(const nsAString& aType, PRInt32 aKeyCode,
                       PRInt32 aCharCode, PRInt32 aModifiers,
                       PRBool aPreventDefault);
-    bool SendRealMouseEvent(nsMouseEvent& event);
-    bool SendMouseScrollEvent(nsMouseScrollEvent& event);
-    bool SendRealKeyEvent(nsKeyEvent& event);
 
     virtual PDocumentRendererParent*
     AllocPDocumentRenderer(const nsRect& documentRect, const gfxMatrix& transform,
                            const nsString& bgcolor,
                            const PRUint32& renderFlags, const bool& flushLayout,
                            const nsIntSize& renderSize);
     virtual bool DeallocPDocumentRenderer(PDocumentRendererParent* actor);
 
--- a/dom/ipc/test.xul
+++ b/dom/ipc/test.xul
@@ -56,28 +56,30 @@
     
     function loadURL(url) {
       document.getElementById('page').setAttribute('src', url);
     }
 
     function randomClick() {
        // First focus the remote frame, then dispatch click. This way remote frame gets focus before
        // mouse event.
-       document.getElementById('page').focus();
+       document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
+                                      .frameLoader.activateRemoteFrame();
        var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
        var x = parseInt(Math.random() * 100);
        var y = parseInt(Math.random() * 100);
        frameLoader.sendCrossProcessMouseEvent("mousedown", x, y, 0, 1, 0, false);
        frameLoader.sendCrossProcessMouseEvent("mouseup", x, y, 0, 1, 0, false);
      }
 
     function keyPress() {
        // First focus the remote frame, then dispatch click. This way remote frame gets focus before
        // mouse event.
-       document.getElementById('page').focus();
+       document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
+                                      .frameLoader.activateRemoteFrame();
        var frameLoader = document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
 
        var keyCode = Components.interfaces.nsIDOMKeyEvent.DOM_VK_A;
        frameLoader.sendCrossProcessKeyEvent("keydown", keyCode, 0, 0);
        frameLoader.sendCrossProcessKeyEvent("keypress", keyCode, 0, 0);
        frameLoader.sendCrossProcessKeyEvent("keyup", keyCode, 0, 0);
      }
 
@@ -273,11 +275,12 @@
     <label value="Eval script in chrome context"/>
     <textbox flex="1"/><button label="run" oncommand="eval(this.previousSibling.value);"/>
   </toolbar>
   <toolbar>
     <checkbox label="allow dialogs from remote content"
                oncommand="document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.delayRemoteDialogs = this.checked;"/>
   </toolbar>
 
-  <browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"/>
+  <browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"
+           onfocus="this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.activateRemoteFrame();"/>
   <label id="messageLog" value="" crop="center"/>
 </window>
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -644,18 +644,84 @@
                 readonly="true"/>
 
       <field name="_contentTitle">null</field>
 
       <property name="contentTitle"
                 onget="return this._contentTitle;"
                 readonly="true"/>
 
+      <field name="_webNavigation"><![CDATA[
+        ({
+          LOAD_FLAGS_MASK: 65535,
+          LOAD_FLAGS_NONE: 0,
+          LOAD_FLAGS_IS_REFRESH: 16,
+          LOAD_FLAGS_IS_LINK: 32,
+          LOAD_FLAGS_BYPASS_HISTORY: 64,
+          LOAD_FLAGS_REPLACE_HISTORY: 128,
+          LOAD_FLAGS_BYPASS_CACHE: 256,
+          LOAD_FLAGS_BYPASS_PROXY: 512,
+          LOAD_FLAGS_CHARSET_CHANGE: 1024,
+          LOAD_FLAGS_STOP_CONTENT: 2048,
+          LOAD_FLAGS_FROM_EXTERNAL: 4096,
+          LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP: 8192,
+          LOAD_FLAGS_FIRST_LOAD: 16384,
+          LOAD_FLAGS_ALLOW_POPUPS: 32768,
+          LOAD_FLAGS_BYPASS_CLASSIFIER: 65536,
+          LOAD_FLAGS_FORCE_ALLOW_COOKIES: 131072,
+
+          STOP_NETWORK: 1,
+          STOP_CONTENT: 2,
+          STOP_ALL: 3,
+
+          canGoBack: false,
+          canGoForward: false,
+          goBack: function() { this._sendMessage("WebNavigation:GoBack", {}); },
+          goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); },
+          gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); },
+          loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
+            this._browser.userTypedValue = aURI;
+            this._browser._contentTitle = "";
+            this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags});
+          },
+          reload: function(aReloadFlags) { this._sendMessage("WebNavigation:Reload", {flags: aReloadFlags}); },
+          stop: function(aStopFlags) { this._sendMessage("WebNavigation:Stop", {flags: aStopFlags}); },
+          get document() { Components.utils.reportError("contentDocument is not available"); return null; },
+          get currentURI() {
+            if (!this._currentURI)
+               this._currentURI = this._browser._ios.newURI("about:blank", null, null);
+
+            return this._currentURI;
+          },
+          set currentURI(aURI) { this.loadURI(aURI.spec, null, null, null); },
+          referringURI: null,
+          get sessionHistory() { return null; },
+          set sessionHistory(aValue) { },
+
+          _currentURI: null,
+          _browser: this,
+          _sendMessage: function(aMessage, aData) {
+            try {
+              this._browser.messageManager.sendAsyncMessage(aMessage, aData);
+            }
+            catch (e) {
+              Components.utils.reportError(e);
+            }
+         },
+
+         QueryInterface: function(aIID) {
+           if (aIID.equals(Components.interfaces.nsIWebNavigation) || aIID.equals(Components.interfaces.nsISupports))
+             return this;
+           throw Components.results.NS_NOINTERFACE;
+         }
+        })
+      ]]></field>
+
       <property name="webNavigation"
-                onget="return this._remoteWebNavigation;"
+                onget="return this._webNavigation;"
                 readonly="true"/>
 
       <property name="contentWindow"
                 readonly="true"
                 onget="return null"/>
 
       <property name="sessionHistory"
                 onget="return null"
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1831,18 +1831,23 @@ const ContentTouchHandler = {
 
     // Check if the user touched near to one of the edges of the browser area
     // or if the urlbar is showing
     this.canCancelPan = (aX >= rect.left + kSafetyX) && (aX <= rect.right - kSafetyX) &&
                         (aY >= rect.top  + kSafetyY) && bcr.top == 0;
   },
 
   tapDown: function tapDown(aX, aY) {
+    // Ensure that the content process has gets an activate event
     let browser = getBrowser();
+    let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
     browser.focus();
+    try {
+      fl.activateRemoteFrame();
+    } catch (e) {}
 
     // if the page might capture touch events, we give it the option
     this.updateCanCancel(aX, aY);
     this.clickPrevented = false;
     this.panningPrevented = false;
 
     let dragger = Elements.browsers.customDragger;
     dragger.contentMouseCapture = this.canCancelPan && Browser.selectedTab.contentMightCaptureMouse;
@@ -2806,17 +2811,16 @@ Tab.prototype = {
     notification.appendChild(browser);
     Elements.browsers.insertBefore(notification, aInsertBefore);
 
     // stop about:blank from loading
     browser.stop();
 
     let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
     fl.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
-    fl.eventMode = Ci.nsIFrameLoader.EVENT_MODE_DONT_FORWARD_TO_CHILD;
 
     return browser;
   },
 
   _destroyBrowser: function _destroyBrowser() {
     if (this._browser) {
       let notification = this._notification;
       let browser = this._browser;
@@ -2955,17 +2959,22 @@ Tab.prototype = {
     let notification = this._notification;
     let browser = this._browser;
 
     if (aActive) {
       browser.setAttribute("type", "content-primary");
       Elements.browsers.selectedPanel = notification;
       browser.active = true;
       document.getElementById("tabs").selectedTab = this._chromeTab;
-      browser.focus();
+
+      // Ensure that the content process has gets an activate event
+      try {
+        let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
+        fl.activateRemoteFrame();
+      } catch (e) {}
     } else {
       browser.messageManager.sendAsyncMessage("Browser:Blur", { });
       browser.setAttribute("type", "content");
       browser.active = false;
     }
   },
 
   get active() {
--- a/mobile/chrome/tests/Makefile.in
+++ b/mobile/chrome/tests/Makefile.in
@@ -46,32 +46,29 @@ ADDONSRC = $(srcdir)/addons
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_FILES = \
   head.js \
   remote_autocomplete.js \
   remote_contentpopup.js \
   remote_head.js \
-  remote_focus.js \
   remote_forms.js \
   remote_formsZoom.js \
   remote_vkb.js \
   browser_addons.js \
   browser_appmenu.js \
   browser_autocompletesearch.js\
   browser_awesomescreen.js \
   browser_blank_01.html \
   browser_blank_02.html \
   browser_bookmarks.js \
   browser_contacts.js \
   browser_dragger.js \
   browser_find.js \
-  browser_focus.html \
-  browser_focus.js \
   browser_forms.html \
   $(warning browser_forms.js disabled due to failures) \
   browser_formsZoom.html \
   $(warning browser_formsZoom.js disabled due to failures) \
   browser_history.js \
   browser_mainui.js \
   browser_preferences_text.js \
   browser_rect.js \
deleted file mode 100644
--- a/mobile/chrome/tests/browser_focus.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-  <head>
-    <title>Focus/Activate test</title>
-  </head>
-  <body>
-  </body>
-</html>
deleted file mode 100644
--- a/mobile/chrome/tests/browser_focus.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-let testURL = chromeRoot + "browser_focus.html";
-let newTab = null;
-
-function test() {
-  waitForExplicitFinish();
-
-  registerCleanupFunction(function() {
-    try {
-      messageManager.sendAsyncMessage("Test:E10SFocusTestFinished", {});
-      Browser.closeTab(newTab);
-    } finally {
-      newTab = null;
-    }
-  });
-
-  messageManager.addMessageListener("pageshow", function listener(aMessage) {
-    if (newTab && newTab.browser.currentURI.spec != "about:blank") {
-      messageManager.removeMessageListener("pageshow", listener);
-      setTimeout(onTabLoaded, 0);
-    }
-  });
-
-  newTab = Browser.addTab(testURL, true);
-}
-
-function onTabLoaded() {
-  // ensure that the <browser> is not already focused
-  newTab.browser.blur();
-  messageManager.loadFrameScript(chromeRoot + "remote_focus.js", false);
-  testFocus();
-}
-
-function testFocus() {
-  onMessageOnce(messageManager, "Test:E10SFocusReceived", function() {
-    ok("Focus in <browser remote> triggered activateRemoteFrame as expected");
-    testBlur();
-  });
-  newTab.browser.focus();
-}
-
-function testBlur() {
-  onMessageOnce(messageManager, "Test:E10SBlurReceived", function() {
-    ok("Blur in <browser remote> triggerered deactivateRemoteFrame as expected");
-    endTest();
-  });
-  newTab.browser.blur();
-}
-
-function endTest() {
-  finish();
-}
deleted file mode 100644
--- a/mobile/chrome/tests/remote_focus.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function focusReceived() {
-  sendAsyncMessage("Test:E10SFocusReceived");
-}
-
-function blurReceived() {
-  sendAsyncMessage("Test:E10SBlurReceived");
-}
-
-addEventListener("focus", focusReceived, true);
-addEventListener("blur", blurReceived, true);
-
-addMessageListener("Test:E10SFocusTestFinished", function testFinished() {
-  removeEventListener("focus", focusReceived, true);
-  removeEventListener("blur", blurReceived, true);
-  removeMessageListener("Test:E10SFocusTestFinished", testFinished);
-});
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3203,32 +3203,24 @@ pref("webgl.verbose", false);
 pref("webgl.prefer-native-gl", false);
 
 #ifdef XP_WIN
 // The default TCP send window on Windows is too small, and autotuning only occurs on receive
 pref("network.tcp.sendbuffer", 131072);
 #endif
 
 // Whether to disable acceleration for all widgets.
-#ifdef MOZ_E10S_COMPAT
-pref("layers.acceleration.disabled", true);
-#else
 pref("layers.acceleration.disabled", false);
-#endif
 
 // Whether to force acceleration on, ignoring blacklists.
 pref("layers.acceleration.force-enabled", false);
 
 #ifdef XP_WIN
 // Whether to disable the automatic detection and use of direct2d.
-#ifdef MOZ_E10S_COMPAT
-pref("gfx.direct2d.disabled", true);
-#else
 pref("gfx.direct2d.disabled", false);
-#endif
 // Whether to attempt to enable Direct2D regardless of automatic detection or
 // blacklisting
 pref("gfx.direct2d.force-enabled", false);
 
 pref("layers.prefer-opengl", false);
 pref("layers.prefer-d3d9", false);
 #endif
 
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
+++ b/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
@@ -455,15 +455,15 @@ function getVisibleRect() {
   </box>
   <vbox id="right_sidebar" class="sidebar" style="background-color: blue"><button label="right sidebar"/></vbox>
   </hbox>
 </scrollbox>
 
   <box>
     <html:div style="position: relative; overflow: hidden; max-width: 0px; max-height: 0px; visibility: hidden;">
     <html:div id="browsers" style="position: absolute;">
-        <!-- <browser id="googlenews" src="http://www.webhamster.com/" type="content" remote="true" style="width: 1024px; height: 614px"/> -->
-	<iframe id="googlenews" src="http://news.google.com/" type="content" remote="true" style="width: 1024px; height: 614px"/>
+        <!-- <browser id="googlenews" src="http://www.webhamster.com/" type="content" style="width: 1024px; height: 614px"/> -->
+	<iframe id="googlenews" src="http://news.google.com/" type="content" style="width: 1024px; height: 614px"/>
     </html:div>
     </html:div>
   </box>
 
 </window>
--- a/toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
+++ b/toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
@@ -1,4 +1,5 @@
 pref("toolkit.defaultChromeURI", "chrome://tile/content/foo.xul");
 pref("javascript.options.tracejit.chrome",  true);
 pref("javascript.options.tracejit.content", false);
 pref("browser.dom.window.dump.enabled", true);
+pref("dom.ipc.tabs.enabled", true);
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -256,117 +256,25 @@
                 readonly="true"/>
 
       <field name="_docShell">null</field>
 
       <property name="docShell"
                 onget="return this._docShell || (this._docShell = this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell);"
                 readonly="true"/>
 
-      <property name="docShellIsActive">
-        <getter>
-          <![CDATA[
-            return this.docShell && this.docShell.isActive;
-          ]]>
-        </getter>
-        <setter>
-          <![CDATA[
-            if (this.docShell)
-              return this.docShell.isActive = val;
-            return false;
-          ]]>
-        </setter>
-      </property>
-
-      <property name="isRemoteBrowser"
-                onget="return (this.getAttribute('remote') == 'true');"
-                readonly="true"/>
-
       <property name="messageManager"
                 onget="return this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.messageManager;"
                 readonly="true"/>
 
       <field name="_webNavigation">null</field>
 
-      <field name="_remoteWebNavigation"><![CDATA[
-        ({
-          LOAD_FLAGS_MASK: 65535,
-          LOAD_FLAGS_NONE: 0,
-          LOAD_FLAGS_IS_REFRESH: 16,
-          LOAD_FLAGS_IS_LINK: 32,
-          LOAD_FLAGS_BYPASS_HISTORY: 64,
-          LOAD_FLAGS_REPLACE_HISTORY: 128,
-          LOAD_FLAGS_BYPASS_CACHE: 256,
-          LOAD_FLAGS_BYPASS_PROXY: 512,
-          LOAD_FLAGS_CHARSET_CHANGE: 1024,
-          LOAD_FLAGS_STOP_CONTENT: 2048,
-          LOAD_FLAGS_FROM_EXTERNAL: 4096,
-          LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP: 8192,
-          LOAD_FLAGS_FIRST_LOAD: 16384,
-          LOAD_FLAGS_ALLOW_POPUPS: 32768,
-          LOAD_FLAGS_BYPASS_CLASSIFIER: 65536,
-          LOAD_FLAGS_FORCE_ALLOW_COOKIES: 131072,
-
-          STOP_NETWORK: 1,
-          STOP_CONTENT: 2,
-          STOP_ALL: 3,
-
-          canGoBack: false,
-          canGoForward: false,
-          goBack: function() { this._sendMessage("WebNavigation:GoBack", {}); },
-          goForward: function() { this._sendMessage("WebNavigation:GoForward", {}); },
-          gotoIndex: function(aIndex) { this._sendMessage("WebNavigation:GotoIndex", {index: aIndex}); },
-          loadURI: function(aURI, aLoadFlags, aReferrer, aPostData, aHeaders) {
-            this._browser.userTypedValue = aURI;
-            this._browser._contentTitle = "";
-            this._sendMessage("WebNavigation:LoadURI", {uri: aURI, flags: aLoadFlags});
-          },
-          reload: function(aReloadFlags) { this._sendMessage("WebNavigation:Reload", {flags: aReloadFlags}); },
-          stop: function(aStopFlags) { this._sendMessage("WebNavigation:Stop", {flags: aStopFlags}); },
-          get document() { Components.utils.reportError("contentDocument is not available"); return null; },
-          get currentURI() {
-            if (!this._currentURI)
-               this._currentURI = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("about:blank", null, null);
-
-            return this._currentURI;
-          },
-          set currentURI(aURI) { this.loadURI(aURI.spec, null, null, null); },
-          referringURI: null,
-          get sessionHistory() { return null; },
-          set sessionHistory(aValue) { },
-
-          _currentURI: null,
-          _browser: this,
-          _sendMessage: function(aMessage, aData) {
-            try {
-              this._browser.messageManager.sendAsyncMessage(aMessage, aData);
-            }
-            catch (e) {
-              Components.utils.reportError(e);
-            }
-         },
-
-         QueryInterface: function(aIID) {
-           if (aIID.equals(Components.interfaces.nsIWebNavigation) || aIID.equals(Components.interfaces.nsISupports))
-             return this;
-           throw Components.results.NS_NOINTERFACE;
-         }
-        })
-      ]]></field>
-
       <property name="webNavigation"
-                readonly="true">
-        <getter>
-        <![CDATA[
-          if (!this._webNavigation)
-            this._webNavigation = this.isRemoteBrowser ? this._remoteWebNavigation : this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
-          return this._webNavigation;
-        ]]>
-        </getter>
-      </property>
+                onget="return this._webNavigation || (this._webNavigation = this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation));"
+                readonly="true"/>
 
       <field name="_webBrowserFind">null</field>
 
       <property name="webBrowserFind"
                 readonly="true">
         <getter>
         <![CDATA[
           if (!this._webBrowserFind)
--- a/widget/public/nsGUIEvent.h
+++ b/widget/public/nsGUIEvent.h
@@ -816,26 +816,17 @@ public:
 };
 
 /**
  * Mouse event
  */
 
 class nsMouseEvent_base : public nsInputEvent
 {
-private:
-  friend class mozilla::dom::PBrowserParent;
-  friend class mozilla::dom::PBrowserChild;
-
 public:
-
-  nsMouseEvent_base()
-  {
-  }
-
   nsMouseEvent_base(PRBool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type)
   : nsInputEvent(isTrusted, msg, w, type), button(0), pressure(0),
     inputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE) {}
 
   /// The possible related target
   nsCOMPtr<nsISupports> relatedTarget;
 
   PRInt16               button;
@@ -845,30 +836,22 @@ public:
   float                 pressure;
 
   // Possible values at nsIDOMNSMouseEvent
   PRUint16              inputSource;
 };
 
 class nsMouseEvent : public nsMouseEvent_base
 {
-private:
-  friend class mozilla::dom::PBrowserParent;
-  friend class mozilla::dom::PBrowserChild;
-
 public:
   enum buttonType  { eLeftButton = 0, eMiddleButton = 1, eRightButton = 2 };
   enum reasonType  { eReal, eSynthesized };
   enum contextType { eNormal, eContextMenuKey };
   enum exitType    { eChild, eTopLevel };
 
-  nsMouseEvent()
-  {
-  }
-
 protected:
   nsMouseEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w,
                PRUint8 structType, reasonType aReason)
     : nsMouseEvent_base(isTrusted, msg, w, structType),
       acceptActivation(PR_FALSE), ignoreRootScrollFrame(PR_FALSE),
       reason(aReason), context(eNormal), exit(eChild), clickCount(0)
   {
     if (msg == NS_MOUSE_MOVE) {
@@ -965,25 +948,17 @@ struct nsAlternativeCharCode {
   {
   }
   PRUint32 mUnshiftedCharCode;
   PRUint32 mShiftedCharCode;
 };
 
 class nsKeyEvent : public nsInputEvent
 {
-private:
-  friend class mozilla::dom::PBrowserParent;
-  friend class mozilla::dom::PBrowserChild;
-
 public:
-  nsKeyEvent()
-  {
-  }
-
   nsKeyEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w)
     : nsInputEvent(isTrusted, msg, w, NS_KEY_EVENT),
       keyCode(0), charCode(0), isChar(0)
   {
   }
 
   /// see NS_VK codes
   PRUint32        keyCode;   
@@ -1200,24 +1175,16 @@ public:
  *    scrolling.
  *  - preventDefault on a DOMMouseScroll event results in no scrolling.
  *  - DOMMouseScroll events aren't polluted with a kHasPixels flag.
  *  - You can make use of pixel scroll DOM events (MozMousePixelScroll).
  */
 
 class nsMouseScrollEvent : public nsMouseEvent_base
 {
-private:
-  friend class mozilla::dom::PBrowserParent;
-  friend class mozilla::dom::PBrowserChild;
-
-  nsMouseScrollEvent()
-  {
-  }
-
 public:
   enum nsMouseScrollFlags {
     kIsFullPage =   1 << 0,
     kIsVertical =   1 << 1,
     kIsHorizontal = 1 << 2,
     kHasPixels =    1 << 3, // Marks line scroll events that are provided as
                             // a fallback for pixel scroll events.
                             // These scroll events are used by things that can't
--- a/widget/public/nsGUIEventIPC.h
+++ b/widget/public/nsGUIEventIPC.h
@@ -148,71 +148,16 @@ struct ParamTraits<nsMouseScrollEvent>
   {
     return ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
            ReadParam(aMsg, aIter, &aResult->scrollFlags) &&
            ReadParam(aMsg, aIter, &aResult->delta) &&
            ReadParam(aMsg, aIter, &aResult->scrollOverflow);
   }
 };
 
-
-template<>
-struct ParamTraits<nsMouseEvent>
-{
-  typedef nsMouseEvent paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, static_cast<nsMouseEvent_base>(aParam));
-    WriteParam(aMsg, aParam.ignoreRootScrollFrame);
-    WriteParam(aMsg, (PRUint8) aParam.reason);
-    WriteParam(aMsg, (PRUint8) aParam.context);
-    WriteParam(aMsg, (PRUint8) aParam.exit);
-    WriteParam(aMsg, aParam.clickCount);
-  }
-
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    bool rv;
-    PRUint8 reason, context, exit;
-    rv = ReadParam(aMsg, aIter, static_cast<nsMouseEvent_base*>(aResult)) &&
-         ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) &&
-         ReadParam(aMsg, aIter, &reason) &&
-         ReadParam(aMsg, aIter, &context) &&
-         ReadParam(aMsg, aIter, &exit) &&
-         ReadParam(aMsg, aIter, &aResult->clickCount);
-    aResult->reason = static_cast<nsMouseEvent::reasonType>(reason);
-    aResult->context = static_cast<nsMouseEvent::contextType>(context);
-    aResult->exit = static_cast<nsMouseEvent::exitType>(exit);
-    return rv;
-  }
-};
-
-template<>
-struct ParamTraits<nsKeyEvent>
-{
-  typedef nsKeyEvent paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, static_cast<nsInputEvent>(aParam));
-    WriteParam(aMsg, aParam.keyCode);
-    WriteParam(aMsg, aParam.charCode);
-    WriteParam(aMsg, aParam.isChar);
-  }
-
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    return ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
-           ReadParam(aMsg, aIter, &aResult->keyCode) &&
-           ReadParam(aMsg, aIter, &aResult->charCode) &&
-           ReadParam(aMsg, aIter, &aResult->isChar);
-  }
-};
-
 template<>
 struct ParamTraits<nsTextRangeStyle>
 {
   typedef nsTextRangeStyle paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, aParam.mDefinedStyles);
--- a/widget/src/xpwidgets/PuppetWidget.cpp
+++ b/widget/src/xpwidgets/PuppetWidget.cpp
@@ -500,26 +500,16 @@ PuppetWidget::OnIMESelectionChange(void)
       mTabChild->SendNotifyIMESelection(mIMELastReceivedSeqno,
                                         queryEvent.GetSelectionStart(),
                                         queryEvent.GetSelectionEnd());
     }
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PuppetWidget::SetCursor(nsCursor aCursor)
-{
-  if (!mTabChild ||
-      !mTabChild->SendSetCursor(aCursor)) {
-    return NS_ERROR_FAILURE;
-  }
-  return NS_OK;
-}
-
 nsresult
 PuppetWidget::DispatchPaintEvent()
 {
   NS_ABORT_IF_FALSE(!mDirtyRegion.IsEmpty(), "paint event logic messed up");
 
   nsIntRect dirtyRect = mDirtyRegion.GetBounds();
   nsPaintEvent event(PR_TRUE, NS_PAINT, this);
   event.refPoint.x = dirtyRect.x;
--- a/widget/src/xpwidgets/PuppetWidget.h
+++ b/widget/src/xpwidgets/PuppetWidget.h
@@ -175,18 +175,16 @@ public:
   NS_IMETHOD SetInputMode(const IMEContext& aContext);
   NS_IMETHOD GetInputMode(IMEContext& aContext);
   NS_IMETHOD CancelComposition();
   NS_IMETHOD OnIMEFocusChange(PRBool aFocus);
   NS_IMETHOD OnIMETextChange(PRUint32 aOffset, PRUint32 aEnd,
                              PRUint32 aNewEnd);
   NS_IMETHOD OnIMESelectionChange(void);
 
-  NS_IMETHOD SetCursor(nsCursor aCursor);
-
   // Gets the DPI of the screen corresponding to this widget.
   // Contacts the parent process which gets the DPI from the
   // proper widget there. TODO: Handle DPI changes that happen
   // later on.
   virtual float GetDPI();
 
 private:
   nsresult DispatchPaintEvent();