Straight revert of content/* dom/interfaces/canvas/* dom/ipc/* toolkit/content/tests/fennec-tile-testapp/* netwerk/* security/manager/ssl* to their mozilla-central state. This named branch will be used as a temporary area to merge just the plugin portion of electrolysis into mozilla-central. electrolysis-plugins-only
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 30 Nov 2009 13:31:41 -0500
branchelectrolysis-plugins-only
changeset 36117 9e7a2c507c41dede81544a4fdeeda3aac678508b
parent 36116 b0943d83c24fb8966fbb2c2b97fbc7a22bd4487c
child 36118 ddc35db526ee3b78535e41259a6178cd07d8a528
push idunknown
push userunknown
push dateunknown
milestone1.9.3a1pre
Straight revert of content/* dom/interfaces/canvas/* dom/ipc/* toolkit/content/tests/fennec-tile-testapp/* netwerk/* security/manager/ssl* to their mozilla-central state. This named branch will be used as a temporary area to merge just the plugin portion of electrolysis into mozilla-central.
content/base/public/nsIFrameLoader.idl
content/base/src/Makefile.in
content/base/src/nsFrameLoader.cpp
content/base/src/nsFrameLoader.h
content/base/src/nsGkAtomList.h
content/base/src/nsXMLHttpRequest.h
content/canvas/public/DocumentRendererChild.h
content/canvas/public/DocumentRendererParent.h
content/canvas/public/Makefile.in
content/canvas/public/nsICanvasRenderingContextInternal.h
content/canvas/src/DocumentRendererChild.cpp
content/canvas/src/DocumentRendererParent.cpp
content/canvas/src/Makefile.in
content/canvas/src/WebGLContext.h
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/events/public/nsIPrivateDOMEvent.h
content/events/src/Makefile.in
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
content/events/src/nsDOMNotifyPaintEvent.cpp
content/events/src/nsDOMNotifyPaintEvent.h
content/events/src/nsDOMScrollAreaEvent.cpp
content/events/src/nsDOMScrollAreaEvent.h
content/events/src/nsDOMUIEvent.cpp
content/events/src/nsDOMUIEvent.h
dom/ipc/ContentProcessChild.cpp
dom/ipc/ContentProcessChild.h
dom/ipc/ContentProcessParent.cpp
dom/ipc/ContentProcessParent.h
dom/ipc/ContentProcessThread.cpp
dom/ipc/ContentProcessThread.h
dom/ipc/Makefile.in
dom/ipc/PContentProcess.ipdl
dom/ipc/PDocumentRenderer.ipdl
dom/ipc/PIFrameEmbedding.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabMessageUtils.cpp
dom/ipc/TabMessageUtils.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/TabTypes.h
dom/ipc/ipdl.mk
dom/ipc/jar.mn
dom/ipc/test.xul
netwerk/Makefile.in
netwerk/build.mk
netwerk/build/Makefile.in
netwerk/build/nsNetModule.cpp
netwerk/dns/src/nsIDNKitInterface.h
netwerk/ipc/Makefile.in
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoChild.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/ipc/PNecko.ipdl
netwerk/ipc/ipdl.mk
netwerk/protocol/http/src/HttpChannelChild.cpp
netwerk/protocol/http/src/HttpChannelChild.h
netwerk/protocol/http/src/HttpChannelParent.cpp
netwerk/protocol/http/src/HttpChannelParent.h
netwerk/protocol/http/src/Makefile.in
netwerk/protocol/http/src/PHttpChannel.ipdl
netwerk/protocol/http/src/ipdl.mk
netwerk/protocol/http/src/nsHttp.h
netwerk/protocol/http/src/nsHttpChunkedDecoder.h
netwerk/protocol/http/src/nsHttpHandler.cpp
netwerk/protocol/http/src/nsHttpHeaderArray.h
netwerk/protocol/http/src/nsHttpRequestHead.h
security/manager/ssl/src/nsSmartCardEvent.cpp
security/manager/ssl/src/nsSmartCardEvent.h
toolkit/content/tests/fennec-tile-testapp/application.ini
toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest
toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul
toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
toolkit/content/tests/fennec-tile-testapp/chrome/content/main.xul
toolkit/content/tests/fennec-tile-testapp/chrome/content/overlay.js
toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.dtd
toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.properties
toolkit/content/tests/fennec-tile-testapp/chrome/skin/overlay.css
toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
toolkit/content/tests/fennec-tile-testapp/install.rdf
toolkit/content/tests/fennec-tile-testapp/logread.py
--- a/content/base/public/nsIFrameLoader.idl
+++ b/content/base/public/nsIFrameLoader.idl
@@ -36,19 +36,18 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 interface nsIDocShell;
 interface nsIURI;
-interface nsIFrame;
 
-[scriptable, uuid(8f94788d-ec69-4220-971c-0fd68d47b80f)]
+[scriptable, uuid(d675c531-6bdc-417c-b176-635060105f07)]
 interface nsIFrameLoader : nsISupports
 {
   /**
    * Get the docshell from the frame loader.
    */
   readonly attribute nsIDocShell docShell;
 
   /**
@@ -70,45 +69,16 @@ interface nsIFrameLoader : nsISupports
   void destroy();
 
   /**
    * Find out whether the loader's frame is at too great a depth in
    * the frame tree.  This can be used to decide what operations may
    * or may not be allowed on the loader's docshell.
    */
   readonly attribute boolean depthTooGreat;
-
-  /**
-   * Updates the position and size of the subdocument loaded by this frameloader.
-   *
-   *  @param aIFrame The nsIFrame for the content node that owns this frameloader
-   */
-  [noscript] void updatePositionAndSize(in nsIFrame aIFrame);
-
-  /**
-   * Activate remote frame.
-   * Throws an exception with non-remote frames.
-   */
-  void activateRemoteFrame();
-
-  /**
-   * @see nsIDOMWindowUtils sendMouseEvent.
-   */
-  void sendCrossProcessMouseEvent(in AString aType,
-                                  in float aX,
-                                  in float aY,
-                                  in long aButton,
-                                  in long aClickCount,
-                                  in long aModifiers,
-                                  [optional] in boolean aIgnoreRootScrollFrame);
-
-  /**
-   * Activate event forwarding from client (remote frame) to parent.
-   */
-  void activateFrameEvent(in AString aType, in boolean capture);
 };
 
 native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);
 
 [scriptable, uuid(8f3b12a0-35ae-4e0d-9152-8e0d7e49d446)]
 interface nsIFrameLoaderOwner : nsISupports
 {
   /**
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -138,29 +138,26 @@ CPPSRCS		= \
 GQI_SRCS = contentbase.gqi
 
 # we don't want the shared lib, but we want to force the creation of a
 # static lib.
 FORCE_STATIC_LIB = 1
 
 EXTRA_COMPONENTS = $(srcdir)/nsBadCertHandler.js
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES	+= \
 		-I$(srcdir)/../../events/src \
 		-I$(srcdir)/../../xml/content/src \
 		-I$(srcdir)/../../../layout/xul/base/src \
 		-I$(srcdir)/../../xul/content/src \
 		-I$(srcdir)/../../html/content/src \
 		-I$(srcdir)/../../base/src \
 		-I$(srcdir)/../../xbl/src \
 		-I$(srcdir)/../../../layout/generic \
 		-I$(srcdir)/../../../layout/style \
 		-I$(srcdir)/../../../dom/base \
 		-I$(srcdir)/../../xml/document/src \
 		-I$(topsrcdir)/xpcom/io \
-		-I$(topsrcdir)/dom/ipc \
 		$(NULL)
 
 DEFINES += -D_IMPL_NS_LAYOUT
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -18,17 +18,16 @@
  * The Initial Developer of the Original Code is
  * Netscape Communications Corporation.
  * Portions created by the Initial Developer are Copyright (C) 1998
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Johnny Stenback <jst@netscape.com> (original author)
  *   Boris Zbarsky <bzbarsky@mit.edu>
- *   Frederic Plourde <frederic.plourde@polymtl.ca>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either of 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
@@ -39,22 +38,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Class for managing loading of a subframe (creation of the docshell,
  * handling of loads in it, recursion-checking).
  */
 
-#ifdef MOZ_IPC
-#  include "base/basictypes.h"
-#endif
-
-#include "prenv.h"
-
 #include "nsIDOMHTMLIFrameElement.h"
 #include "nsIDOMHTMLFrameElement.h"
 #include "nsIDOMWindow.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsIContent.h"
 #include "nsIContentViewer.h"
 #include "nsIDocument.h"
@@ -79,42 +72,26 @@
 #include "nsIFrameFrame.h"
 #include "nsDOMError.h"
 #include "nsPresShellIterator.h"
 #include "nsGUIEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsISHistory.h"
 #include "nsISHistoryInternal.h"
 #include "nsIDOMNSHTMLDocument.h"
-#include "nsLayoutUtils.h"
+#include "nsIView.h"
 
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsNetUtil.h"
 
 #include "nsGkAtoms.h"
 #include "nsINameSpaceManager.h"
 
 #include "nsThreadUtils.h"
-#include "nsIView.h"
-
-#ifdef MOZ_WIDGET_GTK2
-#include "mozcontainer.h"
-
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-#endif
-
-#ifdef MOZ_IPC
-#include "ContentProcessParent.h"
-#include "TabParent.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-#endif
 
 class nsAsyncDocShellDestroyer : public nsRunnable
 {
 public:
   nsAsyncDocShellDestroyer(nsIDocShell* aDocShell)
     : mDocShell(aDocShell)
   {
   }
@@ -226,44 +203,21 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
   }
   return rv;
 }
 
 nsresult
 nsFrameLoader::ReallyStartLoading()
 {
   NS_ENSURE_STATE(mURIToLoad && mOwnerContent && mOwnerContent->IsInDoc());
-
-  nsresult rv = MaybeCreateDocShell();
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    if (!mChildProcess) {
-      TryNewProcess();
-    }
+  // Just to be safe, recheck uri.
+  nsresult rv = CheckURILoad(mURIToLoad);
+  NS_ENSURE_SUCCESS(rv, rv);
 
-    if (!mChildProcess) {
-      NS_WARNING("Couldn't create child process for iframe.");
-      return NS_ERROR_FAILURE;
-    }
-
-    // FIXME get error codes from child
-    mChildProcess->LoadURL(mURIToLoad);
-    return NS_OK;
-  }
-#endif
-
-  NS_ASSERTION(mDocShell,
-               "MaybeCreateDocShell succeeded with a null mDocShell");
-
-  // Just to be safe, recheck uri.
-  rv = CheckURILoad(mURIToLoad);
+  rv = EnsureDocShell();
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
   mDocShell->CreateLoadInfo(getter_AddRefs(loadInfo));
   NS_ENSURE_TRUE(loadInfo, NS_ERROR_FAILURE);
 
   // We'll use our principal, not that of the document loaded inside us.  This
   // is very important; needed to prevent XSS attacks on documents loaded in
@@ -317,48 +271,30 @@ nsFrameLoader::CheckURILoad(nsIURI* aURI
   nsresult rv =
     secMan->CheckLoadURIWithPrincipal(principal, aURI,
                                       nsIScriptSecurityManager::STANDARD);
   if (NS_FAILED(rv)) {
     return rv; // We're not
   }
 
   // Bail out if this is an infinite recursion scenario
-  rv = MaybeCreateDocShell();
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    return NS_OK;
-  }
-#endif
   return CheckForRecursiveLoad(aURI);
 }
 
 NS_IMETHODIMP
 nsFrameLoader::GetDocShell(nsIDocShell **aDocShell)
 {
   *aDocShell = nsnull;
 
   // 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;
-#ifdef MOZ_IPC
-    if (mRemoteFrame) {
-      NS_WARNING("No docshells for remote frames!");
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-#endif
-    NS_ASSERTION(mDocShell,
-                 "MaybeCreateDocShell succeeded, but null mDocShell");
+    nsresult rv = EnsureDocShell();
+    NS_ENSURE_SUCCESS(rv, rv);
   }
 
   *aDocShell = mDocShell;
   NS_IF_ADDREF(*aDocShell);
 
   return NS_OK;
 }
 
@@ -535,88 +471,73 @@ AllDescendantsOfType(nsIDocShellTreeItem
 
 bool
 nsFrameLoader::Show(PRInt32 marginWidth, PRInt32 marginHeight,
                     PRInt32 scrollbarPrefX, PRInt32 scrollbarPrefY,
                     nsIFrameFrame* frame)
 {
   nsContentType contentType;
 
-  nsresult rv = MaybeCreateDocShell();
+  nsresult rv = EnsureDocShell();
   if (NS_FAILED(rv)) {
     return false;
   }
 
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    contentType = eContentTypeUI;
-  }
-  else
-#endif
-  {
-    if (!mDocShell)
-      return false;
+  if (!mDocShell)
+    return false;
+
+  nsCOMPtr<nsIPresShell> presShell;
+  mDocShell->GetPresShell(getter_AddRefs(presShell));
+  if (presShell)
+    return true;
 
-    nsCOMPtr<nsIPresShell> presShell;
-    mDocShell->GetPresShell(getter_AddRefs(presShell));
-    if (presShell)
-      return true;
-
-    mDocShell->SetMarginWidth(marginWidth);
-    mDocShell->SetMarginHeight(marginHeight);
+  mDocShell->SetMarginWidth(marginWidth);
+  mDocShell->SetMarginHeight(marginHeight);
 
-    nsCOMPtr<nsIScrollable> sc = do_QueryInterface(mDocShell);
-    if (sc) {
-      sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
-                                         scrollbarPrefX);
-      sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
-                                         scrollbarPrefY);
-    }
+  nsCOMPtr<nsIScrollable> sc = do_QueryInterface(mDocShell);
+  if (sc) {
+    sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
+                                       scrollbarPrefX);
+    sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
+                                       scrollbarPrefY);
+  }
 
 
-    nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(mDocShell);
-    NS_ASSERTION(treeItem,
-                 "Found a nsIDocShell that isn't a nsIDocShellTreeItem.");
+  nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(mDocShell);
+  NS_ASSERTION(treeItem,
+               "Found a nsIDocShell that isn't a nsIDocShellTreeItem.");
 
-    PRInt32 itemType;
-    treeItem->GetItemType(&itemType);
+  PRInt32 itemType;
+  treeItem->GetItemType(&itemType);
 
-    if (itemType == nsIDocShellTreeItem::typeChrome)
-      contentType = eContentTypeUI;
-    else {
-      nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
-      treeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
-      contentType = sameTypeParent ? eContentTypeContentFrame : eContentTypeContent;
-    }
+  if (itemType == nsIDocShellTreeItem::typeChrome)
+    contentType = eContentTypeUI;
+  else {
+    nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
+    treeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
+    contentType = sameTypeParent ? eContentTypeContentFrame : eContentTypeContent;
   }
 
   nsIView* view = frame->CreateViewAndWidget(contentType);
   if (!view)
     return false;
 
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    return ShowRemoteFrame(frame, view);
-  }
-#endif
-
   nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mDocShell);
   NS_ASSERTION(baseWindow, "Found a nsIDocShell that isn't a nsIBaseWindow.");
   baseWindow->InitWindow(nsnull, view->GetWidget(), 0, 0, 10, 10);
   // This is kinda whacky, this "Create()" call doesn't really
   // create anything, one starts to wonder why this was named
   // "Create"...
   baseWindow->Create();
   baseWindow->SetVisibility(PR_TRUE);
 
   // Trigger editor re-initialization if midas is turned on in the
   // sub-document. This shouldn't be necessary, but given the way our
   // editor works, it is. See
   // https://bugzilla.mozilla.org/show_bug.cgi?id=284245
-  nsCOMPtr<nsIPresShell> presShell;
   mDocShell->GetPresShell(getter_AddRefs(presShell));
   if (presShell) {
     nsCOMPtr<nsIDOMNSHTMLDocument> doc =
       do_QueryInterface(presShell->GetDocument());
 
     if (doc) {
       nsAutoString designMode;
       doc->GetDesignMode(designMode);
@@ -626,77 +547,16 @@ nsFrameLoader::Show(PRInt32 marginWidth,
         doc->SetDesignMode(NS_LITERAL_STRING("on"));
       }
     }
   }
 
   return true;
 }
 
-#ifdef MOZ_IPC
-bool
-nsFrameLoader::ShowRemoteFrame(nsIFrameFrame* frame, nsIView* view)
-{
-  NS_ASSERTION(mRemoteFrame, "ShowRemote only makes sense on remote frames.");
-
-  TryNewProcess();
-  if (!mChildProcess) {
-    NS_ERROR("Couldn't create child process.");
-    return false;
-  }
-
-  nsIWidget* w = view->GetWidget();
-  if (!w) {
-    NS_ERROR("Our view doesn't have a widget. Totally stuffed!");
-    return false;
-  }
-
-  nsIntSize size = GetSubDocumentSize(frame->GetFrame());
-
-#ifdef XP_WIN
-  HWND parentwin =
-    static_cast<HWND>(w->GetNativeData(NS_NATIVE_WINDOW));
-
-  mChildProcess->SendcreateWidget(parentwin);
-#elif defined(MOZ_WIDGET_GTK2)
-  GdkWindow* parent_win =
-    static_cast<GdkWindow*>(w->GetNativeData(NS_NATIVE_WINDOW));
-
-  gpointer user_data = nsnull;
-  gdk_window_get_user_data(parent_win, &user_data);
-
-  MozContainer* parentMozContainer = MOZ_CONTAINER(user_data);
-  GtkContainer* container = GTK_CONTAINER(parentMozContainer);
-
-  // create the socket for the child and add it to our view's widget
-  mRemoteSocket = gtk_socket_new();
-  gtk_widget_set_parent_window(mRemoteSocket, parent_win);
-  gtk_container_add(container, mRemoteSocket);
-  gtk_widget_realize(mRemoteSocket);
-
-  // set the child window's size and position
-  GtkAllocation alloc = { 0, 0, size.width, size.height };
-  gtk_widget_size_allocate(mRemoteSocket, &alloc);
-
-  gtk_widget_show(mRemoteSocket);
-  GdkNativeWindow id = gtk_socket_get_id(GTK_SOCKET(mRemoteSocket));
-  mChildProcess->SendcreateWidget(id);
-#elif defined(XP_MACOSX)
-#  warning IMPLEMENT ME
-
-#else
-#error TODO for this platform
-#endif
-
-  mChildProcess->Move(0, 0, size.width, size.height);
-
-  return true;
-}
-#endif
-
 void
 nsFrameLoader::Hide()
 {
   if (!mDocShell)
     return;
 
   nsCOMPtr<nsIContentViewer> contentViewer;
   mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
@@ -990,37 +850,30 @@ nsFrameLoader::Destroy()
     doc = mOwnerContent->GetOwnerDoc();
 
     if (doc) {
       doc->SetSubDocumentFor(mOwnerContent, nsnull);
     }
 
     mOwnerContent = nsnull;
   }
-#ifdef MOZ_IPC
-  if (mChildProcess) {
-    mChildProcess->SetOwnerElement(nsnull);
-    ContentProcessParent::GetSingleton()->SendPIFrameEmbeddingDestructor(mChildProcess);
-    mChildProcess = nsnull;
-  }
-#endif
 
   // Let the tree owner know we're gone.
   if (mIsTopLevelContent) {
     nsCOMPtr<nsIDocShellTreeItem> ourItem = do_QueryInterface(mDocShell);
     if (ourItem) {
       nsCOMPtr<nsIDocShellTreeItem> parentItem;
       ourItem->GetParent(getter_AddRefs(parentItem));
       nsCOMPtr<nsIDocShellTreeOwner> owner = do_GetInterface(parentItem);
       if (owner) {
         owner->ContentShellRemoved(ourItem);
       }
     }
   }
-
+  
   // Let our window know that we are gone
   nsCOMPtr<nsPIDOMWindow> win_private(do_GetInterface(mDocShell));
   if (win_private) {
     win_private->SetFrameElementInternal(nsnull);
   }
 
   if ((mNeedsAsyncDestroy || !doc ||
        NS_FAILED(doc->FinalizeFrameLoader(this))) && mDocShell) {
@@ -1041,74 +894,24 @@ nsFrameLoader::Destroy()
 
 NS_IMETHODIMP
 nsFrameLoader::GetDepthTooGreat(PRBool* aDepthTooGreat)
 {
   *aDepthTooGreat = mDepthTooGreat;
   return NS_OK;
 }
 
-#ifdef MOZ_IPC
-bool
-nsFrameLoader::ShouldUseRemoteProcess()
-{
-  // 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")) {
-    return false;
-  }
-
-  PRBool remoteDisabled = nsContentUtils::GetBoolPref("dom.ipc.tabs.disabled",
-                                                      PR_FALSE);
-  if (remoteDisabled) {
-    return false;
-  }
-
-  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 = nsContentUtils::GetBoolPref("dom.ipc.tabs.enabled",
-                                                     PR_FALSE);
-  return (bool) remoteEnabled;
-}
-#endif
-
 nsresult
-nsFrameLoader::MaybeCreateDocShell()
+nsFrameLoader::EnsureDocShell()
 {
   if (mDocShell) {
     return NS_OK;
   }
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    return NS_OK;
-  }
-#endif
   NS_ENSURE_STATE(!mDestroyCalled);
 
-#ifdef MOZ_IPC
-  if (ShouldUseRemoteProcess()) {
-    mRemoteFrame = true;
-    return NS_OK;
-  }
-#endif
-
   // Get our parent docshell off the document of mOwnerContent
   // XXXbz this is such a total hack.... We really need to have a
   // better setup for doing this.
   nsIDocument* doc = mOwnerContent->GetDocument();
   if (!doc) {
     return NS_ERROR_UNEXPECTED;
   }
 
@@ -1122,17 +925,16 @@ nsFrameLoader::MaybeCreateDocShell()
 
   // Create the docshell...
   mDocShell = do_CreateInstance("@mozilla.org/docshell;1");
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
 
   // Get the frame name and tell the docshell about it.
   nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mDocShell));
   NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);
-
   nsAutoString frameName;
 
   PRInt32 namespaceID = mOwnerContent->GetNameSpaceID();
   if (namespaceID == kNameSpaceID_XHTML && !mOwnerContent->IsInHTMLDocument()) {
     mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::id, frameName);
   } else {
     mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, frameName);
     // XXX if no NAME then use ID, after a transition period this will be
@@ -1229,30 +1031,19 @@ nsFrameLoader::GetURL(nsString& aURI)
   } else {
     mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, aURI);
   }
 }
 
 nsresult
 nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
 {
-  nsresult rv;
-
   mDepthTooGreat = PR_FALSE;
-  rv = MaybeCreateDocShell();
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-#ifdef MOZ_IPC
-  NS_ASSERTION(!mRemoteFrame,
-               "Shouldn't call CheckForRecursiveLoad on remote frames.");
-#endif
-  if (!mDocShell) {
-    return NS_ERROR_FAILURE;
-  }
+  nsresult rv = EnsureDocShell();
+  NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(mDocShell);
   NS_ASSERTION(treeItem, "docshell must be a treeitem!");
   
   PRInt32 ourType;
   rv = treeItem->GetItemType(&ourType);
   if (NS_SUCCEEDED(rv) && ourType != nsIDocShellTreeItem::typeContent) {
     // No need to do recursion-protection here XXXbz why not??  Do we really
@@ -1327,184 +1118,8 @@ nsFrameLoader::CheckForRecursiveLoad(nsI
     }
     nsCOMPtr<nsIDocShellTreeItem> temp;
     temp.swap(parentAsItem);
     temp->GetSameTypeParent(getter_AddRefs(parentAsItem));
   }
 
   return NS_OK;
 }
-
-NS_IMETHODIMP
-nsFrameLoader::UpdatePositionAndSize(nsIFrame *aIFrame)
-{
-#ifdef MOZ_IPC
-  if (mRemoteFrame) {
-    if (mChildProcess) {
-      nsIntSize size = GetSubDocumentSize(aIFrame);
-
-#ifdef MOZ_WIDGET_GTK2
-      if (mRemoteSocket) {
-        GtkAllocation alloc = {0, 0, size.width, size.height };
-        gtk_widget_size_allocate(mRemoteSocket, &alloc);
-      }
-#endif
-
-      mChildProcess->Move(0, 0, size.width, size.height);
-    }
-    return NS_OK;
-  }
-#endif
-  return UpdateBaseWindowPositionAndSize(aIFrame);
-}
-
-nsresult
-nsFrameLoader::UpdateBaseWindowPositionAndSize(nsIFrame *aIFrame)
-{
-  nsCOMPtr<nsIDocShell> docShell;
-  GetDocShell(getter_AddRefs(docShell));
-  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(docShell));
-
-  // resize the sub document
-  if (baseWindow) {
-    PRInt32 x = 0;
-    PRInt32 y = 0;
-
-    nsWeakFrame weakFrame(aIFrame);
-
-    baseWindow->GetPositionAndSize(&x, &y, nsnull, nsnull);
-
-    if (!weakFrame.IsAlive()) {
-      // GetPositionAndSize() killed us
-      return NS_OK;
-    }
-
-    nsIntSize size = GetSubDocumentSize(aIFrame);
-
-    baseWindow->SetPositionAndSize(x, y, size.width, size.height, PR_FALSE);
-  }
-
-  return NS_OK;
-}
-
-nsIntSize
-nsFrameLoader::GetSubDocumentSize(const nsIFrame *aIFrame)
-{
-  nsAutoDisableGetUsedXAssertions disableAssert;
-  nsSize docSizeAppUnits;
-  nsPresContext* presContext = aIFrame->PresContext();
-  nsCOMPtr<nsIDOMHTMLFrameElement> frameElem = 
-    do_QueryInterface(aIFrame->GetContent());
-  if (frameElem) {
-    docSizeAppUnits = aIFrame->GetSize();
-  } else {
-    docSizeAppUnits = aIFrame->GetContentRect().Size();
-  }
-  return nsIntSize(presContext->AppUnitsToDevPixels(docSizeAppUnits.width),
-                   presContext->AppUnitsToDevPixels(docSizeAppUnits.height));
-}
-
-#ifdef MOZ_IPC
-bool
-nsFrameLoader::TryNewProcess()
-{
-  NS_ASSERTION(!mChildProcess, "TryNewProcess called with a process already?");
-
-  nsIDocument* doc = mOwnerContent->GetDocument();
-  if (!doc) {
-    return false;
-  }
-
-  if (doc->GetDisplayDocument()) {
-    // Don't allow subframe loads in external reference documents
-    return false;
-  }
-
-  nsCOMPtr<nsIWebNavigation> parentAsWebNav =
-    do_GetInterface(doc->GetScriptGlobalObject());
-
-  if (!parentAsWebNav) {
-    return false;
-  }
-
-  nsCOMPtr<nsIDocShellTreeItem> parentAsItem(do_QueryInterface(parentAsWebNav));
-
-  PRInt32 parentType;
-  parentAsItem->GetItemType(&parentType);
-
-  if (parentType != nsIDocShellTreeItem::typeChrome) {
-    return false;
-  }
-
-  if (!mOwnerContent->IsXUL()) {
-    return false;
-  }
-
-  nsAutoString value;
-  mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
-
-  if (!value.LowerCaseEqualsLiteral("content") &&
-      !StringBeginsWith(value, NS_LITERAL_STRING("content-"),
-                        nsCaseInsensitiveStringComparator())) {
-    return false;
-  }
-
-  mChildProcess = ContentProcessParent::GetSingleton()->CreateTab();
-  if (mChildProcess) {
-    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mOwnerContent);
-    mChildProcess->SetOwnerElement(element);
-  }
-  return true;
-}
-#endif
-
-#ifdef MOZ_IPC
-mozilla::dom::PIFrameEmbeddingParent*
-nsFrameLoader::GetChildProcess()
-{
-  return mChildProcess;
-}
-#endif
-
-NS_IMETHODIMP
-nsFrameLoader::ActivateRemoteFrame() {
-#ifdef MOZ_IPC
-  if (mChildProcess) {
-    mChildProcess->Activate();
-    return NS_OK;
-  }
-#endif
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType,
-                                          float aX,
-                                          float aY,
-                                          PRInt32 aButton,
-                                          PRInt32 aClickCount,
-                                          PRInt32 aModifiers,
-                                          PRBool aIgnoreRootScrollFrame)
-{
-#ifdef MOZ_IPC
-  if (mChildProcess) {
-    mChildProcess->SendMouseEvent(aType, aX, aY, aButton,
-                                  aClickCount, aModifiers,
-                                  aIgnoreRootScrollFrame);
-    return NS_OK;
-  }
-#endif
-  return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsFrameLoader::ActivateFrameEvent(const nsAString& aType,
-                                  PRBool aCapture)
-{
-#ifdef MOZ_IPC
-  if (mChildProcess) {
-    mChildProcess->SendactivateFrameEvent(nsString(aType), aCapture);
-    return NS_OK;
-  }
-#endif
-  return NS_ERROR_FAILURE;
-}
-
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -42,55 +42,32 @@
  */
 
 #ifndef nsFrameLoader_h_
 #define nsFrameLoader_h_
 
 #include "nsIDocShell.h"
 #include "nsStringFwd.h"
 #include "nsIFrameLoader.h"
-#include "nsSize.h"
 #include "nsIURI.h"
-#include "nsAutoPtr.h"
 
 class nsIContent;
 class nsIURI;
 class nsIFrameFrame;
-class nsIView;
-
-#ifdef MOZ_IPC
-namespace mozilla {
-  namespace dom {
-    class TabParent;
-    class PIFrameEmbeddingParent;
-  }
-}
-
-#ifdef MOZ_WIDGET_GTK2
-typedef struct _GtkWidget GtkWidget;
-#endif
-#endif
 
 class nsFrameLoader : public nsIFrameLoader
 {
 protected:
   nsFrameLoader(nsIContent *aOwner) :
     mOwnerContent(aOwner),
     mDepthTooGreat(PR_FALSE),
     mIsTopLevelContent(PR_FALSE),
     mDestroyCalled(PR_FALSE),
     mNeedsAsyncDestroy(PR_FALSE),
     mInSwap(PR_FALSE)
-#ifdef MOZ_IPC
-    , mRemoteFrame(false)
-    , mChildProcess(nsnull)
-#ifdef MOZ_WIDGET_GTK2
-    , mRemoteSocket(nsnull)
-#endif
-#endif
   {}
 
 public:
   ~nsFrameLoader() {
     mNeedsAsyncDestroy = PR_TRUE;
     nsFrameLoader::Destroy();
   }
 
@@ -120,64 +97,25 @@ public:
   void Hide();
 
   // The guts of an nsIFrameLoaderOwner::SwapFrameLoader implementation.  A
   // frame loader owner needs to call this, and pass in the two references to
   // nsRefPtrs for frame loaders that need to be swapped.
   nsresult SwapWithOtherLoader(nsFrameLoader* aOther,
                                nsRefPtr<nsFrameLoader>& aFirstToSwap,
                                nsRefPtr<nsFrameLoader>& aSecondToSwap);
-
-#ifdef MOZ_IPC
-  mozilla::dom::PIFrameEmbeddingParent* GetChildProcess();
-#endif
-
 private:
 
-#ifdef MOZ_IPC
-  bool ShouldUseRemoteProcess();
-#endif
-
-  /**
-   * If we are an IPC frame, set mRemoteFrame. Otherwise, create and
-   * initialize mDocShell.
-   */
-  nsresult MaybeCreateDocShell();
-  void GetURL(nsString& aURL);
-
-  // Properly retrieves documentSize of any subdocument type.
-  NS_HIDDEN_(nsIntSize) GetSubDocumentSize(const nsIFrame *aIFrame);
-
-  // Updates the subdocument position and size. This gets called only
-  // when we have our own in-process DocShell.
-  NS_HIDDEN_(nsresult) UpdateBaseWindowPositionAndSize(nsIFrame *aIFrame);
+  NS_HIDDEN_(nsresult) EnsureDocShell();
+  NS_HIDDEN_(void) GetURL(nsString& aURL);
   nsresult CheckURILoad(nsIURI* aURI);
 
-#ifdef MOZ_IPC
-  // True means new process started; nothing else to do
-  bool TryNewProcess();
-
-  // Do the hookup necessary to actually show a remote frame once the view and
-  // widget are available.
-  bool ShowRemoteFrame(nsIFrameFrame* frame, nsIView* view);
-#endif
-
   nsCOMPtr<nsIDocShell> mDocShell;
   nsCOMPtr<nsIURI> mURIToLoad;
   nsIContent *mOwnerContent; // WEAK
   PRPackedBool mDepthTooGreat : 1;
   PRPackedBool mIsTopLevelContent : 1;
   PRPackedBool mDestroyCalled : 1;
   PRPackedBool mNeedsAsyncDestroy : 1;
   PRPackedBool mInSwap : 1;
-
-#ifdef MOZ_IPC
-  bool mRemoteFrame;
-  // XXX leaking
-  mozilla::dom::TabParent* mChildProcess;
-
-#ifdef MOZ_WIDGET_GTK2
-  GtkWidget* mRemoteSocket;
-#endif
-#endif
 };
 
 #endif
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -1694,19 +1694,16 @@ GK_ATOM(Taiwanese, "zh-TW")
 GK_ATOM(HongKongChinese, "zh-HK")
 GK_ATOM(Unicode, "x-unicode")
 
 // Names for editor transactions
 GK_ATOM(TypingTxnName, "Typing")
 GK_ATOM(IMETxnName, "IME")
 GK_ATOM(DeleteTxnName, "Deleting")
 
-// IPC stuff
-GK_ATOM(Remote, "remote")
-
 // Names for system metrics
 GK_ATOM(scrollbar_start_backward, "scrollbar-start-backward")
 GK_ATOM(scrollbar_start_forward, "scrollbar-start-forward")
 GK_ATOM(scrollbar_end_backward, "scrollbar-end-backward")
 GK_ATOM(scrollbar_end_forward, "scrollbar-end-forward")
 GK_ATOM(scrollbar_thumb_proportional, "scrollbar-thumb-proportional")
 GK_ATOM(images_in_menus, "images-in-menus")
 GK_ATOM(images_in_buttons, "images-in-buttons")
--- a/content/base/src/nsXMLHttpRequest.h
+++ b/content/base/src/nsXMLHttpRequest.h
@@ -481,25 +481,16 @@ public:
   NS_IMETHOD_(nsEvent*) GetInternalNSEvent()
   {
     return mInner->GetInternalNSEvent();
   }
   NS_IMETHOD SetTrusted(PRBool aTrusted)
   {
     return mInner->SetTrusted(aTrusted);
   }
-  virtual void Serialize(IPC::Message* aMsg,
-                         PRBool aSerializeInterfaceType)
-  {
-    mInner->Serialize(aMsg, aSerializeInterfaceType);
-  }
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter)
-  {
-    return mInner->Deserialize(aMsg, aIter);
-  }
 
 protected:
   // Use nsDOMProgressEvent so that we can forward
   // most of the method calls easily.
   nsRefPtr<nsDOMProgressEvent> mInner;
   PRUint64 mCurProgress;
   PRUint64 mMaxProgress;
 };
deleted file mode 100644
--- a/content/canvas/public/DocumentRendererChild.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ***** 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 Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_dom_DocumentRendererChild
-#define mozilla_dom_DocumentRendererChild
-
-#include "mozilla/ipc/PDocumentRendererChild.h"
-#include "nsICanvasRenderingContextInternal.h"
-#include "nsString.h"
-#include "gfxContext.h"
-
-class nsIDOMWindow;
-
-namespace mozilla {
-namespace ipc {
-
-class DocumentRendererChild : public PDocumentRendererChild
-{
-public:
-    DocumentRendererChild();
-    virtual ~DocumentRendererChild();
-    
-    bool RenderDocument(nsIDOMWindow *window, const PRInt32& x, const PRInt32& y, const PRInt32& w, const PRInt32& h,
-			    const nsString& bgcolor, const PRUint32& flags, const PRBool& flush, 
-			    PRUint32& _width, PRUint32& _height, nsCString& data);
-
-private:
-
-    DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererChild);
-};
-
-}
-}
-
-#endif
deleted file mode 100644
--- a/content/canvas/public/DocumentRendererParent.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ***** 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 Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_dom_DocumentRendererParent
-#define mozilla_dom_DocumentRendererParent
-
-#include "mozilla/ipc/PDocumentRendererParent.h"
-#include "nsICanvasRenderingContextInternal.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-#include "gfxContext.h"
-
-namespace mozilla {
-namespace ipc {
-
-class DocumentRendererParent : public PDocumentRendererParent
-{
-public:
-    DocumentRendererParent();
-    virtual ~DocumentRendererParent();
-
-    void SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas,
-			  gfxContext* ctx);
-    void DrawToCanvas(PRUint32 aWidth, PRUint32 aHeight,
-		      const nsCString& aData);
-
-private:
-    nsCOMPtr<nsICanvasRenderingContextInternal> mCanvas;
-    nsRefPtr<gfxContext> mCanvasContext;
-
-    DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererParent);
-};
-
-}
-}
-
-#endif
--- a/content/canvas/public/Makefile.in
+++ b/content/canvas/public/Makefile.in
@@ -40,26 +40,19 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= content
 XPIDL_MODULE = content_canvas
 
-EXPORTS_NAMESPACES = mozilla/ipc
-
 EXPORTS		= \
 		nsICanvasRenderingContextInternal.h \
 		nsICanvasElement.h \
 		WebGLArray.h \
 		$(NULL)
 
-EXPORTS_mozilla/ipc = \
-		DocumentRendererChild.h \
-		DocumentRendererParent.h \
-		$(NULL)
-
 XPIDLSRCS	= \
 		nsICanvasGLPrivate.idl \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/content/canvas/public/nsICanvasRenderingContextInternal.h
+++ b/content/canvas/public/nsICanvasRenderingContextInternal.h
@@ -82,17 +82,14 @@ public:
   // return the surface.  Otherwise returns an error.
   NS_IMETHOD GetThebesSurface(gfxASurface **surface) = 0;
 
   // If this context is opaque, the backing store of the canvas should
   // be created as opaque; all compositing operators should assume the
   // dst alpha is always 1.0.  If this is never called, the context
   // defaults to false (not opaque).
   NS_IMETHOD SetIsOpaque(PRBool isOpaque) = 0;
-
-  // Redraw the dirty rectangle of this canvas.
-  NS_IMETHOD Redraw(const gfxRect &dirty) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal,
                               NS_ICANVASRENDERINGCONTEXTINTERNAL_IID)
 
 #endif /* nsICanvasRenderingContextInternal_h___ */
deleted file mode 100644
--- a/content/canvas/src/DocumentRendererChild.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/* ***** 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 Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "base/basictypes.h"
-
-#include "gfxImageSurface.h"
-#include "gfxPattern.h"
-#include "nsPIDOMWindow.h"
-#include "nsIDOMWindow.h"
-#include "nsIDOMDocument.h"
-#include "nsIDocShellTreeNode.h"
-#include "nsIDocShellTreeItem.h"
-#include "nsIDocument.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsComponentManagerUtils.h"
-#include "nsICSSParser.h"
-#include "nsPresContext.h"
-#include "nsCOMPtr.h"
-#include "nsColor.h"
-#include "gfxContext.h"
-#include "gfxImageSurface.h"
-#include "nsLayoutUtils.h"
-
-#include "mozilla/ipc/DocumentRendererChild.h"
-
-using namespace mozilla::ipc;
-
-DocumentRendererChild::DocumentRendererChild()
-{}
-
-DocumentRendererChild::~DocumentRendererChild()
-{}
-
-static void
-FlushLayoutForTree(nsIDOMWindow* aWindow)
-{
-    nsCOMPtr<nsPIDOMWindow> piWin = do_QueryInterface(aWindow);
-    if (!piWin)
-        return;
-
-    // Note that because FlushPendingNotifications flushes parents, this
-    // is O(N^2) in docshell tree depth.  However, the docshell tree is
-    // usually pretty shallow.
-
-    nsCOMPtr<nsIDOMDocument> domDoc;
-    aWindow->GetDocument(getter_AddRefs(domDoc));
-    nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
-    if (doc) {
-        doc->FlushPendingNotifications(Flush_Layout);
-    }
-
-    nsCOMPtr<nsIDocShellTreeNode> node =
-        do_QueryInterface(piWin->GetDocShell());
-    if (node) {
-        PRInt32 i = 0, i_end;
-        node->GetChildCount(&i_end);
-        for (; i < i_end; ++i) {
-            nsCOMPtr<nsIDocShellTreeItem> item;
-            node->GetChildAt(i, getter_AddRefs(item));
-            nsCOMPtr<nsIDOMWindow> win = do_GetInterface(item);
-            if (win) {
-                FlushLayoutForTree(win);
-            }
-        }
-    }
-}
-
-bool
-DocumentRendererChild::RenderDocument(nsIDOMWindow *window, const PRInt32& x, const PRInt32& y, const PRInt32& w, const PRInt32& h,
-                                      const nsString& aBGColor, const PRUint32& flags, const PRBool& flush, 
-                                      PRUint32& _width, PRUint32& _height, nsCString& data)
-{
-    if (flush)
-        FlushLayoutForTree(window);
-
-    nsCOMPtr<nsPresContext> presContext;
-    nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window);
-    if (win) {
-        nsIDocShell* docshell = win->GetDocShell();
-        if (docshell) {
-            docshell->GetPresContext(getter_AddRefs(presContext));
-        }
-    }
-    if (!presContext)
-        return false;
-
-    nscolor bgColor;
-    nsCOMPtr<nsICSSParser> parser = do_CreateInstance("@mozilla.org/content/css-parser;1");
-    nsresult rv = parser->ParseColorString(PromiseFlatString(aBGColor),
-                                           nsnull, 0, &bgColor);
-    if (NS_FAILED(rv))
-        return false;
-
-    nsIPresShell* presShell = presContext->PresShell();
-
-    nsRect r(x, y, w, h);
-
-    _width = nsPresContext::AppUnitsToIntCSSPixels(w);
-    _height = nsPresContext::AppUnitsToIntCSSPixels(h);
-
-    // Draw directly into the output array.
-    data.SetLength(_width * _height * 4);
-    nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(reinterpret_cast<PRUint8*>(const_cast<char*>(data.get())),
-                                                         gfxIntSize(_width, _height),
-                                                         4 * _width, gfxASurface::ImageFormatARGB32);
-    nsRefPtr<gfxContext> ctx = new gfxContext(surf);
-
-    PRBool oldDisableValue = nsLayoutUtils::sDisableGetUsedXAssertions;
-    nsLayoutUtils::sDisableGetUsedXAssertions = oldDisableValue || !flush;
-    presShell->RenderDocument(r, flags, bgColor, ctx);
-    nsLayoutUtils::sDisableGetUsedXAssertions = oldDisableValue;
-
-    return true;
-}
deleted file mode 100644
--- a/content/canvas/src/DocumentRendererParent.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ***** 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 Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "mozilla/ipc/DocumentRendererParent.h"
-#include "gfxImageSurface.h"
-#include "gfxPattern.h"
-
-using namespace mozilla::ipc;
-
-DocumentRendererParent::DocumentRendererParent()
-{}
-
-DocumentRendererParent::~DocumentRendererParent()
-{}
-
-void DocumentRendererParent::SetCanvasContext(nsICanvasRenderingContextInternal* aCanvas,
-                                              gfxContext* ctx)
-{
-    mCanvas = aCanvas;
-    mCanvasContext = ctx;
-}
-
-void DocumentRendererParent::DrawToCanvas(PRUint32 aWidth, PRUint32 aHeight,
-                                          const nsCString& aData)
-{
-    if (!mCanvas || !mCanvasContext)
-        return;
-
-    nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(reinterpret_cast<PRUint8*>(const_cast<char*>(aData.Data())),
-                                                         gfxIntSize(aWidth, aHeight),
-                                                         aWidth * 4,
-                                                         gfxASurface::ImageFormatARGB32);
-    nsRefPtr<gfxPattern> pat = new gfxPattern(surf);
-
-    mCanvasContext->NewPath();
-    mCanvasContext->PixelSnappedRectangleAndSetPattern(gfxRect(0, 0, aWidth, aHeight), pat);
-    mCanvasContext->Fill();
-
-    // get rid of the pattern surface ref, because aData is very likely to go away shortly
-    mCanvasContext->SetColor(gfxRGBA(1,1,1,1));
-
-    gfxRect damageRect = mCanvasContext->UserToDevice(gfxRect(0, 0, aWidth, aHeight));
-    mCanvas->Redraw(damageRect);
-}
--- a/content/canvas/src/Makefile.in
+++ b/content/canvas/src/Makefile.in
@@ -48,23 +48,16 @@ LIBXUL_LIBRARY  = 1
 
 
 
 CPPSRCS	= \
 	CanvasUtils.cpp \
 	nsCanvasRenderingContext2D.cpp \
 	$(NULL)
 
-ifdef MOZ_IPC
-CPPSRCS += \
-	DocumentRendererParent.cpp \
-	DocumentRendererChild.cpp \
-	$(NULL)
-endif
-
 # Canvas 3D Pieces
 
 ifdef MOZ_WEBGL
 
 CPPSRCS += \
 	WebGLArrays.cpp \
 	WebGLContext.cpp \
 	WebGLContextGL.cpp \
@@ -103,17 +96,16 @@ else
 CPPSRCS += WebGLContextNotSupported.cpp
 
 endif
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 CXXFLAGS	+= $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
 
 INCLUDES	+= \
 		-I$(srcdir)/../../../layout/xul/base/src \
 		-I$(srcdir)/../../../layout/style \
 		-I$(srcdir)/../../../layout/generic \
 		-I$(srcdir)/../../base/src \
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -240,17 +240,16 @@ public:
     NS_IMETHOD InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height)
         { return NS_ERROR_NOT_IMPLEMENTED; }
     NS_IMETHOD Render(gfxContext *ctx, gfxPattern::GraphicsFilter f);
     NS_IMETHOD GetInputStream(const char* aMimeType,
                               const PRUnichar* aEncoderOptions,
                               nsIInputStream **aStream);
     NS_IMETHOD GetThebesSurface(gfxASurface **surface);
     NS_IMETHOD SetIsOpaque(PRBool b) { return NS_OK; };
-    NS_IMETHOD Redraw(const gfxRect&) { return NS_ERROR_NOT_IMPLEMENTED; }
 
 protected:
     GLES20Wrap *gl;
 
     nsICanvasElement* mCanvasElement;
 
     nsGLPbuffer *mGLPbuffer;
     PRInt32 mWidth, mHeight;
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -32,22 +32,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 ***** */
 
-#ifdef MOZ_IPC
-#  include "base/basictypes.h"
-#endif
-
-#include "nsIDOMXULElement.h"
-
 #ifdef _MSC_VER
 #define _USE_MATH_DEFINES
 #endif
 #include <math.h>
 
 #include "prmem.h"
 
 #include "nsIServiceManager.h"
@@ -104,30 +98,20 @@
 #include "gfxImageSurface.h"
 #include "gfxPlatform.h"
 #include "gfxFont.h"
 #include "gfxTextRunCache.h"
 #include "gfxBlur.h"
 
 #include "nsFrameManager.h"
 
-#include "nsFrameLoader.h"
-
 #include "nsBidiPresUtils.h"
 
 #include "CanvasUtils.h"
 
-#ifdef MOZ_IPC
-#  include "mozilla/ipc/PDocumentRendererParent.h"
-#  include "mozilla/dom/PIFrameEmbeddingParent.h"
-#  include "mozilla/ipc/DocumentRendererParent.h"
-// windows.h (included by chromium code) defines this, in its infinite wisdom
-#  undef DrawText
-#endif
-
 using namespace mozilla;
 
 #ifndef M_PI
 #define M_PI		3.14159265358979323846
 #define M_PI_2		1.57079632679489661923
 #endif
 
 /* Float validation stuff */
@@ -322,29 +306,29 @@ class nsCanvasRenderingContext2D :
     public nsIDOMCanvasRenderingContext2D,
     public nsICanvasRenderingContextInternal
 {
 public:
     nsCanvasRenderingContext2D();
     virtual ~nsCanvasRenderingContext2D();
 
     nsresult Redraw();
+    // this rect is in CSS pixels
+    nsresult Redraw(const gfxRect& r);
 
     // nsICanvasRenderingContextInternal
     NS_IMETHOD SetCanvasElement(nsICanvasElement* aParentCanvas);
     NS_IMETHOD SetDimensions(PRInt32 width, PRInt32 height);
     NS_IMETHOD InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, PRInt32 width, PRInt32 height);
     NS_IMETHOD Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter);
     NS_IMETHOD GetInputStream(const char* aMimeType,
                               const PRUnichar* aEncoderOptions,
                               nsIInputStream **aStream);
     NS_IMETHOD GetThebesSurface(gfxASurface **surface);
     NS_IMETHOD SetIsOpaque(PRBool isOpaque);
-    // this rect is in CSS pixels
-    NS_IMETHOD Redraw(const gfxRect &r);
 
     // nsISupports interface
     NS_DECL_ISUPPORTS
 
     // nsIDOMCanvasRenderingContext2D interface
     NS_DECL_NSIDOMCANVASRENDERINGCONTEXT2D
 
     enum Style {
@@ -859,17 +843,17 @@ nsCanvasRenderingContext2D::Redraw()
 
     if (mIsEntireFrameInvalid)
         return NS_OK;
 
     mIsEntireFrameInvalid = PR_TRUE;
     return mCanvasElement->InvalidateFrame();
 }
 
-NS_IMETHODIMP
+nsresult
 nsCanvasRenderingContext2D::Redraw(const gfxRect& r)
 {
     if (!mCanvasElement)
         return NS_OK;
 
     if (mIsEntireFrameInvalid)
         return NS_OK;
 
@@ -3320,93 +3304,16 @@ nsCanvasRenderingContext2D::DrawWindow(n
     // space.
     gfxRect damageRect = mThebes->UserToDevice(gfxRect(0, 0, aW, aH));
 
     Redraw(damageRect);
 
     return rv;
 }
 
-NS_IMETHODIMP
-nsCanvasRenderingContext2D::AsyncDrawXULElement(nsIDOMXULElement* aElem, float aX, float aY,
-                                                float aW, float aH,
-                                                const nsAString& aBGColor,
-                                                PRUint32 flags)
-{
-    NS_ENSURE_ARG(aElem != nsnull);
-
-    // We can't allow web apps to call this until we fix at least the
-    // following potential security issues:
-    // -- rendering cross-domain IFRAMEs and then extracting the results
-    // -- rendering the user's theme and then extracting the results
-    // -- rendering native anonymous content (e.g., file input paths;
-    // scrollbars should be allowed)
-    if (!nsContentUtils::IsCallerTrustedForRead()) {
-        // not permitted to use DrawWindow
-        // XXX ERRMSG we need to report an error to developers here! (bug 329026)
-        return NS_ERROR_DOM_SECURITY_ERR;
-    }
-
-    nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aElem);
-    if (!loaderOwner)
-        return NS_ERROR_FAILURE;
-
-    nsCOMPtr<nsFrameLoader> frameloader = loaderOwner->GetFrameLoader();
-    if (!frameloader)
-        return NS_ERROR_FAILURE;
-
-#ifdef MOZ_IPC
-    mozilla::dom::PIFrameEmbeddingParent *child = frameloader->GetChildProcess();
-    if (!child) {
-        nsCOMPtr<nsIDOMWindow> window =
-            do_GetInterface(frameloader->GetExistingDocShell());
-        if (!window)
-            return NS_ERROR_FAILURE;
-
-        return DrawWindow(window, aX, aY, aW, aH, aBGColor, flags);
-    }
-
-    // protect against too-large surfaces that will cause allocation
-    // or overflow issues
-    if (!gfxASurface::CheckSurfaceSize(gfxIntSize(aW, aH), 0xffff))
-        return NS_ERROR_FAILURE;
-
-    PRBool flush =
-        (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) == 0;
-
-    PRUint32 renderDocFlags = nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING;
-    if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) {
-        renderDocFlags |= nsIPresShell::RENDER_CARET;
-    }
-    if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) {
-        renderDocFlags &= ~nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING;
-    }
-
-    PRInt32 x = nsPresContext::CSSPixelsToAppUnits(aX),
-            y = nsPresContext::CSSPixelsToAppUnits(aY),
-            w = nsPresContext::CSSPixelsToAppUnits(aW),
-            h = nsPresContext::CSSPixelsToAppUnits(aH);
-
-    mozilla::ipc::PDocumentRendererParent *pdocrender =
-        child->SendPDocumentRendererConstructor(x, y, w, h, nsString(aBGColor), renderDocFlags, flush);
-    mozilla::ipc::DocumentRendererParent *docrender = static_cast<mozilla::ipc::DocumentRendererParent *>(pdocrender);
-
-    docrender->SetCanvasContext(this, mThebes);
-
-    return NS_OK;
-#else
-    nsCOMPtr<nsIDOMWindow> window =
-        do_GetInterface(frameloader->GetExistingDocShell());
-    if (!window)
-        return NS_ERROR_FAILURE;
-
-    return DrawWindow(window, aX, aY, aW, aH, aBGColor, flags);
-#endif
-}
-
 //
 // device pixel getting/setting
 //
 extern "C" {
 #include "jstypes.h"
 JS_FRIEND_API(JSBool)
 js_CoerceArrayToCanvasImageData(JSObject *obj, jsuint offset, jsuint count,
                                 JSUint8 *dest);
--- a/content/events/public/nsIPrivateDOMEvent.h
+++ b/content/events/public/nsIPrivateDOMEvent.h
@@ -36,42 +36,36 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsIPrivateDOMEvent_h__
 #define nsIPrivateDOMEvent_h__
 
 #include "nsISupports.h"
 
 #define NS_IPRIVATEDOMEVENT_IID \
-{ 0x26f5f0e9, 0x2960, 0x4405, \
-  { 0xa1, 0x7e, 0xd8, 0x9f, 0xb0, 0xd9, 0x4c, 0x71 } }
+{ 0x1da4c501, 0xe87e, 0x49b4, \
+  { 0xb0, 0x49, 0xdf, 0x9f, 0xc3, 0x6b, 0x56, 0xd4 } }
 
 class nsIDOMEventTarget;
 class nsIDOMEvent;
 class nsEvent;
 class nsCommandEvent;
 class nsPresContext;
 class nsInvalidateRequestList;
-namespace IPC {
-class Message;
-}
 
 class nsIPrivateDOMEvent : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRIVATEDOMEVENT_IID)
 
   NS_IMETHOD DuplicatePrivateData() = 0;
   NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) = 0;
   NS_IMETHOD_(PRBool) IsDispatchStopped() = 0;
   NS_IMETHOD_(nsEvent*) GetInternalNSEvent() = 0;
   NS_IMETHOD SetTrusted(PRBool aTrusted) = 0;
-  virtual void Serialize(IPC::Message* aMsg,
-                         PRBool aSerializeInterfaceType) = 0;
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrivateDOMEvent, NS_IPRIVATEDOMEVENT_IID)
 
 nsresult
 NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
 nsresult
 NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent *aEvent);
--- a/content/events/src/Makefile.in
+++ b/content/events/src/Makefile.in
@@ -81,21 +81,19 @@ CPPSRCS		= \
 		nsDOMSimpleGestureEvent.cpp \
 		nsDOMEventTargetHelper.cpp \
 		nsDOMScrollAreaEvent.cpp \
 		$(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES	+= \
+LOCAL_INCLUDES	= \
              -I$(srcdir)/../../base/src \
              -I$(srcdir)/../../html/base/src \
              -I$(srcdir)/../../xul/content/src \
              -I$(srcdir)/../../xml/content/src \
              -I$(srcdir)/../../../dom/base \
              -I$(srcdir)/../../../layout/generic \
              -I$(srcdir)/../../../layout/xul/base/src \
              -I$(srcdir)/../../../layout/xul/base/src/tree/src \
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -32,20 +32,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 ***** */
 
-#ifdef MOZ_IPC
-#include "base/basictypes.h"
-#include "IPC/IPCMessageUtils.h"
-#endif
 #include "nsCOMPtr.h"
 #include "nsDOMEvent.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
 #include "nsIContent.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsIPrivateCompositionEvent.h"
@@ -1532,71 +1528,16 @@ nsDOMEvent::ReportWrongPropertyAccessWar
 NS_IMETHODIMP
 nsDOMEvent::GetPreventDefault(PRBool* aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   *aReturn = mEvent && (mEvent->flags & NS_EVENT_FLAG_NO_DEFAULT);
   return NS_OK;
 }
 
-void
-nsDOMEvent::Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType)
-{
-#ifdef MOZ_IPC
-  if (aSerializeInterfaceType) {
-    IPC::WriteParam(aMsg, NS_LITERAL_STRING("event"));
-  }
-
-  nsString type;
-  GetType(type);
-  IPC::WriteParam(aMsg, type);
-
-  PRBool bubbles = PR_FALSE;
-  GetBubbles(&bubbles);
-  IPC::WriteParam(aMsg, bubbles);
-
-  PRBool cancelable = PR_FALSE;
-  GetCancelable(&cancelable);
-  IPC::WriteParam(aMsg, cancelable);
-
-  PRBool trusted = PR_FALSE;
-  GetIsTrusted(&trusted);
-  IPC::WriteParam(aMsg, trusted);
-
-  // No timestamp serialization for now!
-#endif
-}
-
-PRBool
-nsDOMEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
-{
-#ifdef MOZ_IPC
-  nsString type;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), PR_FALSE);
-
-  PRBool bubbles = PR_FALSE;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &bubbles), PR_FALSE);
-
-  PRBool cancelable = PR_FALSE;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &cancelable), PR_FALSE);
-
-  PRBool trusted = PR_FALSE;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &trusted), PR_FALSE);
-
-  nsresult rv = InitEvent(type, bubbles, cancelable);
-  NS_ENSURE_SUCCESS(rv, PR_FALSE);
-  SetTrusted(trusted);
-
-  return PR_TRUE;
-#else
-  return PR_FALSE;
-#endif
-}
-
-
 nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
                         nsPresContext* aPresContext,
                         nsEvent *aEvent) 
 {
   nsDOMEvent* it = new nsDOMEvent(aPresContext, aEvent);
   if (nsnull == it) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -188,19 +188,16 @@ public:
 
   // nsIPrivateDOMEvent interface
   NS_IMETHOD    DuplicatePrivateData();
   NS_IMETHOD    SetTarget(nsIDOMEventTarget* aTarget);
   NS_IMETHOD_(PRBool)    IsDispatchStopped();
   NS_IMETHOD_(nsEvent*)    GetInternalNSEvent();
   NS_IMETHOD    SetTrusted(PRBool aTrusted);
 
-  virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
-
   static PopupControlState GetEventPopupControlState(nsEvent *aEvent);
 
   static void PopupAllowedEventsChanged();
 
   static void Shutdown();
 
   static const char* GetEventName(PRUint32 aEventType);
 protected:
--- a/content/events/src/nsDOMNotifyPaintEvent.cpp
+++ b/content/events/src/nsDOMNotifyPaintEvent.cpp
@@ -31,20 +31,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 ***** */
 
-#ifdef MOZ_IPC
-#include "base/basictypes.h"
-#include "IPC/IPCMessageUtils.h"
-#endif
 #include "nsDOMNotifyPaintEvent.h"
 #include "nsContentUtils.h"
 #include "nsClientRect.h"
 #include "nsPaintRequest.h"
 #include "nsIFrame.h"
 
 nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(nsPresContext* aPresContext,
                                              nsEvent* aEvent,
@@ -141,60 +137,16 @@ nsDOMNotifyPaintEvent::GetPaintRequests(
     r->SetRequest(mInvalidateRequests[i]);
     requests->Append(r);
   }
 
   requests.forget(aResult);
   return NS_OK;
 }
 
-#ifdef MOZ_IPC
-void
-nsDOMNotifyPaintEvent::Serialize(IPC::Message* aMsg,
-                                 PRBool aSerializeInterfaceType)
-{
-  if (aSerializeInterfaceType) {
-    IPC::WriteParam(aMsg, NS_LITERAL_STRING("notifypaintevent"));
-  }
-
-  nsDOMEvent::Serialize(aMsg, PR_FALSE);
-
-  PRUint32 length = mInvalidateRequests.Length();
-  IPC::WriteParam(aMsg, length);
-  for (PRUint32 i = 0; i < length; ++i) {
-    IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect.x);
-    IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect.y);
-    IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect.width);
-    IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect.height);
-    IPC::WriteParam(aMsg, mInvalidateRequests[i].mFlags);
-  }
-}
-
-PRBool
-nsDOMNotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
-{
-  NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), PR_FALSE);
-
-  PRUint32 length = 0;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &length), PR_FALSE);
-  mInvalidateRequests.SetCapacity(length);
-  for (PRUint32 i = 0; i < length; ++i) {
-    nsInvalidateRequestList::Request req;
-    NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect.x), PR_FALSE);
-    NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect.y), PR_FALSE);
-    NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect.width), PR_FALSE);
-    NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect.height), PR_FALSE);
-    NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mFlags), PR_FALSE);
-    mInvalidateRequests.AppendElement(req);
-  }
-
-  return PR_TRUE;
-}
-#endif
-
 nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult,
                                    nsPresContext* aPresContext,
                                    nsEvent *aEvent,
                                    PRUint32 aEventType,
                                    nsInvalidateRequestList* aInvalidateRequests) 
 {
   nsDOMNotifyPaintEvent* it =
     new nsDOMNotifyPaintEvent(aPresContext, aEvent, aEventType,
--- a/content/events/src/nsDOMNotifyPaintEvent.h
+++ b/content/events/src/nsDOMNotifyPaintEvent.h
@@ -56,19 +56,15 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMNOTIFYPAINTEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMEVENT
 
-#ifdef MOZ_IPC
-  virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
-#endif
 private:
   nsRegion GetRegion();
 
   nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
 };
 
 #endif // nsDOMNotifyPaintEvent_h_
--- a/content/events/src/nsDOMScrollAreaEvent.cpp
+++ b/content/events/src/nsDOMScrollAreaEvent.cpp
@@ -30,20 +30,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 ***** */
 
-#ifdef MOZ_IPC
-#include "base/basictypes.h"
-#include "IPC/IPCMessageUtils.h"
-#endif
 #include "nsDOMScrollAreaEvent.h"
 #include "nsGUIEvent.h"
 #include "nsClientRect.h"
 
 nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(nsPresContext *aPresContext,
                                            nsScrollAreaEvent *aEvent)
   : nsDOMUIEvent(aPresContext, aEvent)
 {
@@ -105,74 +101,16 @@ nsDOMScrollAreaEvent::InitScrollAreaEven
   nsresult rv = nsDOMUIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mClientArea.SetRect(aX, aY, aWidth, aHeight);
 
   return NS_OK;
 }
 
-#ifdef MOZ_IPC
-void
-nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
-                                PRBool aSerializeInterfaceType)
-{
-  if (aSerializeInterfaceType) {
-    IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
-  }
-
-  nsDOMUIEvent::Serialize(aMsg, PR_FALSE);
-
-  NS_ASSERTION(sizeof(PRInt32) == sizeof(float),
-               "PRInt32 and float should be the same size!");
-
-  float x = 0.0f;
-  GetX(&x);
-  IPC::WriteParam(aMsg, reinterpret_cast<PRInt32&>(x));
-
-  float y = 0.0f;
-  GetY(&y);
-  IPC::WriteParam(aMsg, reinterpret_cast<PRInt32&>(y));
-
-  float width = 0.0f;
-  GetWidth(&width);
-  IPC::WriteParam(aMsg, reinterpret_cast<PRInt32&>(width));
-
-  float height = 0.0f;
-  GetHeight(&height);
-  IPC::WriteParam(aMsg, reinterpret_cast<PRInt32&>(height));
-}
-
-PRBool
-nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
-{
-  NS_ENSURE_TRUE(nsDOMUIEvent::Deserialize(aMsg, aIter), PR_FALSE);
-
-  PRInt32 x_;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x_), PR_FALSE);
-  float x = reinterpret_cast<float&>(x_);
-
-  PRInt32 y_;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y_), PR_FALSE);
-  float y = reinterpret_cast<float&>(y_);
-
-  PRInt32 width_;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width_), PR_FALSE);
-  float width = reinterpret_cast<float&>(width_);
-
-  PRInt32 height_;
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height_), PR_FALSE);
-  float height = reinterpret_cast<float&>(height_);
-
-  mClientArea.SetRect(x, y, width, height);
-
-  return PR_TRUE;
-}
-#endif
-
 nsresult
 NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
                          nsPresContext *aPresContext,
                          nsScrollAreaEvent *aEvent)
 {
   nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent);
 
   if (!ev) {
--- a/content/events/src/nsDOMScrollAreaEvent.h
+++ b/content/events/src/nsDOMScrollAreaEvent.h
@@ -53,17 +53,13 @@ public:
   virtual ~nsDOMScrollAreaEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMSCROLLAREAEVENT
 
   NS_FORWARD_TO_NSDOMUIEVENT
 
-#ifdef MOZ_IPC
-  virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
-#endif
 protected:
   nsClientRect mClientArea;
 };
 
 #endif // nsDOMScrollAreaEvent_h__
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -32,20 +32,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 ***** */
 
-#ifdef MOZ_IPC
-#include "base/basictypes.h"
-#include "IPC/IPCMessageUtils.h"
-#endif
 #include "nsCOMPtr.h"
 #include "nsDOMUIEvent.h"
 #include "nsIPresShell.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsIDOMNode.h"
 #include "nsIContent.h"
 #include "nsContentUtils.h"
@@ -393,40 +389,16 @@ nsDOMUIEvent::DuplicatePrivateData()
   nsIntPoint screenPoint = GetScreenPoint();
   nsresult rv = nsDOMEvent::DuplicatePrivateData();
   if (NS_SUCCEEDED(rv)) {
     mEvent->refPoint = screenPoint;
   }
   return rv;
 }
 
-#ifdef MOZ_IPC
-void
-nsDOMUIEvent::Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType)
-{
-  if (aSerializeInterfaceType) {
-    IPC::WriteParam(aMsg, NS_LITERAL_STRING("uievent"));
-  }
-
-  nsDOMEvent::Serialize(aMsg, PR_FALSE);
-
-  PRInt32 detail = 0;
-  GetDetail(&detail);
-  IPC::WriteParam(aMsg, detail);
-}
-
-PRBool
-nsDOMUIEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
-{
-  NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), PR_FALSE);
-  NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), PR_FALSE);
-  return PR_TRUE;
-}
-#endif
-
 nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
                           nsPresContext* aPresContext,
                           nsGUIEvent *aEvent) 
 {
   nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent);
   if (nsnull == it) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
--- a/content/events/src/nsDOMUIEvent.h
+++ b/content/events/src/nsDOMUIEvent.h
@@ -59,20 +59,17 @@ public:
   // nsIDOMUIEvent Interface
   NS_DECL_NSIDOMUIEVENT
 
   // nsIDOMNSUIEvent Interface
   NS_DECL_NSIDOMNSUIEVENT
 
   // nsIPrivateDOMEvent interface
   NS_IMETHOD DuplicatePrivateData();
-#ifdef MOZ_IPC
-  virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
-#endif
+  
   // nsIPrivateCompositionEvent interface
   NS_IMETHOD GetCompositionReply(nsTextEventReply** aReply);
   
   // Forward to nsDOMEvent
   NS_FORWARD_TO_NSDOMEVENT
 
   NS_FORWARD_NSIDOMNSEVENT(nsDOMEvent::)
 protected:
deleted file mode 100644
--- a/dom/ipc/ContentProcessChild.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "ContentProcessChild.h"
-#include "TabChild.h"
-
-#include "mozilla/ipc/TestShellChild.h"
-#include "mozilla/net/NeckoChild.h"
-
-#include "nsXULAppAPI.h"
-
-#include "base/message_loop.h"
-#include "base/task.h"
-
-using namespace mozilla::ipc;
-using namespace mozilla::net;
-
-namespace mozilla {
-namespace dom {
-
-ContentProcessChild* ContentProcessChild::sSingleton;
-
-ContentProcessChild::ContentProcessChild()
-    : mQuit(PR_FALSE)
-{
-}
-
-ContentProcessChild::~ContentProcessChild()
-{
-}
-
-bool
-ContentProcessChild::Init(MessageLoop* aIOLoop,
-                          base::ProcessHandle aParentHandle,
-                          IPC::Channel* aChannel)
-{
-    NS_ASSERTION(!sSingleton, "only one ContentProcessChild per child");
-  
-    Open(aChannel, aParentHandle, aIOLoop);
-    sSingleton = this;
-
-    return true;
-}
-
-PIFrameEmbeddingChild*
-ContentProcessChild::AllocPIFrameEmbedding()
-{
-  nsRefPtr<TabChild> iframe = new TabChild();
-  NS_ENSURE_TRUE(iframe && NS_SUCCEEDED(iframe->Init()) &&
-                 mIFrames.AppendElement(iframe),
-                 nsnull);
-  return iframe.forget().get();
-}
-
-bool
-ContentProcessChild::DeallocPIFrameEmbedding(PIFrameEmbeddingChild* iframe)
-{
-    if (mIFrames.RemoveElement(iframe)) {
-      TabChild* child = static_cast<TabChild*>(iframe);
-      NS_RELEASE(child);
-    }
-    return true;
-}
-
-PTestShellChild*
-ContentProcessChild::AllocPTestShell()
-{
-    PTestShellChild* testshell = new TestShellChild();
-    if (testshell && mTestShells.AppendElement(testshell)) {
-        return testshell;
-    }
-    delete testshell;
-    return nsnull;
-}
-
-bool
-ContentProcessChild::DeallocPTestShell(PTestShellChild* shell)
-{
-    mTestShells.RemoveElement(shell);
-    return true;
-}
-
-PNeckoChild* 
-ContentProcessChild::AllocPNecko()
-{
-    return new NeckoChild();
-}
-
-bool 
-ContentProcessChild::DeallocPNecko(PNeckoChild* necko)
-{
-    delete necko;
-    return true;
-}
-
-void
-ContentProcessChild::Quit()
-{
-    NS_ASSERTION(mQuit, "Exiting uncleanly!");
-    mIFrames.Clear();
-    mTestShells.Clear();
-}
-
-static void
-QuitIOLoop()
-{
-    MessageLoop::current()->Quit();
-}
-
-bool
-ContentProcessChild::RecvQuit()
-{
-    mQuit = PR_TRUE;
-
-    Quit();
-
-    XRE_GetIOMessageLoop()->PostTask(FROM_HERE,
-                                     NewRunnableFunction(&QuitIOLoop));
-
-    return true;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/ContentProcessChild.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_dom_ContentProcessChild_h
-#define mozilla_dom_ContentProcessChild_h
-
-#include "mozilla/dom/PContentProcessChild.h"
-
-#include "nsTArray.h"
-#include "nsAutoPtr.h"
-
-namespace mozilla {
-namespace dom {
-
-class ContentProcessChild : public PContentProcessChild
-{
-public:
-    ContentProcessChild();
-    virtual ~ContentProcessChild();
-
-    bool Init(MessageLoop* aIOLoop,
-              base::ProcessHandle aParentHandle,
-              IPC::Channel* aChannel);
-
-    static ContentProcessChild* GetSingleton() {
-        NS_ASSERTION(sSingleton, "not initialized");
-        return sSingleton;
-    }
-
-    virtual PIFrameEmbeddingChild* AllocPIFrameEmbedding();
-    virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingChild*);
-
-    virtual PTestShellChild* AllocPTestShell();
-    virtual bool DeallocPTestShell(PTestShellChild*);
-
-    virtual PNeckoChild* AllocPNecko();
-    virtual bool DeallocPNecko(PNeckoChild*);
-
-    void Quit();
-    virtual bool RecvQuit();
-
-private:
-    static ContentProcessChild* sSingleton;
-
-    nsTArray<PIFrameEmbeddingChild* > mIFrames;
-    nsTArray<nsAutoPtr<PTestShellChild> > mTestShells;
-
-    PRBool mQuit;
-
-    DISALLOW_EVIL_CONSTRUCTORS(ContentProcessChild);
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif
deleted file mode 100644
--- a/dom/ipc/ContentProcessParent.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "ContentProcessParent.h"
-
-#include "mozilla/ipc/GeckoThread.h"
-
-#include "TabParent.h"
-#include "mozilla/ipc/TestShellParent.h"
-#include "mozilla/net/NeckoParent.h"
-
-#include "nsIObserverService.h"
-
-#include "nsAutoPtr.h"
-#include "nsCOMPtr.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-
-using namespace mozilla::ipc;
-using namespace mozilla::net;
-using mozilla::MonitorAutoEnter;
-
-namespace {
-PRBool gSingletonDied = PR_FALSE;
-}
-
-namespace mozilla {
-namespace dom {
-
-ContentProcessParent* ContentProcessParent::gSingleton;
-
-ContentProcessParent*
-ContentProcessParent::GetSingleton()
-{
-    if (!gSingleton && !gSingletonDied) {
-        nsRefPtr<ContentProcessParent> parent = new ContentProcessParent();
-        if (parent) {
-            nsCOMPtr<nsIObserverService> obs =
-                do_GetService("@mozilla.org/observer-service;1");
-            if (obs) {
-                if (NS_SUCCEEDED(obs->AddObserver(parent, "xpcom-shutdown",
-                                                  PR_FALSE))) {
-                    gSingleton = parent;
-                }
-            }
-        }
-    }
-    return gSingleton;
-}
-
-TabParent*
-ContentProcessParent::CreateTab()
-{
-  return static_cast<TabParent*>(SendPIFrameEmbeddingConstructor());
-}
-
-TestShellParent*
-ContentProcessParent::CreateTestShell()
-{
-  return static_cast<TestShellParent*>(SendPTestShellConstructor());
-}
-
-bool
-ContentProcessParent::DestroyTestShell(TestShellParent* aTestShell)
-{
-    return SendPTestShellDestructor(aTestShell);
-}
-
-ContentProcessParent::ContentProcessParent()
-    : mMonitor("ContentProcessParent::mMonitor")
-{
-    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-    mSubprocess = new GeckoChildProcessHost(GeckoProcessType_Content, this);
-    mSubprocess->AsyncLaunch();
-    Open(mSubprocess->GetChannel(), mSubprocess->GetChildProcessHandle());
-}
-
-ContentProcessParent::~ContentProcessParent()
-{
-    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-    NS_ASSERTION(gSingleton == this, "More than one singleton?!");
-    gSingletonDied = PR_TRUE;
-    gSingleton = nsnull;
-}
-
-NS_IMPL_ISUPPORTS1(ContentProcessParent, nsIObserver)
-
-NS_IMETHODIMP
-ContentProcessParent::Observe(nsISupports* aSubject,
-                              const char* aTopic,
-                              const PRUnichar* aData)
-{
-    if (!strcmp(aTopic, "xpcom-shutdown") && mSubprocess) {
-        SendQuit();
-#ifdef OS_WIN
-        MonitorAutoEnter mon(mMonitor);
-        while (mSubprocess) {
-            mon.Wait();
-        }
-#endif
-    }
-    return NS_OK;
-}
-
-void
-ContentProcessParent::OnWaitableEventSignaled(base::WaitableEvent *event)
-{
-    // The child process has died! Sadly we're on the wrong thread to do much.
-    NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
-    MonitorAutoEnter mon(mMonitor);
-    mSubprocess = nsnull;
-    mon.Notify();
-}
-
-PIFrameEmbeddingParent*
-ContentProcessParent::AllocPIFrameEmbedding()
-{
-    return new TabParent();
-}
-
-bool
-ContentProcessParent::DeallocPIFrameEmbedding(PIFrameEmbeddingParent* frame)
-{
-  delete frame;
-  return true;
-}
-
-PTestShellParent*
-ContentProcessParent::AllocPTestShell()
-{
-  return new TestShellParent();
-}
-
-bool
-ContentProcessParent::DeallocPTestShell(PTestShellParent* shell)
-{
-  delete shell;
-  return true;
-}
-
-PNeckoParent* 
-ContentProcessParent::AllocPNecko()
-{
-    return new NeckoParent();
-}
-
-bool 
-ContentProcessParent::DeallocPNecko(PNeckoParent* necko)
-{
-    delete necko;
-    return true;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/ContentProcessParent.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_dom_ContentProcessParent_h
-#define mozilla_dom_ContentProcessParent_h
-
-#include "base/waitable_event_watcher.h"
-
-#include "mozilla/dom/PContentProcessParent.h"
-#include "mozilla/ipc/GeckoChildProcessHost.h"
-
-#include "nsIObserver.h"
-#include "mozilla/Monitor.h"
-
-namespace mozilla {
-
-namespace ipc {
-class TestShellParent;
-}
-
-namespace dom {
-
-class TabParent;
-
-class ContentProcessParent : public PContentProcessParent,
-                             public base::WaitableEventWatcher::Delegate,
-                             public nsIObserver
-{
-private:
-    typedef mozilla::ipc::GeckoChildProcessHost GeckoChildProcessHost;
-    typedef mozilla::ipc::TestShellParent TestShellParent;
-
-public:
-    static ContentProcessParent* GetSingleton();
-
-#if 0
-    // TODO: implement this somewhere!
-    static ContentProcessParent* FreeSingleton();
-#endif
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIOBSERVER
-
-    virtual void OnWaitableEventSignaled(base::WaitableEvent *event);
-
-    TabParent* CreateTab();
-
-    TestShellParent* CreateTestShell();
-    bool DestroyTestShell(TestShellParent* aTestShell);
-
-private:
-    static ContentProcessParent* gSingleton;
-
-    // Hide the raw constructor methods since we don't want client code
-    // using them.
-    using PContentProcessParent::SendPIFrameEmbeddingConstructor;
-    using PContentProcessParent::SendPTestShellConstructor;
-
-    ContentProcessParent();
-    virtual ~ContentProcessParent();
-
-    virtual PIFrameEmbeddingParent* AllocPIFrameEmbedding();
-    virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingParent* frame);
-
-    virtual PTestShellParent* AllocPTestShell();
-    virtual bool DeallocPTestShell(PTestShellParent* shell);
-
-    virtual PNeckoParent* AllocPNecko();
-    virtual bool DeallocPNecko(PNeckoParent* necko);
-
-    mozilla::Monitor mMonitor;
-
-    GeckoChildProcessHost* mSubprocess;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif
deleted file mode 100644
--- a/dom/ipc/ContentProcessThread.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set sw=4 ts=8 et tw=80 : 
- * ***** 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 Mozilla Plugin App.
- *
- * The Initial Developer of the Original Code is
- *   Ben Turner <bent.mozilla@gmail.com>.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Chris Jones <jones.chris.g@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 ***** */
-
-#include "ContentProcessThread.h"
-
-#include "prlink.h"
-
-#include "base/command_line.h"
-#include "base/string_util.h"
-#include "chrome/common/child_process.h"
-#include "chrome/common/chrome_switches.h"
-
-using mozilla::ipc::GeckoThread;
-
-namespace mozilla {
-namespace dom {
-
-ContentProcessThread::ContentProcessThread(ProcessHandle mParentHandle) :
-    GeckoThread(mParentHandle),
-    mContentProcess()
-{
-}
-
-ContentProcessThread::~ContentProcessThread()
-{
-}
-
-void
-ContentProcessThread::Init()
-{
-    GeckoThread::Init();
-
-    // FIXME/cjones: set up channel stuff, etc.
-    
-    // FIXME owner_loop() is bad here
-    mContentProcess.Init(owner_loop(), GetParentProcessHandle(), channel());
-}
-
-void
-ContentProcessThread::CleanUp()
-{
-    GeckoThread::CleanUp();
-}
-
-} // namespace tabs
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/ContentProcessThread.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set sw=4 ts=8 et tw=80 : 
- * ***** 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 Mozilla Plugin App.
- *
- * The Initial Developer of the Original Code is
- *   Ben Turner <bent.mozilla@gmail.com>.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Chris Jones <jones.chris.g@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 ***** */
-
-#ifndef dom_tabs_ContentProcessThread_h
-#define dom_tabs_ContentProcessThread_h 1
-
-#include "chrome/common/child_thread.h"
-#include "base/file_path.h"
-
-#include "mozilla/ipc/GeckoThread.h"
-#include "ContentProcessChild.h"
-
-#undef _MOZ_LOG
-#define _MOZ_LOG(s)  printf("[ContentProcessThread] %s", s)
-
-namespace mozilla {
-namespace dom {
-
-/**
- * ContentProcessThread is a singleton on the content process which represents
- * a background thread where tab instances live.
- */
-class ContentProcessThread : public mozilla::ipc::GeckoThread
-{
-public:
-    ContentProcessThread(ProcessHandle mParentHandle);
-    ~ContentProcessThread();
-
-private:
-    // Thread implementation:
-    virtual void Init();
-    virtual void CleanUp();
-
-    ContentProcessChild mContentProcess;
-    IPC::Channel* mChannel;
-
-    DISALLOW_EVIL_CONSTRUCTORS(ContentProcessThread);
-};
-
-}  // namespace dom
-}  // namespace mozilla
-
-#endif  // ifndef dom_tabs_ContentProcessThread_h
deleted file mode 100644
--- a/dom/ipc/Makefile.in
+++ /dev/null
@@ -1,77 +0,0 @@
-# ***** 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 Mozilla Firefox.
-#
-# The Initial Developer of the Original Code is
-# The Mozilla Foundation <http://www.mozilla.org/>.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# 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 *****
-
-DEPTH = ../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = dom
-LIBRARY_NAME = domipc_s
-LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
-EXPORT_LIBRARY = 1
-
-EXPORTS = TabMessageUtils.h
-
-EXPORTS_NAMESPACES = mozilla mozilla/dom
-
-EXPORTS_mozilla = \
-  TabTypes.h \
-  $(NULL)
-
-EXPORTS_mozilla/dom = \
-  ContentProcessChild.h \
-  ContentProcessParent.h \
-  ContentProcessThread.h \
-  $(NULL)
-
-CPPSRCS = \
-  ContentProcessThread.cpp \
-  ContentProcessParent.cpp \
-  ContentProcessChild.cpp \
-  TabParent.cpp \
-  TabChild.cpp \
-  TabMessageUtils.cpp \
-  $(NULL)
-
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
-include $(topsrcdir)/config/rules.mk
-
-DEFINES += -DBIN_SUFFIX='"$(BIN_SUFFIX)"'
deleted file mode 100644
--- a/dom/ipc/PContentProcess.ipdl
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-include protocol "PIFrameEmbedding.ipdl";
-include protocol "PTestShell.ipdl";
-include protocol "PNecko.ipdl";
-
-include "mozilla/TabTypes.h";
-
-namespace mozilla {
-namespace dom {
-
-sync protocol PContentProcess
-{
-    manages PIFrameEmbedding;
-    manages PTestShell;
-    manages PNecko;
-
-child:
-    PIFrameEmbedding();
-    ~PIFrameEmbedding();
-
-    PTestShell();
-    ~PTestShell();
-
-    Quit();
-
-parent:
-    PNecko();
-    ~PNecko();
-};
-
-}
-}
deleted file mode 100644
--- a/dom/ipc/PDocumentRenderer.ipdl
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* ***** 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 Mozilla Fenntrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-include protocol "PIFrameEmbedding.ipdl";
-
-namespace mozilla {
-namespace ipc {
-
-protocol PDocumentRenderer
-{
-  manager PIFrameEmbedding;
-};
-
-} // namespace ipc
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/PIFrameEmbedding.ipdl
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
-
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-include protocol "PContentProcess.ipdl";
-include protocol "PDocumentRenderer.ipdl";
-
-include "mozilla/TabTypes.h";
-include "TabMessageUtils.h";
-
-using PRUint32;
-using PRInt32;
-using MagicWindowHandle;
-using RemoteDOMEvent;
-
-namespace mozilla {
-namespace dom {
-
-async protocol PIFrameEmbedding
-{
-    manager PContentProcess;
-    manages PDocumentRenderer;
-
-parent:
-    /**
-     * When child sends this message, parent should move focus to
-     * the next or previous focusable element.
-     */
-    moveFocus(bool forward);
-
-    sendEvent(RemoteDOMEvent aEvent);
-child:
-    createWidget(MagicWindowHandle parentWidget);
-
-    loadURL(nsCString uri);
-
-    move(PRUint32 x,
-         PRUint32 y,
-         PRUint32 width,
-         PRUint32 height);
-
-    /**
-     * Sending an activate message moves focus to the child.
-     */
-    activate();
-
-  /**
-   * @see nsIDOMWindowUtils sendMouseEvent.
-   */
-    sendMouseEvent(nsString aType,
-                   PRInt32 aX, //XXX should be float, but ipdl doesn't seem to support that.
-                   PRInt32 aY, //XXX - " -
-                   PRInt32 aButton,
-                   PRInt32 aClickCount,
-                   PRInt32 aModifiers,
-                   bool aIgnoreRootScrollFrame);
-
-    /**
-     * Activate event forwarding from client to parent.
-     */
-    activateFrameEvent(nsString aType, bool capture);
-
-    PDocumentRenderer(PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h, nsString bgcolor, PRUint32 flags, bool flush);
-
-parent:
-
-    ~PDocumentRenderer(PRUint32 w, PRUint32 h, nsCString data);
-};
-
-}
-}
deleted file mode 100644
--- a/dom/ipc/TabChild.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "TabChild.h"
-
-#include "nsIWebBrowser.h"
-#include "nsEmbedCID.h"
-#include "nsComponentManagerUtils.h"
-#include "nsIBaseWindow.h"
-#include "nsIDOMWindow.h"
-#include "nsIDocShellTreeItem.h"
-#include "nsThreadUtils.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "mozilla/ipc/DocumentRendererChild.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsPIDOMWindow.h"
-#include "nsIDOMWindowUtils.h"
-#include "nsISupportsImpl.h"
-#include "nsIWebBrowserFocus.h"
-#include "nsIDOMEvent.h"
-#include "nsIPrivateDOMEvent.h"
-
-#ifdef MOZ_WIDGET_GTK2
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-#endif
-
-using namespace mozilla::dom;
-
-NS_IMPL_ISUPPORTS1(ContentListener, nsIDOMEventListener)
-
-NS_IMETHODIMP
-ContentListener::HandleEvent(nsIDOMEvent* aEvent)
-{
-  RemoteDOMEvent remoteEvent;
-  remoteEvent.mEvent = do_QueryInterface(aEvent);
-  NS_ENSURE_STATE(remoteEvent.mEvent);
-  mTabChild->SendsendEvent(remoteEvent);
-  return NS_OK;
-}
-
-TabChild::TabChild()
-{
-    printf("creating %d!\n", NS_IsMainThread());
-}
-
-nsresult
-TabChild::Init()
-{
-#ifdef MOZ_WIDGET_GTK2
-  gtk_init(NULL, NULL);
-#endif
-
-  nsCOMPtr<nsIWebBrowser> webBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
-  if (!webBrowser) {
-    NS_ERROR("Couldn't create a nsWebBrowser?");
-    return NS_ERROR_FAILURE;
-  }
-
-  webBrowser->SetContainerWindow(this);
-
-  mWebNav = do_QueryInterface(webBrowser);
-  NS_ASSERTION(mWebNav, "nsWebBrowser doesn't implement nsIWebNavigation?");
-
-  nsCOMPtr<nsIDocShellTreeItem> docShellItem(do_QueryInterface(mWebNav));
-  docShellItem->SetItemType(nsIDocShellTreeItem::typeContentWrapper);
-  return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS5(TabChild, nsIWebBrowserChrome, nsIWebBrowserChrome2,
-                   nsIEmbeddingSiteWindow, nsIEmbeddingSiteWindow2,
-                   nsIWebBrowserChromeFocus)
-
-NS_IMETHODIMP
-TabChild::SetStatus(PRUint32 aStatusType, const PRUnichar* aStatus)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetWebBrowser(nsIWebBrowser** aWebBrowser)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetWebBrowser(nsIWebBrowser* aWebBrowser)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetChromeFlags(PRUint32* aChromeFlags)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetChromeFlags(PRUint32 aChromeFlags)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::DestroyBrowserWindow()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::ShowAsModal()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::IsWindowModal(PRBool* aRetVal)
-{
-  *aRetVal = PR_FALSE;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TabChild::ExitModalEventLoop(nsresult aStatus)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetStatusWithContext(PRUint32 aStatusType,
-                                    const nsAString& aStatusText,
-                                    nsISupports* aStatusContext)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetDimensions(PRUint32 aFlags, PRInt32 aX, PRInt32 aY,
-                             PRInt32 aCx, PRInt32 aCy)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetDimensions(PRUint32 aFlags, PRInt32* aX,
-                             PRInt32* aY, PRInt32* aCx, PRInt32* aCy)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetFocus()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetVisibility(PRBool* aVisibility)
-{
-  *aVisibility = PR_TRUE;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TabChild::SetVisibility(PRBool aVisibility)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetTitle(PRUnichar** aTitle)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::SetTitle(const PRUnichar* aTitle)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::GetSiteWindow(void** aSiteWindow)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::Blur()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChild::FocusNextElement()
-{
-  SendmoveFocus(PR_TRUE);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-TabChild::FocusPrevElement()
-{
-  SendmoveFocus(PR_FALSE);
-  return NS_OK;
-}
-
-bool
-TabChild::RecvcreateWidget(const MagicWindowHandle& parentWidget)
-{
-    nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mWebNav);
-    if (!baseWindow) {
-        NS_ERROR("mWebNav doesn't QI to nsIBaseWindow");
-        return true;
-    }
-
-#ifdef MOZ_WIDGET_GTK2
-    GtkWidget* win = gtk_plug_new((GdkNativeWindow)parentWidget);
-    gtk_widget_show(win);
-#elif defined(XP_WIN)
-    HWND win = parentWidget;
-#elif defined(XP_MACOSX)
-#  warning IMPLEMENT ME
-#else
-#error You lose!
-#endif
-
-#if !defined(XP_MACOSX)
-    baseWindow->InitWindow(win, 0, 0, 0, 0, 0);
-    baseWindow->Create();
-    baseWindow->SetVisibility(PR_TRUE);
-#endif
-
-    return true;
-}
-
-bool
-TabChild::destroyWidget()
-{
-    nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mWebNav);
-    if (baseWindow)
-        baseWindow->Destroy();
-
-    return true;
-}
-
-TabChild::~TabChild()
-{
-    destroyWidget();
-    nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(mWebNav);
-    if (webBrowser) {
-      webBrowser->SetContainerWindow(nsnull);
-    }
-}
-
-bool
-TabChild::RecvloadURL(const nsCString& uri)
-{
-    printf("loading %s, %d\n", uri.get(), NS_IsMainThread());
-
-    nsresult rv = mWebNav->LoadURI(NS_ConvertUTF8toUTF16(uri).get(),
-                                   nsIWebNavigation::LOAD_FLAGS_NONE,
-                                   NULL, NULL, NULL);
-    if (NS_FAILED(rv)) {
-        NS_WARNING("mWebNav->LoadURI failed. Eating exception, what else can I do?");
-    }
-    return true;
-}
-
-bool
-TabChild::Recvmove(const PRUint32& x,
-                     const PRUint32& y,
-                     const PRUint32& width,
-                     const PRUint32& height)
-{
-    printf("[TabChild] MOVE to (x,y)=(%ud, %ud), (w,h)= (%ud, %ud)\n",
-           x, y, width, height);
-
-    nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(mWebNav);
-    baseWin->SetPositionAndSize(x, y, width, height, PR_TRUE);
-    return true;
-}
-
-bool
-TabChild::Recvactivate()
-{
-  nsCOMPtr<nsIWebBrowserFocus> browser = do_QueryInterface(mWebNav);
-  browser->Activate();
-  return true;
-}
-
-bool
-TabChild::RecvsendMouseEvent(const nsString& aType,
-                             const PRInt32&  aX,
-                             const PRInt32&  aY,
-                             const PRInt32&  aButton,
-                             const PRInt32&  aClickCount,
-                             const PRInt32&  aModifiers,
-                             const bool&     aIgnoreRootScrollFrame)
-{
-  nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mWebNav);
-  nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
-  NS_ENSURE_TRUE(utils, true);
-  utils->SendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers,
-                        aIgnoreRootScrollFrame);
-  return true;
-}
-
-mozilla::ipc::PDocumentRendererChild*
-TabChild::AllocPDocumentRenderer(
-        const PRInt32& x,
-        const PRInt32& y,
-        const PRInt32& w,
-        const PRInt32& h,
-        const nsString& bgcolor,
-        const PRUint32& flags,
-        const bool& flush)
-{
-    return new mozilla::ipc::DocumentRendererChild();
-}
-
-bool
-TabChild::DeallocPDocumentRenderer(
-        mozilla::ipc::PDocumentRendererChild* __a,
-        const PRUint32& w,
-        const PRUint32& h,
-        const nsCString& data)
-{
-    delete __a;
-    return true;
-}
-
-bool
-TabChild::RecvPDocumentRendererConstructor(
-        mozilla::ipc::PDocumentRendererChild *__a,
-        const PRInt32& aX,
-        const PRInt32& aY,
-        const PRInt32& aW,
-        const PRInt32& aH,
-        const nsString& bgcolor,
-        const PRUint32& flags,
-        const bool& flush)
-{
-    mozilla::ipc::DocumentRendererChild *render = 
-        static_cast<mozilla::ipc::DocumentRendererChild *>(__a);
-
-    nsCOMPtr<nsIWebBrowser> browser = do_QueryInterface(mWebNav);
-    if (!browser)
-        return true; // silently ignore
-    nsCOMPtr<nsIDOMWindow> window;
-    if (NS_FAILED(browser->GetContentDOMWindow(getter_AddRefs(window))) ||
-        !window)
-    {
-        return true; // silently ignore
-    }
-
-    PRUint32 width, height;
-    nsCString data;
-    bool ret = render->RenderDocument(window, aX, aY, aW, aH, bgcolor, flags, flush,
-                                      width, height, data);
-    if (!ret)
-        return true; // silently ignore
-
-    return SendPDocumentRendererDestructor(__a, width, height, data);
-}
-
-bool
-TabChild::RecvactivateFrameEvent(const nsString& aType, const bool& capture)
-{
-  nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mWebNav);
-  NS_ENSURE_TRUE(window, true);
-  nsCOMPtr<nsIDOMEventTarget> chromeHandler =
-    do_QueryInterface(window->GetChromeEventHandler());
-  NS_ENSURE_TRUE(chromeHandler, true);
-  nsRefPtr<ContentListener> listener = new ContentListener(this);
-  NS_ENSURE_TRUE(listener, true);
-  chromeHandler->AddEventListener(aType, listener, capture);
-  return true;
-}
deleted file mode 100644
--- a/dom/ipc/TabChild.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_tabs_TabChild_h
-#define mozilla_tabs_TabChild_h
-
-#include "mozilla/dom/PIFrameEmbeddingChild.h"
-#include "nsIWebNavigation.h"
-#include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
-#include "nsIWebBrowserChrome2.h"
-#include "nsIEmbeddingSiteWindow2.h"
-#include "nsIWebBrowserChromeFocus.h"
-#include "nsIDOMEventListener.h"
-#include "nsIDOMEventTarget.h"
-
-namespace mozilla {
-namespace dom {
-
-class TabChild;
-
-class ContentListener : public nsIDOMEventListener
-{
-public:
-  ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMEVENTLISTENER
-protected:
-  TabChild* mTabChild;
-};
-
-class TabChild : public PIFrameEmbeddingChild,
-                 public nsIWebBrowserChrome2,
-                 public nsIEmbeddingSiteWindow2,
-                 public nsIWebBrowserChromeFocus
-{
-public:
-    TabChild();
-    virtual ~TabChild();
-    bool destroyWidget();
-    nsresult Init();
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIWEBBROWSERCHROME
-    NS_DECL_NSIWEBBROWSERCHROME2
-    NS_DECL_NSIEMBEDDINGSITEWINDOW
-    NS_DECL_NSIEMBEDDINGSITEWINDOW2
-    NS_DECL_NSIWEBBROWSERCHROMEFOCUS
-
-    virtual bool RecvcreateWidget(const MagicWindowHandle& parentWidget);
-    virtual bool RecvloadURL(const nsCString& uri);
-    virtual bool Recvmove(const PRUint32& x,
-                          const PRUint32& y,
-                          const PRUint32& width,
-                          const PRUint32& height);
-    virtual bool Recvactivate();
-    virtual bool RecvsendMouseEvent(const nsString& aType,
-                                    const PRInt32&  aX,
-                                    const PRInt32&  aY,
-                                    const PRInt32&  aButton,
-                                    const PRInt32&  aClickCount,
-                                    const PRInt32&  aModifiers,
-                                    const bool&     aIgnoreRootScrollFrame);
-    virtual bool RecvactivateFrameEvent(const nsString& aType, const bool& capture);
-    virtual mozilla::ipc::PDocumentRendererChild* AllocPDocumentRenderer(
-            const PRInt32& x,
-            const PRInt32& y,
-            const PRInt32& w,
-            const PRInt32& h,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush);
-    virtual bool DeallocPDocumentRenderer(
-            mozilla::ipc::PDocumentRendererChild* __a,
-            const PRUint32& w,
-            const PRUint32& h,
-            const nsCString& data);
-    virtual bool RecvPDocumentRendererConstructor(
-            mozilla::ipc::PDocumentRendererChild *__a,
-            const PRInt32& x,
-            const PRInt32& y,
-            const PRInt32& w,
-            const PRInt32& h,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush);
-
-private:
-    nsCOMPtr<nsIWebNavigation> mWebNav;
-
-    DISALLOW_EVIL_CONSTRUCTORS(TabChild);
-};
-
-}
-}
-
-#endif // mozilla_tabs_TabChild_h
deleted file mode 100644
--- a/dom/ipc/TabMessageUtils.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is 
- * Mozilla Corporation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Olli Pettay <Olli.Pettay@helsinki.fi>
- *
- * 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 ***** */
-
-#include "TabMessageUtils.h"
-#include "nsCOMPtr.h"
-#include "nsIDOMEvent.h"
-
-#ifdef CreateEvent
-#undef CreateEvent
-#endif
-
-#include "nsEventDispatcher.h"
-
-namespace mozilla {
-namespace dom {
-
-bool
-ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
-                RemoteDOMEvent* aResult)
-{
-  aResult->mEvent = nsnull;
-  nsString type;
-  NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false);
-
-  nsCOMPtr<nsIDOMEvent> event;
-  nsEventDispatcher::CreateEvent(nsnull, nsnull, type, getter_AddRefs(event));
-  aResult->mEvent = do_QueryInterface(event);
-  NS_ENSURE_TRUE(aResult->mEvent, false);
-
-  return aResult->mEvent->Deserialize(aMsg, aIter);
-}
-
-}
-}
deleted file mode 100644
--- a/dom/ipc/TabMessageUtils.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is 
- * Mozilla Corporation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Olli Pettay <Olli.Pettay@helsinki.fi>
- *
- * 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 ***** */
-
-#ifndef TABMESSAGE_UTILS_H
-#define TABMESSAGE_UTILS_H
-
-#include "IPC/IPCMessageUtils.h"
-#include "nsIPrivateDOMEvent.h"
-#include "nsCOMPtr.h"
-
-namespace mozilla {
-namespace dom {
-struct RemoteDOMEvent
-{
-  nsCOMPtr<nsIPrivateDOMEvent> mEvent;
-};
-
-bool ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
-                     mozilla::dom::RemoteDOMEvent* aResult);
-
-}
-}
-
-namespace IPC {
-
-template<>
-struct ParamTraits<mozilla::dom::RemoteDOMEvent>
-{
-  typedef mozilla::dom::RemoteDOMEvent paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    aParam.mEvent->Serialize(aMsg, PR_TRUE);
-  }
-
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
-  }
-
-  static void Log(const paramType& aParam, std::wstring* aLog)
-  {
-  }
-};
-
-
-}
-
-
-#endif
deleted file mode 100644
--- a/dom/ipc/TabParent.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#include "TabParent.h"
-
-#include "mozilla/ipc/GeckoThread.h"
-#include "mozilla/ipc/DocumentRendererParent.h"
-
-#include "nsIURI.h"
-#include "nsFocusManager.h"
-#include "nsCOMPtr.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIDOMElement.h"
-#include "nsEventDispatcher.h"
-#include "nsIDOMEventTarget.h"
-#include "nsIDOMEvent.h"
-#include "nsIPrivateDOMEvent.h"
-
-using mozilla::ipc::BrowserProcessSubThread;
-using mozilla::ipc::DocumentRendererParent;
-
-namespace mozilla {
-namespace dom {
-
-TabParent::TabParent()
-{
-}
-
-TabParent::~TabParent()
-{
-}
-
-bool
-TabParent::RecvmoveFocus(const bool& aForward)
-{
-  nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
-  if (fm) {
-    nsCOMPtr<nsIDOMElement> dummy;
-    PRUint32 type = aForward ? nsIFocusManager::MOVEFOCUS_FORWARD
-                             : nsIFocusManager::MOVEFOCUS_BACKWARD;
-    fm->MoveFocus(nsnull, mFrameElement, type, nsIFocusManager::FLAG_BYKEY, 
-                  getter_AddRefs(dummy));
-  }
-  return true;
-}
-
-bool
-TabParent::RecvsendEvent(const RemoteDOMEvent& aEvent)
-{
-  nsCOMPtr<nsIDOMEvent> event = do_QueryInterface(aEvent.mEvent);
-  NS_ENSURE_TRUE(event, true);
-
-  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mFrameElement);
-  NS_ENSURE_TRUE(target, true);
-
-  PRBool dummy;
-  target->DispatchEvent(event, &dummy);
-  return true;
-}
-
-void
-TabParent::LoadURL(nsIURI* aURI)
-{
-    nsCString spec;
-    aURI->GetSpec(spec);
-
-    SendloadURL(spec);
-}
-
-void
-TabParent::Move(PRUint32 x, PRUint32 y, PRUint32 width, PRUint32 height)
-{
-    Sendmove(x, y, width, height);
-}
-
-void
-TabParent::Activate()
-{
-    Sendactivate();
-}
-
-mozilla::ipc::PDocumentRendererParent*
-TabParent::AllocPDocumentRenderer(const PRInt32& x,
-        const PRInt32& y, const PRInt32& w, const PRInt32& h, const nsString& bgcolor,
-        const PRUint32& flags, const bool& flush)
-{
-    return new DocumentRendererParent();
-}
-
-bool
-TabParent::DeallocPDocumentRenderer(mozilla::ipc::PDocumentRendererParent* __a,
-        const PRUint32& w, const PRUint32& h, const nsCString& data)
-{
-    NS_ENSURE_ARG_POINTER(__a);
-    delete __a;
-    return true;
-}
-
-bool
-TabParent::RecvPDocumentRendererDestructor(PDocumentRendererParent* __a,
-        const PRUint32& w, const PRUint32& h, const nsCString& data)
-{
-    NS_ENSURE_ARG_POINTER(__a);
-    DocumentRendererParent *renderer = static_cast<DocumentRendererParent *>(__a);
-    renderer->DrawToCanvas(w, h, data);
-
-    return true;
-}
-
-void
-TabParent::SendMouseEvent(const nsAString& aType, float aX, float aY,
-                          PRInt32 aButton, PRInt32 aClickCount,
-                          PRInt32 aModifiers, PRBool aIgnoreRootScrollFrame)
-{
-  SendsendMouseEvent(nsString(aType), aX, aY, aButton, aClickCount,
-                     aModifiers, aIgnoreRootScrollFrame);
-}
-
-} // namespace tabs
-} // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/TabParent.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-/* ***** 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 Mozilla Content App.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * 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 ***** */
-
-#ifndef mozilla_tabs_TabParent_h
-#define mozilla_tabs_TabParent_h
-
-#include "mozilla/dom/PIFrameEmbeddingParent.h"
-
-#include "mozilla/ipc/GeckoChildProcessHost.h"
-
-class nsIURI;
-class nsIDOMElement;
-
-namespace mozilla {
-namespace dom {
-
-class TabParent : public PIFrameEmbeddingParent
-{
-public:
-    TabParent();
-    virtual ~TabParent();
-    void SetOwnerElement(nsIDOMElement* aElement) { mFrameElement = aElement; }
-
-    virtual bool RecvmoveFocus(const bool& aForward);
-    virtual bool RecvsendEvent(const RemoteDOMEvent& aEvent);
-
-    void LoadURL(nsIURI* aURI);
-    void Move(PRUint32 x, PRUint32 y, PRUint32 width, PRUint32 height);
-    void Activate();
-    void SendMouseEvent(const nsAString& aType, float aX, float aY,
-                        PRInt32 aButton, PRInt32 aClickCount,
-                        PRInt32 aModifiers, PRBool aIgnoreRootScrollFrame);
-
-    virtual mozilla::ipc::PDocumentRendererParent* AllocPDocumentRenderer(
-            const PRInt32& x,
-            const PRInt32& y,
-            const PRInt32& w,
-            const PRInt32& h,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush);
-    virtual bool DeallocPDocumentRenderer(
-            mozilla::ipc::PDocumentRendererParent* __a,
-            const PRUint32& w,
-            const PRUint32& h,
-            const nsCString& data);
-    virtual bool RecvPDocumentRendererDestructor(
-            mozilla::ipc::PDocumentRendererParent* __a,
-            const PRUint32& w,
-            const PRUint32& h,
-            const nsCString& data);
-protected:
-    nsIDOMElement* mFrameElement;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif
deleted file mode 100644
--- a/dom/ipc/TabTypes.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=8 et tw=80 : */
-
-#ifndef mozilla_tabs_TabTypes_h
-#define mozilla_tabs_TabTypes_h
-
-#include "base/basictypes.h"
-
-#ifdef XP_WIN
-#include <windows.h>
-
-typedef HWND MagicWindowHandle;
-#elif defined(MOZ_WIDGET_GTK2)
-#include <X11/X.h>
-
-typedef XID MagicWindowHandle;
-
-#elif defined(XP_MACOSX)
-#  warning This is a placeholder
-typedef long MagicWindowHandle;
-
-#else
-#error Not implemented, stooge
-#endif
-
-#endif
deleted file mode 100644
--- a/dom/ipc/ipdl.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# ***** 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 Mozilla Content App.
-#
-# The Initial Developer of the Original Code is
-#   The Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# 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 *****
-
-IPDLSRCS = \
-  PContentProcess.ipdl \
-  PIFrameEmbedding.ipdl \
-  PDocumentRenderer.ipdl \
-  $(NULL)
deleted file mode 100644
--- a/dom/ipc/jar.mn
+++ /dev/null
@@ -1,2 +0,0 @@
-toolkit.jar:
-        content/global/test-ipc.xul (test.xul)
deleted file mode 100644
--- a/dom/ipc/test.xul
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        width="800" height="800" orient="vertical">
-  <script>
-
-    function dumpClientRect(r) {
-      dump(r.left + "," + r.top + "," + r.right + "," +
-           r.bottom + "," + r.width + "," + r.height + "\n");
-    }
-
-    function handleMozAfterPaint(e) {
-      return;
-      dump(e.type + "\n")
-      var rects = e.clientRects;
-      var i;
-      dump("\tclientRects:\n");
-      for (i = 0; i &lt; rects.length; ++i) {
-        var r = rects.item(i);
-        dump("\t\t");
-        dumpClientRect(rects.item(i));
-      }
-
-      dump("\tboundingClientRect\n\t\t");
-      dumpClientRect(e.boundingClientRect);
-
-      var paintRequests = e.paintRequests;
-      dump("\tpaintRequests\n");
-      for (i = 0; i &lt; paintRequests.length; ++i) {
-        var pr = paintRequests.item(i);
-        dump("\t\t");
-        dumpClientRect(pr.clientRect);
-        if (pr.reason)
-          dump("\t\t" + pr.reason + "\n");
-      }
-    }
-
-    function handleMozScrolledAreaChanged(e) {
-      return;
-      dump(e.type + "\n");
-      dump("\t" + e.x + "," + e.y + "," + e.width + "," + e.height + "\n");
-    }
-
-    function restart() {
-      var y = document.getElementById('page');
-      var p = y.parentNode;
-      p.removeChild(y);
-      p.appendChild(y);
-
-      var fl = y.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader;
-      fl.activateFrameEvent("MozAfterPaint", true);
-      fl.activateFrameEvent("MozScrolledAreaChanged", true);
-      y.addEventListener("MozAfterPaint", handleMozAfterPaint, true);
-      y.addEventListener("MozScrolledAreaChanged", handleMozScrolledAreaChanged, true);
-    }
-    
-    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').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 openWindow() {
-      window.open('chrome://global/content/test-ipc.xul', '_blank', 'chrome,resizable,width=800,height=800');
-    }
-    
-    function closeWindow() {
-      window.close();
-    }
-  </script>
-
-  <toolbar id="controls">
-    <toolbarbutton label="Back"/>
-    <toolbarbutton label="Forward"/>
-    <textbox onchange="loadURL(this.value)" flex="1" id="URL"/>
-    <toolbarbutton onclick="restart()" label="Recover"/>
-    <toolbarbutton onclick="randomClick()" label="random click"/>
-    <toolbarbutton onclick="openWindow()" label="open new window"/>
-    <toolbarbutton onclick="closeWindow()" label="close this window"/>
-  </toolbar>
-
-  <browser type="content" src="http://www.google.com/" flex="1" id="page" remote="true"
-           onfocus="this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.activateRemoteFrame();"/>
-</window>
--- a/netwerk/Makefile.in
+++ b/netwerk/Makefile.in
@@ -51,22 +51,16 @@ DIRS		= \
 		socket \
 		mime \
 		streamconv \
 		cache \
 		protocol \
 		system \
         $(NULL)
 
-ifdef MOZ_IPC
-DIRS 		+= \
-	        ipc  \
-	        $(NULL)
-endif
-
 ifdef NECKO_WIFI
 DIRS 		+= wifi
 endif
 
 DIRS		+= \
 		build \
 		locales \
 		$(NULL)
--- a/netwerk/build.mk
+++ b/netwerk/build.mk
@@ -40,17 +40,20 @@
 ifndef tier_nspr_dirs
 include $(topsrcdir)/config/nspr/build.mk
 endif
 
 ifndef tier_xpcom_dirs
 include $(topsrcdir)/xpcom/build.mk
 endif
 
-TIERS += zlib
+TIERS += zlib \
+	necko \
+	$(NULL)
+
 
 ifndef MOZ_NATIVE_ZLIB
 tier_zlib_dirs	+= modules/zlib
 endif
 
 #
 # tier "necko" - the networking library and its dependencies
 #
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -58,23 +58,16 @@ SHARED_LIBRARY_LIBS = \
 		../base/src/$(LIB_PREFIX)neckobase_s.$(LIB_SUFFIX) \
 		../dns/src/$(LIB_PREFIX)neckodns_s.$(LIB_SUFFIX) \
 		../socket/base/$(LIB_PREFIX)neckosocket_s.$(LIB_SUFFIX) \
 		../streamconv/src/$(LIB_PREFIX)nkconv_s.$(LIB_SUFFIX) \
 		../streamconv/converters/$(LIB_PREFIX)nkcnvts_s.$(LIB_SUFFIX) \
 		../mime/src/$(LIB_PREFIX)nkmime_s.$(LIB_SUFFIX) \
 		../cache/src/$(LIB_PREFIX)nkcache_s.$(LIB_SUFFIX) \
 		../protocol/about/src/$(LIB_PREFIX)nkabout_s.$(LIB_SUFFIX) \
-		$(NULL)
-
-ifdef MOZ_IPC
-SHARED_LIBRARY_LIBS += ../ipc/$(LIB_PREFIX)neckoipc_s.$(LIB_SUFFIX)
-endif
-
-SHARED_LIBRARY_LIBS += \
 		$(foreach d,$(filter-out about,$(NECKO_PROTOCOLS)), \
 			../protocol/$(d)/src/$(LIB_PREFIX)nk$(d)_s.$(LIB_SUFFIX)) \
 		$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
     SHARED_LIBRARY_LIBS += \
         ../system/win32/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
 endif
@@ -156,17 +149,15 @@ EXTRA_DSO_LDOPTS += \
 		$(TK_LIBS) \
 	$(NULL)
 endif
 
 ifeq ($(OS_ARCH),AIX)
 EXTRA_DSO_LDOPTS += -lodm -lcfg
 endif
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS	+= $(call EXPAND_LIBNAME,ole32 shell32)
 endif
 
 DEFINES += -DIMPL_NS_NET
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -32,20 +32,16 @@
  * 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 "necko-config.h"
 
-#ifdef MOZ_IPC
-#include "base/basictypes.h"
-#endif 
-
 #include "nsCOMPtr.h"
 #include "nsIModule.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIGenericFactory.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsICategoryManager.h"
 #include "nsSocketProviderService.h"
--- a/netwerk/dns/src/nsIDNKitInterface.h
+++ b/netwerk/dns/src/nsIDNKitInterface.h
@@ -87,17 +87,16 @@ typedef enum {
 typedef struct idn_nameprep *idn_nameprep_t;
 
 
 /*
  * The latest version of nameprep.
  */
 #define IDN_NAMEPREP_CURRENT	"nameprep-11"
 
-#undef assert
 #define assert(a)
 #define TRACE(a)
 
 
 /* race.c */
 idn_result_t	race_decode_decompress(const char *from,
 					       PRUint16 *buf,
 					       size_t buflen);
deleted file mode 100644
--- a/netwerk/ipc/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-# ***** 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 Mozilla Firefox.
-#
-# The Initial Developer of the Original Code is
-# The Mozilla Foundation <http://www.mozilla.org/>.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):  Jason Duell
-#
-# 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 *****
-
-DEPTH = ../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = necko
-
-LIBRARY_NAME = neckoipc_s
-LIBXUL_LIBRARY = 1
-FORCE_STATIC_LIB = 1
-EXPORT_LIBRARY = 1
-
-EXPORTS_NAMESPACES = mozilla/net
-
-EXPORTS_mozilla/net = \
-  NeckoParent.h       \
-  NeckoChild.h        \
-  $(NULL)
-
-CPPSRCS =               \
-  NeckoChild.cpp        \
-  NeckoParent.cpp       \
-  $(NULL)
-
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/netwerk/ipc/NeckoChild.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#include "mozilla/net/NeckoChild.h"
-#include "mozilla/dom/ContentProcessChild.h"
-#include "mozilla/net/HttpChannelChild.h"
-
-namespace mozilla {
-namespace net {
-
-PNeckoChild *gNeckoChild = nsnull;
-
-// C++ file contents
-NeckoChild::NeckoChild()
-{
-}
-
-NeckoChild::~NeckoChild()
-{
-}
-
-void NeckoChild::InitNeckoChild()
-{
-  if (XRE_GetProcessType() == GeckoProcessType_Content) {
-    mozilla::dom::ContentProcessChild * cpc = 
-      mozilla::dom::ContentProcessChild::GetSingleton();
-    NS_ASSERTION(cpc, "Content Protocol is NULL!");
-    gNeckoChild = cpc->SendPNeckoConstructor(); 
-    NS_ASSERTION(gNeckoChild, "PNecko Protocol init failed!");
-  }
-}
-
-PHttpChannelChild* 
-NeckoChild::AllocPHttpChannel()
-{
-  return new HttpChannelChild();
-}
-
-bool 
-NeckoChild::DeallocPHttpChannel(PHttpChannelChild* channel)
-{
-  delete channel;
-  return true;
-}
-
-}} // mozilla::net
-
deleted file mode 100644
--- a/netwerk/ipc/NeckoChild.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#ifndef mozilla_net_NeckoChild_h
-#define mozilla_net_NeckoChild_h
-
-#include "mozilla/net/PNeckoChild.h"
-#include "mozilla/net/HttpChannelChild.h"
-#include "nsXULAppAPI.h"
-
-namespace mozilla {
-namespace net {
-
-// Header file contents
-class NeckoChild :
-  public PNeckoChild
-{
-public:
-  NeckoChild();
-  virtual ~NeckoChild();
-
-  static void InitNeckoChild();
-
-  virtual PHttpChannelChild* AllocPHttpChannel();
-  virtual bool DeallocPHttpChannel(PHttpChannelChild*);
-
-protected:
-};
-
-/**
- * Reference to the PNecko Child protocol.
- * Null if this is not a content process.
- */
-extern PNeckoChild *gNeckoChild;
-
-static inline PRBool 
-IsNeckoChild() 
-{
-  return XRE_GetProcessType() == GeckoProcessType_Content;        
-}
-
-} // namespace net
-} // namespace mozilla
-
-#endif // mozilla_net_NeckoChild_h
deleted file mode 100644
--- a/netwerk/ipc/NeckoParent.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#include "mozilla/net/NeckoParent.h"
-#include "mozilla/net/HttpChannelParent.h"
-
-namespace mozilla {
-namespace net {
-
-// C++ file contents
-NeckoParent::NeckoParent()
-{
-}
-
-NeckoParent::~NeckoParent()
-{
-}
-
-PHttpChannelParent* 
-NeckoParent::AllocPHttpChannel()
-{
-  return new HttpChannelParent();
-}
-
-bool 
-NeckoParent::DeallocPHttpChannel(PHttpChannelParent* channel)
-{
-  delete channel;
-  return true;
-}
-
-
-}} // mozilla::net
-
deleted file mode 100644
--- a/netwerk/ipc/NeckoParent.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#include "mozilla/net/PNeckoParent.h"
-#include "mozilla/net/HttpChannelChild.h"
-
-#ifndef mozilla_net_NeckoParent_h
-#define mozilla_net_NeckoParent_h
-
-namespace mozilla {
-namespace net {
-
-// Header file contents
-class NeckoParent :
-  public PNeckoParent
-{
-public:
-  NeckoParent();
-  virtual ~NeckoParent();
-
-protected:
-  virtual PHttpChannelParent* AllocPHttpChannel();
-  virtual bool DeallocPHttpChannel(PHttpChannelParent*);
-};
-
-} // namespace net
-} // namespace mozilla
-
-#endif // mozilla_net_NeckoParent_h
deleted file mode 100644
--- a/netwerk/ipc/PNecko.ipdl
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-include protocol "PContentProcess.ipdl";
-include protocol "PHttpChannel.ipdl";
-
-namespace mozilla {
-namespace net {
-
-
-//-------------------------------------------------------------------
-protocol PNecko
-{
-  manager PContentProcess;
-  manages PHttpChannel;
-
-parent:
-  PHttpChannel();
-  ~PHttpChannel();
-};
-
-
-} // namespace net
-} // namespace mozilla
deleted file mode 100644
--- a/netwerk/ipc/ipdl.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# ***** 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 Mozilla Firefox.
-#
-# The Initial Developer of the Original Code is
-# The Mozilla Foundation <http://www.mozilla.org/>.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):  Jason Duell
-#
-# 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 *****
-
-IPDLSRCS =          \
-  PNecko.ipdl       \
-  $(NULL)
-
deleted file mode 100644
--- a/netwerk/protocol/http/src/HttpChannelChild.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#include "mozilla/net/HttpChannelChild.h"
-#include "mozilla/dom/ContentProcessChild.h"
-
-namespace mozilla {
-namespace net {
-
-// C++ file contents
-HttpChannelChild::HttpChannelChild()
-{
-}
-
-HttpChannelChild::~HttpChannelChild()
-{
-}
-
-}} // mozilla::net
-
deleted file mode 100644
--- a/netwerk/protocol/http/src/HttpChannelChild.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#ifndef mozilla_net_HttpChannelChild_h
-#define mozilla_net_HttpChannelChild_h
-
-#include "mozilla/net/PHttpChannelChild.h"
-#include "nsXULAppAPI.h"
-
-namespace mozilla {
-namespace net {
-
-// Header file contents
-class HttpChannelChild :
-  public PHttpChannelChild
-{
-public:
-  HttpChannelChild();
-  virtual ~HttpChannelChild();
-
-protected:
-};
-
-
-} // namespace net
-} // namespace mozilla
-
-#endif // mozilla_net_HttpChannelChild_h
deleted file mode 100644
--- a/netwerk/protocol/http/src/HttpChannelParent.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#include "mozilla/net/HttpChannelParent.h"
-
-namespace mozilla {
-namespace net {
-
-// C++ file contents
-HttpChannelParent::HttpChannelParent()
-{
-}
-
-HttpChannelParent::~HttpChannelParent()
-{
-}
-
-//-----------------------------------------------------------------------------
-// 
-bool HttpChannelParent::RecvasyncOpen(const nsCString& uri)
-{
-  puts("[HttpChannelParent] got asyncOpen msg");
-  return true;
-}
-
-}} // mozilla::net
-
deleted file mode 100644
--- a/netwerk/protocol/http/src/HttpChannelParent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-#ifndef mozilla_net_HttpChannelParent_h
-#define mozilla_net_HttpChannelParent_h
-
-#include "mozilla/net/PHttpChannelParent.h"
-
-namespace mozilla {
-namespace net {
-
-// Header file contents
-class HttpChannelParent :
-  public PHttpChannelParent
-{
-public:
-  HttpChannelParent();
-  virtual ~HttpChannelParent();
-
-protected:
-  virtual bool RecvasyncOpen(const nsCString& uri);
-};
-
-} // namespace net
-} // namespace mozilla
-
-#endif // mozilla_net_HttpChannelParent_h
--- a/netwerk/protocol/http/src/Makefile.in
+++ b/netwerk/protocol/http/src/Makefile.in
@@ -41,24 +41,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= necko
 LIBRARY_NAME = nkhttp_s
 LIBXUL_LIBRARY  = 1
 
-ifdef MOZ_IPC
-EXPORTS_NAMESPACES = mozilla/net
-
-EXPORTS_mozilla/net = \
-  HttpChannelParent.h \
-  HttpChannelChild.h  \
-  $(NULL)
-endif
 
 CPPSRCS		= \
 		nsHttp.cpp \
 		nsHttpHeaderArray.cpp \
 		nsHttpConnectionInfo.cpp \
 		nsHttpConnection.cpp \
 		nsHttpConnectionMgr.cpp \
 		nsHttpRequestHead.cpp \
@@ -71,26 +63,17 @@ CPPSRCS		= \
 		nsHttpNTLMAuth.cpp \
 		nsHttpTransaction.cpp \
 		nsHttpHandler.cpp \
 		nsHttpChannel.cpp \
 		nsHttpPipeline.cpp \
 		nsHttpActivityDistributor.cpp \
 		$(NULL)
 
-ifdef MOZ_IPC
-CPPSRCS += \
-  HttpChannelParent.cpp \
-  HttpChannelChild.cpp \
-  $(NULL)
-endif
-
 LOCAL_INCLUDES=-I$(srcdir)/../../../base/src -I$(topsrcdir)/xpcom/ds
 
 # we don't want the shared lib, but we want to force the creation of a
 # static lib.
 FORCE_STATIC_LIB = 1
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DIMPL_NS_NET
deleted file mode 100644
--- a/netwerk/protocol/http/src/PHttpChannel.ipdl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
-
-/* ***** 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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- *  The Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Jason Duell <jduell.mcbugs@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 ***** */
-
-include protocol "PNecko.ipdl";
-
-namespace mozilla {
-namespace net {
-
-
-//-------------------------------------------------------------------
-protocol PHttpChannel
-{
-  manager PNecko;
-
-parent:
-  asyncOpen(nsCString uri);
-};
-
-
-} // namespace net
-} // namespace mozilla
-
deleted file mode 100644
--- a/netwerk/protocol/http/src/ipdl.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# ***** 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 Mozilla Firefox.
-#
-# The Initial Developer of the Original Code is
-# The Mozilla Foundation <http://www.mozilla.org/>.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):  Jason Duell
-#
-# 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 *****
-
-IPDLSRCS =          \
-  PHttpChannel.ipdl \
-  $(NULL)
-
--- a/netwerk/protocol/http/src/nsHttp.h
+++ b/netwerk/protocol/http/src/nsHttp.h
@@ -39,20 +39,16 @@
 
 #ifndef nsHttp_h__
 #define nsHttp_h__
 
 #if defined(MOZ_LOGGING)
 #define FORCE_PR_LOG
 #endif
 
-#ifdef MOZ_IPC
-#include "mozilla/net/NeckoChild.h"
-#endif 
-
 #include "plstr.h"
 #include "prlog.h"
 #include "prtime.h"
 #include "nsISupportsUtils.h"
 #include "nsPromiseFlatString.h"
 #include "nsURLHelper.h"
 #include "netCore.h"
 
@@ -66,17 +62,16 @@
 //    set NSPR_LOG_FILE=http.log
 //
 // this enables PR_LOG_ALWAYS level information and places all output in
 // the file http.log
 //
 extern PRLogModuleInfo *gHttpLog;
 #endif
 
-#undef LOG
 // http logging
 #define LOG1(args) PR_LOG(gHttpLog, 1, args)
 #define LOG2(args) PR_LOG(gHttpLog, 2, args)
 #define LOG3(args) PR_LOG(gHttpLog, 3, args)
 #define LOG4(args) PR_LOG(gHttpLog, 4, args)
 #define LOG(args) LOG4(args)
 
 #define LOG1_ENABLED() PR_LOG_TEST(gHttpLog, 1)
--- a/netwerk/protocol/http/src/nsHttpChunkedDecoder.h
+++ b/netwerk/protocol/http/src/nsHttpChunkedDecoder.h
@@ -34,17 +34,16 @@
  * 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 ***** */
 
 #ifndef nsHttpChunkedDecoder_h__
 #define nsHttpChunkedDecoder_h__
 
-#include "nsHttp.h"
 #include "nsError.h"
 #include "nsString.h"
 #include "nsHttpHeaderArray.h"
 
 class nsHttpChunkedDecoder
 {
 public:
     nsHttpChunkedDecoder() : mTrailers(nsnull)
--- a/netwerk/protocol/http/src/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/src/nsHttpHandler.cpp
@@ -89,21 +89,16 @@
 #include <Carbon/Carbon.h>
 #endif
 
 #if defined(XP_OS2)
 #define INCL_DOSMISC
 #include <os2.h>
 #endif
 
-//-----------------------------------------------------------------------------
-#ifdef MOZ_IPC
-using namespace mozilla::net;
-#endif 
-
 #ifdef DEBUG
 // defined by the socket transport service while active
 extern PRThread *gSocketThread;
 #endif
 
 static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
 static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
 static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
@@ -225,21 +220,16 @@ nsHttpHandler::Init()
         return rv;
 
     mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) {
         NS_WARNING("unable to continue without io service");
         return rv;
     }
 
-#ifdef MOZ_IPC
-    if (IsNeckoChild() && !gNeckoChild)
-        NeckoChild::InitNeckoChild();
-#endif // MOZ_IPC
-
     InitUserAgentComponents();
 
     // monitor some preference changes
     nsCOMPtr<nsIPrefBranch2> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (prefBranch) {
         prefBranch->AddObserver(HTTP_PREF_PREFIX, this, PR_TRUE);
         prefBranch->AddObserver(UA_PREF_PREFIX, this, PR_TRUE);
         prefBranch->AddObserver(INTL_ACCEPT_LANGUAGES, this, PR_TRUE); 
--- a/netwerk/protocol/http/src/nsHttpHeaderArray.h
+++ b/netwerk/protocol/http/src/nsHttpHeaderArray.h
@@ -34,22 +34,22 @@
  * 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 ***** */
 
 #ifndef nsHttpHeaderArray_h__
 #define nsHttpHeaderArray_h__
 
-#include "nsHttp.h"
 #include "nsTArray.h"
 #include "nsIHttpChannel.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
+#include "nsHttp.h"
 
 class nsHttpHeaderArray
 {
 public:
     nsHttpHeaderArray() {}
    ~nsHttpHeaderArray() { Clear(); }
 
     const char *PeekHeader(nsHttpAtom header);
--- a/netwerk/protocol/http/src/nsHttpRequestHead.h
+++ b/netwerk/protocol/http/src/nsHttpRequestHead.h
@@ -34,18 +34,18 @@
  * 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 ***** */
 
 #ifndef nsHttpRequestHead_h__
 #define nsHttpRequestHead_h__
 
+#include "nsHttpHeaderArray.h"
 #include "nsHttp.h"
-#include "nsHttpHeaderArray.h"
 #include "nsString.h"
 #include "nsCRT.h"
 
 //-----------------------------------------------------------------------------
 // nsHttpRequestHead represents the request line and headers from an HTTP
 // request.
 //-----------------------------------------------------------------------------
 
--- a/security/manager/ssl/src/nsSmartCardEvent.cpp
+++ b/security/manager/ssl/src/nsSmartCardEvent.cpp
@@ -123,30 +123,16 @@ NS_IMETHODIMP_(nsEvent*) nsSmartCardEven
 }
 
 NS_IMETHODIMP nsSmartCardEvent::SetTrusted(PRBool aResult)
 {
   NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
   return mPrivate->SetTrusted(aResult);
 }
 
-void
-nsSmartCardEvent::Serialize(IPC::Message* aMsg,
-                            PRBool aSerializeInterfaceType)
-{
-  NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
-  mPrivate->Serialize(aMsg, aSerializeInterfaceType);
-}
-
-PRBool
-nsSmartCardEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
-{
-  NS_ASSERTION(mPrivate, "SmartCardEvent called without Init");
-  return mPrivate->Deserialize(aMsg, aIter);
-}
 
 // IDOMNSEvent maps
 NS_IMETHODIMP nsSmartCardEvent::GetOriginalTarget(nsIDOMEventTarget * *aOriginalTarget)
 {
   NS_ASSERTION(mNSEvent, "SmartCardEvent called without Init");
   return mNSEvent->GetOriginalTarget(aOriginalTarget);
 }
 
--- a/security/manager/ssl/src/nsSmartCardEvent.h
+++ b/security/manager/ssl/src/nsSmartCardEvent.h
@@ -61,19 +61,16 @@ public:
   NS_DECL_NSIDOMNSEVENT
 
   //NS_DECL_NSIPRIVATEDOMEEVENT
   NS_IMETHOD DuplicatePrivateData();
   NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget);
   NS_IMETHOD_(nsEvent*) GetInternalNSEvent();
   NS_IMETHOD_(PRBool ) IsDispatchStopped();
   NS_IMETHOD SetTrusted(PRBool aResult);
-  virtual void Serialize(IPC::Message* aMsg,
-                         PRBool aSerializeInterfaceType);
-  virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
 
   NS_DECL_NSIDOMEVENT
 
 protected:
   nsCOMPtr<nsIDOMEvent> mInner;
   nsCOMPtr<nsIPrivateDOMEvent> mPrivate;
   nsCOMPtr<nsIDOMNSEvent> mNSEvent;
   nsString mTokenName;
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/application.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[App]
-Vendor=venderr
-Name=tile
-Version=1.0
-BuildID=20060101
-Copyright=Copyright (c) 2006 Mark Finkle
-ID=xulapp@starkravingfinkle.org
-
-[Gecko]
-MinVersion=1.8
-MaxVersion=2.0
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content	tile	file:content/
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js
+++ /dev/null
@@ -1,728 +0,0 @@
-// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
-/*
- * ***** 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 Mozilla Mobile Browser.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Roy Frostig <rfrostig@mozilla.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 ***** */
-
-let Ci = Components.interfaces;
-
-// --- REMOVE ---
-let noop = function() {};
-let endl = '\n';
-// --------------
-
-function BrowserView(container, visibleRect) {
-  bindAll(this);
-  this.init(container, visibleRect);
-}
-
-/**
- * A BrowserView maintains state of the viewport (browser, zoom level,
- * dimensions) and the visible rectangle into the viewport, for every
- * browser it is given (cf setBrowser()).  In updates to the viewport state,
- * a BrowserView (using its TileManager) renders parts of the page quasi-
- * intelligently, with guarantees of having rendered and appended all of the
- * visible browser content (aka the "critical rectangle").
- *
- * State is characterized in large part by two rectangles (and an implicit third):
- * - Viewport: Always rooted at the origin, ie with (left, top) at (0, 0).  The
- *     width and height (right and bottom) of this rectangle are that of the
- *     current viewport, which corresponds more or less to the transformed
- *     browser content (scaled by zoom level).
- * - Visible: Corresponds to the client's viewing rectangle in viewport
- *     coordinates.  Has (top, left) corresponding to position, and width & height
- *     corresponding to the clients viewing dimensions.  Take note that the top
- *     and left of the visible rect are per-browser state, but that the width
- *     and height persist across setBrowser() calls.  This is best explained by
- *     a simple example: user views browser A, pans to position (x0, y0), switches
- *     to browser B, where she finds herself at position (x1, y1), tilts her
- *     device so that visible rectangle's width and height change, and switches
- *     back to browser A.  She expects to come back to position (x0, y0), but her
- *     device remains tilted.
- * - Critical (the implicit one): The critical rectangle is the (possibly null)
- *     intersection of the visible and viewport rectangles.  That is, it is that
- *     region of the viewport which is visible to the user.  We care about this
- *     because it tells us which region must be rendered as soon as it is dirtied.
- *     The critical rectangle is mostly state that we do not keep in BrowserView
- *     but that our TileManager maintains.
- *
- * Example rectangle state configurations:
- *
- *
- *        +-------------------------------+
- *        |A                              |
- *        |                               |
- *        |                               |
- *        |                               |
- *        |        +----------------+     |
- *        |        |B,C             |     |
- *        |        |                |     |
- *        |        |                |     |
- *        |        |                |     |
- *        |        +----------------+     |
- *        |                               |
- *        |                               |
- *        |                               |
- *        |                               |
- *        |                               |
- *        +-------------------------------+
- *
- *
- * A = viewport ; at (0, 0)
- * B = visible  ; at (x, y) where x > 0, y > 0
- * C = critical ; at (x, y)
- *
- *
- *
- *        +-------------------------------+
- *        |A                              |
- *        |                               |
- *        |                               |
- *        |                               |
- *   +----+-----------+                   |
- *   |B   .C          |                   |
- *   |    .           |                   |
- *   |    .           |                   |
- *   |    .           |                   |
- *   +----+-----------+                   |
- *        |                               |
- *        |                               |
- *        |                               |
- *        |                               |
- *        |                               |
- *        +-------------------------------+
- *
- *
- * A = viewport ; at (0, 0)
- * B = visible  ; at (x, y) where x < 0, y > 0
- * C = critical ; at (0, y)
- *
- *
- * Maintaining per-browser state is a little bit of a hack involving attaching
- * an object as the obfuscated dynamic JS property of the browser object, that
- * hopefully no one but us will touch.  See getViewportStateFromBrowser() for
- * the property name.
- */
-BrowserView.prototype = (
-function() {
-
-  // -----------------------------------------------------------
-  // Privates
-  //
-
-  const kZoomLevelMin = 0.2;
-  const kZoomLevelMax = 4.0;
-  const kZoomLevelPrecision = 10000;
-
-  function visibleRectToCriticalRect(visibleRect, browserViewportState) {
-    return visibleRect.intersect(browserViewportState.viewportRect);
-  }
-
-  function clampZoomLevel(zl) {
-    let bounded = Math.min(Math.max(kZoomLevelMin, zl), kZoomLevelMax);
-    return Math.round(bounded * kZoomLevelPrecision) / kZoomLevelPrecision;
-  }
-
-  function pageZoomLevel(visibleRect, browserW, browserH) {
-    return clampZoomLevel(visibleRect.width / browserW);
-  }
-
-  function seenBrowser(browser) {
-    return !!(browser.__BrowserView__vps);
-  }
-
-  function initBrowserState(browser, visibleRect) {
-    let [browserW, browserH] = getBrowserDimensions(browser);
-
-    let zoomLevel = pageZoomLevel(visibleRect, browserW, browserH);
-    let viewportRect = (new wsRect(0, 0, browserW, browserH)).scale(zoomLevel, zoomLevel);
-
-    dump('--- initing browser to ---' + endl);
-    browser.__BrowserView__vps = new BrowserView.BrowserViewportState(viewportRect,
-                                                                      visibleRect.x,
-                                                                      visibleRect.y,
-                                                                      zoomLevel);
-    dump(browser.__BrowserView__vps.toString() + endl);
-    dump('--------------------------' + endl);
-  }
-
-  function getViewportStateFromBrowser(browser) {
-    return browser.__BrowserView__vps;
-  }
-
-  function getBrowserDimensions(browser) {
-    return [browser.scrollWidth, browser.scrollHeight];
-  }
-
-  function getContentScrollValues(browser) {
-    let cwu = getBrowserDOMWindowUtils(browser);
-    let scrollX = {};
-    let scrollY = {};
-    cwu.getScrollXY(false, scrollX, scrollY);
-
-    return [scrollX.value, scrollY.value];
-  }
-
-  function getBrowserDOMWindowUtils(browser) {
-    return browser.contentWindow
-      .QueryInterface(Ci.nsIInterfaceRequestor)
-      .getInterface(Ci.nsIDOMWindowUtils);
-  }
-
-  function getNewBatchOperationState() {
-    return {
-      viewportSizeChanged: false,
-      dirtyAll: false
-    };
-  }
-
-  function clampViewportWH(width, height, visibleRect) {
-    let minW = visibleRect.width;
-    let minH = visibleRect.height;
-    return [Math.max(width, minW), Math.max(height, minH)];
-  }
-
-  function initContainer(container, visibleRect) {
-    container.style.width    = visibleRect.width  + 'px';
-    container.style.height   = visibleRect.height + 'px';
-    container.style.overflow = '-moz-hidden-unscrollable';
-  }
-
-  function resizeContainerToViewport(container, viewportRect) {
-    container.style.width  = viewportRect.width  + 'px';
-    container.style.height = viewportRect.height + 'px';
-  }
-
-  // !!! --- RESIZE HACK BEGIN -----
-  function simulateMozAfterSizeChange(browser, width, height) {
-    let ev = document.createElement("MouseEvents");
-    ev.initEvent("FakeMozAfterSizeChange", false, false, window, 0, width, height);
-    browser.dispatchEvent(ev);
-  }
-  // !!! --- RESIZE HACK END -------
-
-  // --- Change of coordinates functions --- //
-
-
-  // The following returned object becomes BrowserView.prototype
-  return {
-
-    // -----------------------------------------------------------
-    // Public instance methods
-    //
-
-    init: function init(container, visibleRect) {
-      this._batchOps = [];
-      this._container = container;
-      this._browserViewportState = null;
-      this._renderMode = 0;
-      this._tileManager = new TileManager(this._appendTile, this._removeTile, this);
-      this.setVisibleRect(visibleRect);
-
-      // !!! --- RESIZE HACK BEGIN -----
-      // remove this eventually
-      this._resizeHack = {
-        maxSeenW: 0,
-        maxSeenH: 0
-      };
-      // !!! --- RESIZE HACK END -------
-    },
-
-    setVisibleRect: function setVisibleRect(r) {
-      let bvs = this._browserViewportState;
-      let vr  = this._visibleRect;
-
-      if (!vr)
-        this._visibleRect = vr = r.clone();
-      else
-        vr.copyFrom(r);
-
-      if (bvs) {
-        bvs.visibleX = vr.left;
-        bvs.visibleY = vr.top;
-
-        // reclamp minimally to the new visible rect
-        //this.setViewportDimensions(bvs.viewportRect.right, bvs.viewportRect.bottom);
-      } else
-        this._viewportChanged(false, false);
-    },
-
-    getVisibleRect: function getVisibleRect() {
-      return this._visibleRect.clone();
-    },
-
-    getVisibleRectX: function getVisibleRectX() { return this._visibleRect.x; },
-    getVisibleRectY: function getVisibleRectY() { return this._visibleRect.y; },
-    getVisibleRectWidth: function getVisibleRectWidth() { return this._visibleRect.width; },
-    getVisibleRectHeight: function getVisibleRectHeight() { return this._visibleRect.height; },
-
-    setViewportDimensions: function setViewportDimensions(width, height, causedByZoom) {
-      let bvs = this._browserViewportState;
-      let vis = this._visibleRect;
-
-      if (!bvs)
-        return;
-
-      //[width, height] = clampViewportWH(width, height, vis);
-      bvs.viewportRect.right  = width;
-      bvs.viewportRect.bottom = height;
-
-      // XXX we might not want the user's page to disappear from under them
-      // at this point, which could happen if the container gets resized such
-      // that visible rect becomes entirely outside of viewport rect.  might
-      // be wise to define what UX should be in this case, like a move occurs.
-      // then again, we could also argue this is the responsibility of the
-      // caller who would do such a thing...
-
-      this._viewportChanged(true, !!causedByZoom);
-    },
-
-    setZoomLevel: function setZoomLevel(zl) {
-      let bvs = this._browserViewportState;
-
-      if (!bvs)
-        return;
-
-      let newZL = clampZoomLevel(zl);
-
-      if (newZL != bvs.zoomLevel) {
-        let browserW = this.viewportToBrowser(bvs.viewportRect.right);
-        let browserH = this.viewportToBrowser(bvs.viewportRect.bottom);
-        bvs.zoomLevel = newZL; // side-effect: now scale factor in transformations is newZL
-        this.setViewportDimensions(this.browserToViewport(browserW),
-                                   this.browserToViewport(browserH));
-      }
-    },
-
-    getZoomLevel: function getZoomLevel() {
-      let bvs = this._browserViewportState;
-      if (!bvs)
-        return undefined;
-
-      return bvs.zoomLevel;
-    },
-
-    beginBatchOperation: function beginBatchOperation() {
-      this._batchOps.push(getNewBatchOperationState());
-      this.pauseRendering();
-    },
-
-    commitBatchOperation: function commitBatchOperation() {
-      let bops = this._batchOps;
-
-      if (bops.length == 0)
-        return;
-
-      let opState = bops.pop();
-      this._viewportChanged(opState.viewportSizeChanged, opState.dirtyAll);
-      this.resumeRendering();
-    },
-
-    discardBatchOperation: function discardBatchOperation() {
-      let bops = this._batchOps;
-      bops.pop();
-      this.resumeRendering();
-    },
-
-    discardAllBatchOperations: function discardAllBatchOperations() {
-      let bops = this._batchOps;
-      while (bops.length > 0)
-        this.discardBatchOperation();
-    },
-
-    moveVisibleBy: function moveVisibleBy(dx, dy) {
-      let vr = this._visibleRect;
-      let vs = this._browserViewportState;
-
-      this.onBeforeVisibleMove(dx, dy);
-      this.onAfterVisibleMove(dx, dy);
-    },
-
-    moveVisibleTo: function moveVisibleTo(x, y) {
-      let visibleRect = this._visibleRect;
-      let dx = x - visibleRect.x;
-      let dy = y - visibleRect.y;
-      this.moveBy(dx, dy);
-    },
-
-    /**
-     * Calls to this function need to be one-to-one with calls to
-     * resumeRendering()
-     */
-    pauseRendering: function pauseRendering() {
-      this._renderMode++;
-    },
-
-    /**
-     * Calls to this function need to be one-to-one with calls to
-     * pauseRendering()
-     */
-    resumeRendering: function resumeRendering(renderNow) {
-      if (this._renderMode > 0)
-        this._renderMode--;
-
-      if (renderNow || this._renderMode == 0)
-        this._tileManager.criticalRectPaint();
-    },
-
-    isRendering: function isRendering() {
-      return (this._renderMode == 0);
-    },
-
-    /**
-     * @param dx Guess delta to destination x coordinate
-     * @param dy Guess delta to destination y coordinate
-     */
-    onBeforeVisibleMove: function onBeforeVisibleMove(dx, dy) {
-      let vs = this._browserViewportState;
-      let vr = this._visibleRect;
-
-      let destCR = visibleRectToCriticalRect(vr.clone().translate(dx, dy), vs);
-
-      this._tileManager.beginCriticalMove(destCR);
-    },
-
-    /**
-     * @param dx Actual delta to destination x coordinate
-     * @param dy Actual delta to destination y coordinate
-     */
-    onAfterVisibleMove: function onAfterVisibleMove(dx, dy) {
-      let vs = this._browserViewportState;
-      let vr = this._visibleRect;
-
-      vr.translate(dx, dy);
-      vs.visibleX = vr.left;
-      vs.visibleY = vr.top;
-
-      let cr = visibleRectToCriticalRect(vr, vs);
-
-      this._tileManager.endCriticalMove(cr, this.isRendering());
-    },
-
-    setBrowser: function setBrowser(browser, skipZoom) {
-      let currentBrowser = this._browser;
-
-      let browserChanged = (currentBrowser !== browser);
-
-      if (currentBrowser) {
-        currentBrowser.removeEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
-        // !!! --- RESIZE HACK BEGIN -----
-        // change to the real event type and perhaps refactor the handler function name
-        currentBrowser.removeEventListener("FakeMozAfterSizeChange", this.handleMozAfterSizeChange, false);
-        // !!! --- RESIZE HACK END -------
-
-        this.discardAllBatchOperations();
-
-        currentBrowser.setAttribute("type", "content");
-        currentBrowser.docShell.isOffScreenBrowser = false;
-      }
-
-      this._restoreBrowser(browser);
-
-      browser.setAttribute("type", "content-primary");
-
-      this.beginBatchOperation();
-
-      browser.addEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
-      // !!! --- RESIZE HACK BEGIN -----
-      // change to the real event type and perhaps refactor the handler function name
-      browser.addEventListener("FakeMozAfterSizeChange", this.handleMozAfterSizeChange, false);
-      // !!! --- RESIZE HACK END -------
-
-      if (!skipZoom) {
-        browser.docShell.isOffScreenBrowser = true;
-        this.zoomToPage();
-      }
-
-      this._viewportChanged(browserChanged, browserChanged);
-
-      this.commitBatchOperation();
-    },
-
-    handleMozAfterPaint: function handleMozAfterPaint(ev) {
-      let browser = this._browser;
-      let tm = this._tileManager;
-      let vs = this._browserViewportState;
-
-      let [scrollX, scrollY] = getContentScrollValues(browser);
-      let clientRects = ev.clientRects;
-
-      // !!! --- RESIZE HACK BEGIN -----
-      // remove this, cf explanation in loop below
-      let hack = this._resizeHack;
-      let hackSizeChanged = false;
-      // !!! --- RESIZE HACK END -------
-
-      let rects = [];
-      // loop backwards to avoid xpconnect penalty for .length
-      for (let i = clientRects.length - 1; i >= 0; --i) {
-        let e = clientRects.item(i);
-        let r = new wsRect(e.left + scrollX,
-                           e.top + scrollY,
-                           e.width, e.height);
-
-        this.browserToViewportRect(r);
-        r.round();
-
-        if (r.right < 0 || r.bottom < 0)
-          continue;
-
-        // !!! --- RESIZE HACK BEGIN -----
-        // remove this.  this is where we make 'lazy' calculations
-        // that hint at a browser size change and fake the size change
-        // event dispach
-        if (r.right > hack.maxW) {
-          hack.maxW = rect.right;
-          hackSizeChanged = true;
-        }
-        if (r.bottom > hack.maxH) {
-          hack.maxH = rect.bottom;
-          hackSizeChanged = true;
-        }
-        // !!! --- RESIZE HACK END -------
-
-        r.restrictTo(vs.viewportRect);
-        rects.push(r);
-      }
-
-      // !!! --- RESIZE HACK BEGIN -----
-      // remove this, cf explanation in loop above
-      if (hackSizeChanged)
-        simulateMozAfterSizeChange(browser, hack.maxW, hack.maxH);
-      // !!! --- RESIZE HACK END -------
-
-      tm.dirtyRects(rects, this.isRendering());
-    },
-
-    handleMozAfterSizeChange: function handleMozAfterPaint(ev) {
-      // !!! --- RESIZE HACK BEGIN -----
-      // get the correct properties off of the event, these are wrong because
-      // we're using a MouseEvent since it has an X and Y prop of some sort and
-      // we piggyback on that.
-      let w = ev.screenX;
-      let h = ev.screenY;
-      // !!! --- RESIZE HACK END -------
-
-      this.setViewportDimensions(w, h);
-    },
-
-    zoomToPage: function zoomToPage() {
-      let browser = this._browser;
-
-      if (!browser)
-        return;
-
-      let [w, h] = getBrowserDimensions(browser);
-      this.setZoomLevel(pageZoomLevel(this._visibleRect, w, h));
-    },
-
-    zoom: function zoom(aDirection) {
-      if (aDirection == 0)
-        return;
-
-      var zoomDelta = 0.05; // 1/20
-      if (aDirection >= 0)
-        zoomDelta *= -1;
-
-      this.zoomLevel = this._zoomLevel + zoomDelta;
-    },
-
-    viewportToBrowser: function viewportToBrowser(x) {
-      let bvs = this._browserViewportState;
-
-      if (!bvs)
-        throw "No browser is set";
-
-      return x / bvs.zoomLevel;
-    },
-
-    browserToViewport: function browserToViewport(x) {
-      let bvs = this._browserViewportState;
-
-      if (!bvs)
-        throw "No browser is set";
-
-      return x * bvs.zoomLevel;
-    },
-
-    viewportToBrowserRect: function viewportToBrowserRect(rect) {
-      let f = this.viewportToBrowser(1.0);
-      return rect.scale(f, f);
-    },
-
-    browserToViewportRect: function browserToViewportRect(rect) {
-      let f = this.browserToViewport(1.0);
-      return rect.scale(f, f);
-    },
-
-    browserToViewportCanvasContext: function browserToViewportCanvasContext(ctx) {
-      let f = this.browserToViewport(1.0);
-      ctx.scale(f, f);
-    },
-
-
-    // -----------------------------------------------------------
-    // Private instance methods
-    //
-
-    _restoreBrowser: function _restoreBrowser(browser) {
-      let vr = this._visibleRect;
-
-      if (!seenBrowser(browser))
-        initBrowserState(browser, vr);
-
-      let bvs = getViewportStateFromBrowser(browser);
-
-      this._contentWindow = browser.contentWindow;
-      this._browser = browser;
-      this._browserViewportState = bvs;
-      vr.left = bvs.visibleX;
-      vr.top  = bvs.visibleY;
-      this._tileManager.setBrowser(browser);
-    },
-
-    _viewportChanged: function _viewportChanged(viewportSizeChanged, dirtyAll) {
-      let bops = this._batchOps;
-
-      if (bops.length > 0) {
-        let opState = bops[bops.length - 1];
-
-        if (viewportSizeChanged)
-          opState.viewportSizeChanged = viewportSizeChanged;
-
-        if (dirtyAll)
-          opState.dirtyAll = dirtyAll;
-
-        return;
-      }
-
-      let bvs = this._browserViewportState;
-      let vis = this._visibleRect;
-
-      // !!! --- RESIZE HACK BEGIN -----
-      // We want to uncomment this for perf, but we can't with the hack in place
-      // because the mozAfterPaint gives us rects that we use to create the
-      // fake mozAfterResize event, so we can't just clear things.
-      /*
-      if (dirtyAll) {
-        // We're about to mark the entire viewport dirty, so we can clear any
-        // queued afterPaint events that will cause redundant draws
-        getBrowserDOMWindowUtils(this._browser).clearMozAfterPaintEvents();
-      }
-      */
-      // !!! --- RESIZE HACK END -------
-
-      if (bvs) {
-        resizeContainerToViewport(this._container, bvs.viewportRect);
-
-        this._tileManager.viewportChangeHandler(bvs.viewportRect,
-                                                visibleRectToCriticalRect(vis, bvs),
-                                                viewportSizeChanged,
-                                                dirtyAll);
-      }
-    },
-
-    _appendTile: function _appendTile(tile) {
-      let canvas = tile.getContentImage();
-
-      /*
-      canvas.style.position = "absolute";
-      canvas.style.left = tile.x + "px";
-      canvas.style.top  = tile.y + "px";
-      */
-
-      canvas.setAttribute("style", "position: absolute; left: " + tile.boundRect.left + "px; " + "top: " + tile.boundRect.top + "px;");
-
-      this._container.appendChild(canvas);
-
-      //dump('++ ' + tile.toString(true) + endl);
-    },
-
-    _removeTile: function _removeTile(tile) {
-      let canvas = tile.getContentImage();
-
-      this._container.removeChild(canvas);
-
-      //dump('-- ' + tile.toString(true) + endl);
-    }
-
-  };
-
-}
-)();
-
-
-// -----------------------------------------------------------
-// Helper structures
-//
-
-BrowserView.BrowserViewportState = function(viewportRect,
-                                            visibleX,
-                                            visibleY,
-                                            zoomLevel) {
-
-  this.init(viewportRect, visibleX, visibleY, zoomLevel);
-};
-
-BrowserView.BrowserViewportState.prototype = {
-
-  init: function init(viewportRect, visibleX, visibleY, zoomLevel) {
-    this.viewportRect = viewportRect;
-    this.visibleX     = visibleX;
-    this.visibleY     = visibleY;
-    this.zoomLevel    = zoomLevel;
-  },
-
-  clone: function clone() {
-    return new BrowserView.BrowserViewportState(this.viewportRect,
-                                                this.visibleX,
-                                                this.visibleY,
-						                                    this.zoomLevel);
-  },
-
-  toString: function toString() {
-    let props = ['\tviewportRect=' + this.viewportRect.toString(),
-                 '\tvisibleX='     + this.visibleX,
-                 '\tvisibleY='     + this.visibleY,
-                 '\tzoomLevel='    + this.zoomLevel];
-
-    return '[BrowserViewportState] {\n' + props.join(',\n') + '\n}';
-  }
-
-};
-
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js
+++ /dev/null
@@ -1,359 +0,0 @@
-let noop = function() {};
-Browser = {
-  updateViewportSize: noop
-    /*************************************************************
-  function
-    let browser = document.getElementById("googlenews");
-    let cdoc = browser.contentDocument;
-
-    // These might not exist yet depending on page load state
-    var body = cdoc.body || {};
-    var html = cdoc.documentElement || {};
-
-    var w = Math.max(body.scrollWidth || 0, html.scrollWidth);
-    var h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
-    window.tileManager.viewportHandler(new wsRect(0, 0, w, h),
-                                       window.innerWidth,
-                                       new wsRect(0, 0, window.innerWidth, window.innerHeight),
-                                       false);
-  *************************************************************/
-};
-let ws = {
-  beginUpdateBatch: noop,
-  panTo: noop,
-  endUpdateBatch: noop
-};
-let Ci = Components.interfaces;
-let bv = null;
-let endl = "\n";
-
-
-function BrowserView() {
-  this.init();
-  bindAll(this);
-}
-
-BrowserView.prototype = {
-
-  // --- PROPERTIES ---
-  // public:
-  //   init()
-  //   getViewportInnerBoundsRect(dx, dy)
-  //   tileManager
-  //   scrollbox
-  //
-  // private:
-  //   _scrollbox
-  //   _leftbar
-  //   _rightbar
-  //   _topbar
-  //   _browser
-  //   _tileManager
-  //   _viewportRect
-  //   _viewportInnerBoundsRect
-  //
-
-  get tileManager() { return this._tileManager; },
-  get scrollbox() { return this._scrollbox; },
-
-  init: function init() {
-    let scrollbox = document.getElementById("scrollbox")
-			.boxObject
-			.QueryInterface(Components.interfaces.nsIScrollBoxObject);
-    this._scrollbox = scrollbox;
-
-    let leftbar  = document.getElementById("left_sidebar");
-    let rightbar = document.getElementById("right_sidebar");
-    let topbar   = document.getElementById("top_urlbar");
-    this._leftbar = leftbar;
-    this._rightbar = rightbar;
-    this._topbar = topbar;
-
-    scrollbox.scrollTo(Math.round(leftbar.getBoundingClientRect().right), 0);
-
-    let tileContainer = document.getElementById("tile_container");
-    tileContainer.addEventListener("mousedown", onMouseDown, true);
-    tileContainer.addEventListener("mouseup",   onMouseUp,   true);
-    tileContainer.addEventListener("mousemove", onMouseMove, true);
-    this._tileContainer = tileContainer;
-
-    let tileManager = new TileManager(this.appendTile, this.removeTile, window.innerWidth);
-    this._tileManager = tileManager;
-
-    let browser = document.getElementById("googlenews");
-    this.setCurrentBrowser(browser, false);    // sets this._browser
-
-    let cdoc = browser.contentDocument;
-
-    // These might not exist yet depending on page load state
-    let body = cdoc.body || {};
-    let html = cdoc.documentElement || {};
-
-    let w = Math.max(body.scrollWidth || 0, html.scrollWidth);
-    let h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
-    let viewportRect = new wsRect(0, 0, w, h);
-    this._viewportRect = viewportRect;
-
-    let viewportInnerBoundsRect = this.getViewportInnerBoundsRect();
-    this._viewportInnerBoundsRect = viewportInnerBoundsRect;
-
-    tileManager.viewportHandler(viewportRect,
-				window.innerWidth,
-				viewportInnerBoundsRect,
-				true);
-  },
-
-  resizeTileContainer: function resizeTileContainer() {
-
-  },
-
-  scrollboxToViewportRect: function scrollboxToViewportRect(rect, clip) {
-    let leftbar  = this._leftbar.getBoundingClientRect();
-    let rightbar = this._rightbar.getBoundingClientRect();
-    let topbar   = this._topbar.getBoundingClientRect();
-
-    let xtrans = -leftbar.width;
-    let ytrans = -topbar.height;
-    let x = rect.x + xtrans;
-    let y = rect.y + ytrans;
-
-    // XXX we're cheating --- this is not really a clip, but its the only
-    // way this function is used
-    rect.x = (clip) ? Math.max(x, 0) : x;
-    rect.y = (clip) ? Math.max(y, 0) : y;
-
-    return rect;
-  },
-
-  getScrollboxPosition: function getScrollboxPosition() {
-    let x = {};
-    let y = {};
-    this._scrollbox.getPosition(x, y);
-    return [x.value, y.value];
-  },
-
-  getViewportInnerBoundsRect: function getViewportInnerBoundsRect(dx, dy) {
-    if (!dx) dx = 0;
-    if (!dy) dy = 0;
-
-    let w = window.innerWidth;
-    let h = window.innerHeight;
-
-    let leftbar  = this._leftbar.getBoundingClientRect();
-    let rightbar = this._rightbar.getBoundingClientRect();
-    let topbar   = this._topbar.getBoundingClientRect();
-
-    let leftinner  = Math.max(leftbar.right - dx, 0);
-    let rightinner = Math.min(rightbar.left - dx, w);
-    let topinner   = Math.max(topbar.bottom - dy, 0);
-
-    let [x, y] = this.getScrollboxPosition();
-
-    return this.scrollboxToViewportRect(new wsRect(x + dx, y + dy, rightinner - leftinner, h - topinner),
-				        true);
-  },
-
-  appendTile: function appendTile(tile) {
-    let canvas = tile.contentImage;
-
-    canvas.style.position = "absolute";
-    canvas.style.left = tile.x + "px";
-    canvas.style.top  = tile.y + "px";
-
-    let tileContainer = document.getElementById("tile_container");
-    tileContainer.appendChild(canvas);
-
-    dump('++ ' + tile.toString() + endl);
-  },
-
-  removeTile: function removeTile(tile) {
-    let canvas = tile.contentImage;
-
-    let tileContainer = document.getElementById("tile_container");
-    tileContainer.removeChild(canvas);
-
-    dump('-- ' + tile.toString() + endl);
-  },
-
-  scrollBy: function scrollBy(dx, dy) {
-    // TODO
-    this.onBeforeScroll();
-    this.onAfterScroll();
-  },
-
-  // x: current x
-  // y: current y
-  // dx: delta to get to x from current x
-  // dy: delta to get to y from current y
-  onBeforeScroll: function onBeforeScroll(x, y, dx, dy) {
-    this.tileManager.onBeforeScroll(this.getViewportInnerBoundsRect(dx, dy));
-
-    // shouldn't update margin if it doesn't need to be changed
-    let sidebars = document.getElementsByClassName("sidebar");
-    for (let i = 0; i < sidebars.length; i++) {
-      let sidebar = sidebars[i];
-      sidebar.style.margin = (y + dy) + "px 0px 0px 0px";
-    }
-
-    let urlbar = document.getElementById("top_urlbar");
-    urlbar.style.margin = "0px 0px 0px " + (x + dx) + "px";
-  },
-
-  onAfterScroll: function onAfterScroll(x, y, dx, dy) {
-    this.tileManager.onAfterScroll(this.getViewportInnerBoundsRect());
-  },
-
-  setCurrentBrowser: function setCurrentBrowser(browser, skipZoom) {
-    let currentBrowser = this._browser;
-    if (currentBrowser) {
-      // backup state
-      currentBrowser.mZoomLevel = this.zoomLevel;
-      currentBrowser.mPanX = ws._viewingRect.x;
-      currentBrowser.mPanY = ws._viewingRect.y;
-
-      // stop monitor paint events for this browser
-      currentBrowser.removeEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-      currentBrowser.setAttribute("type", "content");
-      currentBrowser.docShell.isOffScreenBrowser = false;
-    }
-
-    browser.setAttribute("type", "content-primary");
-    if (!skipZoom)
-      browser.docShell.isOffScreenBrowser = true;
-
-    // start monitoring paint events for this browser
-    browser.addEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
-    this._browser = browser;
-
-    // endLoading(and startLoading in most cases) calls zoom anyway
-    if (!skipZoom) {
-      this.zoomToPage();
-    }
-
-    if ("mZoomLevel" in browser) {
-      // restore last state
-      ws.beginUpdateBatch();
-      ws.panTo(browser.mPanX, browser.mPanY);
-      this.zoomLevel = browser.mZoomLevel;
-      ws.endUpdateBatch(true);
-
-      // drop the cache
-      delete browser.mZoomLevel;
-      delete browser.mPanX;
-      delete browser.mPanY;
-    }
-
-    this.tileManager.browser = browser;
-  },
-
-  handleMozAfterPaint: function handleMozAfterPaint(ev) {
-    this.tileManager.handleMozAfterPaint(ev);
-  },
-
-  zoomToPage: function zoomToPage() {
-    /********************************************************
-    let needToPanToTop = this._needToPanToTop;
-    // Ensure pages are panned at the top before zooming/painting
-    // combine the initial pan + zoom into a transaction
-    if (needToPanToTop) {
-      ws.beginUpdateBatch();
-      this._needToPanToTop = false;
-      ws.panTo(0, -BrowserUI.toolbarH);
-    }
-    // Adjust the zoomLevel to fit the page contents in our window width
-    let [contentW, ] = this._contentAreaDimensions;
-    let fakeW = this._fakeWidth;
-
-    if (contentW > fakeW)
-      this.zoomLevel = fakeW / contentW;
-
-    if (needToPanToTop)
-      ws.endUpdateBatch();
-    ********************************************************/
-  }
-
-};
-
-
-function onResize(e) {
-  let browser = document.getElementById("googlenews");
-  let cdoc = browser.contentDocument;
-
-  // These might not exist yet depending on page load state
-  var body = cdoc.body || {};
-  var html = cdoc.documentElement || {};
-
-  var w = Math.max(body.scrollWidth || 0, html.scrollWidth);
-  var h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
-  if (bv)
-    bv.tileManager.viewportHandler(new wsRect(0, 0, w, h),
-				   window.innerWidth,
-				   bv.getViewportInnerBoundsRect(),
-				   true);
-}
-
-function onMouseDown(e) {
-  window._isDragging = true;
-  window._dragStart = {x: e.clientX, y: e.clientY};
-
-  bv.tileManager.startPanning();
-}
-
-function onMouseUp() {
-  window._isDragging = false;
-
-  bv.tileManager.endPanning();
-}
-
-function onMouseMove(e) {
-  if (window._isDragging) {
-    let scrollbox = bv.scrollbox;
-
-    let x = {};
-    let y = {};
-    let w = {};
-    let h = {};
-    scrollbox.getPosition(x, y);
-    scrollbox.getScrolledSize(w, h);
-
-    let dx = window._dragStart.x - e.clientX;
-    let dy = window._dragStart.y - e.clientY;
-
-    // XXX if max(x, 0) > scrollwidth we shouldn't do anything (same for y/height)
-    let newX = Math.max(x.value + dx, 0);
-    let newY = Math.max(y.value + dy, 0);
-
-    if (newX < w.value || newY < h.value) {
-      // clip dx and dy to prevent us from going below 0
-      dx = Math.max(dx, -x.value);
-      dy = Math.max(dy, -y.value);
-
-      bv.onBeforeScroll(x.value, y.value, dx, dy);
-
-      /*dump("==========scroll==========" + endl);
-      dump("delta: " + dx + "," + dy + endl);
-      let xx = {};
-      let yy = {};
-      scrollbox.getPosition(xx, yy);
-      dump(xx.value + "," + yy.value + endl);*/
-
-      scrollbox.scrollBy(dx, dy);
-
-      /*scrollbox.getPosition(xx, yy);
-      dump(xx.value + "," + yy.value + endl);
-      dump("==========================" + endl);*/
-
-      bv.onAfterScroll();
-    }
-  }
-
-  window._dragStart = {x: e.clientX, y: e.clientY};
-}
-
-function onLoad() {
-  bv = new BrowserView();
-}
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js
+++ /dev/null
@@ -1,1055 +0,0 @@
-// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
-/*
- * ***** 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 Mozilla Mobile Browser.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Roy Frostig <rfrostig@mozilla.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 kXHTMLNamespaceURI  = "http://www.w3.org/1999/xhtml";
-
-// base-2 exponent for width, height of a single tile.
-const kTileExponentWidth  = 7;
-const kTileExponentHeight = 7;
-const kTileWidth  = Math.pow(2, kTileExponentWidth);   // 2^7 = 128
-const kTileHeight = Math.pow(2, kTileExponentHeight);  // 2^7 = 128
-const kLazyRoundTimeCap = 500;    // millis
-
-
-function bind(f, thisObj) {
-  return function() {
-    return f.apply(thisObj, arguments);
-  };
-}
-
-function bindSome(instance, methodNames) {
-  for each (let methodName in methodNames)
-    if (methodName in instance)
-      instance[methodName] = bind(instance[methodName], instance);
-}
-
-function bindAll(instance) {
-  for (let key in instance)
-    if (instance[key] instanceof Function)
-      instance[key] = bind(instance[key], instance);
-}
-
-
-/**
- * The Tile Manager!
- *
- * @param appendTile The function the tile manager should call in order to
- * "display" a tile (e.g. append it to the DOM).  The argument to this
- * function is a TileManager.Tile object.
- * @param removeTile The function the tile manager should call in order to
- * "undisplay" a tile (e.g. remove it from the DOM).  The argument to this
- * function is a TileManager.Tile object.
- * @param fakeWidth The width of the widest possible visible rectangle, e.g.
- * the width of the screen.  This is used in setting the zoomLevel.
- */
-function TileManager(appendTile, removeTile, browserView) {
-  // backref to the BrowserView object that owns us
-  this._browserView = browserView;
-
-  // callbacks to append / remove a tile to / from the parent
-  this._appendTile = appendTile;
-  this._removeTile = removeTile;
-
-  // tile cache holds tile objects and pools them under a given capacity
-  let self = this;
-  this._tileCache = new TileManager.TileCache(function(tile) { self._removeTileSafe(tile); },
-                                              -1, -1, 110);
-
-  // Rectangle within the viewport that is visible to the user.  It is "critical"
-  // in the sense that it must be rendered as soon as it becomes dirty
-  this._criticalRect = null;
-
-  // Current <browser> DOM element, holding the content we wish to render.
-  // This is null when no browser is attached
-  this._browser = null;
-
-  // if we have an outstanding paint timeout, its value is stored here
-  // for cancelling when we end page loads
-  //this._drawTimeout = 0;
-  this._pageLoadResizerTimeout = 0;
-
-  // timeout of the non-visible-tiles-crawler to cache renders from the browser
-  this._idleTileCrawlerTimeout = 0;
-
-  // object that keeps state on our current lazyload crawl
-  this._crawler = null;
-
-  // the max right coordinate we've seen from paint events
-  // while we were loading a page.  If we see something that's bigger than
-  // our width, we'll trigger a page zoom.
-  this._pageLoadMaxRight = 0;
-  this._pageLoadMaxBottom = 0;
-
-  // Tells us to pan to top before first draw
-  this._needToPanToTop = false;
-}
-
-TileManager.prototype = {
-
-  setBrowser: function setBrowser(b) { this._browser = b; },
-
-  // This is the callback fired by our client whenever the viewport
-  // changed somehow (or didn't change but someone asked it to update).
-  viewportChangeHandler: function viewportChangeHandler(viewportRect,
-                                                        criticalRect,
-                                                        boundsSizeChanged,
-                                                        dirtyAll) {
-    // !!! --- DEBUG BEGIN -----
-    dump("***vphandler***\n");
-    dump(viewportRect.toString() + "\n");
-    dump(criticalRect.toString() + "\n");
-    dump(boundsSizeChanged + "\n");
-    dump(dirtyAll + "\n***************\n");
-    // !!! --- DEBUG END -------
-
-    let tc = this._tileCache;
-
-    tc.iBound = Math.ceil(viewportRect.right / kTileWidth);
-    tc.jBound = Math.ceil(viewportRect.bottom / kTileHeight);
-
-    if (!criticalRect || !criticalRect.equals(this._criticalRect)) {
-      this.beginCriticalMove(criticalRect);
-      this.endCriticalMove(criticalRect, !boundsSizeChanged);
-    }
-
-    if (boundsSizeChanged) {
-      // TODO fastpath if !dirtyAll
-      this.dirtyRects([viewportRect.clone()], true);
-    }
-  },
-
-  dirtyRects: function dirtyRects(rects, doCriticalRender) {
-    let criticalIsDirty = false;
-    let criticalRect = this._criticalRect;
-
-    for each (let rect in rects) {
-      this._tileCache.forEachIntersectingRect(rect, false, this._dirtyTile, this);
-
-      if (criticalRect && rect.intersects(criticalRect))
-        criticalIsDirty = true;
-    }
-
-    if (criticalIsDirty && doCriticalRender)
-      this.criticalRectPaint();
-  },
-
-  criticalRectPaint: function criticalRectPaint() {
-    let cr = this._criticalRect;
-
-    if (cr) {
-      let [ctrx, ctry] = cr.centerRounded();
-      this.recenterEvictionQueue(ctrx, ctry);
-      this._renderAppendHoldRect(cr);
-    }
-  },
-
-  beginCriticalMove2: function beginCriticalMove(destCriticalRect) {
-    let start = Date.now();
-    function appendNonDirtyTile(tile) {
-      if (!tile.isDirty())
-        this._appendTileSafe(tile);
-    }
-
-    if (destCriticalRect)
-      this._tileCache.forEachIntersectingRect(destCriticalRect, false, appendNonDirtyTile, this);
-    let end = Date.now();
-    dump("start: " + (end-start) + "\n")
-  },
-
-  beginCriticalMove: function beginCriticalMove(destCriticalRect) {
-  /*
-  function appendNonDirtyTile(tile) {
-    if (!tile.isDirty())
-      this._appendTileSafe(tile);
-  }
-  */
-
-    let start = Date.now();
-
-    if (destCriticalRect) {
-
-      let rect = destCriticalRect;
-
-      let create = false;
-
-      // this._tileCache.forEachIntersectingRect(destCriticalRect, false, appendNonDirtyTile, this);
-      let visited = {};
-      let evictGuard = null;
-      if (create) {
-	evictGuard = function evictGuard(tile) {
-	  return !visited[tile.toString()];
-	};
-      }
-
-      let starti = rect.left  >> kTileExponentWidth;
-      let endi   = rect.right >> kTileExponentWidth;
-
-      let startj = rect.top    >> kTileExponentHeight;
-      let endj   = rect.bottom >> kTileExponentHeight;
-
-      let tile = null;
-      let tc = this._tileCache;
-
-      for (var j = startj; j <= endj; ++j) {
-	for (var i = starti; i <= endi; ++i) {
-
-	  // 'this' for getTile needs to be tc
-
-	  //tile = this.getTile(i, j, create, evictGuard);
-	  //if (!tc.inBounds(i, j)) {
-	  if (0 <= i && 0 <= j && i <= tc.iBound && j <= tc.jBound) {
-	    //return null;
-	    break;
-	  }
-
-	  tile = null;
-
-	  //if (tc._isOccupied(i, j)) {
-	  if (!!(tc._tiles[i] && tc._tiles[i][j])) {
-	    tile = tc._tiles[i][j];
-	  } else if (create) {
-	    // NOTE: create is false here
-	    tile = tc._createTile(i, j, evictionGuard);
-	    if (tile) tile.markDirty();
-	  }
-
-	  if (tile) {
-	    visited[tile.toString()] = true;
-	    //fn.call(thisObj, tile);
-	    //function appendNonDirtyTile(tile) {
-	    //if (!tile.isDirty())
-	    if (!tile._dirtyTileCanvas) {
-	      //this._appendTileSafe(tile);
-	      if (!tile._appended) {
-		let astart = Date.now();
-		this._appendTile(tile);
-		tile._appended = true;
-		let aend = Date.now();
-		dump("append: " + (aend - astart) + "\n");
-	      }
-	    }
-	    //}
-	  }
-	}
-      }
-    }
-
-    let end = Date.now();
-    dump("start: " + (end-start) + "\n")
-  },
-
-  endCriticalMove: function endCriticalMove(destCriticalRect, doCriticalPaint) {
-    let start = Date.now();
-
-    let tc = this._tileCache;
-    let cr = this._criticalRect;
-
-    let dcr = destCriticalRect.clone();
-
-    let f = function releaseOldTile(tile) {
-      // release old tile
-      if (!tile.boundRect.intersects(dcr))
-        tc.releaseTile(tile);
-    }
-
-    if (cr)
-      tc.forEachIntersectingRect(cr, false, f, this);
-
-    this._holdRect(destCriticalRect);
-
-    if (cr)
-      cr.copyFrom(destCriticalRect);
-    else
-      this._criticalRect = cr = destCriticalRect;
-
-    let crpstart = Date.now();
-    if (doCriticalPaint)
-      this.criticalRectPaint();
-    dump(" crp: " + (Date.now() - crpstart) + "\n");
-
-    let end = Date.now();
-    dump("end: " + (end - start) + "\n");
-  },
-
-  restartLazyCrawl: function restartLazyCrawl(startRectOrQueue) {
-    if (!startRectOrQueue || startRectOrQueue instanceof Array) {
-      this._crawler = new TileManager.CrawlIterator(this._tileCache);
-
-      if (startRectOrQueue) {
-        let len = startRectOrQueue.length;
-        for (let k = 0; k < len; ++k)
-          this._crawler.enqueue(startRectOrQueue[k].i, startRectOrQueue[k].j);
-      }
-    } else {
-      this._crawler = new TileManager.CrawlIterator(this._tileCache, startRectOrQueue);
-    }
-
-    if (!this._idleTileCrawlerTimeout)
-      this._idleTileCrawlerTimeout = setTimeout(this._idleTileCrawler, 2000, this);
-  },
-
-  stopLazyCrawl: function stopLazyCrawl() {
-    this._idleTileCrawlerTimeout = 0;
-    this._crawler = null;
-
-    let cr = this._criticalRect;
-    if (cr) {
-      let [ctrx, ctry] = cr.centerRounded();
-      this.recenterEvictionQueue(ctrx, ctry);
-    }
-  },
-
-  recenterEvictionQueue: function recenterEvictionQueue(ctrx, ctry) {
-    let ctri = ctrx >> kTileExponentWidth;
-    let ctrj = ctry >> kTileExponentHeight;
-
-    function evictFarTiles(a, b) {
-      let dista = Math.max(Math.abs(a.i - ctri), Math.abs(a.j - ctrj));
-      let distb = Math.max(Math.abs(b.i - ctri), Math.abs(b.j - ctrj));
-      return dista - distb;
-    }
-
-    this._tileCache.sortEvictionQueue(evictFarTiles);
-  },
-
-  _renderTile: function _renderTile(tile) {
-    if (tile.isDirty())
-      tile.render(this._browser, this._browserView);
-  },
-
-  _appendTileSafe: function _appendTileSafe(tile) {
-    if (!tile._appended) {
-      this._appendTile(tile);
-      tile._appended = true;
-    }
-  },
-
-  _removeTileSafe: function _removeTileSafe(tile) {
-    if (tile._appended) {
-      this._removeTile(tile);
-      tile._appended = false;
-    }
-  },
-
-  _dirtyTile: function _dirtyTile(tile) {
-    if (!this._criticalRect || !tile.boundRect.intersects(this._criticalRect))
-      this._removeTileSafe(tile);
-
-    tile.markDirty();
-
-    if (this._crawler)
-      this._crawler.enqueue(tile.i, tile.j);
-  },
-
-  _holdRect: function _holdRect(rect) {
-    this._tileCache.holdTilesIntersectingRect(rect);
-  },
-
-  _releaseRect: function _releaseRect(rect) {
-    this._tileCache.releaseTilesIntersectingRect(rect);
-  },
-
-  _renderAppendHoldRect: function _renderAppendHoldRect(rect) {
-    function renderAppendHoldTile(tile) {
-      if (tile.isDirty())
-        this._renderTile(tile);
-
-      this._appendTileSafe(tile);
-      this._tileCache.holdTile(tile);
-    }
-
-    this._tileCache.forEachIntersectingRect(rect, true, renderAppendHoldTile, this);
-  },
-
-  _idleTileCrawler: function _idleTileCrawler(self) {
-    if (!self) self = this;
-    dump('crawl pass.\n');
-    let itered = 0, rendered = 0;
-
-    let start = Date.now();
-    let comeAgain = true;
-
-    while ((Date.now() - start) <= kLazyRoundTimeCap) {
-      let tile = self._crawler.next();
-
-      if (!tile) {
-        comeAgain = false;
-        break;
-      }
-
-      if (tile.isDirty()) {
-        self._renderTile(tile);
-        ++rendered;
-      }
-      ++itered;
-    }
-
-    dump('crawl itered:' + itered + ' rendered:' + rendered + '\n');
-
-    if (comeAgain) {
-      self._idleTileCrawlerTimeout = setTimeout(self._idleTileCrawler, 2000, self);
-    } else {
-      self.stopLazyCrawl();
-      dump('crawl end\n');
-    }
-  }
-
-};
-
-
-/**
- * The tile cache used by the tile manager to hold and index all
- * tiles.  Also responsible for pooling tiles and maintaining the
- * number of tiles under given capacity.
- *
- * @param onBeforeTileDetach callback set by the TileManager to call before
- * we must "detach" a tile from a tileholder due to needing it elsewhere or
- * having to discard it on capacity decrease
- * @param capacity the initial capacity of the tile cache, i.e. the max number
- * of tiles the cache can have allocated
- */
-TileManager.TileCache = function TileCache(onBeforeTileDetach, iBound, jBound, capacity) {
-  if (arguments.length <= 3 || capacity < 0)
-    capacity = Infinity;
-
-  // We track all pooled tiles in a 2D array (row, column) ordered as
-  // they "appear on screen".  The array is a grid that functions for
-  // storage of the tiles and as a lookup map.  Each array entry is
-  // a reference to the tile occupying that space ("tileholder").  Entries
-  // are not unique, so a tile could be referenced by multiple array entries,
-  // i.e. a tile could "span" many tile placeholders (e.g. if we merge
-  // neighbouring tiles).
-  this._tiles = [];
-
-  // holds the same tiles that _tiles holds, but as contiguous array
-  // elements, for pooling tiles for reuse under finite capacity
-  this._tilePool = (capacity == Infinity) ? new Array() : new Array(capacity);
-
-  this._capacity = capacity;
-  this._nTiles = 0;
-  this._numFree = 0;
-
-  this._onBeforeTileDetach = onBeforeTileDetach;
-
-  this.iBound = iBound;
-  this.jBound = jBound;
-};
-
-TileManager.TileCache.prototype = {
-
-  get size() { return this._nTiles; },
-  get numFree() { return this._numFree; },
-
-  // A comparison function that will compare all free tiles as greater
-  // than all non-free tiles.  Useful because, for instance, to shrink
-  // the tile pool when capacity is lowered, we want to remove all tiles
-  // at the new cap and beyond, favoring removal of free tiles first.
-  evictionCmp: function freeTilesLast(a, b) {
-    if (a.free == b.free) return (a.j == b.j) ? b.i - a.i : b.j - a.j;
-    return (a.free) ? 1 : -1;
-  },
-
-  getCapacity: function getCapacity() { return this._capacity; },
-
-  setCapacity: function setCapacity(newCap, skipEvictionQueueSort) {
-    if (newCap < 0)
-      throw "Cannot set a negative tile cache capacity";
-
-    if (newCap == Infinity) {
-      this._capacity = Infinity;
-      return;
-    } else if (this._capacity == Infinity) {
-      // pretend we had a finite capacity all along and proceed normally
-      this._capacity = this._tilePool.length;
-    }
-
-    let rem = null;
-
-    if (newCap < this._capacity) {
-      // This case is obnoxious.  We're decreasing our capacity which means
-      // we may have to get rid of tiles.  Depending on our eviction comparator,
-      // we probably try to get rid free tiles first, but we might have to throw
-      // out some nonfree ones too.  Note that "throwing out" means the cache
-      // won't keep them, and they'll get GC'ed as soon as all other refholders
-      // let go of their refs to the tile.
-      if (!skipEvictionQueueSort)
-        this.sortEvictionQueue();
-
-      rem = this._tilePool.splice(newCap);
-
-    } else {
-      // This case is win.  Extend our tile pool array with new empty space.
-      this._tilePool.push.apply(this._tilePool, new Array(newCap - this._capacity));
-    }
-
-    // update state in the case that we threw things out.
-    let nTilesDeleted = this._nTiles - newCap;
-    if (nTilesDeleted > 0) {
-      let nFreeDeleted = 0;
-      for (let k = 0; k < nTilesDeleted; ++k) {
-        if (rem[k].free)
-          nFreeDeleted++;
-
-        this._detachTile(rem[k].i, rem[k].j);
-      }
-
-      this._nTiles -= nTilesDeleted;
-      this._numFree -= nFreeDeleted;
-    }
-
-    this._capacity = newCap;
-  },
-
-  _isOccupied: function _isOccupied(i, j) {
-    return !!(this._tiles[i] && this._tiles[i][j]);
-  },
-
-  _detachTile: function _detachTile(i, j) {
-    let tile = null;
-    if (this._isOccupied(i, j)) {
-      tile = this._tiles[i][j];
-
-      if (this._onBeforeTileDetach)
-        this._onBeforeTileDetach(tile);
-
-      this.releaseTile(tile);
-      delete this._tiles[i][j];
-    }
-    return tile;
-  },
-
-  _reassignTile: function _reassignTile(tile, i, j) {
-    this._detachTile(tile.i, tile.j);    // detach
-    tile.init(i, j);                     // re-init
-    this._tiles[i][j] = tile;            // attach
-    return tile;
-  },
-
-  _evictTile: function _evictTile(evictionGuard) {
-    let k = this._nTiles - 1;
-    let pool = this._tilePool;
-    let victim = null;
-
-    for (; k >= 0; --k) {
-      if (pool[k].free &&
-          (!evictionGuard || evictionGuard(pool[k])))
-      {
-        victim = pool[k];
-        break;
-      }
-    }
-
-    return victim;
-  },
-
-  _createTile: function _createTile(i, j, evictionGuard) {
-    if (!this._tiles[i])
-      this._tiles[i] = [];
-
-    let tile = null;
-
-    if (this._nTiles < this._capacity) {
-      // either capacity is infinite, or we still have room to allocate more
-      tile = new TileManager.Tile(i, j);
-      this._tiles[i][j] = tile;
-      this._tilePool[this._nTiles++] = tile;
-      this._numFree++;
-
-    } else {
-      // assert: nTiles == capacity
-      dump("\nevicting\n");
-      tile = this._evictTile(evictionGuard);
-      if (tile)
-        this._reassignTile(tile, i, j);
-    }
-
-    return tile;
-  },
-
-  inBounds: function inBounds(i, j) {
-    return 0 <= i && 0 <= j && i <= this.iBound && j <= this.jBound;
-  },
-
-  sortEvictionQueue: function sortEvictionQueue(cmp) {
-    if (!cmp) cmp = this.evictionCmp;
-    this._tilePool.sort(cmp);
-  },
-
-  /**
-   * Get a tile by its indices
-   *
-   * @param i Column
-   * @param j Row
-   * @param create Flag true if the tile should be created in case there is no
-   * tile at (i, j)
-   * @param reuseCondition Boolean-valued function to restrict conditions under
-   * which an old tile may be reused for creating this one.  This can happen if
-   * the cache has reached its capacity and must reuse existing tiles in order to
-   * create this one.  The function is given a Tile object as its argument and
-   * returns true if the tile is OK for reuse. This argument has no effect if the
-   * create argument is false.
-   */
-  getTile: function getTile(i, j, create, evictionGuard) {
-    if (!this.inBounds(i, j))
-      return null;
-
-    let tile = null;
-
-    if (this._isOccupied(i, j)) {
-      tile = this._tiles[i][j];
-    } else if (create) {
-      tile = this._createTile(i, j, evictionGuard);
-      if (tile) tile.markDirty();
-    }
-
-    return tile;
-  },
-
-  /**
-   * Look up (possibly creating) a tile from its viewport coordinates.
-   *
-   * @param x
-   * @param y
-   * @param create Flag true if the tile should be created in case it doesn't
-   * already exist at the tileholder corresponding to (x, y)
-   */
-  tileFromPoint: function tileFromPoint(x, y, create) {
-    let i = x >> kTileExponentWidth;
-    let j = y >> kTileExponentHeight;
-
-    return this.getTile(i, j, create);
-  },
-
-  /**
-   * Hold a tile (i.e. mark it non-free).  Returns true if the operation
-   * actually did something, false elsewise.
-   */
-  holdTile: function holdTile(tile) {
-    if (tile && tile.free) {
-      tile._hold();
-      this._numFree--;
-      return true;
-    }
-    return false;
-  },
-
-  /**
-   * Release a tile (i.e. mark it free).  Returns true if the operation
-   * actually did something, false elsewise.
-   */
-  releaseTile: function releaseTile(tile) {
-    if (tile && !tile.free) {
-      tile._release();
-      this._numFree++;
-      return true;
-    }
-    return false;
-  },
-
-  // XXX the following two functions will iterate through duplicate tiles
-  // once we begin to merge tiles.
-  /**
-   * Fetch all tiles that share at least one point with this rect.  If `create'
-   * is true then any tileless tileholders will have tiles created for them.
-   */
-  tilesIntersectingRect: function tilesIntersectingRect(rect, create) {
-    let dx = (rect.right % kTileWidth) - (rect.left % kTileWidth);
-    let dy = (rect.bottom % kTileHeight) - (rect.top % kTileHeight);
-    let tiles = [];
-
-    for (let y = rect.top; y <= rect.bottom - dy; y += kTileHeight) {
-      for (let x = rect.left; x <= rect.right - dx; x += kTileWidth) {
-        let tile = this.tileFromPoint(x, y, create);
-        if (tile)
-          tiles.push(tile);
-      }
-    }
-
-    return tiles;
-  },
-
-  forEachIntersectingRect: function forEachIntersectingRect(rect, create, fn, thisObj) {
-    let visited = {};
-    let evictGuard = null;
-    if (create) {
-      evictGuard = function evictGuard(tile) {
-        return !visited[tile.toString()];
-      };
-    }
-
-    let starti = rect.left  >> kTileExponentWidth;
-    let endi   = rect.right >> kTileExponentWidth;
-
-    let startj = rect.top    >> kTileExponentHeight;
-    let endj   = rect.bottom >> kTileExponentHeight;
-
-    let tile = null;
-    for (var j = startj; j <= endj; ++j) {
-      for (var i = starti; i <= endi; ++i) {
-        tile = this.getTile(i, j, create, evictGuard);
-        if (tile) {
-          visited[tile.toString()] = true;
-          fn.call(thisObj, tile);
-        }
-      }
-    }
-  },
-
-  holdTilesIntersectingRect: function holdTilesIntersectingRect(rect) {
-    this.forEachIntersectingRect(rect, false, this.holdTile, this);
-  },
-
-  releaseTilesIntersectingRect: function releaseTilesIntersectingRect(rect) {
-    this.forEachIntersectingRect(rect, false, this.releaseTile, this);
-  }
-
-};
-
-
-
-TileManager.Tile = function Tile(i, j) {
-  // canvas element is where we keep paint data from browser for this tile
-  this._canvas = document.createElementNS(kXHTMLNamespaceURI, "canvas");
-  this._canvas.setAttribute("width", String(kTileWidth));
-  this._canvas.setAttribute("height", String(kTileHeight));
-  this._canvas.setAttribute("moz-opaque", "true");
-  //this._canvas.style.border = "1px solid red";
-
-  this.init(i, j);  // defines more properties, cf below
-};
-
-TileManager.Tile.prototype = {
-
-  // essentially, this is part of constructor code, but since we reuse tiles
-  // in the tile cache, this is here so that we can reinitialize tiles when we
-  // reuse them
-  init: function init(i, j) {
-    if (!this.boundRect)
-      this.boundRect = new wsRect(i * kTileWidth, j * kTileHeight, kTileWidth, kTileHeight);
-    else
-      this.boundRect.setRect(i * kTileWidth, j * kTileHeight, kTileWidth, kTileHeight);
-
-    // indices!
-    this.i = i;
-    this.j = j;
-
-    // flags true if we need to repaint our own local canvas
-    this._dirtyTileCanvas = false;
-
-    // keep a dirty rectangle (i.e. only part of the tile is dirty)
-    this._dirtyTileCanvasRect = null;
-
-    // flag used by TileManager to avoid re-appending tiles that have already
-    // been appended
-    this._appended = false;
-
-    // We keep tile objects around after their use for later reuse, so this
-    // flags true for an unused pooled tile.  We don't actually care about
-    // this from within the Tile prototype, it is here for the cache to use.
-    this.free = true;
-  },
-
-  // viewport coordinates
-  get x() { return this.boundRect.left; },
-  get y() { return this.boundRect.top; },
-
-  // the actual canvas that holds the most recently rendered image of this
-  // canvas
-  getContentImage: function getContentImage() { return this._canvas; },
-
-  isDirty: function isDirty() { return this._dirtyTileCanvas; },
-
-  /**
-   * Mark this entire tile as dirty (i.e. the whole tile needs to be rendered
-   * on next render).
-   */
-  markDirty: function markDirty() { this.updateDirtyRegion(); },
-
-  unmarkDirty: function unmarkDirty() {
-    this._dirtyTileCanvasRect = null;
-    this._dirtyTileCanvas = false;
-  },
-
-  /**
-   * This will mark dirty at least everything in dirtyRect (which must be
-   * specified in canvas coordinates).  If dirtyRect is not given then
-   * the entire tile is marked dirty.
-   */
-  updateDirtyRegion: function updateDirtyRegion(dirtyRect) {
-    if (!dirtyRect) {
-
-      if (!this._dirtyTileCanvasRect)
-        this._dirtyTileCanvasRect = this.boundRect.clone();
-      else
-        this._dirtyTileCanvasRect.copyFrom(this.boundRect);
-
-    } else {
-
-      if (!this._dirtyTileCanvasRect)
-        this._dirtyTileCanvasRect = dirtyRect.intersect(this.boundRect);
-      else if (dirtyRect.intersects(this.boundRect))
-        this._dirtyTileCanvasRect.expandToContain(dirtyRect.intersect(this.boundRect));
-
-    }
-
-    // TODO if after the above, the dirty rectangle is large enough,
-    // mark the whole tile dirty.
-
-    if (this._dirtyTileCanvasRect)
-      this._dirtyTileCanvas = true;
-  },
-
-  /**
-   * Actually draw the browser content into the dirty region of this
-   * tile.  This requires us to actually draw with the
-   * nsIDOMCanvasRenderingContext2D object's drawWindow method, which
-   * we expect to be a relatively heavy operation.
-   *
-   * You likely want to check if the tile isDirty() before asking it
-   * to render, as this will cause the entire tile to re-render in the
-   * case that it is not dirty.
-   */
-  render: function render(browser, browserView) {
-    if (!this.isDirty())
-      this.markDirty();
-
-    let rect = this._dirtyTileCanvasRect;
-
-    let x = rect.left - this.boundRect.left;
-    let y = rect.top - this.boundRect.top;
-
-    // content process is not being scaled, so don't scale our rect either
-    //browserView.viewportToBrowserRect(rect);
-    //rect.round(); // snap outward to get whole "pixel" (in browser coords)
-
-    let ctx = this._canvas.getContext("2d");
-    ctx.save();
-
-    browserView.browserToViewportCanvasContext(ctx);
-
-    ctx.translate(x, y);
-
-    let cw = browserView._contentWindow;
-    //let cw = browser.contentWindow;
-    ctx.asyncDrawXULElement(browserView._browser,
-                   rect.left, rect.top,
-                   rect.right - rect.left, rect.bottom - rect.top,
-                   "grey",
-                   (ctx.DRAWWINDOW_DO_NOT_FLUSH | ctx.DRAWWINDOW_DRAW_CARET));
-
-    ctx.restore();
-
-    this.unmarkDirty();
-  },
-
-  toString: function toString(more) {
-    if (more) {
-      return 'Tile(' + [this.i,
-                        this.j,
-                        "dirty=" + this.isDirty(),
-                        "boundRect=" + this.boundRect].join(', ')
-               + ')';
-    }
-
-    return 'Tile(' + this.i + ', ' + this.j + ')';
-  },
-
-  _hold: function hold() { this.free = false; },
-  _release: function release() { this.free = true; }
-
-};
-
-
-/**
- * A CrawlIterator is in charge of creating and returning subsequent tiles "crawled"
- * over as we render tiles lazily.  It supports iterator semantics so you can use
- * CrawlIterator objects in for..in loops.
- *
- * Currently the CrawlIterator is built to expand a rectangle iteratively and return
- * subsequent tiles that intersect the boundary of the rectangle.  Each expansion of
- * the rectangle is one unit of tile dimensions in each direction.  This is repeated
- * until all tiles from elsewhere have been reused (assuming the cache has finite
- * capacity) in this crawl, so that we don't start reusing tiles from the beginning
- * of our crawl.  Afterward, the CrawlIterator enters a state where it operates as a
- * FIFO queue, and calls to next() simply dequeue elements, which must be added with
- * enqueue().
- *
- * @param tileCache The TileCache over whose tiles this CrawlIterator will crawl
- * @param startRect [optional] The rectangle that we grow in the first (rectangle
- * expansion) iteration state.
- */
-TileManager.CrawlIterator = function CrawlIterator(tileCache, startRect) {
-  this._tileCache = tileCache;
-  this._stepRect = startRect;
-
-  // used to remember tiles that we've reused during this crawl
-  this._visited = {};
-
-  // filters the tiles we've already reused once from being considered victims
-  // for reuse when we ask the tile cache to create a new tile
-  let visited = this._visited;
-  this._notVisited = function(tile) { return !visited[tile]; };
-
-  // a generator that generates tile indices corresponding to tiles intersecting
-  // the boundary of an expanding rectangle
-  this._crawlIndices = !startRect ? null : (function indicesGenerator(rect, tc) {
-    let outOfBounds = false;
-    while (!outOfBounds) {
-      // expand rect
-      rect.left   -= kTileWidth;
-      rect.right  += kTileWidth;
-      rect.top    -= kTileHeight;
-      rect.bottom += kTileHeight;
-
-      let dx = (rect.right % kTileWidth) - (rect.left % kTileWidth);
-      let dy = (rect.bottom % kTileHeight) - (rect.top % kTileHeight);
-
-      outOfBounds = true;
-
-      // top, bottom borders
-      for each (let y in [rect.top, rect.bottom]) {
-        for (let x = rect.left; x <= rect.right - dx; x += kTileWidth) {
-          let i = x >> kTileExponentWidth;
-          let j = y >> kTileExponentHeight;
-          if (tc.inBounds(i, j)) {
-            outOfBounds = false;
-            yield [i, j];
-          }
-        }
-      }
-
-      // left, right borders
-      for each (let x in [rect.left, rect.right]) {
-        for (let y = rect.top; y <= rect.bottom - dy; y += kTileHeight) {
-          let i = x >> kTileExponentWidth;
-          let j = y >> kTileExponentHeight;
-          if (tc.inBounds(i, j)) {
-            outOfBounds = false;
-            yield [i, j];
-          }
-        }
-      }
-    }
-  })(this._stepRect, this._tileCache),    // instantiate the generator
-
-  // after we finish the rectangle iteration state, we enter the FIFO queue state
-  this._queueState = !startRect;
-  this._queue = [];
-
-  // used to prevent tiles from being enqueued twice --- "patience, we'll get to
-  // it in a moment"
-  this._enqueued = {};
-};
-
-TileManager.CrawlIterator.prototype = {
-  __iterator__: function() {
-    while (true) {
-      let tile = this.next();
-      if (!tile) break;
-      yield tile;
-    }
-  },
-
-  becomeQueue: function becomeQueue() {
-    this._queueState = true;
-  },
-
-  unbecomeQueue: function unbecomeQueue() {
-    this._queueState = false;
-  },
-
-  next: function next() {
-    if (this._queueState)
-      return this.dequeue();
-
-    let tile = null;
-
-    if (this._crawlIndices) {
-      try {
-        let [i, j] = this._crawlIndices.next();
-        tile = this._tileCache.getTile(i, j, true, this._notVisited);
-      } catch (e) {
-        if (!(e instanceof StopIteration))
-          throw e;
-      }
-    }
-
-    if (tile) {
-      this._visited[tile] = true;
-    } else {
-      this.becomeQueue();
-      return this.next();
-    }
-
-    return tile;
-  },
-
-  dequeue: function dequeue() {
-    let tile = null;
-    do {
-      let idx = this._queue.shift();
-      if (!idx)
-      return null;
-
-      delete this._enqueued[idx];
-      let [i, j]  = this._unstrIndices(idx);
-      tile = this._tileCache.getTile(i, j, false);
-
-    } while (!tile);
-
-    return tile;
-  },
-
-  enqueue: function enqueue(i, j) {
-    let idx = this._strIndices(i, j);
-    if (!this._enqueued[idx]) {
-      this._queue.push(idx);
-      this._enqueued[idx] = true;
-    }
-  },
-
-  _strIndices: function _strIndices(i, j) {
-    return i + "," + j;
-  },
-
-  _unstrIndices: function _unstrIndices(str) {
-    return str.split(',');
-  }
-
-};
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
+++ /dev/null
@@ -1,1465 +0,0 @@
-/* -*- Mode: js2; tab-width: 40; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- */
-/*
- * ***** 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 Mozilla Mobile Browser.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Vladimir Vukicevic <vladimir@pobox.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 ***** */
-
-var gWsDoLog = false;
-var gWsLogDiv = null;
-
-function logbase() {
-  if (!gWsDoLog)
-    return;
-
-  if (gWsLogDiv == null && "console" in window) {
-    console.log.apply(console, arguments);
-  } else {
-    var s = "";
-    for (var i = 0; i < arguments.length; i++) {
-      s += arguments[i] + " ";
-    }
-    s += "\n";
-    if (gWsLogDiv) {
-      gWsLogDiv.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "br"));
-      gWsLogDiv.appendChild(document.createTextNode(s));
-    }
-
-    dump(s);
-  }
-}
-
-function dumpJSStack(stopAtNamedFunction) {
-  let caller = Components.stack.caller;
-  dump("\tStack: " + caller.name);
-  while ((caller = caller.caller)) {
-    dump(" <- " + caller.name);
-    if (stopAtNamedFunction && caller.name != "anonymous")
-      break;
-  }
-  dump("\n");
-}
-
-function log() {
-  return;
-  logbase.apply(window, arguments);
-}
-
-function log2() {
-  return;
-  logbase.apply(window, arguments);
-}
-
-let reportError = log;
-
-/*
- * wsBorder class
- *
- * Simple container for top,left,bottom,right "border" values
- */
-function wsBorder(t, l, b, r) {
-  this.setBorder(t, l, b, r);
-}
-
-wsBorder.prototype = {
-
-  setBorder: function (t, l, b, r) {
-    this.top = t;
-    this.left = l;
-    this.bottom = b;
-    this.right = r;
-  },
-
-  toString: function () {
-    return "[l:" + this.left + ",t:" + this.top + ",r:" + this.right + ",b:" + this.bottom + "]";
-  }
-};
-
-/*
- * wsRect class
- *
- * Rectangle class, with both x/y/w/h and t/l/b/r accessors.
- */
-function wsRect(x, y, w, h) {
-  this.left = x;
-  this.top = y;
-  this.right = x+w;
-  this.bottom = y+h;
-}
-
-wsRect.prototype = {
-
-  get x() { return this.left; },
-  get y() { return this.top; },
-  get width() { return this.right - this.left; },
-  get height() { return this.bottom - this.top; },
-  set x(v) {
-    let diff = this.left - v;
-    this.left = v;
-    this.right -= diff;
-  },
-  set y(v) {
-    let diff = this.top - v;
-    this.top = v;
-    this.bottom -= diff;
-  },
-  set width(v) { this.right = this.left + v; },
-  set height(v) { this.bottom = this.top + v; },
-
-  setRect: function(x, y, w, h) {
-    this.left = x;
-    this.top = y;
-    this.right = x+w;
-    this.bottom = y+h;
-
-    return this;
-  },
-
-  setBounds: function(t, l, b, r) {
-    this.top = t;
-    this.left = l;
-    this.bottom = b;
-    this.right = r;
-
-    return this;
-  },
-
-  equals: function equals(r) {
-    return (r != null       &&
-            this.top == r.top &&
-            this.left == r.left &&
-            this.bottom == r.bottom &&
-            this.right == r.right);
-  },
-
-  clone: function clone() {
-    return new wsRect(this.left, this.top, this.right - this.left, this.bottom - this.top);
-  },
-
-  center: function center() {
-    return [this.left + (this.right - this.left) / 2,
-            this.top + (this.bottom - this.top) / 2];
-  },
-
-  centerRounded: function centerRounded() {
-    return this.center().map(Math.round);
-  },
-
-  copyFrom: function(r) {
-    this.top = r.top;
-    this.left = r.left;
-    this.bottom = r.bottom;
-    this.right = r.right;
-
-    return this;
-  },
-
-  copyFromTLBR: function(r) {
-    this.left = r.left;
-    this.top = r.top;
-    this.right = r.right;
-    this.bottom = r.bottom;
-
-    return this;
-  },
-
-  translate: function(x, y) {
-    this.left += x;
-    this.right += x;
-    this.top += y;
-    this.bottom += y;
-
-    return this;
-  },
-
-  // return a new wsRect that is the union of that one and this one
-  union: function(rect) {
-    let l = Math.min(this.left, rect.left);
-    let r = Math.max(this.right, rect.right);
-    let t = Math.min(this.top, rect.top);
-    let b = Math.max(this.bottom, rect.bottom);
-
-    return new wsRect(l, t, r-l, b-t);
-  },
-
-  toString: function() {
-    return "[" + this.x + "," + this.y + "," + this.width + "," + this.height + "]";
-  },
-
-  expandBy: function(b) {
-    this.left += b.left;
-    this.right += b.right;
-    this.top += b.top;
-    this.bottom += b.bottom;
-    return this;
-  },
-
-  contains: function(other) {
-    return !!(other.left >= this.left &&
-              other.right <= this.right &&
-              other.top >= this.top &&
-              other.bottom <= this.bottom);
-  },
-
-  intersect: function(r2) {
-    let xmost1 = this.right;
-    let xmost2 = r2.right;
-
-    let x = Math.max(this.left, r2.left);
-
-    let temp = Math.min(xmost1, xmost2);
-    if (temp <= x)
-      return null;
-
-    let width = temp - x;
-
-    let ymost1 = this.bottom;
-    let ymost2 = r2.bottom;
-    let y = Math.max(this.top, r2.top);
-
-    temp = Math.min(ymost1, ymost2);
-    if (temp <= y)
-      return null;
-
-    let height = temp - y;
-
-    return new wsRect(x, y, width, height);
-  },
-
-  intersects: function(other) {
-    let xok = (other.left > this.left && other.left < this.right) ||
-      (other.right > this.left && other.right < this.right) ||
-      (other.left <= this.left && other.right >= this.right);
-    let yok = (other.top > this.top && other.top < this.bottom) ||
-      (other.bottom > this.top && other.bottom < this.bottom) ||
-      (other.top <= this.top && other.bottom >= this.bottom);
-    return xok && yok;
-  },
-
-  /**
-   * Similar to (and most code stolen from) intersect().  A restriction
-   * is an intersection, but this modifies the receiving object instead
-   * of returning a new rect.
-   */
-  restrictTo: function restrictTo(r2) {
-    let xmost1 = this.right;
-    let xmost2 = r2.right;
-
-    let x = Math.max(this.left, r2.left);
-
-    let temp = Math.min(xmost1, xmost2);
-    if (temp <= x)
-      throw "Intersection is empty but rects cannot be empty";
-
-    let width = temp - x;
-
-    let ymost1 = this.bottom;
-    let ymost2 = r2.bottom;
-    let y = Math.max(this.top, r2.top);
-
-    temp = Math.min(ymost1, ymost2);
-    if (temp <= y)
-      throw "Intersection is empty but rects cannot be empty";
-
-    let height = temp - y;
-
-    return this.setRect(x, y, width, height);
-  },
-
-  /**
-   * Similar to (and most code stolen from) union().  An extension is a
-   * union (in our sense of the term, not the common set-theoretic sense),
-   * but this modifies the receiving object instead of returning a new rect.
-   * Effectively, this rectangle is expanded minimally to contain all of the
-   * other rect.  "Expanded minimally" means that the rect may shrink if
-   * given a strict subset rect as the argument.
-   */
-  expandToContain: function extendTo(rect) {
-    let l = Math.min(this.left, rect.left);
-    let r = Math.max(this.right, rect.right);
-    let t = Math.min(this.top, rect.top);
-    let b = Math.max(this.bottom, rect.bottom);
-
-    return this.setRect(l, t, r-l, b-t);
-  },
-
-  round: function round(scale) {
-    if (!scale) scale = 1;
-
-    this.left = Math.floor(this.left * scale) / scale;
-    this.top = Math.floor(this.top * scale) / scale;
-    this.right = Math.ceil(this.right * scale) / scale;
-    this.bottom = Math.ceil(this.bottom * scale) / scale;
-
-    return this;
-  },
-
-  scale: function scale(xscl, yscl) {
-    this.left *= xscl;
-    this.right *= xscl;
-    this.top *= yscl;
-    this.bottom *= yscl;
-
-    return this;
-  }
-};
-
-/*
- * The "Widget Stack"
- *
- * Manages a <xul:stack>'s children, allowing them to be dragged around
- * the stack, subject to specified constraints.  Optionally supports
- * one widget designated as the viewport, which can be panned over a virtual
- * area without needing to draw that area entirely.  The viewport widget
- * is designated by a 'viewport' attribute on the child element.
- *
- * Widgets are subject to various constraints, specified in xul via the
- * 'constraint' attribute.  Current constraints are:
- *   ignore-x: When panning, ignore any changes to the widget's x position
- *   ignore-y: When panning, ignore any changes to the widget's y position
- *   vp-relative: This widget's position should be claculated relative to
- *     the viewport widget.  It will always keep the same offset from that
- *     widget as initially laid out, regardless of changes to the viewport
- *     bounds.
- *   frozen: This widget is in a fixed position and should never pan.
- */
-function WidgetStack(el, ew, eh) {
-  this.init(el, ew, eh);
-}
-
-WidgetStack.prototype = {
-  // the <stack> element
-  _el: null,
-
-  // object indexed by widget id, with state struct for each object (see _addNewWidget)
-  _widgetState: null,
-
-  // any barriers
-  _barriers: null,
-
-  // If a viewport widget is present, this will point to its state object;
-  // otherwise null.
-  _viewport: null,
-
-  // a wsRect; the inner bounds of the viewport content
-  _viewportBounds: null,
-  // a wsBorder; the overflow area to the side of the bounds where our
-  // viewport-relative widgets go
-  _viewportOverflow: null,
-
-  // a wsRect; the viewportBounds expanded by the viewportOverflow
-  _pannableBounds: null,
-  get pannableBounds() {
-    if (!this._pannableBounds) {
-      this._pannableBounds = this._viewportBounds.clone()
-                                 .expandBy(this._viewportOverflow);
-    }
-    return this._pannableBounds.clone();
-  },
-
-  // a wsRect; the currently visible part of pannableBounds.
-  _viewingRect: null,
-
-  // the amount of current global offset applied to all widgets (whether
-  // static or not).  Set via offsetAll().  Can be used to push things
-  // out of the way for overlaying some other UI.
-  globalOffsetX: 0,
-  globalOffsetY: 0,
-
-  // if true (default), panning is constrained to the pannable bounds.
-  _constrainToViewport: true,
-
-  _viewportUpdateInterval: -1,
-  _viewportUpdateTimeout: -1,
-
-  _viewportUpdateHandler: null,
-  _panHandler: null,
-
-  _dragState: null,
-
-  _skipViewportUpdates: 0,
-  _forceViewportUpdate: false,
-
-  //
-  // init:
-  //   el: the <stack> element whose children are to be managed
-  //
-  init: function (el, ew, eh) {
-    this._el = el;
-    this._widgetState = {};
-    this._barriers = [];
-
-    let rect = this._el.getBoundingClientRect();
-    let width = rect.width;
-    let height = rect.height;
-
-    if (ew != undefined && eh != undefined) {
-      width = ew;
-      height = eh;
-    }
-
-    this._viewportOverflow = new wsBorder(0, 0, 0, 0);
-
-    this._viewingRect = new wsRect(0, 0, width, height);
-
-    // listen for DOMNodeInserted/DOMNodeRemoved/DOMAttrModified
-    let children = this._el.childNodes;
-    for (let i = 0; i < children.length; i++) {
-      let c = this._el.childNodes[i];
-      if (c.tagName == "spacer")
-        this._addNewBarrierFromSpacer(c);
-      else
-        this._addNewWidget(c);
-    }
-
-    // this also updates the viewportOverflow and pannableBounds
-    this._updateWidgets();
-
-    if (this._viewport) {
-      this._viewportBounds = new wsRect(0, 0, this._viewport.rect.width, this._viewport.rect.height);
-    } else {
-      this._viewportBounds = new wsRect(0, 0, 0, 0);
-    }
-  },
-
-  // moveWidgetBy: move the widget with the given id by x,y.  Should
-  // not be used on vp-relative or otherwise frozen widgets (using it
-  // on the x coordinate for x-ignore widgets and similarily for y is
-  // ok, as long as the other coordinate remains 0.)
-  moveWidgetBy: function (wid, x, y) {
-    let state = this._getState(wid);
-
-    state.rect.x += x;
-    state.rect.y += y;
-
-    this._commitState(state);
-  },
-
-  // panBy: pan the entire set of widgets by the given x and y amounts.
-  // This does the same thing as if the user dragged by the given amount.
-  // If this is called with an outstanding drag, weirdness might happen,
-  // but it also might work, so not disabling that.
-  //
-  // if ignoreBarriers is true, then barriers are ignored for the pan.
-  panBy: function panBy(dx, dy, ignoreBarriers) {
-    dx = Math.round(dx);
-    dy = Math.round(dy);
-
-    if (dx == 0 && dy == 0)
-      return false;
-
-    let needsDragWrap = !this._dragging;
-
-    if (needsDragWrap)
-      this.dragStart(0, 0);
-
-    let panned = this._panBy(dx, dy, ignoreBarriers);
-
-    if (needsDragWrap)
-      this.dragStop();
-
-    return panned;
-  },
-
-  // panTo: pan the entire set of widgets so that the given x,y
-  // coordinates are in the upper left of the stack.  If either is
-  // null or undefined, only move the other axis
-  panTo: function panTo(x, y) {
-    if (x == undefined || x == null)
-      x = this._viewingRect.x;
-    if (y == undefined || y == null)
-      y = this._viewingRect.y;
-    this.panBy(x - this._viewingRect.x, y - this._viewingRect.y, true);
-  },
-
-  // freeze: set a widget as frozen.  A frozen widget won't be moved
-  // in the stack -- its x,y position will still be tracked in the
-  // state, but the left/top attributes won't be overwritten.  Call unfreeze
-  // to move the widget back to where the ws thinks it should be.
-  freeze: function (wid) {
-    let state = this._getState(wid);
-
-    state.frozen = true;
-  },
-
-  unfreeze: function (wid) {
-    let state = this._getState(wid);
-    if (!state.frozen)
-      return;
-
-    state.frozen = false;
-    this._commitState(state);
-  },
-
-  // moveFrozenTo: move a frozen widget with id wid to x, y in the stack.
-  // can only be used on frozen widgets
-  moveFrozenTo: function (wid, x, y) {
-    let state = this._getState(wid);
-    if (!state.frozen)
-      throw "moveFrozenTo on non-frozen widget " + wid;
-
-    state.widget.setAttribute("left", x);
-    state.widget.setAttribute("top", y);
-  },
-
-  // moveUnfrozenTo: move an unfrozen, pannable widget with id wid to x, y in
-  // the stack. should only be used on unfrozen widgets when a dynamic change
-  // in position needs to be made. we basically remove, adjust and re-add
-  // the widget
-  moveUnfrozenTo: function (wid, x, y) {
-    delete this._widgetState[wid];
-    let widget = document.getElementById(wid);
-    if (x) widget.setAttribute("left", x);
-    if (y) widget.setAttribute("top", y);
-    this._addNewWidget(widget);
-    this._updateWidgets();
-  },
-
-  // we're relying on viewportBounds and viewingRect having the same origin
-  get viewportVisibleRect () {
-    let rect = this._viewportBounds.intersect(this._viewingRect);
-    if (!rect)
-        rect = new wsRect(0, 0, 0, 0);
-    return rect;
-  },
-
-  isWidgetFrozen: function isWidgetFrozen(wid) {
-    return this._getState(wid).frozen;
-  },
-
-  // isWidgetVisible: return true if any portion of widget with id wid is
-  // visible; otherwise return false.
-  isWidgetVisible: function (wid) {
-    let state = this._getState(wid);
-    let visibleStackRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
-    return visibleStackRect.intersects(state.rect);
-  },
-
-  // getWidgetVisibility: returns the percentage that the widget is visible
-  getWidgetVisibility: function (wid) {
-    let state = this._getState(wid);
-    let visibleStackRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
-    let visibleRect = visibleStackRect.intersect(state.rect);
-    if (visibleRect)
-      return [visibleRect.width / state.rect.width, visibleRect.height / state.rect.height]
-
-    return [0, 0];
-  },
-
-  // offsetAll: add an offset to all widgets
-  offsetAll: function (x, y) {
-    this.globalOffsetX += x;
-    this.globalOffsetY += y;
-
-    for each (let state in this._widgetState) {
-      state.rect.x += x;
-      state.rect.y += y;
-
-      this._commitState(state);
-    }
-  },
-
-  // setViewportBounds
-  //  nb: an object containing top, left, bottom, right properties
-  //    OR
-  //  width, height: integer values; origin assumed to be 0,0
-  //    OR
-  //  top, left, bottom, right: integer values
-  //
-  // Set the bounds of the viewport area; that is, set the size of the
-  // actual content that the viewport widget will be providing a view
-  // over.  For example, in the case of a 100x100 viewport showing a
-  // view into a 100x500 webpage, the viewport bounds would be
-  // { top: 0, left: 0, bottom: 500, right: 100 }.
-  //
-  // setViewportBounds will move all the viewport-relative widgets into
-  // place based on the new viewport bounds.
-  setViewportBounds: function setViewportBounds() {
-    let oldBounds = this._viewportBounds.clone();
-
-    if (arguments.length == 1) {
-      this._viewportBounds.copyFromTLBR(arguments[0]);
-    } else if (arguments.length == 2) {
-      this._viewportBounds.setRect(0, 0, arguments[0], arguments[1]);
-    } else if (arguments.length == 4) {
-      this._viewportBounds.setBounds(arguments[0],
-      arguments[1],
-      arguments[2],
-      arguments[3]);
-    } else {
-      throw "Invalid number of arguments to setViewportBounds";
-    }
-
-    let vp = this._viewport;
-
-    let dleft = this._viewportBounds.left - oldBounds.left;
-    let dright = this._viewportBounds.right - oldBounds.right;
-    let dtop = this._viewportBounds.top - oldBounds.top;
-    let dbottom = this._viewportBounds.bottom - oldBounds.bottom;
-
-    //log2("setViewportBounds dltrb", dleft, dtop, dright, dbottom);
-
-    // move all vp-relative widgets to be the right offset from the bounds again
-    for each (let state in this._widgetState) {
-      if (state.vpRelative) {
-        //log2("vpRelative widget", state.id, state.rect.x, dleft, dright);
-        if (state.vpOffsetXBefore) {
-          state.rect.x += dleft;
-        } else {
-          state.rect.x += dright;
-        }
-
-        if (state.vpOffsetYBefore) {
-          state.rect.y += dtop;
-        } else {
-          state.rect.y += dbottom;
-        }
-
-        //log2("vpRelative widget", state.id, state.rect.x, dleft, dright);
-        this._commitState(state);
-      }
-    }
-
-    for (let bid in this._barriers) {
-      let barrier = this._barriers[bid];
-
-      //log2("setViewportBounds: looking at barrier", bid, barrier.vpRelative, barrier.type);
-
-      if (barrier.vpRelative) {
-        if (barrier.type == "vertical") {
-          let q = "v barrier moving from " + barrier.x + " to ";
-          if (barrier.vpOffsetXBefore) {
-            barrier.x += dleft;
-          } else {
-            barrier.x += dright;
-          }
-          //log2(q += barrier.x);
-        } else if (barrier.type == "horizontal") {
-          let q = "h barrier moving from " + barrier.y + " to ";
-          if (barrier.vpOffsetYBefore) {
-            barrier.y += dtop;
-          } else {
-            barrier.y += dbottom;
-          }
-          //log2(q += barrier.y);
-        }
-      }
-    }
-
-    // clear the pannable bounds cache to make sure it gets rebuilt
-    this._pannableBounds = null;
-
-    // now let's make sure that the viewing rect and inner bounds are still valid
-    this._adjustViewingRect();
-
-    this._viewportUpdate(0, 0, true);
-  },
-
-  // setViewportHandler
-  //  uh: A function object
-  //
-  // The given function object is called at the end of every drag and viewport
-  // bounds change, passing in the new rect that's to be displayed in the
-  // viewport.
-  //
-  setViewportHandler: function (uh) {
-    this._viewportUpdateHandler = uh;
-  },
-
-  // setPanHandler
-  // uh: A function object
-  //
-  // The given functin object is called whenever elements pan; it provides
-  // the new area of the pannable bounds that's visible in the stack.
-  setPanHandler: function (uh) {
-    this._panHandler = uh;
-  },
-
-  // dragStart: start a drag, with the current coordinates being clientX,clientY
-  dragStart: function dragStart(clientX, clientY) {
-    log("(dragStart)", clientX, clientY);
-
-    if (this._dragState) {
-      reportError("dragStart with drag already in progress? what?");
-      this._dragState = null;
-    }
-
-    this._dragState = { };
-
-    let t = Date.now();
-
-    this._dragState.barrierState = [];
-
-    this._dragState.startTime = t;
-    // outer x, that is outer from the viewport coordinates.  In stack-relative coords.
-    this._dragState.outerStartX = clientX;
-    this._dragState.outerStartY = clientY;
-
-    this._dragCoordsFromClient(clientX, clientY, t);
-
-    this._dragState.outerLastUpdateDX = 0;
-    this._dragState.outerLastUpdateDY = 0;
-
-    if (this._viewport) {
-      // create a copy of these so that we can compute
-      // deltas correctly to update the viewport
-      this._viewport.dragStartRect = this._viewport.rect.clone();
-    }
-
-    this._dragState.dragging = true;
-  },
-
-  _viewportDragUpdate: function viewportDragUpdate() {
-    let vws = this._viewport;
-    this._viewportUpdate((vws.dragStartRect.x - vws.rect.x),
-                         (vws.dragStartRect.y - vws.rect.y));
-  },
-
-  // dragStop: stop any drag in progress
-  dragStop: function dragStop() {
-    log("(dragStop)");
-
-    if (!this._dragging)
-      return;
-
-    if (this._viewportUpdateTimeout != -1)
-      clearTimeout(this._viewportUpdateTimeout);
-
-    this._viewportDragUpdate();
-
-    this._dragState = null;
-  },
-
-  // dragMove: process a mouse move to clientX,clientY for an ongoing drag
-  dragMove: function dragMove(clientX, clientY) {
-    if (!this._dragging)
-      return false;
-
-    this._dragCoordsFromClient(clientX, clientY);
-
-    let panned = this._dragUpdate();
-
-    if (this._viewportUpdateInterval != -1) {
-      if (this._viewportUpdateTimeout != -1)
-        clearTimeout(this._viewportUpdateTimeout);
-      let self = this;
-      this._viewportUpdateTimeout = setTimeout(function () { self._viewportDragUpdate(); }, this._viewportUpdateInterval);
-    }
-
-    return panned;
-  },
-
-  // dragBy: process a mouse move by dx,dy for an ongoing drag
-  dragBy: function dragBy(dx, dy) {
-    return this.dragMove(this._dragState.outerCurX + dx, this._dragState.outerCurY + dy);
-  },
-
-  // updateSize: tell the WidgetStack to update its size, because it
-  // was either resized or some other event took place.
-  updateSize: function updateSize(width, height) {
-    if (width == undefined || height == undefined) {
-      let rect = this._el.getBoundingClientRect();
-      width = rect.width;
-      height = rect.height;
-    }
-
-    // update widget rects and viewportOverflow, since the resize might have
-    // caused them to change (widgets first, since the viewportOverflow depends
-    // on them).
-
-    // XXX these methods aren't working correctly yet, but they aren't strictly
-    // necessary in Fennec's default config
-    //for each (let s in this._widgetState)
-    //  this._updateWidgetRect(s);
-    //this._updateViewportOverflow();
-
-    this._viewingRect.width = width;
-    this._viewingRect.height = height;
-
-    // Wrap this call in a batch to ensure that we always call the
-    // viewportUpdateHandler, even if _adjustViewingRect doesn't trigger a pan.
-    // If it does, the batch also ensures that we don't call the handler twice.
-    this.beginUpdateBatch();
-    this._adjustViewingRect();
-    this.endUpdateBatch();
-  },
-
-  beginUpdateBatch: function startUpdate() {
-    if (!this._skipViewportUpdates) {
-      this._startViewportBoundsString = this._viewportBounds.toString();
-      this._forceViewportUpdate = false;
-    }
-    this._skipViewportUpdates++;
-  },
-
-  endUpdateBatch: function endUpdate(aForceRedraw) {
-    if (!this._skipViewportUpdates)
-      throw new Error("Unbalanced call to endUpdateBatch");
-
-    this._forceViewportUpdate = this._forceViewportUpdate || aForceRedraw;
-
-    this._skipViewportUpdates--;
-    if (this._skipViewportUpdates)
-      return;
-
-    let boundsSizeChanged =
-      this._startViewportBoundsString != this._viewportBounds.toString();
-    this._callViewportUpdateHandler(boundsSizeChanged || this._forceViewportUpdate);
-  },
-
-  //
-  // Internal code
-  //
-
-  _updateWidgetRect: function(state) {
-    // don't need to support updating the viewport rect at the moment
-    // (we'd need to duplicate the vptarget* code from _addNewWidget if we did)
-    if (state == this._viewport)
-      return;
-
-    let w = state.widget;
-    let x = w.getAttribute("left") || 0;
-    let y = w.getAttribute("top") || 0;
-    let rect = w.getBoundingClientRect();
-    state.rect = new wsRect(parseInt(x), parseInt(y),
-                            rect.right - rect.left,
-                            rect.bottom - rect.top);
-    if (w.hasAttribute("widgetwidth") && w.hasAttribute("widgetheight")) {
-      state.rect.width = parseInt(w.getAttribute("widgetwidth"));
-      state.rect.height = parseInt(w.getAttribute("widgetheight"));
-    }
-  },
-
-  _dumpRects: function () {
-    dump("WidgetStack:\n");
-    dump("\tthis._viewportBounds: " + this._viewportBounds + "\n");
-    dump("\tthis._viewingRect: " + this._viewingRect + "\n");
-    dump("\tthis._viewport.viewportInnerBounds: " + this._viewport.viewportInnerBounds + "\n");
-    dump("\tthis._viewport.rect: " + this._viewport.rect + "\n");
-    dump("\tthis._viewportOverflow: " + this._viewportOverflow + "\n");
-    dump("\tthis.pannableBounds: " + this.pannableBounds + "\n");
-  },
-
-  // Ensures that _viewingRect is within _pannableBounds (call this when either
-  // one is resized)
-  _adjustViewingRect: function _adjustViewingRect() {
-    let vr = this._viewingRect;
-    let pb = this.pannableBounds;
-
-    if (pb.contains(vr))
-      return; // nothing to do here
-
-    // don't bother adjusting _viewingRect if it can't fit into
-    // _pannableBounds
-    if (vr.height > pb.height || vr.width > pb.width)
-      return;
-
-    let panX = 0, panY = 0;
-    if (vr.right > pb.right)
-      panX = pb.right - vr.right;
-    else if (vr.left < pb.left)
-      panX = pb.left - vr.left;
-
-    if (vr.bottom > pb.bottom)
-      panY = pb.bottom - vr.bottom;
-    else if(vr.top < pb.top)
-      panY = pb.top - vr.top;
-
-    this.panBy(panX, panY, true);
-  },
-
-  _getState: function (wid) {
-    let w = this._widgetState[wid];
-    if (!w)
-      throw "Unknown widget id '" + wid + "'; widget not in stack";
-    return w;
-  },
-
-  get _dragging() {
-    return this._dragState && this._dragState.dragging;
-  },
-
-  _viewportUpdate: function _viewportUpdate(dX, dY, boundsChanged) {
-    if (!this._viewport)
-      return;
-
-    this._viewportUpdateTimeout = -1;
-
-    let vws = this._viewport;
-    let vwib = vws.viewportInnerBounds;
-    let vpb = this._viewportBounds;
-
-    // recover the amount the inner bounds moved by the amount the viewport
-    // widget moved, but don't include offsets that we're making up from previous
-    // drags that didn't affect viewportInnerBounds
-    let [ignoreX, ignoreY] = this._offsets || [0, 0];
-    let rx = dX - ignoreX;
-    let ry = dY - ignoreY;
-
-    [dX, dY] = this._rectTranslateConstrain(rx, ry, vwib, vpb);
-
-    // record the offsets that correspond to the amount of the drag we're ignoring
-    // to ensure the viewportInnerBounds remains within the viewportBounds
-    this._offsets = [dX - rx, dY - ry];
-
-    // adjust the viewportInnerBounds, and snap the viewport back
-    vwib.translate(dX, dY);
-    vws.rect.translate(dX, dY);
-    this._commitState(vws);
-
-    // update this so that we can call this function again during the same drag
-    // and get the right values.
-    vws.dragStartRect = vws.rect.clone();
-
-    this._callViewportUpdateHandler(boundsChanged);
-  },
-
-  _callViewportUpdateHandler: function _callViewportUpdateHandler(boundsChanged) {
-    if (!this._viewport || !this._viewportUpdateHandler || this._skipViewportUpdates)
-      return;
-
-    let vwb = this._viewportBounds.clone();
-
-    let vwib = this._viewport.viewportInnerBounds.clone();
-
-    let vis = this.viewportVisibleRect;
-
-    vwib.left += this._viewport.offsetLeft;
-    vwib.top += this._viewport.offsetTop;
-    vwib.right += this._viewport.offsetRight;
-    vwib.bottom += this._viewport.offsetBottom;
-
-    this._viewportUpdateHandler.apply(window, [vwb, vwib, vis, boundsChanged]);
-  },
-
-  _dragCoordsFromClient: function (cx, cy, t) {
-    this._dragState.curTime = t ? t : Date.now();
-    this._dragState.outerCurX = cx;
-    this._dragState.outerCurY = cy;
-
-    let dx = this._dragState.outerCurX - this._dragState.outerStartX;
-    let dy = this._dragState.outerCurY - this._dragState.outerStartY;
-    this._dragState.outerDX = dx;
-    this._dragState.outerDY = dy;
-  },
-
-  _panHandleBarriers: function (dx, dy) {
-    // XXX unless the barriers are sorted by position, this will break
-    // with multiple barriers that are near enough to eachother that a
-    // drag could cross more than one.
-
-    let vr = this._viewingRect;
-
-    // XXX this just stops at the first horizontal and vertical barrier it finds
-
-    // barrier_[xy] is the barrier that was used to get to the final
-    // barrier_d[xy] value.  if null, no barrier, and dx/dy shouldn't
-    // be replaced with barrier_d[xy].
-    let barrier_y = null, barrier_x = null;
-    let barrier_dy = 0, barrier_dx = 0;
-
-    for (let i = 0; i < this._barriers.length; i++) {
-      let b = this._barriers[i];
-
-      //log2("barrier", i, b.type, b.x, b.y);
-
-      if (dx != 0 && b.type == "vertical") {
-        if (barrier_x != null) {
-          delete this._dragState.barrierState[i];
-          continue;
-        }
-
-        let alreadyKnownDistance = this._dragState.barrierState[i] || 0;
-
-        //log2("alreadyKnownDistance", alreadyKnownDistance);
-
-        let dbx = 0;
-
-        //100 <= 100 && 100-(-5) > 100
-
-        if ((vr.left <= b.x && vr.left+dx > b.x) ||
-            (vr.left >= b.x && vr.left+dx < b.x))
-        {
-          dbx = b.x - vr.left;
-        } else if ((vr.right <= b.x && vr.right+dx > b.x) ||
-                   (vr.right >= b.x && vr.right+dx < b.x))
-        {
-          dbx = b.x - vr.right;
-        } else {
-          delete this._dragState.barrierState[i];
-          continue;
-        }
-
-        let leftoverDistance = dbx - dx;
-
-        //log2("initial dbx", dbx, leftoverDistance);
-
-        let dist = Math.abs(leftoverDistance + alreadyKnownDistance) - b.size;
-
-        if (dist >= 0) {
-          if (dx < 0)
-            dbx -= dist;
-          else
-            dbx += dist;
-          delete this._dragState.barrierState[i];
-        } else {
-          dbx = 0;
-          this._dragState.barrierState[i] = leftoverDistance + alreadyKnownDistance;
-        }
-
-        //log2("final dbx", dbx, "state", this._dragState.barrierState[i]);
-
-        if (Math.abs(barrier_dx) <= Math.abs(dbx)) {
-          barrier_x = b;
-          barrier_dx = dbx;
-
-          //log2("new barrier_dx", barrier_dx);
-        }
-      }
-
-      if (dy != 0 && b.type == "horizontal") {
-        if (barrier_y != null) {
-          delete this._dragState.barrierState[i];
-          continue;
-        }
-
-        let alreadyKnownDistance = this._dragState.barrierState[i] || 0;
-
-        //log2("alreadyKnownDistance", alreadyKnownDistance);
-
-        let dby = 0;
-
-        //100 <= 100 && 100-(-5) > 100
-
-        if ((vr.top <= b.y && vr.top+dy > b.y) ||
-            (vr.top >= b.y && vr.top+dy < b.y))
-        {
-          dby = b.y - vr.top;
-        } else if ((vr.bottom <= b.y && vr.bottom+dy > b.y) ||
-                   (vr.bottom >= b.y && vr.bottom+dy < b.y))
-        {
-          dby = b.y - vr.bottom;
-        } else {
-          delete this._dragState.barrierState[i];
-          continue;
-        }
-
-        let leftoverDistance = dby - dy;
-
-        //log2("initial dby", dby, leftoverDistance);
-
-        let dist = Math.abs(leftoverDistance + alreadyKnownDistance) - b.size;
-
-        if (dist >= 0) {
-          if (dy < 0)
-            dby -= dist;
-          else
-            dby += dist;
-          delete this._dragState.barrierState[i];
-        } else {
-          dby = 0;
-          this._dragState.barrierState[i] = leftoverDistance + alreadyKnownDistance;
-        }
-
-        //log2("final dby", dby, "state", this._dragState.barrierState[i]);
-
-        if (Math.abs(barrier_dy) <= Math.abs(dby)) {
-          barrier_y = b;
-          barrier_dy = dby;
-
-          //log2("new barrier_dy", barrier_dy);
-        }
-      }
-    }
-
-    if (barrier_x) {
-      //log2("did barrier_x", barrier_x, "barrier_dx", barrier_dx);
-      dx = barrier_dx;
-    }
-
-    if (barrier_y) {
-      dy = barrier_dy;
-    }
-
-    return [dx, dy];
-  },
-
-  _panBy: function _panBy(dx, dy, ignoreBarriers) {
-    let vr = this._viewingRect;
-
-    // check if any barriers would be crossed by this pan, and take them
-    // into account.  do this first.
-    if (!ignoreBarriers)
-      [dx, dy] = this._panHandleBarriers(dx, dy);
-
-    // constrain the full drag of the viewingRect to the pannableBounds.
-    // note that the viewingRect needs to move in the opposite
-    // direction of the pan, so we fiddle with the signs here (as you
-    // pan to the upper left, more of the bottom right becomes visible,
-    // so the viewing rect moves to the bottom right of the virtual surface).
-    [dx, dy] = this._rectTranslateConstrain(dx, dy, vr, this.pannableBounds);
-
-    // If the net result is that we don't have any room to move, then
-    // just return.
-    if (dx == 0 && dy == 0)
-      return false;
-
-    // the viewingRect moves opposite of the actual pan direction, see above
-    vr.x += dx;
-    vr.y += dy;
-
-    // Go through each widget and move it by dx,dy.  Frozen widgets
-    // will be ignored in commitState.
-    // The widget rects are in real stack space though, so we need to subtract
-    // our (now negated) dx, dy from their coordinates.
-    for each (let state in this._widgetState) {
-      if (!state.ignoreX)
-        state.rect.x -= dx;
-      if (!state.ignoreY)
-        state.rect.y -= dy;
-
-      this._commitState(state);
-    }
-
-    /* Do not call panhandler during pans within a transaction.
-     * Those pans always end-up covering up the checkerboard and
-     * do not require sliding out the location bar
-     */
-    if (!this._skipViewportUpdates && this._panHandler)
-      this._panHandler.apply(window, [vr.clone(), dx, dy]);
-
-    return true;
-  },
-
-  _dragUpdate: function _dragUpdate() {
-    let dx = this._dragState.outerLastUpdateDX - this._dragState.outerDX;
-    let dy = this._dragState.outerLastUpdateDY - this._dragState.outerDY;
-
-    this._dragState.outerLastUpdateDX = this._dragState.outerDX;
-    this._dragState.outerLastUpdateDY = this._dragState.outerDY;
-
-    return this.panBy(dx, dy);
-  },
-
-  //
-  // widget addition/removal
-  //
-  _addNewWidget: function (w) {
-    let wid = w.getAttribute("id");
-    if (!wid) {
-      reportError("WidgetStack: child widget without id!");
-      return;
-    }
-
-    if (w.getAttribute("hidden") == "true")
-      return;
-
-    let state = {
-      widget: w,
-      id: wid,
-
-      viewport: false,
-      ignoreX: false,
-      ignoreY: false,
-      sticky: false,
-      frozen: false,
-      vpRelative: false,
-
-      offsetLeft: 0,
-      offsetTop: 0,
-      offsetRight: 0,
-      offsetBottom: 0
-    };
-
-    this._updateWidgetRect(state);
-
-    if (w.hasAttribute("constraint")) {
-      let cs = w.getAttribute("constraint").split(",");
-      for each (let s in cs) {
-        if (s == "ignore-x")
-          state.ignoreX = true;
-        else if (s == "ignore-y")
-          state.ignoreY = true;
-        else if (s == "sticky")
-          state.sticky = true;
-        else if (s == "frozen") {
-          state.frozen = true;
-        } else if (s == "vp-relative")
-          state.vpRelative = true;
-      }
-    }
-
-    if (w.hasAttribute("viewport")) {
-      if (this._viewport)
-        reportError("WidgetStack: more than one viewport canvas in stack!");
-
-      this._viewport = state;
-      state.viewport = true;
-
-      if (w.hasAttribute("vptargetx") && w.hasAttribute("vptargety") &&
-          w.hasAttribute("vptargetw") && w.hasAttribute("vptargeth"))
-      {
-        let wx = parseInt(w.getAttribute("vptargetx"));
-        let wy = parseInt(w.getAttribute("vptargety"));
-        let ww = parseInt(w.getAttribute("vptargetw"));
-        let wh = parseInt(w.getAttribute("vptargeth"));
-
-        state.offsetLeft = state.rect.left - wx;
-        state.offsetTop = state.rect.top - wy;
-        state.offsetRight = state.rect.right - (wx + ww);
-        state.offsetBottom = state.rect.bottom - (wy + wh);
-
-        state.rect = new wsRect(wx, wy, ww, wh);
-      }
-
-      // initialize inner bounds to top-left
-      state.viewportInnerBounds = new wsRect(0, 0, state.rect.width, state.rect.height);
-    }
-
-    this._widgetState[wid] = state;
-
-    log ("(New widget: " + wid + (state.viewport ? " [viewport]" : "") + " at: " + state.rect + ")");
-  },
-
-  _removeWidget: function (w) {
-    let wid = w.getAttribute("id");
-    delete this._widgetState[wid];
-    this._updateWidgets();
-  },
-
-  // updateWidgets:
-  //   Go through all the widgets and figure out their viewport-relative offsets.
-  // If the widget goes to the left or above the viewport widget, then
-  // vpOffsetXBefore or vpOffsetYBefore is set.
-  // See setViewportBounds for use of vpOffset* state variables, and for how
-  // the actual x and y coords of each widget are calculated based on their offsets
-  // and the viewport bounds.
-  _updateWidgets: function () {
-    let vp = this._viewport;
-
-    let ofRect = this._viewingRect.clone();
-
-    for each (let state in this._widgetState) {
-      if (vp && state.vpRelative) {
-        // compute the vpOffset from 0,0 assuming that the viewport rect is 0,0
-        if (state.rect.left >= vp.rect.right) {
-          state.vpOffsetXBefore = false;
-          state.vpOffsetX = state.rect.left - vp.rect.width;
-        } else {
-          state.vpOffsetXBefore = true;
-          state.vpOffsetX = state.rect.left - vp.rect.left;
-        }
-
-        if (state.rect.top >= vp.rect.bottom) {
-          state.vpOffsetYBefore = false;
-          state.vpOffsetY = state.rect.top - vp.rect.height;
-        } else {
-          state.vpOffsetYBefore = true;
-          state.vpOffsetY = state.rect.top - vp.rect.top;
-        }
-
-        log("widget", state.id, "offset", state.vpOffsetX, state.vpOffsetXBefore ? "b" : "a", state.vpOffsetY, state.vpOffsetYBefore ? "b" : "a", "rect", state.rect);
-      }
-    }
-
-    this._updateViewportOverflow();
-  },
-
-  // updates the viewportOverflow/pannableBounds
-  _updateViewportOverflow: function() {
-    let vp = this._viewport;
-    if (!vp)
-      return;
-
-    let ofRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
-    for each (let state in this._widgetState) {
-      if (vp && state.vpRelative) {
-        ofRect.left = Math.min(ofRect.left, state.rect.left);
-        ofRect.top = Math.min(ofRect.top, state.rect.top);
-        ofRect.right = Math.max(ofRect.right, state.rect.right);
-        ofRect.bottom = Math.max(ofRect.bottom, state.rect.bottom);
-      }
-    }
-
-    // prevent the viewportOverflow from having positive top/left or negative
-    // bottom/right values, which would otherwise happen if there aren't widgets
-    // beyond each of those edges
-    this._viewportOverflow = new wsBorder(
-      /*top*/ Math.round(Math.min(ofRect.top, 0)),
-      /*left*/ Math.round(Math.min(ofRect.left, 0)),
-      /*bottom*/ Math.round(Math.max(ofRect.bottom - vp.rect.height, 0)),
-      /*right*/ Math.round(Math.max(ofRect.right - vp.rect.width, 0))
-    );
-
-    // clear the _pannableBounds cache, since it depends on the
-    // viewportOverflow
-    this._pannableBounds = null;
-  },
-
-  _widgetBounds: function () {
-    let r = new wsRect(0,0,0,0);
-
-    for each (let state in this._widgetState)
-      r = r.union(state.rect);
-
-    return r;
-  },
-
-  _commitState: function (state) {
-    // if the widget is frozen, don't actually update its left/top;
-    // presumably the caller is managing those directly for now.
-    if (state.frozen)
-      return;
-    let w = state.widget;
-    let l = state.rect.x + state.offsetLeft;
-    let t = state.rect.y + state.offsetTop;
-
-    //cache left/top to avoid calling setAttribute unnessesarily
-    if (state._left != l) {
-      state._left = l;
-      w.setAttribute("left", l);
-    }
-
-    if (state._top != t) {
-      state._top = t;
-      w.setAttribute("top", t);
-    }
-  },
-
-  // constrain translate of rect by dx dy to bounds; return dx dy that can
-  // be used to bring rect up to the edge of bounds if we'd go over.
-  _rectTranslateConstrain: function (dx, dy, rect, bounds) {
-    let newX, newY;
-
-    // If the rect is larger than the bounds, allow it to increase its overlap
-    let woverflow = rect.width > bounds.width;
-    let hoverflow = rect.height > bounds.height;
-    if (woverflow || hoverflow) {
-      let intersection = rect.intersect(bounds);
-      let newIntersection = rect.clone().translate(dx, dy).intersect(bounds);
-      if (woverflow)
-        newX = (newIntersection.width > intersection.width) ? rect.x + dx : rect.x;
-      if (hoverflow)
-        newY = (newIntersection.height > intersection.height) ? rect.y + dy : rect.y;
-    }
-
-    // Common case, rect fits within the bounds
-    // clamp new X to within [bounds.left, bounds.right - rect.width],
-    //       new Y to within [bounds.top, bounds.bottom - rect.height]
-    if (isNaN(newX))
-      newX = Math.min(Math.max(bounds.left, rect.x + dx), bounds.right - rect.width);
-    if (isNaN(newY))
-      newY = Math.min(Math.max(bounds.top, rect.y + dy), bounds.bottom - rect.height);
-
-    return [newX - rect.x, newY - rect.y];
-  },
-
-  // add a new barrier from a <spacer>
-  _addNewBarrierFromSpacer: function (el) {
-    let t = el.getAttribute("barriertype");
-
-    // XXX implement these at some point
-    // t != "lr" && t != "rl" &&
-    // t != "tb" && t != "bt" &&
-
-    if (t != "horizontal" &&
-        t != "vertical")
-    {
-      throw "Invalid barrier type: " + t;
-    }
-
-    let x, y;
-
-    let barrier = {};
-    let vp = this._viewport;
-
-    barrier.type = t;
-
-    if (el.getAttribute("left"))
-      barrier.x = parseInt(el.getAttribute("left"));
-    else if (el.getAttribute("top"))
-      barrier.y = parseInt(el.getAttribute("top"));
-    else
-      throw "Barrier without top or left attribute";
-
-    if (el.getAttribute("size"))
-      barrier.size = parseInt(el.getAttribute("size"));
-    else
-      barrier.size = 10;
-
-    if (el.hasAttribute("constraint")) {
-      let cs = el.getAttribute("constraint").split(",");
-      for each (let s in cs) {
-        if (s == "ignore-x")
-          barrier.ignoreX = true;
-        else if (s == "ignore-y")
-          barrier.ignoreY = true;
-        else if (s == "sticky")
-          barrier.sticky = true;
-        else if (s == "frozen") {
-          barrier.frozen = true;
-        } else if (s == "vp-relative")
-          barrier.vpRelative = true;
-      }
-    }
-
-    if (barrier.vpRelative) {
-      if (barrier.type == "vertical") {
-        if (barrier.x >= vp.rect.right) {
-          barrier.vpOffsetXBefore = false;
-          barrier.vpOffsetX = barrier.x - vp.rect.right;
-        } else {
-          barrier.vpOffsetXBefore = true;
-          barrier.vpOffsetX = barrier.x - vp.rect.left;
-        }
-      } else if (barrier.type == "horizontal") {
-        if (barrier.y >= vp.rect.bottom) {
-          barrier.vpOffsetYBefore = false;
-          barrier.vpOffsetY = barrier.y - vp.rect.bottom;
-        } else {
-          barrier.vpOffsetYBefore = true;
-          barrier.vpOffsetY = barrier.y - vp.rect.top;
-        }
-
-        //log2("h barrier relative", barrier.vpOffsetYBefore, barrier.vpOffsetY);
-      }
-    }
-
-    this._barriers.push(barrier);
-  }
-};
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet href="chrome://tile/skin/overlay.css" type="text/css"?>
-<!DOCTYPE overlay SYSTEM "chrome://tile/locale/tile.dtd">
-<overlay id="tile-overlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="overlay.js"/>
-  <stringbundleset id="stringbundleset">
-    <stringbundle id="tile-strings" src="chrome://tile/locale/tile.properties"/>
-  </stringbundleset>
-
-  <menupopup id="menu_ToolsPopup">
-    <menuitem id="tile-hello" label="&tile.label;" 
-              oncommand="tile.onMenuItemCommand(event);"/>
-  </menupopup>
-</overlay>
deleted file mode 100644
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
+++ /dev/null
@@ -1,469 +0,0 @@
-<window
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  onload="onAlmostLoad();"
-  style="background-color:white;"
-  width="800"
-  height="480"
-  onresize="onResize();"
-  onkeypress="onKeyPress(event);">
-
-<script type="application/javascript" src="WidgetStack.js"/>
-<script type="application/javascript" src="TileManager.js"/>
-<script type="application/javascript" src="BrowserView.js"/>
-<script type="application/javascript">
-<![CDATA[
-
-// We do not endorse the use of globals, but this is just a closed lab
-// environment.  What could possibly go wrong? ...
-let bv        = null;
-let scrollbox = null;
-let leftbar   = null;
-let rightbar  = null;
-let topbar    = null;
-
-function debug() {
-  let w = {};
-  let h = {};
-  scrollbox.getScrolledSize(w, h);
-  let container = document.getElementById("tile_container");
-  let [x, y] = getScrollboxPosition();
-  let [w, h] = [w.value, h.value];
-  if (bv) {
-    dump('----------------------DEBUG!-------------------------\n');
-    dump(bv._browserViewportState.toString() + endl);
-
-    dump(endl);
-
-    let cr = bv._tileManager._criticalRect;
-    dump('criticalRect from BV: ' + (cr ? cr.toString() : null) + endl);
-    dump('visibleRect from BV : ' + bv._visibleRect.toString() + endl);
-    dump('visibleRect from foo: ' + scrollboxToViewportRect(getVisibleRect()) + endl);
-
-    dump(endl);
-
-    dump('container width,height from BV: ' + bv._container.style.width + ', '
-                                            + bv._container.style.height + endl);
-    dump('container width,height via DOM: ' + container.style.width + ', '
-                                            + container.style.height + endl);
-
-    dump(endl);
-
-    dump('scrollbox position    : ' + x + ', ' + y + endl);
-    dump('scrollbox scrolledsize: ' + w + ', ' + h + endl);
-
-    dump(endl);
-
-    dump('tilecache capacity: ' + bv._tileManager._tileCache.getCapacity() + endl);
-    dump('tilecache size    : ' + bv._tileManager._tileCache.size          + endl);
-    dump('tilecache numFree : ' + bv._tileManager._tileCache.numFree       + endl);
-    dump('tilecache iBound  : ' + bv._tileManager._tileCache.iBound        + endl);
-    dump('tilecache jBound  : ' + bv._tileManager._tileCache.jBound        + endl);
-    dump('tilecache _lru    : ' + bv._tileManager._tileCache._lru          + endl);
-
-    dump('-----------------------------------------------------\n');
-  }
-}
-
-function debugTile(i, j) {
-  let tc = bv._tileManager._tileCache;
-  let t  = tc.getTile(i, j);
-
-  dump('------ DEBUGGING TILE (' + i + ',' + j + ') --------\n');
-
-  dump('in bounds: ' + tc.inBounds(i, j) + endl);
-  dump('occupied : ' + tc._isOccupied(i, j) + endl);
-  if (t)
-  {
-  dump('toString : ' + t.toString(true) + endl);
-  dump('free     : ' + t.free + endl);
-  dump('dirtyRect: ' + t._dirtyTileCanvasRect + endl);
-
-  let len = tc._tilePool.length;
-  for (let k = 0; k < len; ++k)
-    if (tc._tilePool[k] === t)
-      dump('found in tilePool at index ' + k + endl);
-  }
-
-  dump('------------------------------------\n');
-}
-
-function onKeyPress(e) {
-  const a = 97;   // debug all critical tiles
-  const c = 99;   // set tilecache capacity
-  const d = 100;  // debug dump
-  const f = 102;  // run noop() through forEachIntersectingRect (for timing)
-  const i = 105;  // toggle info click mode
-  const l = 108;  // restart lazy crawl
-  const m = 109;  // fix mouseout
-  const t = 116;  // debug given list of tiles separated by space
-
-  switch (e.charCode) {
-  case d:
-    debug();
-
-    break;
-  case l:
-    bv._tileManager.restartLazyCrawl(bv._tileManager._criticalRect);
-
-    break;
-  case c:
-    let cap = parseInt(window.prompt('new capacity'));
-    bv._tileManager._tileCache.setCapacity(cap);
-
-    break;
-  case f:
-    let noop = function noop() { for (let i = 0; i < 10; ++i); };
-    bv._tileManager._tileCache.forEachIntersectingRect(bv._tileManager._criticalRect,
-                                                       false, noop, window);
-    
-    break;
-  case t:
-    let ijstrs = window.prompt('row,col plz').split(' ');
-    for each (let ijstr in ijstrs) {
-      let [i, j] = ijstr.split(',').map(function (x) parseInt(x));
-      debugTile(i, j);
-    }
-
-    break;
-  case a:
-    let cr = bv._tileManager._criticalRect;
-    dump('>>>>>> critical rect is ' + (cr ? cr.toString() : cr) + endl);
-    if (cr) {
-      let starti = cr.left  >> kTileExponentWidth;
-      let endi   = cr.right >> kTileExponentWidth;
-
-      let startj = cr.top    >> kTileExponentHeight;
-      let endj   = cr.bottom >> kTileExponentHeight;
-
-      for (var jj = startj; jj <= endj; ++jj)
-        for (var ii = starti; ii <= endi; ++ii)
-          debugTile(ii, jj);
-    }
-
-    break;
-  case i:
-    window.infoMode = !window.infoMode;
-    break;
-  case m:
-    onMouseUp();
-    break;
-  default:
-    break;
-  }
-}
-
-function onResize(e) {
-  if (bv) {
-    bv.beginBatchOperation();
-    bv.setVisibleRect(scrollboxToViewportRect(getVisibleRect()));
-    bv.zoomToPage();
-    bv.commitBatchOperation();
-  }
-}
-
-function onMouseDown(e) {
-  if (window.infoMode) {
-    let [basex, basey] = getScrollboxPosition();
-    let [x, y] = scrollboxToViewportXY(basex + e.clientX, basey + e.clientY);
-    let i = x >> kTileExponentWidth;
-    let j = y >> kTileExponentHeight;
-
-    debugTile(i, j);
-  }
-
-  window._isDragging = true;
-  window._dragStart = {x: e.clientX, y: e.clientY};
-
-  bv.pauseRendering();
-}
-
-function onMouseUp() {
-  window._isDragging = false;
-  bv.resumeRendering();
-}
-
-function onMouseMove(e) {
-  if (window._isDragging) {
-    let x = {};
-    let y = {};
-    let w = {};
-    let h = {};
-    scrollbox.getPosition(x, y);
-    scrollbox.getScrolledSize(w, h);
-
-    let dx = window._dragStart.x - e.clientX;
-    let dy = window._dragStart.y - e.clientY;
-
-    // XXX if max(x, 0) > scrollwidth we shouldn't do anything (same for y/height)
-    let newX = Math.max(x.value + dx, 0);
-    let newY = Math.max(y.value + dy, 0);
-
-    if (newX < w.value || newY < h.value) {
-      // clip dx and dy to prevent us from going below 0
-      dx = Math.max(dx, -x.value);
-      dy = Math.max(dy, -y.value);
-
-      let oldx = x.value;
-      let oldy = y.value;
-
-      bv.onBeforeVisibleMove(dx, dy);
-
-      updateBars(oldx, oldy, dx, dy);
-      scrollbox.scrollBy(dx, dy);
-      
-      let [newx, newy] = getScrollboxPosition();
-      let realdx = newx - oldx;
-      let realdy = newy - oldy;
-
-      updateBars(oldx, oldy, realdx, realdy);
-      bv.onAfterVisibleMove(realdx, realdy);
-    }
-    window._dragStart = {x: e.clientX, y: e.clientY};
-  }
-}
-
-function onAlmostLoad() {
-  window._isDragging = false;
-  window.infoMode = false;
-  window.setTimeout(onLoad, 1500);
-}
-
-function onLoad() {
-  // ----------------------------------------------------
-  scrollbox = document.getElementById("scrollbox")
-		.boxObject
-		.QueryInterface(Components.interfaces.nsIScrollBoxObject);
-  leftbar  = document.getElementById("left_sidebar");
-  rightbar = document.getElementById("right_sidebar");
-  topbar   = document.getElementById("top_urlbar");
-  // ----------------------------------------------------
-
-  let initX = Math.round(leftbar.getBoundingClientRect().right);
-  dump('scrolling to ' + initX + endl);
-  scrollbox.scrollTo(initX, 0);
-  let [x, y] = getScrollboxPosition();
-  dump(' scrolled to ' + x + ',' + y + endl);
-
-  let container = document.getElementById("tile_container");
-  container.addEventListener("mousedown", onMouseDown, true);
-  container.addEventListener("mouseup",   onMouseUp,   true);
-  container.addEventListener("mousemove", onMouseMove, true);
-
-  bv = new BrowserView(container, scrollboxToViewportRect(getVisibleRect()));
-
-  let browser = document.getElementById("googlenews");
-  bv.setBrowser(browser, false);
-}
-
-function updateBars(x, y, dx, dy) {
-return;
-  // shouldn't update margin if it doesn't need to be changed
-  let sidebars = document.getElementsByClassName("sidebar");
-  for (let i = 0; i < sidebars.length; i++) {
-    let sidebar = sidebars[i];
-    sidebar.style.margin = (y + dy) + "px 0px 0px 0px";
-  }
-
-  let urlbar = document.getElementById("top_urlbar");
-  urlbar.style.margin = "0px 0px 0px " + (x + dx) + "px";
-}
-
-function viewportToScrollboxXY(x, y) {
-  return scrollboxToViewportXY(x, y, -1);
-}
-
-function scrollboxToViewportXY(x, y) {
-  if (!x) x = 0;
-  if (!y) y = 0;
-
-  // shield your eyes!
-  let direction = (arguments.length >= 3) ? arguments[2] : 1;
-
-  let leftbarcr  = leftbar.getBoundingClientRect();
-  let rightbarcr = rightbar.getBoundingClientRect();
-  let topbarcr   = topbar.getBoundingClientRect();
-
-  let xtrans = direction * (-leftbarcr.width);
-  let ytrans = direction * (-topbarcr.height);
-  x += xtrans;
-  y += ytrans;
-
-  return [x, y];
-}
-
-function scrollboxToBrowserXY(browserView, x, y) {
-  [x, y] = scrollboxToViewportXY(x, y);
-  return [browserView.viewportToBrowser(x),
-          browserView.viewportToBrowser(y)];
-}
-
-function scrollboxToViewportRect(rect) {
-  let leftbarcr = leftbar.getBoundingClientRect();
-  let topbarcr  = topbar.getBoundingClientRect();
-
-  let xtrans = -leftbarcr.width;
-  let ytrans = -topbarcr.height;
-
-  rect.translate(xtrans, ytrans);
-
-  return rect;
-}
-
-function getScrollboxPosition() {
-  let x = {};
-  let y = {};
-  scrollbox.getPosition(x, y);
-  return [x.value, y.value];
-}
-
-function getContentScrollValues(browser) {
-  let cwu = getBrowserDOMWindowUtils(browser);
-  let scrollX = {};
-  let scrollY = {};
-  cwu.getScrollXY(false, scrollX, scrollY);
-
-  return [scrollX.value, scrollY.value];
-}
-
-function getBrowserDOMWindowUtils(browser) {
-  return browser.contentWindow
-    .QueryInterface(Ci.nsIInterfaceRequestor)
-    .getInterface(Ci.nsIDOMWindowUtils);
-}
-
-function getBrowserClientRect(browser, el) {
-  let [scrollX, scrollY] = getContentScrollValues(browser);
-  let r = el.getBoundingClientRect();
-
-  return new wsRect(r.left + scrollX,
-		    r.top + scrollY,
-                    r.width, r.height);
-}
-
-function scrollToElement(browser, el) {
-  var elRect = getPagePosition(browser, el);
-  bv.browserToViewportRect(elRect);
-  elRect.round();
-  this.scrollTo(elRect.x, elRect.y);
-}
-
-function zoomToElement(aElement) {
-  const margin = 15;
-
-  let elRect = getBrowserClientRect(browser, aElement);
-  let elWidth = elRect.width;
-  let vrWidth = bv.visibleRect.width;
-  /* Try to set zoom-level such that once zoomed element is as wide
-   *  as the visible rect */
-  let zoomLevel = vrtWidth / (elWidth + (2 * margin));
-
-  bv.beginBatchOperation();
-
-  bv.setZoomLevel(zoomLevel);
-
-  /* If zoomLevel ends up clamped to less than asked for, calculate
-   * how many more screen pixels will fit horizontally in addition to
-   * element's width. This ensures that more of the webpage is
-   * showing instead of the navbar. Bug 480595. */