Backed out 6 changesets (bug 1288841, bug 1268544) for causing Win7 e10s Marionette to fail in test_import_script.py TestImportScriptContent.test_imports_apply_globally
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 18 Aug 2016 00:30:21 -0700
changeset 351368 1ea96bf70664dbac2584881fcf39408733278e46
parent 351367 ae927fbd31e24bc930eaf6c7721fc744eb4aeec3
child 351369 844995477d5693876d8297e31fab5bbc4fd21aa5
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1288841, 1268544
milestone51.0a1
backs outc9f49a1192559dd939a0b10fa8c2335bda40afff
a9d43e83e0700fa19565f54e55356caf49f488ba
d898178a0809c9542e27696281c42fc0dca8853f
4887b4164dd90bd6d43754d96558f005a1b27487
7c3a5a770cae858dc7c7d19a03560173978758ab
12aa15cf58791f26f5fd77af31d97eb66f4d4125
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 6 changesets (bug 1288841, bug 1268544) for causing Win7 e10s Marionette to fail in test_import_script.py TestImportScriptContent.test_imports_apply_globally Backed out changeset c9f49a119255 (bug 1288841) Backed out changeset a9d43e83e070 (bug 1268544) Backed out changeset d898178a0809 (bug 1268544) Backed out changeset 4887b4164dd9 (bug 1268544) Backed out changeset 7c3a5a770cae (bug 1268544) Backed out changeset 12aa15cf5879 (bug 1268544)
accessible/atk/moz.build
accessible/base/DocManager.cpp
accessible/base/NotificationController.cpp
accessible/base/Platform.h
accessible/base/moz.build
accessible/generic/Accessible.cpp
accessible/generic/DocAccessible.h
accessible/generic/moz.build
accessible/ipc/DocAccessibleChild.cpp
accessible/ipc/DocAccessibleChild.h
accessible/ipc/DocAccessibleChildBase.cpp
accessible/ipc/DocAccessibleChildBase.h
accessible/ipc/DocAccessibleParent.cpp
accessible/ipc/DocAccessibleParent.h
accessible/ipc/PDocAccessible.ipdl
accessible/ipc/ProxyAccessible.cpp
accessible/ipc/ProxyAccessible.h
accessible/ipc/ProxyAccessibleBase.cpp
accessible/ipc/ProxyAccessibleBase.h
accessible/ipc/moz.build
accessible/ipc/other/DocAccessibleChild.cpp
accessible/ipc/other/DocAccessibleChild.h
accessible/ipc/other/PDocAccessible.ipdl
accessible/ipc/other/ProxyAccessible.cpp
accessible/ipc/other/ProxyAccessible.h
accessible/ipc/other/moz.build
accessible/ipc/win/COMPtrTypes.cpp
accessible/ipc/win/COMPtrTypes.h
accessible/ipc/win/DocAccessibleChild.cpp
accessible/ipc/win/DocAccessibleChild.h
accessible/ipc/win/PDocAccessible.ipdl
accessible/ipc/win/PlatformChild.cpp
accessible/ipc/win/PlatformChild.h
accessible/ipc/win/ProxyAccessible.cpp
accessible/ipc/win/ProxyAccessible.h
accessible/ipc/win/moz.build
accessible/ipc/win/typelib/Accessible.idl
accessible/ipc/win/typelib/Makefile.in
accessible/ipc/win/typelib/moz.build
accessible/mac/moz.build
accessible/windows/ProxyWrappers.h
accessible/windows/ia2/ia2Accessible.cpp
accessible/windows/ia2/ia2AccessibleEditableText.cpp
accessible/windows/ia2/ia2AccessibleHyperlink.cpp
accessible/windows/ia2/ia2AccessibleHypertext.cpp
accessible/windows/ia2/ia2AccessibleText.cpp
accessible/windows/ia2/ia2AccessibleValue.cpp
accessible/windows/msaa/AccessibleWrap.cpp
accessible/windows/msaa/DocAccessibleWrap.cpp
accessible/windows/msaa/DocAccessibleWrap.h
accessible/windows/msaa/Platform.cpp
accessible/windows/msaa/moz.build
accessible/xpcom/xpcAccessible.cpp
accessible/xpcom/xpcAccessibleDocument.h
accessible/xpcom/xpcAccessibleHyperLink.cpp
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleValue.cpp
browser/installer/package-manifest.in
--- a/accessible/atk/moz.build
+++ b/accessible/atk/moz.build
@@ -31,17 +31,16 @@ SOURCES += [
     'UtilInterface.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
     '/accessible/html',
     '/accessible/ipc',
-    '/accessible/ipc/other',
     '/accessible/xpcom',
     '/accessible/xul',
     '/other-licenses/atk-1.0',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -510,21 +510,16 @@ DocManager::CreateDocOrRootAccessible(ns
         // XXX We may need to handle the case that we don't have a tab child
         // differently.  It may be that this will cause us to fail to notify
         // the parent process about important accessible documents.
         if (tabChild) {
           DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
           docAcc->SetIPCDoc(ipcDoc);
           static_cast<TabChild*>(tabChild.get())->
             SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
-
-#if defined(XP_WIN)
-          IAccessibleHolder holder(CreateHolderFromAccessible(docAcc));
-          ipcDoc->SendCOMProxy(holder);
-#endif
         }
       }
     }
   } else {
     parentDocAcc->BindChildDocument(docAcc);
   }
 
 #ifdef A11Y_LOG
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -415,20 +415,16 @@ NotificationController::WillRefresh(mozi
 
       ipcDoc = new DocAccessibleChild(childDoc);
       childDoc->SetIPCDoc(ipcDoc);
       nsCOMPtr<nsITabChild> tabChild =
         do_GetInterface(mDocument->DocumentNode()->GetDocShell());
       if (tabChild) {
         static_cast<TabChild*>(tabChild.get())->
           SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
-#if defined(XP_WIN)
-        IAccessibleHolder holder(CreateHolderFromAccessible(childDoc));
-        ipcDoc->SendCOMProxy(holder);
-#endif
       }
     }
   }
 
   mObservingState = eRefreshObserving;
   if (!mDocument)
     return;
 
--- a/accessible/base/Platform.h
+++ b/accessible/base/Platform.h
@@ -1,17 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_a11y_Platform_h
-#define mozilla_a11y_Platform_h
-
 #include <stdint.h>
 
 class nsString;
 
 namespace mozilla {
 namespace a11y {
 
 class ProxyAccessible;
@@ -80,9 +77,8 @@ void ProxyTextChangeEvent(ProxyAccessibl
                           bool aFromUser);
 void ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible* aParent,
                         bool aInsert, bool aFromUser);
 void ProxySelectionEvent(ProxyAccessible* aTarget, ProxyAccessible* aWidget,
                          uint32_t aType);
 } // namespace a11y
 } // namespace mozilla
 
-#endif // mozilla_a11y_Platform_h
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -58,28 +58,16 @@ if CONFIG['A11Y_LOG']:
     UNIFIED_SOURCES += [
         'Logging.cpp',
     ]
 
 LOCAL_INCLUDES += [
     '/accessible/generic',
     '/accessible/html',
     '/accessible/ipc',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
-    LOCAL_INCLUDES += [
-        '/accessible/ipc/win',
-    ]
-else:
-    LOCAL_INCLUDES += [
-        '/accessible/ipc/other',
-    ]
-
-LOCAL_INCLUDES += [
     '/accessible/xpcom',
     '/accessible/xul',
     '/dom/base',
     '/dom/xbl',
     '/ipc/chromium/src',
     '/layout/generic',
     '/layout/style',
     '/layout/svg',
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -850,47 +850,47 @@ Accessible::HandleAccEvent(AccEvent* aEv
 
         case nsIAccessibleEvent::EVENT_REORDER:
           // reorder events on the application acc aren't necessary to tell the parent
           // about new top level documents.
           if (!aEvent->GetAccessible()->IsApplication())
             ipcDoc->SendEvent(id, aEvent->GetEventType());
           break;
         case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
-          AccStateChangeEvent* event = downcast_accEvent(aEvent);
-          ipcDoc->SendStateChangeEvent(id, event->GetState(),
-                                       event->IsStateEnabled());
-          break;
-        }
+                                                       AccStateChangeEvent* event = downcast_accEvent(aEvent);
+                                                       ipcDoc->SendStateChangeEvent(id, event->GetState(),
+                                                                                    event->IsStateEnabled());
+                                                       break;
+                                                     }
         case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
           AccCaretMoveEvent* event = downcast_accEvent(aEvent);
           ipcDoc->SendCaretMoveEvent(id, event->GetCaretOffset());
           break;
         }
         case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
         case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
           AccTextChangeEvent* event = downcast_accEvent(aEvent);
           ipcDoc->SendTextChangeEvent(id, event->ModifiedText(),
                                       event->GetStartOffset(),
                                       event->GetLength(),
                                       event->IsTextInserted(),
                                       event->IsFromUserInput());
           break;
-        }
+                                                     }
         case nsIAccessibleEvent::EVENT_SELECTION:
         case nsIAccessibleEvent::EVENT_SELECTION_ADD:
         case nsIAccessibleEvent::EVENT_SELECTION_REMOVE: {
           AccSelChangeEvent* selEvent = downcast_accEvent(aEvent);
           uint64_t widgetID = selEvent->Widget()->IsDoc() ? 0 :
             reinterpret_cast<uintptr_t>(selEvent->Widget());
           ipcDoc->SendSelectionEvent(id, widgetID, aEvent->GetEventType());
           break;
-        }
+                                                         }
         default:
-          ipcDoc->SendEvent(id, aEvent->GetEventType());
+                                                         ipcDoc->SendEvent(id, aEvent->GetEventType());
       }
     }
   }
 
   if (nsCoreUtils::AccEventObserversExist()) {
     nsCoreUtils::DispatchAccEvent(MakeXPCEvent(aEvent));
   }
 
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -572,17 +572,17 @@ protected:
   bool IsLoadEventTarget() const;
 
   /*
    * Set the object responsible for communicating with the main process on
    * behalf of this document.
    */
   void SetIPCDoc(DocAccessibleChild* aIPCDoc) { mIPCDoc = aIPCDoc; }
 
-  friend class DocAccessibleChildBase;
+  friend class DocAccessibleChild;
 
   /**
    * Used to fire scrolling end event after page scroll.
    *
    * @param aTimer    [in] the timer object
    * @param aClosure  [in] the document accessible where scrolling happens
    */
   static void ScrollTimerCallback(nsITimer* aTimer, void* aClosure);
--- a/accessible/generic/moz.build
+++ b/accessible/generic/moz.build
@@ -23,32 +23,24 @@ UNIFIED_SOURCES += [
     'RootAccessible.cpp',
     'TableCellAccessible.cpp',
     'TextLeafAccessible.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/html',
+    '/accessible/ipc',
     '/accessible/xpcom',
     '/accessible/xul',
     '/dom/base',
     '/layout/generic',
     '/layout/xul',
 ]
 
-if CONFIG['OS_ARCH'] == 'WINNT':
-    LOCAL_INCLUDES += [
-        '/accessible/ipc/win',
-    ]
-else:
-    LOCAL_INCLUDES += [
-        '/accessible/ipc/other',
-    ]
-
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     LOCAL_INCLUDES += [
         '/accessible/atk',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     LOCAL_INCLUDES += [
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
rename from accessible/ipc/other/DocAccessibleChild.cpp
rename to accessible/ipc/DocAccessibleChild.cpp
--- a/accessible/ipc/other/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -19,16 +19,73 @@
 #include "nsAccUtils.h"
 #ifdef MOZ_ACCESSIBILITY_ATK
 #include "AccessibleWrap.h"
 #endif
 
 namespace mozilla {
 namespace a11y {
 
+static uint32_t
+InterfacesFor(Accessible* aAcc)
+{
+  uint32_t interfaces = 0;
+  if (aAcc->IsHyperText() && aAcc->AsHyperText()->IsTextRole())
+    interfaces |= Interfaces::HYPERTEXT;
+
+  if (aAcc->IsLink())
+    interfaces |= Interfaces::HYPERLINK;
+
+  if (aAcc->HasNumericValue())
+    interfaces |= Interfaces::VALUE;
+
+  if (aAcc->IsImage())
+    interfaces |= Interfaces::IMAGE;
+
+  if (aAcc->IsTable()) {
+    interfaces |= Interfaces::TABLE;
+  }
+
+  if (aAcc->IsTableCell())
+    interfaces |= Interfaces::TABLECELL;
+
+  if (aAcc->IsDoc())
+    interfaces |= Interfaces::DOCUMENT;
+
+  if (aAcc->IsSelect()) {
+    interfaces |= Interfaces::SELECTION;
+  }
+
+  if (aAcc->ActionCount()) {
+    interfaces |= Interfaces::ACTION;
+  }
+
+  return interfaces;
+}
+
+static void
+SerializeTree(Accessible* aRoot, nsTArray<AccessibleData>& aTree)
+{
+  uint64_t id = reinterpret_cast<uint64_t>(aRoot->UniqueID());
+  uint32_t role = aRoot->Role();
+  uint32_t childCount = aRoot->ChildCount();
+  uint32_t interfaces = InterfacesFor(aRoot);
+
+  // OuterDocAccessibles are special because we don't want to serialize the
+  // child doc here, we'll call PDocAccessibleConstructor in
+  // NotificationController.
+  MOZ_ASSERT(!aRoot->IsDoc(), "documents shouldn't be serialized");
+  if (aRoot->IsOuterDoc())
+    childCount = 0;
+
+  aTree.AppendElement(AccessibleData(id, role, childCount, interfaces));
+  for (uint32_t i = 0; i < childCount; i++)
+    SerializeTree(aRoot->GetChildAt(i), aTree);
+}
+
 Accessible*
 DocAccessibleChild::IdToAccessible(const uint64_t& aID) const
 {
   if (!aID)
     return mDoc;
 
   if (!mDoc)
     return nullptr;
@@ -80,16 +137,28 @@ DocAccessibleChild::IdToTableCellAccessi
 
 TableAccessible*
 DocAccessibleChild::IdToTableAccessible(const uint64_t& aID) const
 {
   Accessible* acc = IdToAccessible(aID);
   return (acc && acc->IsTable()) ? acc->AsTable() : nullptr;
 }
 
+void
+DocAccessibleChild::ShowEvent(AccShowEvent* aShowEvent)
+{
+  Accessible* parent = aShowEvent->Parent();
+  uint64_t parentID = parent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(parent->UniqueID());
+  uint32_t idxInParent = aShowEvent->InsertionIndex();
+  nsTArray<AccessibleData> shownTree;
+  ShowEventData data(parentID, idxInParent, shownTree);
+  SerializeTree(aShowEvent->GetAccessible(), data.NewTree());
+  SendShowEvent(data, aShowEvent->IsFromUserInput());
+}
+
 bool
 DocAccessibleChild::RecvState(const uint64_t& aID, uint64_t* aState)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
     *aState = states::DEFUNCT;
     return true;
   }
rename from accessible/ipc/other/DocAccessibleChild.h
rename to accessible/ipc/DocAccessibleChild.h
--- a/accessible/ipc/other/DocAccessibleChild.h
+++ b/accessible/ipc/DocAccessibleChild.h
@@ -2,46 +2,68 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_DocAccessibleChild_h
 #define mozilla_a11y_DocAccessibleChild_h
 
-#include "mozilla/a11y/DocAccessibleChildBase.h"
+#include "mozilla/a11y/DocAccessible.h"
+#include "mozilla/a11y/PDocAccessibleChild.h"
+#include "nsISupportsImpl.h"
 
 namespace mozilla {
 namespace a11y {
-
 class Accessible;
 class HyperTextAccessible;
 class TextLeafAccessible;
 class ImageAccessible;
 class TableAccessible;
 class TableCellAccessible;
+class AccShowEvent;
 
-/*
- * These objects handle content side communication for an accessible document,
- * and their lifetime is the same as the document they represent.
- */
-class DocAccessibleChild : public DocAccessibleChildBase
+  /*
+   * These objects handle content side communication for an accessible document,
+   * and their lifetime is the same as the document they represent.
+   */
+class DocAccessibleChild : public PDocAccessibleChild
 {
 public:
-  explicit DocAccessibleChild(DocAccessible* aDoc)
-    : DocAccessibleChildBase(aDoc)
+  explicit DocAccessibleChild(DocAccessible* aDoc) :
+    mDoc(aDoc)
+  { MOZ_COUNT_CTOR(DocAccessibleChild); }
+  ~DocAccessibleChild()
   {
-    MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
+    // Shutdown() should have been called, but maybe it isn't if the process is
+    // killed?
+    MOZ_ASSERT(!mDoc);
+    if (mDoc)
+      mDoc->SetIPCDoc(nullptr);
+    MOZ_COUNT_DTOR(DocAccessibleChild);
   }
 
-  ~DocAccessibleChild()
+  void Shutdown()
+  {
+    mDoc->SetIPCDoc(nullptr);
+    mDoc = nullptr;
+    SendShutdown();
+  }
+
+  virtual void ActorDestroy(ActorDestroyReason) override
   {
-    MOZ_COUNT_DTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
+    if (!mDoc)
+      return;
+
+    mDoc->SetIPCDoc(nullptr);
+    mDoc = nullptr;
   }
 
+  void ShowEvent(AccShowEvent* aShowEvent);
+
   /*
    * Return the state for the accessible with given ID.
    */
   virtual bool RecvState(const uint64_t& aID, uint64_t* aState) override;
 
   /*
    * Return the native state for the accessible with given ID.
    */
@@ -469,14 +491,16 @@ private:
   HyperTextAccessible* IdToHyperTextAccessible(const uint64_t& aID) const;
   TextLeafAccessible* IdToTextLeafAccessible(const uint64_t& aID) const;
   ImageAccessible* IdToImageAccessible(const uint64_t& aID) const;
   TableCellAccessible* IdToTableCellAccessible(const uint64_t& aID) const;
   TableAccessible* IdToTableAccessible(const uint64_t& aID) const;
 
   bool PersistentPropertiesToArray(nsIPersistentProperties* aProps,
                                    nsTArray<Attribute>* aAttributes);
+
+  DocAccessible* mDoc;
 };
 
 }
 }
 
 #endif
deleted file mode 100644
--- a/accessible/ipc/DocAccessibleChildBase.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/a11y/DocAccessibleChildBase.h"
-#include "mozilla/a11y/ProxyAccessible.h"
-
-#include "Accessible-inl.h"
-
-namespace mozilla {
-namespace a11y {
-
-/* static */ uint32_t
-DocAccessibleChildBase::InterfacesFor(Accessible* aAcc)
-{
-  uint32_t interfaces = 0;
-  if (aAcc->IsHyperText() && aAcc->AsHyperText()->IsTextRole())
-    interfaces |= Interfaces::HYPERTEXT;
-
-  if (aAcc->IsLink())
-    interfaces |= Interfaces::HYPERLINK;
-
-  if (aAcc->HasNumericValue())
-    interfaces |= Interfaces::VALUE;
-
-  if (aAcc->IsImage())
-    interfaces |= Interfaces::IMAGE;
-
-  if (aAcc->IsTable()) {
-    interfaces |= Interfaces::TABLE;
-  }
-
-  if (aAcc->IsTableCell())
-    interfaces |= Interfaces::TABLECELL;
-
-  if (aAcc->IsDoc())
-    interfaces |= Interfaces::DOCUMENT;
-
-  if (aAcc->IsSelect()) {
-    interfaces |= Interfaces::SELECTION;
-  }
-
-  if (aAcc->ActionCount()) {
-    interfaces |= Interfaces::ACTION;
-  }
-
-  return interfaces;
-}
-
-/* static */ void
-DocAccessibleChildBase::SerializeTree(Accessible* aRoot,
-                                      nsTArray<AccessibleData>& aTree)
-{
-  uint64_t id = reinterpret_cast<uint64_t>(aRoot->UniqueID());
-  uint32_t role = aRoot->Role();
-  uint32_t childCount = aRoot->ChildCount();
-  uint32_t interfaces = InterfacesFor(aRoot);
-
-#if defined(XP_WIN)
-  IAccessibleHolder holder(CreateHolderFromAccessible(aRoot));
-#endif
-
-  // OuterDocAccessibles are special because we don't want to serialize the
-  // child doc here, we'll call PDocAccessibleConstructor in
-  // NotificationController.
-  MOZ_ASSERT(!aRoot->IsDoc(), "documents shouldn't be serialized");
-  if (aRoot->IsOuterDoc()) {
-    childCount = 0;
-  }
-
-#if defined(XP_WIN)
-  aTree.AppendElement(AccessibleData(id, role, childCount, interfaces,
-                                     holder));
-#else
-  aTree.AppendElement(AccessibleData(id, role, childCount, interfaces));
-#endif
-
-  for (uint32_t i = 0; i < childCount; i++) {
-    SerializeTree(aRoot->GetChildAt(i), aTree);
-  }
-}
-
-void
-DocAccessibleChildBase::ShowEvent(AccShowEvent* aShowEvent)
-{
-  Accessible* parent = aShowEvent->Parent();
-  uint64_t parentID = parent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(parent->UniqueID());
-  uint32_t idxInParent = aShowEvent->InsertionIndex();
-  nsTArray<AccessibleData> shownTree;
-  ShowEventData data(parentID, idxInParent, shownTree);
-  SerializeTree(aShowEvent->GetAccessible(), data.NewTree());
-  SendShowEvent(data, aShowEvent->IsFromUserInput());
-}
-
-} // namespace a11y
-} // namespace mozilla
-
deleted file mode 100644
--- a/accessible/ipc/DocAccessibleChildBase.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_DocAccessibleChildBase_h
-#define mozilla_a11y_DocAccessibleChildBase_h
-
-#include "mozilla/a11y/DocAccessible.h"
-#include "mozilla/a11y/PDocAccessibleChild.h"
-#include "nsISupportsImpl.h"
-
-namespace mozilla {
-namespace a11y {
-
-class Accessible;
-class AccShowEvent;
-
-class DocAccessibleChildBase : public PDocAccessibleChild
-{
-public:
-  explicit DocAccessibleChildBase(DocAccessible* aDoc)
-    : mDoc(aDoc)
-  {
-    MOZ_COUNT_CTOR(DocAccessibleChildBase);
-  }
-
-  ~DocAccessibleChildBase()
-  {
-    // Shutdown() should have been called, but maybe it isn't if the process is
-    // killed?
-    MOZ_ASSERT(!mDoc);
-    if (mDoc) {
-      mDoc->SetIPCDoc(nullptr);
-    }
-
-    MOZ_COUNT_DTOR(DocAccessibleChildBase);
-  }
-
-  void Shutdown()
-  {
-    mDoc->SetIPCDoc(nullptr);
-    mDoc = nullptr;
-    SendShutdown();
-  }
-
-  void ShowEvent(AccShowEvent* aShowEvent);
-
-  virtual void ActorDestroy(ActorDestroyReason) override
-  {
-    if (!mDoc) {
-      return;
-    }
-
-    mDoc->SetIPCDoc(nullptr);
-    mDoc = nullptr;
-  }
-
-protected:
-  static uint32_t InterfacesFor(Accessible* aAcc);
-  static void SerializeTree(Accessible* aRoot, nsTArray<AccessibleData>& aTree);
-
-  DocAccessible*  mDoc;
-};
-
-} // namespace a11y
-} // namespace mozilla
-
-#endif // mozilla_a11y_DocAccessibleChildBase_h
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocAccessibleParent.h"
 #include "mozilla/a11y/Platform.h"
+#include "ProxyAccessible.h"
 #include "mozilla/dom/TabParent.h"
 #include "xpcAccessibleDocument.h"
 #include "xpcAccEvents.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 
 namespace mozilla {
 namespace a11y {
@@ -97,34 +98,19 @@ DocAccessibleParent::AddSubtree(ProxyAcc
   }
 
   if (mAccessibles.Contains(newChild.ID())) {
     NS_ERROR("ID already in use");
     return 0;
   }
 
   auto role = static_cast<a11y::role>(newChild.Role());
-
-#if defined(XP_WIN)
-  const IAccessibleHolder& proxyStream = newChild.COMProxy();
-  RefPtr<IAccessible> comPtr(proxyStream.Get());
-  if (!comPtr) {
-    NS_ERROR("Could not obtain remote IAccessible interface");
-    return 0;
-  }
-
-  ProxyAccessible* newProxy =
-    new ProxyAccessible(newChild.ID(), aParent, this, role,
-                        newChild.Interfaces(), comPtr);
-#else
   ProxyAccessible* newProxy =
     new ProxyAccessible(newChild.ID(), aParent, this, role,
                         newChild.Interfaces());
-#endif
-
   aParent->AddChildAt(aIdxInParent, newProxy);
   mAccessibles.PutEntry(newChild.ID())->mProxy = newProxy;
   ProxyCreated(newProxy, newChild.Interfaces());
 
   uint32_t accessibles = 1;
   uint32_t kids = newChild.ChildrenCount();
   for (uint32_t i = 0; i < kids; i++) {
     uint32_t consumed = AddSubtree(newProxy, aNewTree, aIdx + accessibles, i);
@@ -461,37 +447,10 @@ DocAccessibleParent::CheckDocTree() cons
 xpcAccessibleGeneric*
 DocAccessibleParent::GetXPCAccessible(ProxyAccessible* aProxy)
 {
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   MOZ_ASSERT(doc);
 
   return doc->GetXPCAccessible(aProxy);
 }
-
-#if defined(XP_WIN)
-/**
- * @param aCOMProxy COM Proxy to the document in the content process.
- * @param aParentCOMProxy COM Proxy to the OuterDocAccessible that is
- *        the parent of the document. The content process will use this
- *        proxy when traversing up across the content/chrome boundary.
- */
-bool
-DocAccessibleParent::RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
-                                  IAccessibleHolder* aParentCOMProxy)
-{
-  RefPtr<IAccessible> ptr(aCOMProxy.Get());
-  SetCOMInterface(ptr);
-
-  Accessible* outerDoc = OuterDocOfRemoteBrowser();
-  MOZ_ASSERT(outerDoc);
-  IAccessible* rawNative = nullptr;
-  if (outerDoc) {
-    outerDoc->GetNativeInterface((void**) &rawNative);
-  }
-
-  aParentCOMProxy->Set(IAccessibleHolder::COMPtrType(rawNative));
-  return true;
-}
-#endif // defined(XP_WIN)
-
 } // a11y
 } // mozilla
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -3,18 +3,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_DocAccessibleParent_h
 #define mozilla_a11y_DocAccessibleParent_h
 
 #include "nsAccessibilityService.h"
+#include "ProxyAccessible.h"
 #include "mozilla/a11y/PDocAccessibleParent.h"
-#include "mozilla/a11y/ProxyAccessible.h"
 #include "nsClassHashtable.h"
 #include "nsHashKeys.h"
 #include "nsISupportsImpl.h"
 
 namespace mozilla {
 namespace a11y {
 
 class xpcAccessibleGeneric;
@@ -137,21 +137,16 @@ public:
 
   const ProxyAccessible* GetAccessible(uintptr_t aID) const
     { return const_cast<DocAccessibleParent*>(this)->GetAccessible(aID); }
 
   size_t ChildDocCount() const { return mChildDocs.Length(); }
   const DocAccessibleParent* ChildDocAt(size_t aIdx) const
     { return mChildDocs[aIdx]; }
 
-#if defined(XP_WIN)
-  virtual bool RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
-                            IAccessibleHolder* aParentCOMProxy) override;
-#endif
-
 private:
 
   class ProxyEntry : public PLDHashEntryHdr
   {
   public:
     explicit ProxyEntry(const void*) : mProxy(nullptr) {}
     ProxyEntry(ProxyEntry&& aOther) :
       mProxy(aOther.mProxy) { aOther.mProxy = nullptr; }
rename from accessible/ipc/win/PDocAccessible.ipdl
rename to accessible/ipc/PDocAccessible.ipdl
--- a/accessible/ipc/win/PDocAccessible.ipdl
+++ b/accessible/ipc/PDocAccessible.ipdl
@@ -1,44 +1,54 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+include protocol PFileDescriptorSet;
 include protocol PBrowser;
 
-using mozilla::a11y::IAccessibleHolder from "mozilla/a11y/COMPtrTypes.h";
+include "mozilla/GfxMessageUtils.h";
+
+using nsIntRect from "nsRect.h";
+using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
+using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
 
 namespace mozilla {
 namespace a11y {
 
 struct AccessibleData
 {
   uint64_t ID;
   uint32_t Role;
   uint32_t ChildrenCount;
   uint32_t Interfaces;
-  IAccessibleHolder COMProxy;
 };
 
 struct ShowEventData
 {
   uint64_t ID;
   uint32_t Idx;
   AccessibleData[] NewTree;
 };
 
 struct Attribute
 {
   nsCString Name;
   nsString Value;
 };
 
-sync protocol PDocAccessible
+struct RelationTargets
+{
+  uint32_t Type;
+  uint64_t[] Targets;
+};
+
+prio(normal upto high) sync protocol PDocAccessible
 {
   manager PBrowser;
 
 parent:
   async Shutdown();
 
   /*
    * Notify the parent process the document in the child process is firing an
@@ -55,19 +65,197 @@ parent:
   async RoleChangedEvent(uint32_t aRole);
 
   /*
    * Tell the parent document to bind the existing document as a new child
    * document.
    */
   async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
 
-  // For now we'll add the command to send the proxy here. This might move to
-  // PDocAccessible constructor in PBrowser.
-  sync COMProxy(IAccessibleHolder aDocCOMProxy)
-    returns(IAccessibleHolder aParentCOMProxy);
-
 child:
   async __delete__();
+
+  // Accessible
+  prio(high) sync State(uint64_t aID) returns(uint64_t states);
+  prio(high) sync NativeState(uint64_t aID) returns(uint64_t states);
+  prio(high) sync Name(uint64_t aID) returns(nsString name);
+  prio(high) sync Value(uint64_t aID) returns(nsString value);
+  prio(high) sync Help(uint64_t aID) returns(nsString help);
+  prio(high) sync Description(uint64_t aID) returns(nsString desc);
+  prio(high) sync Attributes(uint64_t aID) returns(Attribute[] attributes);
+  prio(high) sync RelationByType(uint64_t aID, uint32_t aRelationType)
+    returns(uint64_t[] targets);
+  prio(high) sync Relations(uint64_t aID) returns(RelationTargets[] relations);
+  prio(high) sync IsSearchbox(uint64_t aID) returns(bool retval);
+  prio(high) sync LandmarkRole(uint64_t aID) returns(nsString landmark);
+  prio(high) sync ARIARoleAtom(uint64_t aID) returns(nsString role);
+  prio(high) sync GetLevelInternal(uint64_t aID) returns(int32_t aLevel);
+  async ScrollTo(uint64_t aID, uint32_t aScrollType);
+  async ScrollToPoint(uint64_t aID, uint32_t aScrollType, int32_t aX,
+                      int32_t aY);
+
+  // AccessibleText
+
+  // TextSubstring is getText in IDL.
+  prio(high) sync CaretLineNumber(uint64_t aID) returns(int32_t aLineNumber);
+  prio(high) sync CaretOffset(uint64_t aID) returns(int32_t aOffset);
+   async SetCaretOffset(uint64_t aID, int32_t aOffset);
+  prio(high) sync CharacterCount(uint64_t aID) returns(int32_t aCount);
+  prio(high) sync SelectionCount(uint64_t aID) returns(int32_t aCount);
+  prio(high) sync TextSubstring(uint64_t aID, int32_t aStartOffset, int32_t
+                                aEndOffset) returns(nsString aText, bool aValid);
+  prio(high) sync GetTextAfterOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
+    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
+  prio(high) sync GetTextAtOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
+    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
+
+  prio(high) sync GetTextBeforeOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
+    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
+  prio(high) sync CharAt(uint64_t aID, int32_t aOffset) returns(uint16_t aChar);
+
+  prio(high) sync TextAttributes(uint64_t aID, bool aIncludeDefAttrs, int32_t aOffset)
+    returns(Attribute[] aAttributes, int32_t aStartOffset, int32_t aEndOffset);
+  prio(high) sync DefaultTextAttributes(uint64_t aID) returns(Attribute[] aAttributes);
+
+  prio(high) sync TextBounds(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
+                             uint32_t aCoordType)
+    returns(nsIntRect aRetVal);
+  prio(high) sync CharBounds(uint64_t aID, int32_t aOffset, uint32_t aCoordType)
+    returns(nsIntRect aRetVal);
+
+  prio(high) sync OffsetAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aCoordType)
+    returns(int32_t aRetVal);
+
+  prio(high) sync SelectionBoundsAt(uint64_t aID, int32_t aSelectionNum)
+    returns(bool aSucceeded, nsString aData, int32_t aStartOffset, int32_t aEndOffset);
+  prio(high) sync SetSelectionBoundsAt(uint64_t aID, int32_t aSelectionNum,
+                                       int32_t aStartOffset, int32_t aEndOffset)
+    returns(bool aSucceeded);
+  prio(high) sync AddToSelection(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset)
+    returns(bool aSucceeded);
+  prio(high) sync RemoveFromSelection(uint64_t aID, int32_t aSelectionNum)
+    returns(bool aSucceeded);
+
+  async ScrollSubstringTo(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
+                          uint32_t aScrollType);
+  async ScrollSubstringToPoint(uint64_t aID,
+                               int32_t aStartOffset,
+                               int32_t aEndOffset,
+                               uint32_t aCoordinateType,
+                               int32_t aX, int32_t aY);
+
+  prio(high) sync Text(uint64_t aID) returns(nsString aText);
+  prio(high) sync ReplaceText(uint64_t aID, nsString aText);
+  prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition)
+    returns(bool aValid);
+  prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
+    returns(bool aValid);
+  prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
+    returns(bool aValid);
+  prio(high) sync DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
+    returns(bool aValid);
+  prio(high) sync PasteText(uint64_t aID, int32_t aPosition)
+    returns(bool aValid);
+
+  prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(IntPoint aRetVal);
+  prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
+
+  prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
+  prio(high) sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
+  prio(high) sync IsLinkValid(uint64_t aID) returns(bool aRetVal);
+  prio(high) sync AnchorCount(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
+  prio(high) sync AnchorURIAt(uint64_t aID, uint32_t aIndex) returns(nsCString aURI, bool aOk);
+  prio(high) sync AnchorAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfAnchor, bool aOk);
+
+  prio(high) sync LinkCount(uint64_t aID) returns(uint32_t aCount);
+  prio(high) sync LinkAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfLink, bool aOk);
+  prio(high) sync LinkIndexOf(uint64_t aID, uint64_t aLinkID) returns(int32_t aIndex);
+  prio(high) sync LinkIndexAtOffset(uint64_t aID, uint32_t aOffset) returns(int32_t aIndex);
+
+  prio(high) sync TableOfACell(uint64_t aID) returns(uint64_t aTableID, bool aOk);
+  prio(high) sync ColIdx(uint64_t aID) returns(uint32_t aIndex);
+  prio(high) sync RowIdx(uint64_t aID) returns(uint32_t aIndex);
+  prio(high) sync ColExtent(uint64_t aID) returns(uint32_t aExtent);
+  prio(high) sync RowExtent(uint64_t aID) returns(uint32_t aExtent);
+  prio(high) sync ColHeaderCells(uint64_t aID) returns(uint64_t[] aCells);
+  prio(high) sync RowHeaderCells(uint64_t aID) returns(uint64_t[] aCells);
+  prio(high) sync IsCellSelected(uint64_t aID) returns(bool aSelected);
+
+  prio(high) sync TableCaption(uint64_t aID) returns(uint64_t aCaptionID, bool aOk);
+  prio(high) sync TableSummary(uint64_t aID) returns(nsString aSummary);
+  prio(high) sync TableColumnCount(uint64_t aID) returns(uint32_t aColCount);
+  prio(high) sync TableRowCount(uint64_t aID) returns(uint32_t aRowCount);
+  prio(high) sync TableCellAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint64_t aCellID, bool aOk);
+  prio(high) sync TableCellIndexAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(int32_t aIndex);
+  prio(high) sync TableColumnIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aCol);
+  prio(high) sync TableRowIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow);
+  prio(high) sync TableRowAndColumnIndicesAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow, int32_t aCol);
+  prio(high) sync TableColumnExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent);
+  prio(high) sync TableRowExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent);
+  prio(high) sync TableColumnDescription(uint64_t aID, uint32_t aCol) returns(nsString aDescription);
+  prio(high) sync TableRowDescription(uint64_t aID, uint32_t aRow) returns(nsString aDescription);
+  prio(high) sync TableColumnSelected(uint64_t aID, uint32_t aCol) returns(bool aSelected);
+  prio(high) sync TableRowSelected(uint64_t aID, uint32_t aRow) returns(bool aSelected);
+  prio(high) sync TableCellSelected(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(bool aSelected);
+  prio(high) sync TableSelectedCellCount(uint64_t aID) returns(uint32_t aSelectedCells);
+  prio(high) sync TableSelectedColumnCount(uint64_t aID) returns(uint32_t aSelectedColumns);
+  prio(high) sync TableSelectedRowCount(uint64_t aID) returns(uint32_t aSelectedRows);
+  prio(high) sync TableSelectedCells(uint64_t aID) returns(uint64_t[] aCellIDs);
+  prio(high) sync TableSelectedCellIndices(uint64_t aID) returns(uint32_t[] aCellIndeces);
+  prio(high) sync TableSelectedColumnIndices(uint64_t aID) returns(uint32_t[] aColumnIndeces);
+  prio(high) sync TableSelectedRowIndices(uint64_t aID) returns(uint32_t[] aRowIndeces);
+  prio(high) sync TableSelectColumn(uint64_t aID, uint32_t aCol);
+  prio(high) sync TableSelectRow(uint64_t aID, uint32_t aRow);
+  prio(high) sync TableUnselectColumn(uint64_t aID, uint32_t aCol);
+  prio(high) sync TableUnselectRow(uint64_t aID, uint32_t aRow);
+  prio(high) sync TableIsProbablyForLayout(uint64_t aID) returns(bool aForLayout);
+  prio(high) sync AtkTableColumnHeader(uint64_t aID, int32_t aCol)
+    returns(uint64_t aHeaderID, bool aOk);
+  prio(high) sync AtkTableRowHeader(uint64_t aID, int32_t aRow)
+    returns(uint64_t aHeaderID, bool aOk);
+
+  prio(high) sync SelectedItems(uint64_t aID) returns(uint64_t[] aSelectedItemIDs);
+  prio(high) sync SelectedItemCount(uint64_t aID) returns(uint32_t aCount);
+  prio(high) sync GetSelectedItem(uint64_t aID, uint32_t aIndex) returns(uint64_t aSelected, bool aOk);
+  prio(high) sync IsItemSelected(uint64_t aID, uint32_t aIndex) returns(bool aSelected);
+  prio(high) sync AddItemToSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess);
+  prio(high) sync RemoveItemFromSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess);
+  prio(high) sync SelectAll(uint64_t aID) returns(bool aSuccess);
+  prio(high) sync UnselectAll(uint64_t aID) returns(bool aSuccess);
+
+  async TakeSelection(uint64_t aID);
+  async SetSelected(uint64_t aID, bool aSelected);
+
+  prio(high) sync DoAction(uint64_t aID, uint8_t aIndex) returns(bool aSuccess);
+  prio(high) sync ActionCount(uint64_t aID) returns(uint8_t aCount);
+  prio(high) sync ActionDescriptionAt(uint64_t aID, uint8_t aIndex) returns(nsString aDescription);
+  prio(high) sync ActionNameAt(uint64_t aID, uint8_t aIndex) returns(nsString aName);
+  prio(high) sync AccessKey(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
+  prio(high) sync KeyboardShortcut(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
+  prio(high) sync AtkKeyBinding(uint64_t aID) returns(nsString aResult);
+
+  prio(high) sync CurValue(uint64_t aID) returns(double aValue);
+  prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);
+  prio(high) sync MinValue(uint64_t aID) returns(double aValue);
+  prio(high) sync MaxValue(uint64_t aID) returns(double aValue);
+  prio(high) sync Step(uint64_t aID) returns(double aStep);
+
+  async TakeFocus(uint64_t aID);
+  prio(high) sync FocusedChild(uint64_t aID)
+    returns(uint64_t aChild, bool aOk);
+
+  prio(high) sync Language(uint64_t aID) returns(nsString aLocale);
+  prio(high) sync DocType(uint64_t aID) returns(nsString aType);
+  prio(high) sync Title(uint64_t aID) returns(nsString aTitle);
+  prio(high) sync URL(uint64_t aID) returns(nsString aURL);
+  prio(high) sync MimeType(uint64_t aID) returns(nsString aMime);
+  prio(high) sync URLDocTypeMimeType(uint64_t aID) returns(nsString aURL, nsString aDocType, nsString aMimeType);
+
+  prio(high) sync AccessibleAtPoint(uint64_t aID, int32_t aX, int32_t aY, bool aNeedsScreenCoords, uint32_t aWhich)
+    returns(uint64_t aResult, bool aOk);
+
+  prio(high) sync Extents(uint64_t aID, bool aNeedsScreenCoords)
+    returns(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight);
+  prio(high) sync DOMNodeID(uint64_t aID) returns(nsString aDOMNodeID);
 };
 
 }
 }
rename from accessible/ipc/win/ProxyAccessible.cpp
rename to accessible/ipc/ProxyAccessible.cpp
--- a/accessible/ipc/win/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -1,280 +1,1192 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "Accessible2.h"
 #include "ProxyAccessible.h"
-#include "mozilla/a11y/DocAccessibleParent.h"
+#include "DocAccessibleParent.h"
 #include "DocAccessible.h"
 #include "mozilla/a11y/DocManager.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/unused.h"
 #include "mozilla/a11y/Platform.h"
 #include "RelationType.h"
 #include "mozilla/a11y/Role.h"
 #include "xpcAccessibleDocument.h"
 
-#include <comutil.h>
-
 namespace mozilla {
 namespace a11y {
 
-bool
-ProxyAccessible::GetCOMInterface(void** aOutAccessible) const
+void
+ProxyAccessible::Shutdown()
 {
-  if (!aOutAccessible) {
-    return false;
-  }
-  RefPtr<IAccessible> addRefed = mCOMProxy;
-  addRefed.forget(aOutAccessible);
-  return !!mCOMProxy;
-}
-
-void
-ProxyAccessible::Name(nsString& aName) const
-{
-  aName.Truncate();
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return;
+  MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
+  NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
+  xpcAccessibleDocument* xpcDoc =
+    GetAccService()->GetCachedXPCDocument(Document());
+  if (xpcDoc) {
+    xpcDoc->NotifyOfShutdown(this);
   }
 
-  VARIANT id;
-  id.vt = VT_I4;
-  id.lVal = CHILDID_SELF;
-  BSTR result;
-  HRESULT hr = acc->get_accName(id, &result);
-  _bstr_t resultWrap(result, false);
-  if (FAILED(hr)) {
-    return;
+  // XXX Ideally  this wouldn't be necessary, but it seems OuterDoc accessibles
+  // can be destroyed before the doc they own.
+  if (!mOuterDoc) {
+    uint32_t childCount = mChildren.Length();
+    for (uint32_t idx = 0; idx < childCount; idx++)
+      mChildren[idx]->Shutdown();
+  } else {
+    if (mChildren.Length() != 1)
+      MOZ_CRASH("outer doc doesn't own adoc!");
+
+    mChildren[0]->AsDoc()->Unbind();
   }
-  aName = (wchar_t*)resultWrap;
+
+  mChildren.Clear();
+  ProxyDestroyed(this);
+  mDoc->RemoveAccessible(this);
 }
 
 void
-ProxyAccessible::Value(nsString& aValue) const
+ProxyAccessible::SetChildDoc(DocAccessibleParent* aParent)
 {
-  aValue.Truncate();
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return;
+  if (aParent) {
+    MOZ_ASSERT(mChildren.IsEmpty());
+    mChildren.AppendElement(aParent);
+    mOuterDoc = true;
+  } else {
+    MOZ_ASSERT(mChildren.Length() == 1);
+    mChildren.Clear();
+    mOuterDoc = false;
   }
-
-  VARIANT id;
-  id.vt = VT_I4;
-  id.lVal = CHILDID_SELF;
-  BSTR result;
-  HRESULT hr = acc->get_accValue(id, &result);
-  _bstr_t resultWrap(result, false);
-  if (FAILED(hr)) {
-    return;
-  }
-  aValue = (wchar_t*)resultWrap;
 }
 
-void
-ProxyAccessible::Description(nsString& aDesc) const
+bool
+ProxyAccessible::MustPruneChildren() const
 {
-  aDesc.Truncate();
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return;
-  }
+  // this is the equivalent to nsAccUtils::MustPrune for proxies and should be
+  // kept in sync with that.
+  if (mRole != roles::MENUITEM && mRole != roles::COMBOBOX_OPTION
+      && mRole != roles::OPTION && mRole != roles::ENTRY
+      && mRole != roles::FLAT_EQUATION && mRole != roles::PASSWORD_TEXT
+      && mRole != roles::PUSHBUTTON && mRole != roles::TOGGLE_BUTTON
+      && mRole != roles::GRAPHIC && mRole != roles::SLIDER
+      && mRole != roles::PROGRESSBAR && mRole != roles::SEPARATOR)
+    return false;
 
-  VARIANT id;
-  id.vt = VT_I4;
-  id.lVal = CHILDID_SELF;
-  BSTR result;
-  HRESULT hr = acc->get_accDescription(id, &result);
-  _bstr_t resultWrap(result, false);
-  if (FAILED(hr)) {
-    return;
-  }
-  aDesc = (wchar_t*)resultWrap;
+  if (mChildren.Length() != 1)
+    return false;
+
+  return mChildren[0]->Role() == roles::TEXT_LEAF
+    || mChildren[0]->Role() == roles::STATICTEXT;
 }
 
 uint64_t
 ProxyAccessible::State() const
 {
   uint64_t state = 0;
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return state;
+  Unused << mDoc->SendState(mID, &state);
+  return state;
+}
+
+uint64_t
+ProxyAccessible::NativeState() const
+{
+  uint64_t state = 0;
+  Unused << mDoc->SendNativeState(mID, &state);
+  return state;
+}
+
+void
+ProxyAccessible::Name(nsString& aName) const
+{
+  Unused << mDoc->SendName(mID, &aName);
+}
+
+void
+ProxyAccessible::Value(nsString& aValue) const
+{
+  Unused << mDoc->SendValue(mID, &aValue);
+}
+
+void
+ProxyAccessible::Help(nsString& aHelp) const
+{
+  Unused << mDoc->SendHelp(mID, &aHelp);
+}
+
+void
+ProxyAccessible::Description(nsString& aDesc) const
+{
+  Unused << mDoc->SendDescription(mID, &aDesc);
+}
+
+void
+ProxyAccessible::Attributes(nsTArray<Attribute> *aAttrs) const
+{
+  Unused << mDoc->SendAttributes(mID, aAttrs);
+}
+
+nsTArray<ProxyAccessible*>
+ProxyAccessible::RelationByType(RelationType aType) const
+{
+  nsTArray<uint64_t> targetIDs;
+  Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
+                                     &targetIDs);
+
+  size_t targetCount = targetIDs.Length();
+  nsTArray<ProxyAccessible*> targets(targetCount);
+  for (size_t i = 0; i < targetCount; i++)
+    if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
+      targets.AppendElement(proxy);
+
+  return Move(targets);
+}
+
+void
+ProxyAccessible::Relations(nsTArray<RelationType>* aTypes,
+                           nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets)
+  const
+{
+  nsTArray<RelationTargets> ipcRelations;
+  Unused << mDoc->SendRelations(mID, &ipcRelations);
+
+  size_t relationCount = ipcRelations.Length();
+  aTypes->SetCapacity(relationCount);
+  aTargetSets->SetCapacity(relationCount);
+  for (size_t i = 0; i < relationCount; i++) {
+    uint32_t type = ipcRelations[i].Type();
+    if (type > static_cast<uint32_t>(RelationType::LAST))
+      continue;
+
+    size_t targetCount = ipcRelations[i].Targets().Length();
+    nsTArray<ProxyAccessible*> targets(targetCount);
+    for (size_t j = 0; j < targetCount; j++)
+      if (ProxyAccessible* proxy = mDoc->GetAccessible(ipcRelations[i].Targets()[j]))
+        targets.AppendElement(proxy);
+
+    if (targets.IsEmpty())
+      continue;
+
+    aTargetSets->AppendElement(Move(targets));
+    aTypes->AppendElement(static_cast<RelationType>(type));
+  }
+}
+
+bool
+ProxyAccessible::IsSearchbox() const
+{
+  bool retVal = false;
+  Unused << mDoc->SendIsSearchbox(mID, &retVal);
+  return retVal;
+}
+
+nsIAtom*
+ProxyAccessible::LandmarkRole() const
+{
+  nsString landmark;
+  Unused << mDoc->SendLandmarkRole(mID, &landmark);
+  return NS_GetStaticAtom(landmark);
+}
+
+nsIAtom*
+ProxyAccessible::ARIARoleAtom() const
+{
+  nsString role;
+  Unused << mDoc->SendARIARoleAtom(mID, &role);
+  return NS_GetStaticAtom(role);
+}
+
+int32_t
+ProxyAccessible::GetLevelInternal()
+{
+  int32_t level = 0;
+  Unused << mDoc->SendGetLevelInternal(mID, &level);
+  return level;
+}
+
+void
+ProxyAccessible::ScrollTo(uint32_t aScrollType)
+{
+  Unused << mDoc->SendScrollTo(mID, aScrollType);
+}
+
+void
+ProxyAccessible::ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY)
+{
+  Unused << mDoc->SendScrollToPoint(mID, aScrollType, aX, aY);
+}
+
+int32_t
+ProxyAccessible::CaretLineNumber()
+{
+  int32_t line = -1;
+  Unused << mDoc->SendCaretOffset(mID, &line);
+  return line;
+}
+
+int32_t
+ProxyAccessible::CaretOffset()
+{
+  int32_t offset = 0;
+  Unused << mDoc->SendCaretOffset(mID, &offset);
+  return offset;
+}
+
+void
+ProxyAccessible::SetCaretOffset(int32_t aOffset)
+{
+  Unused << mDoc->SendSetCaretOffset(mID, aOffset);
+}
+
+int32_t
+ProxyAccessible::CharacterCount()
+{
+  int32_t count = 0;
+  Unused << mDoc->SendCharacterCount(mID, &count);
+  return count;
+}
+
+int32_t
+ProxyAccessible::SelectionCount()
+{
+  int32_t count = 0;
+  Unused << mDoc->SendSelectionCount(mID, &count);
+  return count;
+}
+
+bool
+ProxyAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
+                               nsString& aText) const
+{
+  bool valid;
+  Unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid);
+  return valid;
+}
+
+void
+ProxyAccessible::GetTextAfterOffset(int32_t aOffset,
+                                    AccessibleTextBoundary aBoundaryType,
+                                    nsString& aText, int32_t* aStartOffset,
+                                    int32_t* aEndOffset)
+{
+  Unused << mDoc->SendGetTextAfterOffset(mID, aOffset, aBoundaryType,
+                                         &aText, aStartOffset, aEndOffset);
+}
+
+void
+ProxyAccessible::GetTextAtOffset(int32_t aOffset,
+                                 AccessibleTextBoundary aBoundaryType,
+                                 nsString& aText, int32_t* aStartOffset,
+                                 int32_t* aEndOffset)
+{
+  Unused << mDoc->SendGetTextAtOffset(mID, aOffset, aBoundaryType,
+                                      &aText, aStartOffset, aEndOffset);
+}
+
+void
+ProxyAccessible::GetTextBeforeOffset(int32_t aOffset,
+                                     AccessibleTextBoundary aBoundaryType,
+                                     nsString& aText, int32_t* aStartOffset,
+                                     int32_t* aEndOffset)
+{
+  Unused << mDoc->SendGetTextBeforeOffset(mID, aOffset, aBoundaryType,
+                                          &aText, aStartOffset, aEndOffset);
+}
+
+char16_t
+ProxyAccessible::CharAt(int32_t aOffset)
+{
+  uint16_t retval = 0;
+  Unused << mDoc->SendCharAt(mID, aOffset, &retval);
+  return static_cast<char16_t>(retval);
+}
+
+void
+ProxyAccessible::TextAttributes(bool aIncludeDefAttrs,
+                                int32_t aOffset,
+                                nsTArray<Attribute>* aAttributes,
+                                int32_t* aStartOffset,
+                                int32_t* aEndOffset)
+{
+  Unused << mDoc->SendTextAttributes(mID, aIncludeDefAttrs, aOffset,
+                                     aAttributes, aStartOffset, aEndOffset);
+}
+
+void
+ProxyAccessible::DefaultTextAttributes(nsTArray<Attribute>* aAttrs)
+{
+  Unused << mDoc->SendDefaultTextAttributes(mID, aAttrs);
+}
+
+nsIntRect
+ProxyAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
+                            uint32_t aCoordType)
+{
+  nsIntRect rect;
+  Unused <<
+    mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType, &rect);
+  return rect;
+}
+
+nsIntRect
+ProxyAccessible::CharBounds(int32_t aOffset, uint32_t aCoordType)
+{
+  nsIntRect rect;
+  Unused <<
+    mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect);
+  return rect;
+}
+
+int32_t
+ProxyAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType)
+{
+  int32_t retVal = -1;
+  Unused << mDoc->SendOffsetAtPoint(mID, aX, aY, aCoordType, &retVal);
+  return retVal;
+}
+
+bool
+ProxyAccessible::SelectionBoundsAt(int32_t aSelectionNum,
+                                   nsString& aData,
+                                   int32_t* aStartOffset,
+                                   int32_t* aEndOffset)
+{
+  bool retVal = false;
+  Unused << mDoc->SendSelectionBoundsAt(mID, aSelectionNum, &retVal, &aData,
+                                        aStartOffset, aEndOffset);
+  return retVal;
+}
+
+bool
+ProxyAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
+                                      int32_t aStartOffset,
+                                      int32_t aEndOffset)
+{
+  bool retVal = false;
+  Unused << mDoc->SendSetSelectionBoundsAt(mID, aSelectionNum, aStartOffset,
+                                           aEndOffset, &retVal);
+  return retVal;
+}
+
+bool
+ProxyAccessible::AddToSelection(int32_t aStartOffset,
+                                int32_t aEndOffset)
+{
+  bool retVal = false;
+  Unused << mDoc->SendAddToSelection(mID, aStartOffset, aEndOffset, &retVal);
+  return retVal;
+}
+
+bool
+ProxyAccessible::RemoveFromSelection(int32_t aSelectionNum)
+{
+  bool retVal = false;
+  Unused << mDoc->SendRemoveFromSelection(mID, aSelectionNum, &retVal);
+  return retVal;
+}
+
+void
+ProxyAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
+                                   uint32_t aScrollType)
+{
+  Unused << mDoc->SendScrollSubstringTo(mID, aStartOffset, aEndOffset, aScrollType);
+}
+
+void
+ProxyAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
+                                        int32_t aEndOffset,
+                                        uint32_t aCoordinateType,
+                                        int32_t aX, int32_t aY)
+{
+  Unused << mDoc->SendScrollSubstringToPoint(mID, aStartOffset, aEndOffset,
+                                             aCoordinateType, aX, aY);
+}
+
+void
+ProxyAccessible::Text(nsString* aText)
+{
+  Unused << mDoc->SendText(mID, aText);
+}
+
+void
+ProxyAccessible::ReplaceText(const nsString& aText)
+{
+  Unused << mDoc->SendReplaceText(mID, aText);
+}
+
+bool
+ProxyAccessible::InsertText(const nsString& aText, int32_t aPosition)
+{
+  bool valid;
+  Unused << mDoc->SendInsertText(mID, aText, aPosition, &valid);
+  return valid;
+}
+
+bool
+ProxyAccessible::CopyText(int32_t aStartPos, int32_t aEndPos)
+{
+  bool valid;
+  Unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid);
+  return valid;
+}
+
+bool
+ProxyAccessible::CutText(int32_t aStartPos, int32_t aEndPos)
+{
+  bool valid;
+  Unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid);
+  return valid;
+}
+
+bool
+ProxyAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos)
+{
+  bool valid;
+  Unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid);
+  return valid;
+}
+
+bool
+ProxyAccessible::PasteText(int32_t aPosition)
+{
+  bool valid;
+  Unused << mDoc->SendPasteText(mID, aPosition, &valid);
+  return valid;
+}
+
+nsIntPoint
+ProxyAccessible::ImagePosition(uint32_t aCoordType)
+{
+  nsIntPoint retVal;
+  Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal);
+  return retVal;
+}
+
+nsIntSize
+ProxyAccessible::ImageSize()
+{
+  nsIntSize retVal;
+  Unused << mDoc->SendImageSize(mID, &retVal);
+  return retVal;
+}
+
+uint32_t
+ProxyAccessible::StartOffset(bool* aOk)
+{
+  uint32_t retVal = 0;
+  Unused << mDoc->SendStartOffset(mID, &retVal, aOk);
+  return retVal;
+}
+
+uint32_t
+ProxyAccessible::EndOffset(bool* aOk)
+{
+  uint32_t retVal = 0;
+  Unused << mDoc->SendEndOffset(mID, &retVal, aOk);
+  return retVal;
+}
+
+bool
+ProxyAccessible::IsLinkValid()
+{
+  bool retVal = false;
+  Unused << mDoc->SendIsLinkValid(mID, &retVal);
+  return retVal;
+}
+
+uint32_t
+ProxyAccessible::AnchorCount(bool* aOk)
+{
+  uint32_t retVal = 0;
+  Unused << mDoc->SendAnchorCount(mID, &retVal, aOk);
+  return retVal;
+}
+
+void
+ProxyAccessible::AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk)
+{
+  Unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk);
+}
+
+ProxyAccessible*
+ProxyAccessible::AnchorAt(uint32_t aIndex)
+{
+  uint64_t id = 0;
+  bool ok = false;
+  Unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok);
+  return ok ? mDoc->GetAccessible(id) : nullptr;
+}
+
+uint32_t
+ProxyAccessible::LinkCount()
+{
+  uint32_t retVal = 0;
+  Unused << mDoc->SendLinkCount(mID, &retVal);
+  return retVal;
+}
+
+ProxyAccessible*
+ProxyAccessible::LinkAt(const uint32_t& aIndex)
+{
+  uint64_t linkID = 0;
+  bool ok = false;
+  Unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok);
+  return ok ? mDoc->GetAccessible(linkID) : nullptr;
+}
+
+int32_t
+ProxyAccessible::LinkIndexOf(ProxyAccessible* aLink)
+{
+  int32_t retVal = -1;
+  if (aLink) {
+    Unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal);
   }
 
-  VARIANT id;
-  id.vt = VT_I4;
-  id.lVal = CHILDID_SELF;
-  VARIANT varState;
-  HRESULT hr = acc->get_accState(id, &varState);
-  if (FAILED(hr)) {
-    return state;
+  return retVal;
+}
+
+int32_t
+ProxyAccessible::LinkIndexAtOffset(uint32_t aOffset)
+{
+  int32_t retVal = -1;
+  Unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal);
+  return retVal;
+}
+
+ProxyAccessible*
+ProxyAccessible::TableOfACell()
+{
+  uint64_t tableID = 0;
+  bool ok = false;
+  Unused << mDoc->SendTableOfACell(mID, &tableID, &ok);
+  return ok ? mDoc->GetAccessible(tableID) : nullptr;
+}
+
+uint32_t
+ProxyAccessible::ColIdx()
+{
+  uint32_t index = 0;
+  Unused << mDoc->SendColIdx(mID, &index);
+  return index;
+}
+
+uint32_t
+ProxyAccessible::RowIdx()
+{
+  uint32_t index = 0;
+  Unused << mDoc->SendRowIdx(mID, &index);
+  return index;
+}
+
+uint32_t
+ProxyAccessible::ColExtent()
+{
+  uint32_t extent = 0;
+  Unused << mDoc->SendColExtent(mID, &extent);
+  return extent;
+}
+
+uint32_t
+ProxyAccessible::RowExtent()
+{
+  uint32_t extent = 0;
+  Unused << mDoc->SendRowExtent(mID, &extent);
+  return extent;
+}
+
+void
+ProxyAccessible::ColHeaderCells(nsTArray<ProxyAccessible*>* aCells)
+{
+  nsTArray<uint64_t> targetIDs;
+  Unused << mDoc->SendColHeaderCells(mID, &targetIDs);
+
+  size_t targetCount = targetIDs.Length();
+  for (size_t i = 0; i < targetCount; i++) {
+    aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
+  }
+}
+
+void
+ProxyAccessible::RowHeaderCells(nsTArray<ProxyAccessible*>* aCells)
+{
+  nsTArray<uint64_t> targetIDs;
+  Unused << mDoc->SendRowHeaderCells(mID, &targetIDs);
+
+  size_t targetCount = targetIDs.Length();
+  for (size_t i = 0; i < targetCount; i++) {
+    aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
+  }
+}
+
+bool
+ProxyAccessible::IsCellSelected()
+{
+  bool selected = false;
+  Unused << mDoc->SendIsCellSelected(mID, &selected);
+  return selected;
+}
+
+ProxyAccessible*
+ProxyAccessible::TableCaption()
+{
+  uint64_t captionID = 0;
+  bool ok = false;
+  Unused << mDoc->SendTableCaption(mID, &captionID, &ok);
+  return ok ? mDoc->GetAccessible(captionID) : nullptr;
+}
+
+void
+ProxyAccessible::TableSummary(nsString& aSummary)
+{
+  Unused << mDoc->SendTableSummary(mID, &aSummary);
+}
+
+uint32_t
+ProxyAccessible::TableColumnCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendTableColumnCount(mID, &count);
+  return count;
+}
+
+uint32_t
+ProxyAccessible::TableRowCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendTableRowCount(mID, &count);
+  return count;
+}
+
+ProxyAccessible*
+ProxyAccessible::TableCellAt(uint32_t aRow, uint32_t aCol)
+{
+  uint64_t cellID = 0;
+  bool ok = false;
+  Unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok);
+  return ok ? mDoc->GetAccessible(cellID) : nullptr;
+}
+
+int32_t
+ProxyAccessible::TableCellIndexAt(uint32_t aRow, uint32_t aCol)
+{
+  int32_t index = 0;
+  Unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index);
+  return index;
+}
+
+int32_t
+ProxyAccessible::TableColumnIndexAt(uint32_t aCellIndex)
+{
+  int32_t index = 0;
+  Unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index);
+  return index;
+}
+
+int32_t
+ProxyAccessible::TableRowIndexAt(uint32_t aCellIndex)
+{
+  int32_t index = 0;
+  Unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index);
+  return index;
+}
+
+void
+ProxyAccessible::TableRowAndColumnIndicesAt(uint32_t aCellIndex,
+                                            int32_t* aRow, int32_t* aCol)
+{
+  Unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol);
+}
+
+uint32_t
+ProxyAccessible::TableColumnExtentAt(uint32_t aRow, uint32_t aCol)
+{
+  uint32_t extent = 0;
+  Unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent);
+  return extent;
+}
+
+uint32_t
+ProxyAccessible::TableRowExtentAt(uint32_t aRow, uint32_t aCol)
+{
+  uint32_t extent = 0;
+  Unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent);
+  return extent;
+}
+
+void
+ProxyAccessible::TableColumnDescription(uint32_t aCol, nsString& aDescription)
+{
+  Unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription);
+}
+
+void
+ProxyAccessible::TableRowDescription(uint32_t aRow, nsString& aDescription)
+{
+  Unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription);
+}
+
+bool
+ProxyAccessible::TableColumnSelected(uint32_t aCol)
+{
+  bool selected = false;
+  Unused << mDoc->SendTableColumnSelected(mID, aCol, &selected);
+  return selected;
+}
+
+bool
+ProxyAccessible::TableRowSelected(uint32_t aRow)
+{
+  bool selected = false;
+  Unused << mDoc->SendTableRowSelected(mID, aRow, &selected);
+  return selected;
+}
+
+bool
+ProxyAccessible::TableCellSelected(uint32_t aRow, uint32_t aCol)
+{
+  bool selected = false;
+  Unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected);
+  return selected;
+}
+
+uint32_t
+ProxyAccessible::TableSelectedCellCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendTableSelectedCellCount(mID, &count);
+  return count;
+}
+
+uint32_t
+ProxyAccessible::TableSelectedColumnCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendTableSelectedColumnCount(mID, &count);
+  return count;
+}
+
+uint32_t
+ProxyAccessible::TableSelectedRowCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendTableSelectedRowCount(mID, &count);
+  return count;
+}
+
+void
+ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
+{
+  AutoTArray<uint64_t, 30> cellIDs;
+  Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
+  aCellIDs->SetCapacity(cellIDs.Length());
+  for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
+    aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i]));
   }
-  return uint64_t(varState.lVal);
+}
+
+void
+ProxyAccessible::TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices)
+{
+  Unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices);
+}
+
+void
+ProxyAccessible::TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices)
+{
+  Unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices);
+}
+
+void
+ProxyAccessible::TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices)
+{
+  Unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices);
+}
+
+void
+ProxyAccessible::TableSelectColumn(uint32_t aCol)
+{
+  Unused << mDoc->SendTableSelectColumn(mID, aCol);
+}
+
+void
+ProxyAccessible::TableSelectRow(uint32_t aRow)
+{
+  Unused << mDoc->SendTableSelectRow(mID, aRow);
+}
+
+void
+ProxyAccessible::TableUnselectColumn(uint32_t aCol)
+{
+  Unused << mDoc->SendTableUnselectColumn(mID, aCol);
+}
+
+void
+ProxyAccessible::TableUnselectRow(uint32_t aRow)
+{
+  Unused << mDoc->SendTableUnselectRow(mID, aRow);
+}
+
+bool
+ProxyAccessible::TableIsProbablyForLayout()
+{
+  bool forLayout = false;
+  Unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout);
+  return forLayout;
+}
+
+ProxyAccessible*
+ProxyAccessible::AtkTableColumnHeader(int32_t aCol)
+{
+  uint64_t headerID = 0;
+  bool ok = false;
+  Unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
+  return ok ? mDoc->GetAccessible(headerID) : nullptr;
+}
+
+ProxyAccessible*
+ProxyAccessible::AtkTableRowHeader(int32_t aRow)
+{
+  uint64_t headerID = 0;
+  bool ok = false;
+  Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
+  return ok ? mDoc->GetAccessible(headerID) : nullptr;
+}
+
+void
+ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
+{
+  AutoTArray<uint64_t, 10> itemIDs;
+  Unused << mDoc->SendSelectedItems(mID, &itemIDs);
+  aSelectedItems->SetCapacity(itemIDs.Length());
+  for (size_t i = 0; i < itemIDs.Length(); ++i) {
+    aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i]));
+  }
+}
+
+uint32_t
+ProxyAccessible::SelectedItemCount()
+{
+  uint32_t count = 0;
+  Unused << mDoc->SendSelectedItemCount(mID, &count);
+  return count;
+}
+
+ProxyAccessible*
+ProxyAccessible::GetSelectedItem(uint32_t aIndex)
+{
+  uint64_t selectedItemID = 0;
+  bool ok = false;
+  Unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok);
+  return ok ? mDoc->GetAccessible(selectedItemID) : nullptr;
+}
+
+bool
+ProxyAccessible::IsItemSelected(uint32_t aIndex)
+{
+  bool selected = false;
+  Unused << mDoc->SendIsItemSelected(mID, aIndex, &selected);
+  return selected;
+}
+ 
+bool
+ProxyAccessible::AddItemToSelection(uint32_t aIndex)
+{
+  bool success = false;
+  Unused << mDoc->SendAddItemToSelection(mID, aIndex, &success);
+  return success;
+}
+
+bool
+ProxyAccessible::RemoveItemFromSelection(uint32_t aIndex)
+{
+  bool success = false;
+  Unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success);
+  return success;
+}
+
+bool
+ProxyAccessible::SelectAll()
+{
+  bool success = false;
+  Unused << mDoc->SendSelectAll(mID, &success);
+  return success;
+}
+
+bool
+ProxyAccessible::UnselectAll()
+{
+  bool success = false;
+  Unused << mDoc->SendUnselectAll(mID, &success);
+  return success;
+}
+
+void
+ProxyAccessible::TakeSelection()
+{
+  Unused << mDoc->SendTakeSelection(mID);
+}
+
+void
+ProxyAccessible::SetSelected(bool aSelect)
+{
+  Unused << mDoc->SendSetSelected(mID, aSelect);
+}
+
+bool
+ProxyAccessible::DoAction(uint8_t aIndex)
+{
+  bool success = false;
+  Unused << mDoc->SendDoAction(mID, aIndex, &success);
+  return success;
+}
+
+uint8_t
+ProxyAccessible::ActionCount()
+{
+  uint8_t count = 0;
+  Unused << mDoc->SendActionCount(mID, &count);
+  return count;
+}
+
+void
+ProxyAccessible::ActionDescriptionAt(uint8_t aIndex, nsString& aDescription)
+{
+  Unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription);
+}
+
+void
+ProxyAccessible::ActionNameAt(uint8_t aIndex, nsString& aName)
+{
+  Unused << mDoc->SendActionNameAt(mID, aIndex, &aName);
+}
+
+KeyBinding
+ProxyAccessible::AccessKey()
+{
+  uint32_t key = 0;
+  uint32_t modifierMask = 0;
+  Unused << mDoc->SendAccessKey(mID, &key, &modifierMask);
+  return KeyBinding(key, modifierMask);
+}
+
+KeyBinding
+ProxyAccessible::KeyboardShortcut()
+{
+  uint32_t key = 0;
+  uint32_t modifierMask = 0;
+  Unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask);
+  return KeyBinding(key, modifierMask);
+}
+
+void
+ProxyAccessible::AtkKeyBinding(nsString& aBinding)
+{
+  Unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
+}
+
+double
+ProxyAccessible::CurValue()
+{
+  double val = UnspecifiedNaN<double>();
+  Unused << mDoc->SendCurValue(mID, &val);
+  return val;
+}
+
+bool
+ProxyAccessible::SetCurValue(double aValue)
+{
+  bool success = false;
+  Unused << mDoc->SendSetCurValue(mID, aValue, &success);
+  return success;
+}
+
+double
+ProxyAccessible::MinValue()
+{
+  double val = UnspecifiedNaN<double>();
+  Unused << mDoc->SendMinValue(mID, &val);
+  return val;
+}
+
+double
+ProxyAccessible::MaxValue()
+{
+  double val = UnspecifiedNaN<double>();
+  Unused << mDoc->SendMaxValue(mID, &val);
+  return val;
+}
+
+double
+ProxyAccessible::Step()
+{
+  double step = UnspecifiedNaN<double>();
+  Unused << mDoc->SendStep(mID, &step);
+  return step;
+}
+
+void
+ProxyAccessible::TakeFocus()
+{
+  Unused << mDoc->SendTakeFocus(mID);
+}
+
+uint32_t
+ProxyAccessible::EmbeddedChildCount() const
+{
+  size_t count = 0, kids = mChildren.Length();
+  for (size_t i = 0; i < kids; i++) {
+    if (mChildren[i]->IsEmbeddedObject()) {
+      count++;
+    }
+  }
+
+  return count;
+}
+
+int32_t
+ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
+{
+  size_t index = 0, kids = mChildren.Length();
+  for (size_t i = 0; i < kids; i++) {
+    if (mChildren[i]->IsEmbeddedObject()) {
+      if (mChildren[i] == aChild) {
+        return index;
+      }
+
+      index++;
+    }
+  }
+
+  return -1;
+}
+
+ProxyAccessible*
+ProxyAccessible::EmbeddedChildAt(size_t aChildIdx)
+{
+  size_t index = 0, kids = mChildren.Length();
+  for (size_t i = 0; i < kids; i++) {
+    if (!mChildren[i]->IsEmbeddedObject()) {
+      continue;
+    }
+
+    if (index == aChildIdx) {
+      return mChildren[i];
+    }
+
+    index++;
+  }
+
+  return nullptr;
+}
+
+ProxyAccessible*
+ProxyAccessible::FocusedChild()
+{
+  uint64_t childID = 0;
+  bool ok = false;
+  Unused << mDoc->SendFocusedChild(mID, &childID, &ok);
+  return ok ? mDoc->GetAccessible(childID) : nullptr;
+}
+
+ProxyAccessible*
+ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
+                              Accessible::EWhichChildAtPoint aWhichChild)
+{
+  uint64_t childID = 0;
+  bool ok = false;
+  Unused << mDoc->SendAccessibleAtPoint(mID, aX, aY, false,
+                                        static_cast<uint32_t>(aWhichChild),
+                                        &childID, &ok);
+  return ok ? mDoc->GetAccessible(childID) : nullptr;
 }
 
 nsIntRect
 ProxyAccessible::Bounds()
 {
   nsIntRect rect;
-
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return rect;
-  }
-
-  long left;
-  long top;
-  long width;
-  long height;
-  VARIANT id;
-  id.vt = VT_I4;
-  id.lVal = CHILDID_SELF;
-  HRESULT hr = acc->accLocation(&left, &top, &width, &height, id);
-  if (FAILED(hr)) {
-    return rect;
-  }
-  rect.x = left;
-  rect.y = top;
-  rect.width = width;
-  rect.height = height;
+  Unused << mDoc->SendExtents(mID, false,
+                              &(rect.x), &(rect.y),
+                              &(rect.width), &(rect.height));
   return rect;
 }
 
 void
 ProxyAccessible::Language(nsString& aLocale)
 {
-  aLocale.Truncate();
-
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return;
-  }
-
-  RefPtr<IAccessible2> acc2;
-  if (FAILED(acc->QueryInterface(IID_IAccessible2, (void**)getter_AddRefs(acc2)))) {
-    return;
-  }
-
-  IA2Locale locale;
-  HRESULT hr = acc2->get_locale(&locale);
-
-  _bstr_t langWrap(locale.language, false);
-  _bstr_t countryWrap(locale.country, false);
-  _bstr_t variantWrap(locale.variant, false);
-
-  if (FAILED(hr)) {
-    return;
-  }
-
-  // The remaining code should essentially be the inverse of the
-  // ia2Accessible::get_locale conversion to IA2Locale.
-
-  if (!!variantWrap) {
-    aLocale = (wchar_t*)variantWrap;
-    return;
-  }
-
-  if (!!langWrap) {
-    aLocale = (wchar_t*)langWrap;
-    if (!!countryWrap) {
-      aLocale += L"-";
-      aLocale += (wchar_t*)countryWrap;
-    }
-  }
+  Unused << mDoc->SendLanguage(mID, &aLocale);
 }
 
-static bool
-IsEscapedChar(const wchar_t c)
+void
+ProxyAccessible::DocType(nsString& aType)
 {
-  return c == L'\\' || c == L':' || c == ',' || c == '=' || c == ';';
+  Unused << mDoc->SendDocType(mID, &aType);
 }
 
-static bool
-ConvertBSTRAttributesToArray(const nsAString& aStr,
-                             nsTArray<Attribute>* aAttrs)
+void
+ProxyAccessible::Title(nsString& aTitle)
 {
-  if (!aAttrs) {
-    return false;
-  }
-
-  enum
-  {
-    eName = 0,
-    eValue = 1,
-    eNumStates
-  } state;
-  nsAutoString tokens[eNumStates];
-  auto itr = aStr.BeginReading(), end = aStr.EndReading();
+  Unused << mDoc->SendTitle(mID, &aTitle);
+}
 
-  state = eName;
-  while (itr != end) {
-    switch (*itr) {
-      case L'\\':
-        // Skip the backslash so that we're looking at the escaped char
-        ++itr;
-        if (itr == end || !IsEscapedChar(*itr)) {
-          // Invalid state
-          return false;
-        }
-        break;
-      case L':':
-        if (state != eName) {
-          // Bad, should be looking at name
-          return false;
-        }
-        state = eValue;
-        ++itr;
-        continue;
-      case L';':
-        if (state != eValue) {
-          // Bad, should be looking at value
-          return false;
-        }
-        state = eName;
-        aAttrs->AppendElement(Attribute(NS_ConvertUTF16toUTF8(tokens[eName]),
-                                        tokens[eValue]));
-        tokens[eName].Truncate();
-        tokens[eValue].Truncate();
-        ++itr;
-        continue;
-      default:
-        break;
-    }
-    tokens[state] += *itr;
-  }
-  return true;
+void
+ProxyAccessible::URL(nsString& aURL)
+{
+  Unused << mDoc->SendURL(mID, &aURL);
+}
+
+void
+ProxyAccessible::MimeType(nsString aMime)
+{
+  Unused << mDoc->SendMimeType(mID, &aMime);
 }
 
 void
-ProxyAccessible::Attributes(nsTArray<Attribute>* aAttrs) const
+ProxyAccessible::URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
+                                    nsString& aMimeType)
 {
-  aAttrs->Clear();
-
-  RefPtr<IAccessible> acc;
-  if (!GetCOMInterface((void**)getter_AddRefs(acc))) {
-    return;
-  }
+  Unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType);
+}
 
-  RefPtr<IAccessible2> acc2;
-  if (FAILED(acc->QueryInterface(IID_IAccessible2, (void**)getter_AddRefs(acc2)))) {
-    return;
-  }
-
-  BSTR attrs;
-  HRESULT hr = acc2->get_attributes(&attrs);
-  _bstr_t attrsWrap(attrs, false);
-  if (FAILED(hr)) {
-    return;
-  }
-
-  ConvertBSTRAttributesToArray(nsDependentString((wchar_t*)attrs,
-                                                 attrsWrap.length()),
-                               aAttrs);
+ProxyAccessible*
+ProxyAccessible::AccessibleAtPoint(int32_t aX, int32_t aY,
+                                   bool aNeedsScreenCoords)
+{
+  uint64_t childID = 0;
+  bool ok = false;
+  Unused <<
+    mDoc->SendAccessibleAtPoint(mID, aX, aY, aNeedsScreenCoords,
+                                static_cast<uint32_t>(Accessible::eDirectChild),
+                                &childID, &ok);
+  return ok ? mDoc->GetAccessible(childID) : nullptr;
 }
 
-} // namespace a11y
-} // namespace mozilla
+void
+ProxyAccessible::Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
+                        int32_t* aWidth, int32_t* aHeight)
+{
+  Unused << mDoc->SendExtents(mID, aNeedsScreenCoords, aX, aY, aWidth, aHeight);
+}
+
+void
+ProxyAccessible::DOMNodeID(nsString& aID)
+{
+  Unused << mDoc->SendDOMNodeID(mID, &aID);
+}
+
+Accessible*
+ProxyAccessible::OuterDocOfRemoteBrowser() const
+{
+  auto tab = static_cast<dom::TabParent*>(mDoc->Manager());
+  dom::Element* frame = tab->GetOwnerElement();
+  NS_ASSERTION(frame, "why isn't the tab in a frame!");
+  if (!frame)
+    return nullptr;
+
+  DocAccessible* chromeDoc = GetExistingDocAccessible(frame->OwnerDoc());
+
+  return chromeDoc ? chromeDoc->GetAccessible(frame) : nullptr;
+}
+}
+}
rename from accessible/ipc/win/ProxyAccessible.h
rename to accessible/ipc/ProxyAccessible.h
--- a/accessible/ipc/win/ProxyAccessible.h
+++ b/accessible/ipc/ProxyAccessible.h
@@ -2,87 +2,453 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_ProxyAccessible_h
 #define mozilla_a11y_ProxyAccessible_h
 
-#include "Accessible.h"
-#include "mozilla/a11y/ProxyAccessibleBase.h"
 #include "mozilla/a11y/Role.h"
 #include "nsIAccessibleText.h"
 #include "nsIAccessibleTypes.h"
+#include "Accessible.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsRect.h"
-
-#include <oleacc.h>
+#include "Accessible.h"
 
 namespace mozilla {
 namespace a11y {
 
-class ProxyAccessible : public ProxyAccessibleBase<ProxyAccessible>
+class Accessible;
+class Attribute;
+class DocAccessibleParent;
+enum class RelationType;
+
+enum Interfaces
+{
+  HYPERTEXT = 1,
+  HYPERLINK = 1 << 1,
+  IMAGE = 1 << 2,
+  VALUE = 1 << 3,
+  TABLE = 1 << 4,
+  TABLECELL = 1 << 5,
+  DOCUMENT = 1 << 6,
+  SELECTION = 1 << 7,
+  ACTION = 1 << 8,
+};
+
+class ProxyAccessible
 {
 public:
+
   ProxyAccessible(uint64_t aID, ProxyAccessible* aParent,
-                  DocAccessibleParent* aDoc, role aRole, uint32_t aInterfaces,
-                  const RefPtr<IAccessible>& aIAccessible)
-    : ProxyAccessibleBase(aID, aParent, aDoc, aRole, aInterfaces)
-    , mCOMProxy(aIAccessible)
+                  DocAccessibleParent* aDoc, role aRole, uint32_t aInterfaces) :
+     mParent(aParent), mDoc(aDoc), mWrapper(0), mID(aID), mRole(aRole),
+     mOuterDoc(false), mIsDoc(false),
+     mHasValue(aInterfaces & Interfaces::VALUE),
+     mIsHyperLink(aInterfaces & Interfaces::HYPERLINK),
+     mIsHyperText(aInterfaces & Interfaces::HYPERTEXT)
+  {
+    MOZ_COUNT_CTOR(ProxyAccessible);
+  }
+  ~ProxyAccessible()
+  {
+    MOZ_COUNT_DTOR(ProxyAccessible);
+    MOZ_ASSERT(!mWrapper);
+  }
 
+  void AddChildAt(uint32_t aIdx, ProxyAccessible* aChild)
+  { mChildren.InsertElementAt(aIdx, aChild); }
+
+  uint32_t ChildrenCount() const { return mChildren.Length(); }
+  ProxyAccessible* ChildAt(uint32_t aIdx) const { return mChildren[aIdx]; }
+  ProxyAccessible* FirstChild() const
+    { return mChildren.Length() ? mChildren[0] : nullptr; }
+  ProxyAccessible* LastChild() const
+    { return mChildren.Length() ? mChildren[mChildren.Length() - 1] : nullptr; }
+  ProxyAccessible* PrevSibling() const
   {
-    MOZ_COUNT_CTOR_INHERITED(ProxyAccessible, ProxyAccessibleBase);
+    size_t idx = IndexInParent();
+    return idx > 0 ? Parent()->mChildren[idx - 1] : nullptr;
+  }
+  ProxyAccessible* NextSibling() const
+  {
+    size_t idx = IndexInParent();
+    return idx + 1 < Parent()->mChildren.Length() ? Parent()->mChildren[idx + 1]
+    : nullptr;
   }
 
-  ~ProxyAccessible()
+  // XXX evaluate if this is fast enough.
+  size_t IndexInParent() const { return Parent()->mChildren.IndexOf(this); }
+  uint32_t EmbeddedChildCount() const;
+  int32_t IndexOfEmbeddedChild(const ProxyAccessible*);
+  ProxyAccessible* EmbeddedChildAt(size_t aChildIdx);
+  bool MustPruneChildren() const;
+
+  void Shutdown();
+
+  void SetChildDoc(DocAccessibleParent*);
+
+  /**
+   * Remove The given child.
+   */
+  void RemoveChild(ProxyAccessible* aChild)
+    { mChildren.RemoveElement(aChild); }
+
+  /**
+   * Return the proxy for the parent of the wrapped accessible.
+   */
+  ProxyAccessible* Parent() const { return mParent; }
+
+  Accessible* OuterDocOfRemoteBrowser() const;
+
+  /**
+   * Get the role of the accessible we're proxying.
+   */
+  role Role() const { return mRole; }
+
+  /**
+   * Return true if this is an embedded object.
+   */
+  bool IsEmbeddedObject() const
   {
-    MOZ_COUNT_DTOR_INHERITED(ProxyAccessible, ProxyAccessibleBase);
+    role role = Role();
+    return role != roles::TEXT_LEAF &&
+           role != roles::WHITESPACE &&
+           role != roles::STATICTEXT;
   }
 
   /*
    * Return the states for the proxied accessible.
    */
   uint64_t State() const;
 
   /*
+   * Return the native states for the proxied accessible.
+   */
+  uint64_t NativeState() const;
+
+  /*
    * Set aName to the name of the proxied accessible.
    */
   void Name(nsString& aName) const;
 
   /*
    * Set aValue to the value of the proxied accessible.
    */
   void Value(nsString& aValue) const;
 
+  /*
+   * Set aHelp to the help string of the proxied accessible.
+   */
+  void Help(nsString& aHelp) const;
+
   /**
    * Set aDesc to the description of the proxied accessible.
    */
   void Description(nsString& aDesc) const;
 
   /**
    * Get the set of attributes on the proxied accessible.
    */
   void Attributes(nsTArray<Attribute> *aAttrs) const;
 
+  /**
+   * Return set of targets of given relation type.
+   */
+  nsTArray<ProxyAccessible*> RelationByType(RelationType aType) const;
+
+  /**
+   * Get all relations for this accessible.
+   */
+  void Relations(nsTArray<RelationType>* aTypes,
+                 nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) const;
+
+  bool IsSearchbox() const;
+
+  nsIAtom* LandmarkRole() const;
+
+  nsIAtom* ARIARoleAtom() const;
+
+  int32_t GetLevelInternal();
+  void ScrollTo(uint32_t aScrollType);
+  void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY);
+
+  int32_t CaretLineNumber();
+  int32_t CaretOffset();
+  void SetCaretOffset(int32_t aOffset);
+
+  int32_t CharacterCount();
+  int32_t SelectionCount();
+
+  /**
+   * Get the text between the given offsets.
+   */
+  bool TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
+                     nsString& aText) const;
+
+  void GetTextAfterOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
+                          nsString& aText, int32_t* aStartOffset,
+                          int32_t* aEndOffset);
+
+  void GetTextAtOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
+                       nsString& aText, int32_t* aStartOffset,
+                       int32_t* aEndOffset);
+
+  void GetTextBeforeOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
+                           nsString& aText, int32_t* aStartOffset,
+                           int32_t* aEndOffset);
+
+  char16_t CharAt(int32_t aOffset);
+
+  void TextAttributes(bool aIncludeDefAttrs,
+                      const int32_t aOffset,
+                      nsTArray<Attribute>* aAttributes,
+                      int32_t* aStartOffset,
+                      int32_t* aEndOffset);
+  void DefaultTextAttributes(nsTArray<Attribute>* aAttrs);
+
+  nsIntRect TextBounds(int32_t aStartOffset, int32_t aEndOffset,
+                       uint32_t aCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
+
+  nsIntRect CharBounds(int32_t aOffset, uint32_t aCoordType);
+
+  int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType);
+
+  bool SelectionBoundsAt(int32_t aSelectionNum,
+                         nsString& aData,
+                         int32_t* aStartOffset,
+                         int32_t* aEndOffset);
+
+  bool SetSelectionBoundsAt(int32_t aSelectionNum,
+                            int32_t aStartOffset,
+                            int32_t aEndOffset);
+
+  bool AddToSelection(int32_t aStartOffset,
+                      int32_t aEndOffset);
+
+  bool RemoveFromSelection(int32_t aSelectionNum);
+
+  void ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
+                         uint32_t aScrollType);
+
+  void ScrollSubstringToPoint(int32_t aStartOffset,
+                              int32_t aEndOffset,
+                              uint32_t aCoordinateType,
+                              int32_t aX, int32_t aY);
+
+  void Text(nsString* aText);
+
+  void ReplaceText(const nsString& aText);
+
+  bool InsertText(const nsString& aText, int32_t aPosition);
+
+  bool CopyText(int32_t aStartPos, int32_t aEndPos);
+
+  bool CutText(int32_t aStartPos, int32_t aEndPos);
+
+  bool DeleteText(int32_t aStartPos, int32_t aEndPos);
+
+  bool PasteText(int32_t aPosition);
+
+  nsIntPoint ImagePosition(uint32_t aCoordType);
+
+  nsIntSize ImageSize();
+
+  uint32_t StartOffset(bool* aOk);
+
+  uint32_t EndOffset(bool* aOk);
+
+  bool IsLinkValid();
+
+  // XXX checking mRole alone may not result in same behavior as Accessibles
+  // due to ARIA roles. See bug 1210477.
+  inline bool IsTable() const
+  {
+    return mRole == roles::TABLE || mRole == roles::MATHML_TABLE;
+  }
+  inline bool IsTableRow() const
+  {
+    return (mRole == roles::ROW ||
+            mRole == roles::MATHML_TABLE_ROW ||
+            mRole == roles::MATHML_LABELED_ROW);
+  }
+  inline bool IsTableCell() const
+  {
+    return (mRole == roles::CELL ||
+            mRole == roles::COLUMNHEADER ||
+            mRole == roles::ROWHEADER ||
+            mRole == roles::GRID_CELL ||
+            mRole == roles::MATHML_CELL);
+  }
+
+  uint32_t AnchorCount(bool* aOk);
+
+  void AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk);
+
+  ProxyAccessible* AnchorAt(uint32_t aIndex);
+
+  uint32_t LinkCount();
+
+  ProxyAccessible* LinkAt(const uint32_t& aIndex);
+
+  int32_t LinkIndexOf(ProxyAccessible* aLink);
+
+  int32_t LinkIndexAtOffset(uint32_t aOffset);
+
+  ProxyAccessible* TableOfACell();
+
+  uint32_t ColIdx();
+
+  uint32_t RowIdx();
+
+  uint32_t ColExtent();
+
+  uint32_t RowExtent();
+
+  void ColHeaderCells(nsTArray<ProxyAccessible*>* aCells);
+
+  void RowHeaderCells(nsTArray<ProxyAccessible*>* aCells);
+
+  bool IsCellSelected();
+
+  ProxyAccessible* TableCaption();
+  void TableSummary(nsString& aSummary);
+  uint32_t TableColumnCount();
+  uint32_t TableRowCount();
+  ProxyAccessible* TableCellAt(uint32_t aRow, uint32_t aCol);
+  int32_t TableCellIndexAt(uint32_t aRow, uint32_t aCol);
+  int32_t TableColumnIndexAt(uint32_t aCellIndex);
+  int32_t TableRowIndexAt(uint32_t aCellIndex);
+  void TableRowAndColumnIndicesAt(uint32_t aCellIndex,
+                                  int32_t* aRow, int32_t* aCol);
+  uint32_t TableColumnExtentAt(uint32_t aRow, uint32_t aCol);
+  uint32_t TableRowExtentAt(uint32_t aRow, uint32_t aCol);
+  void TableColumnDescription(uint32_t aCol, nsString& aDescription);
+  void TableRowDescription(uint32_t aRow, nsString& aDescription);
+  bool TableColumnSelected(uint32_t aCol);
+  bool TableRowSelected(uint32_t aRow);
+  bool TableCellSelected(uint32_t aRow, uint32_t aCol);
+  uint32_t TableSelectedCellCount();
+  uint32_t TableSelectedColumnCount();
+  uint32_t TableSelectedRowCount();
+  void TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs);
+  void TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices);
+  void TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices);
+  void TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices);
+  void TableSelectColumn(uint32_t aCol);
+  void TableSelectRow(uint32_t aRow);
+  void TableUnselectColumn(uint32_t aCol);
+  void TableUnselectRow(uint32_t aRow);
+  bool TableIsProbablyForLayout();
+  ProxyAccessible* AtkTableColumnHeader(int32_t aCol);
+  ProxyAccessible* AtkTableRowHeader(int32_t aRow);
+
+  void SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems);
+  uint32_t SelectedItemCount();
+  ProxyAccessible* GetSelectedItem(uint32_t aIndex);
+  bool IsItemSelected(uint32_t aIndex);
+  bool AddItemToSelection(uint32_t aIndex);
+  bool RemoveItemFromSelection(uint32_t aIndex);
+  bool SelectAll();
+  bool UnselectAll();
+
+  void TakeSelection();
+  void SetSelected(bool aSelect);
+
+  bool DoAction(uint8_t aIndex);
+  uint8_t ActionCount();
+  void ActionDescriptionAt(uint8_t aIndex, nsString& aDescription);
+  void ActionNameAt(uint8_t aIndex, nsString& aName);
+  KeyBinding AccessKey();
+  KeyBinding KeyboardShortcut();
+  void AtkKeyBinding(nsString& aBinding);
+
+  double CurValue();
+  bool SetCurValue(double aValue);
+  double MinValue();
+  double MaxValue();
+  double Step();
+
+  void TakeFocus();
+  ProxyAccessible* FocusedChild();
+  ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY,
+                                Accessible::EWhichChildAtPoint aWhichChild);
   nsIntRect Bounds();
 
   void Language(nsString& aLocale);
+  void DocType(nsString& aType);
+  void Title(nsString& aTitle);
+  void URL(nsString& aURL);
+  void MimeType(nsString aMime);
+  void URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
+                          nsString& aMimeType);
 
-  bool GetCOMInterface(void** aOutAccessible) const;
+  ProxyAccessible* AccessibleAtPoint(int32_t aX, int32_t aY,
+                                     bool aNeedsScreenCoords);
+
+  void Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
+               int32_t* aWidth, int32_t* aHeight);
+
+  /**
+   * Return the id of the dom node this accessible represents.  Note this
+   * should probably only be used for testing.
+   */
+  void DOMNodeID(nsString& aID);
+
+  /**
+   * Allow the platform to store a pointers worth of data on us.
+   */
+  uintptr_t GetWrapper() const { return mWrapper; }
+  void SetWrapper(uintptr_t aWrapper) { mWrapper = aWrapper; }
+
+  /*
+   * Return the ID of the accessible being proxied.
+   */
+  uint64_t ID() const { return mID; }
+
+  /**
+   * Return the document containing this proxy, or the proxy itself if it is a
+   * document.
+   */
+  DocAccessibleParent* Document() const { return mDoc; }
+
+  /**
+   * Return true if this proxy is a DocAccessibleParent.
+   */
+  bool IsDoc() const { return mIsDoc; }
+  DocAccessibleParent* AsDoc() const { return IsDoc() ? mDoc : nullptr; }
 
 protected:
-  explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc)
-    : ProxyAccessibleBase(aThisAsDoc)
-  { MOZ_COUNT_CTOR(ProxyAccessibleBase); }
+  explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc) :
+    mParent(nullptr), mDoc(aThisAsDoc), mWrapper(0), mID(0),
+    mRole(roles::DOCUMENT), mOuterDoc(false), mIsDoc(true), mHasValue(false),
+    mIsHyperLink(false), mIsHyperText(false)
+  { MOZ_COUNT_CTOR(ProxyAccessible); }
 
-  void SetCOMInterface(const RefPtr<IAccessible>& aIAccessible)
-  { mCOMProxy = aIAccessible; }
+protected:
+  ProxyAccessible* mParent;
 
 private:
-  RefPtr<IAccessible> mCOMProxy;
+  nsTArray<ProxyAccessible*> mChildren;
+  DocAccessibleParent* mDoc;
+  uintptr_t mWrapper;
+  uint64_t mID;
+protected:
+  // XXX DocAccessibleParent gets to change this to change the role of
+  // documents.
+  role mRole : 27;
+private:
+  bool mOuterDoc : 1;
+
+public:
+  const bool mIsDoc: 1;
+  const bool mHasValue: 1;
+  const bool mIsHyperLink: 1;
+  const bool mIsHyperText: 1;
 };
 
 }
 }
 
 #endif
deleted file mode 100644
--- a/accessible/ipc/ProxyAccessibleBase.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DocAccessible.h"
-#include "mozilla/a11y/DocAccessibleParent.h"
-#include "mozilla/a11y/DocManager.h"
-#include "mozilla/a11y/Platform.h"
-#include "mozilla/a11y/ProxyAccessibleBase.h"
-#include "mozilla/a11y/ProxyAccessible.h"
-#include "mozilla/a11y/Role.h"
-#include "mozilla/dom/Element.h"
-#include "mozilla/dom/TabParent.h"
-#include "mozilla/unused.h"
-#include "RelationType.h"
-#include "xpcAccessibleDocument.h"
-
-namespace mozilla {
-namespace a11y {
-
-template <class Derived>
-void
-ProxyAccessibleBase<Derived>::Shutdown()
-{
-  MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
-  NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
-  xpcAccessibleDocument* xpcDoc =
-    GetAccService()->GetCachedXPCDocument(Document());
-  if (xpcDoc) {
-    xpcDoc->NotifyOfShutdown(static_cast<Derived*>(this));
-  }
-
-  // XXX Ideally  this wouldn't be necessary, but it seems OuterDoc accessibles
-  // can be destroyed before the doc they own.
-  if (!mOuterDoc) {
-    uint32_t childCount = mChildren.Length();
-    for (uint32_t idx = 0; idx < childCount; idx++)
-      mChildren[idx]->Shutdown();
-  } else {
-    if (mChildren.Length() != 1)
-      MOZ_CRASH("outer doc doesn't own adoc!");
-
-    mChildren[0]->AsDoc()->Unbind();
-  }
-
-  mChildren.Clear();
-  ProxyDestroyed(static_cast<Derived*>(this));
-  mDoc->RemoveAccessible(static_cast<Derived*>(this));
-}
-
-template <class Derived>
-void
-ProxyAccessibleBase<Derived>::SetChildDoc(DocAccessibleParent* aParent)
-{
-  if (aParent) {
-    MOZ_ASSERT(mChildren.IsEmpty());
-    mChildren.AppendElement(aParent);
-    mOuterDoc = true;
-  } else {
-    MOZ_ASSERT(mChildren.Length() == 1);
-    mChildren.Clear();
-    mOuterDoc = false;
-  }
-}
-
-template <class Derived>
-bool
-ProxyAccessibleBase<Derived>::MustPruneChildren() const
-{
-  // this is the equivalent to nsAccUtils::MustPrune for proxies and should be
-  // kept in sync with that.
-  if (mRole != roles::MENUITEM && mRole != roles::COMBOBOX_OPTION
-      && mRole != roles::OPTION && mRole != roles::ENTRY
-      && mRole != roles::FLAT_EQUATION && mRole != roles::PASSWORD_TEXT
-      && mRole != roles::PUSHBUTTON && mRole != roles::TOGGLE_BUTTON
-      && mRole != roles::GRAPHIC && mRole != roles::SLIDER
-      && mRole != roles::PROGRESSBAR && mRole != roles::SEPARATOR)
-    return false;
-
-  if (mChildren.Length() != 1)
-    return false;
-
-  return mChildren[0]->Role() == roles::TEXT_LEAF
-    || mChildren[0]->Role() == roles::STATICTEXT;
-}
-
-template <class Derived>
-uint32_t
-ProxyAccessibleBase<Derived>::EmbeddedChildCount() const
-{
-  size_t count = 0, kids = mChildren.Length();
-  for (size_t i = 0; i < kids; i++) {
-    if (mChildren[i]->IsEmbeddedObject()) {
-      count++;
-    }
-  }
-
-  return count;
-}
-
-template <class Derived>
-int32_t
-ProxyAccessibleBase<Derived>::IndexOfEmbeddedChild(const Derived* aChild)
-{
-  size_t index = 0, kids = mChildren.Length();
-  for (size_t i = 0; i < kids; i++) {
-    if (mChildren[i]->IsEmbeddedObject()) {
-      if (mChildren[i] == aChild) {
-        return index;
-      }
-
-      index++;
-    }
-  }
-
-  return -1;
-}
-
-template <class Derived>
-Derived*
-ProxyAccessibleBase<Derived>::EmbeddedChildAt(size_t aChildIdx)
-{
-  size_t index = 0, kids = mChildren.Length();
-  for (size_t i = 0; i < kids; i++) {
-    if (!mChildren[i]->IsEmbeddedObject()) {
-      continue;
-    }
-
-    if (index == aChildIdx) {
-      return mChildren[i];
-    }
-
-    index++;
-  }
-
-  return nullptr;
-}
-
-template <class Derived>
-Accessible*
-ProxyAccessibleBase<Derived>::OuterDocOfRemoteBrowser() const
-{
-  auto tab = static_cast<dom::TabParent*>(mDoc->Manager());
-  dom::Element* frame = tab->GetOwnerElement();
-  NS_ASSERTION(frame, "why isn't the tab in a frame!");
-  if (!frame)
-    return nullptr;
-
-  DocAccessible* chromeDoc = GetExistingDocAccessible(frame->OwnerDoc());
-
-  return chromeDoc ? chromeDoc->GetAccessible(frame) : nullptr;
-}
-
-template class ProxyAccessibleBase<ProxyAccessible>;
-
-} // namespace a11y
-} // namespace mozilla
deleted file mode 100644
--- a/accessible/ipc/ProxyAccessibleBase.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_ProxyAccessibleBase_h
-#define mozilla_a11y_ProxyAccessibleBase_h
-
-#include "mozilla/a11y/Role.h"
-#include "nsIAccessibleText.h"
-#include "nsIAccessibleTypes.h"
-#include "Accessible.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsRect.h"
-#include "Accessible.h"
-
-namespace mozilla {
-namespace a11y {
-
-class Accessible;
-class Attribute;
-class DocAccessibleParent;
-class ProxyAccessible;
-enum class RelationType;
-
-enum Interfaces
-{
-  HYPERTEXT = 1,
-  HYPERLINK = 1 << 1,
-  IMAGE = 1 << 2,
-  VALUE = 1 << 3,
-  TABLE = 1 << 4,
-  TABLECELL = 1 << 5,
-  DOCUMENT = 1 << 6,
-  SELECTION = 1 << 7,
-  ACTION = 1 << 8,
-};
-
-template <class Derived>
-class ProxyAccessibleBase
-{
-public:
-  ProxyAccessibleBase(uint64_t aID, Derived* aParent,
-                      DocAccessibleParent* aDoc, role aRole,
-                      uint32_t aInterfaces)
-    : mParent(aParent)
-    , mDoc(aDoc)
-    , mWrapper(0)
-    , mID(aID)
-    , mRole(aRole)
-    , mOuterDoc(false)
-    , mIsDoc(false)
-    , mHasValue(aInterfaces & Interfaces::VALUE)
-    , mIsHyperLink(aInterfaces & Interfaces::HYPERLINK)
-    , mIsHyperText(aInterfaces & Interfaces::HYPERTEXT)
-  {
-    MOZ_COUNT_CTOR(ProxyAccessibleBase);
-  }
-
-  ~ProxyAccessibleBase()
-  {
-    MOZ_COUNT_DTOR(ProxyAccessibleBase);
-    MOZ_ASSERT(!mWrapper);
-  }
-
-  void AddChildAt(uint32_t aIdx, Derived* aChild)
-  { mChildren.InsertElementAt(aIdx, aChild); }
-
-  uint32_t ChildrenCount() const { return mChildren.Length(); }
-  Derived* ChildAt(uint32_t aIdx) const { return mChildren[aIdx]; }
-  Derived* FirstChild() const
-    { return mChildren.Length() ? mChildren[0] : nullptr; }
-  Derived* LastChild() const
-    { return mChildren.Length() ? mChildren[mChildren.Length() - 1] : nullptr; }
-  Derived* PrevSibling() const
-  {
-    size_t idx = IndexInParent();
-    return idx > 0 ? Parent()->mChildren[idx - 1] : nullptr;
-  }
-  Derived* NextSibling() const
-  {
-    size_t idx = IndexInParent();
-    return idx + 1 < Parent()->mChildren.Length() ? Parent()->mChildren[idx + 1]
-    : nullptr;
-  }
-
-  // XXX evaluate if this is fast enough.
-  size_t IndexInParent() const { return
-    Parent()->mChildren.IndexOf(static_cast<const Derived*>(this)); }
-  uint32_t EmbeddedChildCount() const;
-  int32_t IndexOfEmbeddedChild(const Derived* aChild);
-  Derived* EmbeddedChildAt(size_t aChildIdx);
-  bool MustPruneChildren() const;
-
-  void Shutdown();
-
-  void SetChildDoc(DocAccessibleParent*);
-
-  /**
-   * Remove The given child.
-   */
-  void RemoveChild(Derived* aChild)
-    { mChildren.RemoveElement(aChild); }
-
-  /**
-   * Return the proxy for the parent of the wrapped accessible.
-   */
-  Derived* Parent() const { return mParent; }
-
-  Accessible* OuterDocOfRemoteBrowser() const;
-
-  /**
-   * Get the role of the accessible we're proxying.
-   */
-  role Role() const { return mRole; }
-
-  /**
-   * Return true if this is an embedded object.
-   */
-  bool IsEmbeddedObject() const
-  {
-    role role = Role();
-    return role != roles::TEXT_LEAF &&
-           role != roles::WHITESPACE &&
-           role != roles::STATICTEXT;
-  }
-
-  /**
-   * Allow the platform to store a pointers worth of data on us.
-   */
-  uintptr_t GetWrapper() const { return mWrapper; }
-  void SetWrapper(uintptr_t aWrapper) { mWrapper = aWrapper; }
-
-  /*
-   * Return the ID of the accessible being proxied.
-   */
-  uint64_t ID() const { return mID; }
-
-  /**
-   * Return the document containing this proxy, or the proxy itself if it is a
-   * document.
-   */
-  DocAccessibleParent* Document() const { return mDoc; }
-
-  /**
-   * Return true if this proxy is a DocAccessibleParent.
-   */
-  bool IsDoc() const { return mIsDoc; }
-  DocAccessibleParent* AsDoc() const { return IsDoc() ? mDoc : nullptr; }
-
-
-protected:
-  explicit ProxyAccessibleBase(DocAccessibleParent* aThisAsDoc) :
-    mParent(nullptr), mDoc(aThisAsDoc), mWrapper(0), mID(0),
-    mRole(roles::DOCUMENT), mOuterDoc(false), mIsDoc(true), mHasValue(false),
-    mIsHyperLink(false), mIsHyperText(false)
-  { MOZ_COUNT_CTOR(ProxyAccessibleBase); }
-
-protected:
-  Derived* mParent;
-
-private:
-  friend Derived;
-
-  nsTArray<Derived*> mChildren;
-  DocAccessibleParent* mDoc;
-  uintptr_t mWrapper;
-  uint64_t mID;
-
-protected:
-  // XXX DocAccessibleParent gets to change this to change the role of
-  // documents.
-  role mRole : 27;
-
-private:
-  bool mOuterDoc : 1;
-
-public:
-  const bool mIsDoc: 1;
-  const bool mHasValue: 1;
-  const bool mIsHyperLink: 1;
-  const bool mIsHyperText: 1;
-};
-
-extern template class ProxyAccessibleBase<ProxyAccessible>;
-
-}
-}
-
-#endif
--- a/accessible/ipc/moz.build
+++ b/accessible/ipc/moz.build
@@ -1,58 +1,53 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['OS_ARCH'] == 'WINNT':
-    DIRS += ['win']
+IPDL_SOURCES += ['PDocAccessible.ipdl']
+
+# with --disable-accessibility we need to compile PDocAccessible.ipdl, but not
+# the C++.
+if CONFIG['ACCESSIBILITY']:
+    EXPORTS.mozilla.a11y += [
+        'DocAccessibleChild.h',
+        'DocAccessibleParent.h',
+        'ProxyAccessible.h'
+    ]
+
+    SOURCES += [
+        'DocAccessibleChild.cpp',
+        'DocAccessibleParent.cpp',
+        'ProxyAccessible.cpp'
+    ]
+
     LOCAL_INCLUDES += [
-        '/accessible/ipc/win',
-        '/accessible/windows/ia2',
-        '/accessible/windows/msaa',
+        '../base',
+        '../generic',
+        '../xpcom',
     ]
-else:
-    DIRS += ['other']
-    LOCAL_INCLUDES += [
-        '/accessible/ipc/other',
-    ]
+
     if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
         LOCAL_INCLUDES += [
             '/accessible/atk',
         ]
+    elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+        LOCAL_INCLUDES += [
+            '/accessible/windows/ia2',
+            '/accessible/windows/msaa',
+        ]
     elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
         LOCAL_INCLUDES += [
             '/accessible/mac',
         ]
     else:
         LOCAL_INCLUDES += [
             '/accessible/other',
         ]
 
-if CONFIG['GNU_CXX']:
-    CXXFLAGS += ['-Wno-error=shadow']
-
-# with --disable-accessibility we need to compile PDocAccessible.ipdl, but not
-# the C++.
-if CONFIG['ACCESSIBILITY']:
-    EXPORTS.mozilla.a11y += [
-        'DocAccessibleChildBase.h',
-        'DocAccessibleParent.h',
-        'ProxyAccessibleBase.h',
-    ]
-
-    UNIFIED_SOURCES += [
-        'DocAccessibleChildBase.cpp',
-        'DocAccessibleParent.cpp',
-        'ProxyAccessibleBase.cpp',
-    ]
-
-    LOCAL_INCLUDES += [
-        '/accessible/base',
-        '/accessible/generic',
-        '/accessible/xpcom',
-    ]
+    FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
-FINAL_LIBRARY = 'xul'
+if CONFIG['GNU_CXX']:
+    CXXFLAGS += ['-Wno-error=shadow']
deleted file mode 100644
--- a/accessible/ipc/other/PDocAccessible.ipdl
+++ /dev/null
@@ -1,261 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PFileDescriptorSet;
-include protocol PBrowser;
-
-include "mozilla/GfxMessageUtils.h";
-
-using nsIntRect from "nsRect.h";
-using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
-using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
-
-namespace mozilla {
-namespace a11y {
-
-struct AccessibleData
-{
-  uint64_t ID;
-  uint32_t Role;
-  uint32_t ChildrenCount;
-  uint32_t Interfaces;
-};
-
-struct ShowEventData
-{
-  uint64_t ID;
-  uint32_t Idx;
-  AccessibleData[] NewTree;
-};
-
-struct Attribute
-{
-  nsCString Name;
-  nsString Value;
-};
-
-struct RelationTargets
-{
-  uint32_t Type;
-  uint64_t[] Targets;
-};
-
-prio(normal upto high) sync protocol PDocAccessible
-{
-  manager PBrowser;
-
-parent:
-  async Shutdown();
-
-  /*
-   * Notify the parent process the document in the child process is firing an
-   * event.
-   */
-  async Event(uint64_t aID, uint32_t type);
-  async ShowEvent(ShowEventData data, bool aFromuser);
-  async HideEvent(uint64_t aRootID, bool aFromUser);
-  async StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
-  async CaretMoveEvent(uint64_t aID, int32_t aOffset);
-  async TextChangeEvent(uint64_t aID, nsString aStr, int32_t aStart, uint32_t aLen,
-                        bool aIsInsert, bool aFromUser);
-  async SelectionEvent(uint64_t aID, uint64_t aWidgetID, uint32_t aType);
-  async RoleChangedEvent(uint32_t aRole);
-
-  /*
-   * Tell the parent document to bind the existing document as a new child
-   * document.
-   */
-  async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
-
-child:
-  async __delete__();
-
-  // Accessible
-  prio(high) sync State(uint64_t aID) returns(uint64_t states);
-  prio(high) sync NativeState(uint64_t aID) returns(uint64_t states);
-  prio(high) sync Name(uint64_t aID) returns(nsString name);
-  prio(high) sync Value(uint64_t aID) returns(nsString value);
-  prio(high) sync Help(uint64_t aID) returns(nsString help);
-  prio(high) sync Description(uint64_t aID) returns(nsString desc);
-  prio(high) sync Attributes(uint64_t aID) returns(Attribute[] attributes);
-  prio(high) sync RelationByType(uint64_t aID, uint32_t aRelationType)
-    returns(uint64_t[] targets);
-  prio(high) sync Relations(uint64_t aID) returns(RelationTargets[] relations);
-  prio(high) sync IsSearchbox(uint64_t aID) returns(bool retval);
-  prio(high) sync LandmarkRole(uint64_t aID) returns(nsString landmark);
-  prio(high) sync ARIARoleAtom(uint64_t aID) returns(nsString role);
-  prio(high) sync GetLevelInternal(uint64_t aID) returns(int32_t aLevel);
-  async ScrollTo(uint64_t aID, uint32_t aScrollType);
-  async ScrollToPoint(uint64_t aID, uint32_t aScrollType, int32_t aX,
-                      int32_t aY);
-
-  // AccessibleText
-
-  // TextSubstring is getText in IDL.
-  prio(high) sync CaretLineNumber(uint64_t aID) returns(int32_t aLineNumber);
-  prio(high) sync CaretOffset(uint64_t aID) returns(int32_t aOffset);
-   async SetCaretOffset(uint64_t aID, int32_t aOffset);
-  prio(high) sync CharacterCount(uint64_t aID) returns(int32_t aCount);
-  prio(high) sync SelectionCount(uint64_t aID) returns(int32_t aCount);
-  prio(high) sync TextSubstring(uint64_t aID, int32_t aStartOffset, int32_t
-                                aEndOffset) returns(nsString aText, bool aValid);
-  prio(high) sync GetTextAfterOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
-    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
-  prio(high) sync GetTextAtOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
-    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
-
-  prio(high) sync GetTextBeforeOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
-    returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
-  prio(high) sync CharAt(uint64_t aID, int32_t aOffset) returns(uint16_t aChar);
-
-  prio(high) sync TextAttributes(uint64_t aID, bool aIncludeDefAttrs, int32_t aOffset)
-    returns(Attribute[] aAttributes, int32_t aStartOffset, int32_t aEndOffset);
-  prio(high) sync DefaultTextAttributes(uint64_t aID) returns(Attribute[] aAttributes);
-
-  prio(high) sync TextBounds(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
-                             uint32_t aCoordType)
-    returns(nsIntRect aRetVal);
-  prio(high) sync CharBounds(uint64_t aID, int32_t aOffset, uint32_t aCoordType)
-    returns(nsIntRect aRetVal);
-
-  prio(high) sync OffsetAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aCoordType)
-    returns(int32_t aRetVal);
-
-  prio(high) sync SelectionBoundsAt(uint64_t aID, int32_t aSelectionNum)
-    returns(bool aSucceeded, nsString aData, int32_t aStartOffset, int32_t aEndOffset);
-  prio(high) sync SetSelectionBoundsAt(uint64_t aID, int32_t aSelectionNum,
-                                       int32_t aStartOffset, int32_t aEndOffset)
-    returns(bool aSucceeded);
-  prio(high) sync AddToSelection(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset)
-    returns(bool aSucceeded);
-  prio(high) sync RemoveFromSelection(uint64_t aID, int32_t aSelectionNum)
-    returns(bool aSucceeded);
-
-  async ScrollSubstringTo(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
-                          uint32_t aScrollType);
-  async ScrollSubstringToPoint(uint64_t aID,
-                               int32_t aStartOffset,
-                               int32_t aEndOffset,
-                               uint32_t aCoordinateType,
-                               int32_t aX, int32_t aY);
-
-  prio(high) sync Text(uint64_t aID) returns(nsString aText);
-  prio(high) sync ReplaceText(uint64_t aID, nsString aText);
-  prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition)
-    returns(bool aValid);
-  prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
-    returns(bool aValid);
-  prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
-    returns(bool aValid);
-  prio(high) sync DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
-    returns(bool aValid);
-  prio(high) sync PasteText(uint64_t aID, int32_t aPosition)
-    returns(bool aValid);
-
-  prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(IntPoint aRetVal);
-  prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
-
-  prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
-  prio(high) sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
-  prio(high) sync IsLinkValid(uint64_t aID) returns(bool aRetVal);
-  prio(high) sync AnchorCount(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
-  prio(high) sync AnchorURIAt(uint64_t aID, uint32_t aIndex) returns(nsCString aURI, bool aOk);
-  prio(high) sync AnchorAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfAnchor, bool aOk);
-
-  prio(high) sync LinkCount(uint64_t aID) returns(uint32_t aCount);
-  prio(high) sync LinkAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfLink, bool aOk);
-  prio(high) sync LinkIndexOf(uint64_t aID, uint64_t aLinkID) returns(int32_t aIndex);
-  prio(high) sync LinkIndexAtOffset(uint64_t aID, uint32_t aOffset) returns(int32_t aIndex);
-
-  prio(high) sync TableOfACell(uint64_t aID) returns(uint64_t aTableID, bool aOk);
-  prio(high) sync ColIdx(uint64_t aID) returns(uint32_t aIndex);
-  prio(high) sync RowIdx(uint64_t aID) returns(uint32_t aIndex);
-  prio(high) sync ColExtent(uint64_t aID) returns(uint32_t aExtent);
-  prio(high) sync RowExtent(uint64_t aID) returns(uint32_t aExtent);
-  prio(high) sync ColHeaderCells(uint64_t aID) returns(uint64_t[] aCells);
-  prio(high) sync RowHeaderCells(uint64_t aID) returns(uint64_t[] aCells);
-  prio(high) sync IsCellSelected(uint64_t aID) returns(bool aSelected);
-
-  prio(high) sync TableCaption(uint64_t aID) returns(uint64_t aCaptionID, bool aOk);
-  prio(high) sync TableSummary(uint64_t aID) returns(nsString aSummary);
-  prio(high) sync TableColumnCount(uint64_t aID) returns(uint32_t aColCount);
-  prio(high) sync TableRowCount(uint64_t aID) returns(uint32_t aRowCount);
-  prio(high) sync TableCellAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint64_t aCellID, bool aOk);
-  prio(high) sync TableCellIndexAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(int32_t aIndex);
-  prio(high) sync TableColumnIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aCol);
-  prio(high) sync TableRowIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow);
-  prio(high) sync TableRowAndColumnIndicesAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow, int32_t aCol);
-  prio(high) sync TableColumnExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent);
-  prio(high) sync TableRowExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent);
-  prio(high) sync TableColumnDescription(uint64_t aID, uint32_t aCol) returns(nsString aDescription);
-  prio(high) sync TableRowDescription(uint64_t aID, uint32_t aRow) returns(nsString aDescription);
-  prio(high) sync TableColumnSelected(uint64_t aID, uint32_t aCol) returns(bool aSelected);
-  prio(high) sync TableRowSelected(uint64_t aID, uint32_t aRow) returns(bool aSelected);
-  prio(high) sync TableCellSelected(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(bool aSelected);
-  prio(high) sync TableSelectedCellCount(uint64_t aID) returns(uint32_t aSelectedCells);
-  prio(high) sync TableSelectedColumnCount(uint64_t aID) returns(uint32_t aSelectedColumns);
-  prio(high) sync TableSelectedRowCount(uint64_t aID) returns(uint32_t aSelectedRows);
-  prio(high) sync TableSelectedCells(uint64_t aID) returns(uint64_t[] aCellIDs);
-  prio(high) sync TableSelectedCellIndices(uint64_t aID) returns(uint32_t[] aCellIndeces);
-  prio(high) sync TableSelectedColumnIndices(uint64_t aID) returns(uint32_t[] aColumnIndeces);
-  prio(high) sync TableSelectedRowIndices(uint64_t aID) returns(uint32_t[] aRowIndeces);
-  prio(high) sync TableSelectColumn(uint64_t aID, uint32_t aCol);
-  prio(high) sync TableSelectRow(uint64_t aID, uint32_t aRow);
-  prio(high) sync TableUnselectColumn(uint64_t aID, uint32_t aCol);
-  prio(high) sync TableUnselectRow(uint64_t aID, uint32_t aRow);
-  prio(high) sync TableIsProbablyForLayout(uint64_t aID) returns(bool aForLayout);
-  prio(high) sync AtkTableColumnHeader(uint64_t aID, int32_t aCol)
-    returns(uint64_t aHeaderID, bool aOk);
-  prio(high) sync AtkTableRowHeader(uint64_t aID, int32_t aRow)
-    returns(uint64_t aHeaderID, bool aOk);
-
-  prio(high) sync SelectedItems(uint64_t aID) returns(uint64_t[] aSelectedItemIDs);
-  prio(high) sync SelectedItemCount(uint64_t aID) returns(uint32_t aCount);
-  prio(high) sync GetSelectedItem(uint64_t aID, uint32_t aIndex) returns(uint64_t aSelected, bool aOk);
-  prio(high) sync IsItemSelected(uint64_t aID, uint32_t aIndex) returns(bool aSelected);
-  prio(high) sync AddItemToSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess);
-  prio(high) sync RemoveItemFromSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess);
-  prio(high) sync SelectAll(uint64_t aID) returns(bool aSuccess);
-  prio(high) sync UnselectAll(uint64_t aID) returns(bool aSuccess);
-
-  async TakeSelection(uint64_t aID);
-  async SetSelected(uint64_t aID, bool aSelected);
-
-  prio(high) sync DoAction(uint64_t aID, uint8_t aIndex) returns(bool aSuccess);
-  prio(high) sync ActionCount(uint64_t aID) returns(uint8_t aCount);
-  prio(high) sync ActionDescriptionAt(uint64_t aID, uint8_t aIndex) returns(nsString aDescription);
-  prio(high) sync ActionNameAt(uint64_t aID, uint8_t aIndex) returns(nsString aName);
-  prio(high) sync AccessKey(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
-  prio(high) sync KeyboardShortcut(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask);
-  prio(high) sync AtkKeyBinding(uint64_t aID) returns(nsString aResult);
-
-  prio(high) sync CurValue(uint64_t aID) returns(double aValue);
-  prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal);
-  prio(high) sync MinValue(uint64_t aID) returns(double aValue);
-  prio(high) sync MaxValue(uint64_t aID) returns(double aValue);
-  prio(high) sync Step(uint64_t aID) returns(double aStep);
-
-  async TakeFocus(uint64_t aID);
-  prio(high) sync FocusedChild(uint64_t aID)
-    returns(uint64_t aChild, bool aOk);
-
-  prio(high) sync Language(uint64_t aID) returns(nsString aLocale);
-  prio(high) sync DocType(uint64_t aID) returns(nsString aType);
-  prio(high) sync Title(uint64_t aID) returns(nsString aTitle);
-  prio(high) sync URL(uint64_t aID) returns(nsString aURL);
-  prio(high) sync MimeType(uint64_t aID) returns(nsString aMime);
-  prio(high) sync URLDocTypeMimeType(uint64_t aID) returns(nsString aURL, nsString aDocType, nsString aMimeType);
-
-  prio(high) sync AccessibleAtPoint(uint64_t aID, int32_t aX, int32_t aY, bool aNeedsScreenCoords, uint32_t aWhich)
-    returns(uint64_t aResult, bool aOk);
-
-  prio(high) sync Extents(uint64_t aID, bool aNeedsScreenCoords)
-    returns(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight);
-  prio(high) sync DOMNodeID(uint64_t aID) returns(nsString aDOMNodeID);
-};
-
-}
-}
deleted file mode 100644
--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ /dev/null
@@ -1,1067 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ProxyAccessible.h"
-#include "mozilla/a11y/DocAccessibleParent.h"
-#include "DocAccessible.h"
-#include "mozilla/a11y/DocManager.h"
-#include "mozilla/dom/Element.h"
-#include "mozilla/dom/TabParent.h"
-#include "mozilla/unused.h"
-#include "mozilla/a11y/Platform.h"
-#include "RelationType.h"
-#include "mozilla/a11y/Role.h"
-#include "xpcAccessibleDocument.h"
-
-namespace mozilla {
-namespace a11y {
-
-uint64_t
-ProxyAccessible::State() const
-{
-  uint64_t state = 0;
-  Unused << mDoc->SendState(mID, &state);
-  return state;
-}
-
-uint64_t
-ProxyAccessible::NativeState() const
-{
-  uint64_t state = 0;
-  Unused << mDoc->SendNativeState(mID, &state);
-  return state;
-}
-
-void
-ProxyAccessible::Name(nsString& aName) const
-{
-  Unused << mDoc->SendName(mID, &aName);
-}
-
-void
-ProxyAccessible::Value(nsString& aValue) const
-{
-  Unused << mDoc->SendValue(mID, &aValue);
-}
-
-void
-ProxyAccessible::Help(nsString& aHelp) const
-{
-  Unused << mDoc->SendHelp(mID, &aHelp);
-}
-
-void
-ProxyAccessible::Description(nsString& aDesc) const
-{
-  Unused << mDoc->SendDescription(mID, &aDesc);
-}
-
-void
-ProxyAccessible::Attributes(nsTArray<Attribute> *aAttrs) const
-{
-  Unused << mDoc->SendAttributes(mID, aAttrs);
-}
-
-nsTArray<ProxyAccessible*>
-ProxyAccessible::RelationByType(RelationType aType) const
-{
-  nsTArray<uint64_t> targetIDs;
-  Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
-                                     &targetIDs);
-
-  size_t targetCount = targetIDs.Length();
-  nsTArray<ProxyAccessible*> targets(targetCount);
-  for (size_t i = 0; i < targetCount; i++)
-    if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
-      targets.AppendElement(proxy);
-
-  return Move(targets);
-}
-
-void
-ProxyAccessible::Relations(nsTArray<RelationType>* aTypes,
-                           nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets)
-  const
-{
-  nsTArray<RelationTargets> ipcRelations;
-  Unused << mDoc->SendRelations(mID, &ipcRelations);
-
-  size_t relationCount = ipcRelations.Length();
-  aTypes->SetCapacity(relationCount);
-  aTargetSets->SetCapacity(relationCount);
-  for (size_t i = 0; i < relationCount; i++) {
-    uint32_t type = ipcRelations[i].Type();
-    if (type > static_cast<uint32_t>(RelationType::LAST))
-      continue;
-
-    size_t targetCount = ipcRelations[i].Targets().Length();
-    nsTArray<ProxyAccessible*> targets(targetCount);
-    for (size_t j = 0; j < targetCount; j++)
-      if (ProxyAccessible* proxy = mDoc->GetAccessible(ipcRelations[i].Targets()[j]))
-        targets.AppendElement(proxy);
-
-    if (targets.IsEmpty())
-      continue;
-
-    aTargetSets->AppendElement(Move(targets));
-    aTypes->AppendElement(static_cast<RelationType>(type));
-  }
-}
-
-bool
-ProxyAccessible::IsSearchbox() const
-{
-  bool retVal = false;
-  Unused << mDoc->SendIsSearchbox(mID, &retVal);
-  return retVal;
-}
-
-nsIAtom*
-ProxyAccessible::LandmarkRole() const
-{
-  nsString landmark;
-  Unused << mDoc->SendLandmarkRole(mID, &landmark);
-  return NS_GetStaticAtom(landmark);
-}
-
-nsIAtom*
-ProxyAccessible::ARIARoleAtom() const
-{
-  nsString role;
-  Unused << mDoc->SendARIARoleAtom(mID, &role);
-  return NS_GetStaticAtom(role);
-}
-
-int32_t
-ProxyAccessible::GetLevelInternal()
-{
-  int32_t level = 0;
-  Unused << mDoc->SendGetLevelInternal(mID, &level);
-  return level;
-}
-
-void
-ProxyAccessible::ScrollTo(uint32_t aScrollType)
-{
-  Unused << mDoc->SendScrollTo(mID, aScrollType);
-}
-
-void
-ProxyAccessible::ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY)
-{
-  Unused << mDoc->SendScrollToPoint(mID, aScrollType, aX, aY);
-}
-
-int32_t
-ProxyAccessible::CaretLineNumber()
-{
-  int32_t line = -1;
-  Unused << mDoc->SendCaretOffset(mID, &line);
-  return line;
-}
-
-int32_t
-ProxyAccessible::CaretOffset()
-{
-  int32_t offset = 0;
-  Unused << mDoc->SendCaretOffset(mID, &offset);
-  return offset;
-}
-
-void
-ProxyAccessible::SetCaretOffset(int32_t aOffset)
-{
-  Unused << mDoc->SendSetCaretOffset(mID, aOffset);
-}
-
-int32_t
-ProxyAccessible::CharacterCount()
-{
-  int32_t count = 0;
-  Unused << mDoc->SendCharacterCount(mID, &count);
-  return count;
-}
-
-int32_t
-ProxyAccessible::SelectionCount()
-{
-  int32_t count = 0;
-  Unused << mDoc->SendSelectionCount(mID, &count);
-  return count;
-}
-
-bool
-ProxyAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
-                               nsString& aText) const
-{
-  bool valid;
-  Unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid);
-  return valid;
-}
-
-void
-ProxyAccessible::GetTextAfterOffset(int32_t aOffset,
-                                    AccessibleTextBoundary aBoundaryType,
-                                    nsString& aText, int32_t* aStartOffset,
-                                    int32_t* aEndOffset)
-{
-  Unused << mDoc->SendGetTextAfterOffset(mID, aOffset, aBoundaryType,
-                                         &aText, aStartOffset, aEndOffset);
-}
-
-void
-ProxyAccessible::GetTextAtOffset(int32_t aOffset,
-                                 AccessibleTextBoundary aBoundaryType,
-                                 nsString& aText, int32_t* aStartOffset,
-                                 int32_t* aEndOffset)
-{
-  Unused << mDoc->SendGetTextAtOffset(mID, aOffset, aBoundaryType,
-                                      &aText, aStartOffset, aEndOffset);
-}
-
-void
-ProxyAccessible::GetTextBeforeOffset(int32_t aOffset,
-                                     AccessibleTextBoundary aBoundaryType,
-                                     nsString& aText, int32_t* aStartOffset,
-                                     int32_t* aEndOffset)
-{
-  Unused << mDoc->SendGetTextBeforeOffset(mID, aOffset, aBoundaryType,
-                                          &aText, aStartOffset, aEndOffset);
-}
-
-char16_t
-ProxyAccessible::CharAt(int32_t aOffset)
-{
-  uint16_t retval = 0;
-  Unused << mDoc->SendCharAt(mID, aOffset, &retval);
-  return static_cast<char16_t>(retval);
-}
-
-void
-ProxyAccessible::TextAttributes(bool aIncludeDefAttrs,
-                                int32_t aOffset,
-                                nsTArray<Attribute>* aAttributes,
-                                int32_t* aStartOffset,
-                                int32_t* aEndOffset)
-{
-  Unused << mDoc->SendTextAttributes(mID, aIncludeDefAttrs, aOffset,
-                                     aAttributes, aStartOffset, aEndOffset);
-}
-
-void
-ProxyAccessible::DefaultTextAttributes(nsTArray<Attribute>* aAttrs)
-{
-  Unused << mDoc->SendDefaultTextAttributes(mID, aAttrs);
-}
-
-nsIntRect
-ProxyAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
-                            uint32_t aCoordType)
-{
-  nsIntRect rect;
-  Unused <<
-    mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType, &rect);
-  return rect;
-}
-
-nsIntRect
-ProxyAccessible::CharBounds(int32_t aOffset, uint32_t aCoordType)
-{
-  nsIntRect rect;
-  Unused <<
-    mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect);
-  return rect;
-}
-
-int32_t
-ProxyAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType)
-{
-  int32_t retVal = -1;
-  Unused << mDoc->SendOffsetAtPoint(mID, aX, aY, aCoordType, &retVal);
-  return retVal;
-}
-
-bool
-ProxyAccessible::SelectionBoundsAt(int32_t aSelectionNum,
-                                   nsString& aData,
-                                   int32_t* aStartOffset,
-                                   int32_t* aEndOffset)
-{
-  bool retVal = false;
-  Unused << mDoc->SendSelectionBoundsAt(mID, aSelectionNum, &retVal, &aData,
-                                        aStartOffset, aEndOffset);
-  return retVal;
-}
-
-bool
-ProxyAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
-                                      int32_t aStartOffset,
-                                      int32_t aEndOffset)
-{
-  bool retVal = false;
-  Unused << mDoc->SendSetSelectionBoundsAt(mID, aSelectionNum, aStartOffset,
-                                           aEndOffset, &retVal);
-  return retVal;
-}
-
-bool
-ProxyAccessible::AddToSelection(int32_t aStartOffset,
-                                int32_t aEndOffset)
-{
-  bool retVal = false;
-  Unused << mDoc->SendAddToSelection(mID, aStartOffset, aEndOffset, &retVal);
-  return retVal;
-}
-
-bool
-ProxyAccessible::RemoveFromSelection(int32_t aSelectionNum)
-{
-  bool retVal = false;
-  Unused << mDoc->SendRemoveFromSelection(mID, aSelectionNum, &retVal);
-  return retVal;
-}
-
-void
-ProxyAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
-                                   uint32_t aScrollType)
-{
-  Unused << mDoc->SendScrollSubstringTo(mID, aStartOffset, aEndOffset, aScrollType);
-}
-
-void
-ProxyAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
-                                        int32_t aEndOffset,
-                                        uint32_t aCoordinateType,
-                                        int32_t aX, int32_t aY)
-{
-  Unused << mDoc->SendScrollSubstringToPoint(mID, aStartOffset, aEndOffset,
-                                             aCoordinateType, aX, aY);
-}
-
-void
-ProxyAccessible::Text(nsString* aText)
-{
-  Unused << mDoc->SendText(mID, aText);
-}
-
-void
-ProxyAccessible::ReplaceText(const nsString& aText)
-{
-  Unused << mDoc->SendReplaceText(mID, aText);
-}
-
-bool
-ProxyAccessible::InsertText(const nsString& aText, int32_t aPosition)
-{
-  bool valid;
-  Unused << mDoc->SendInsertText(mID, aText, aPosition, &valid);
-  return valid;
-}
-
-bool
-ProxyAccessible::CopyText(int32_t aStartPos, int32_t aEndPos)
-{
-  bool valid;
-  Unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid);
-  return valid;
-}
-
-bool
-ProxyAccessible::CutText(int32_t aStartPos, int32_t aEndPos)
-{
-  bool valid;
-  Unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid);
-  return valid;
-}
-
-bool
-ProxyAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos)
-{
-  bool valid;
-  Unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid);
-  return valid;
-}
-
-bool
-ProxyAccessible::PasteText(int32_t aPosition)
-{
-  bool valid;
-  Unused << mDoc->SendPasteText(mID, aPosition, &valid);
-  return valid;
-}
-
-nsIntPoint
-ProxyAccessible::ImagePosition(uint32_t aCoordType)
-{
-  nsIntPoint retVal;
-  Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal);
-  return retVal;
-}
-
-nsIntSize
-ProxyAccessible::ImageSize()
-{
-  nsIntSize retVal;
-  Unused << mDoc->SendImageSize(mID, &retVal);
-  return retVal;
-}
-
-uint32_t
-ProxyAccessible::StartOffset(bool* aOk)
-{
-  uint32_t retVal = 0;
-  Unused << mDoc->SendStartOffset(mID, &retVal, aOk);
-  return retVal;
-}
-
-uint32_t
-ProxyAccessible::EndOffset(bool* aOk)
-{
-  uint32_t retVal = 0;
-  Unused << mDoc->SendEndOffset(mID, &retVal, aOk);
-  return retVal;
-}
-
-bool
-ProxyAccessible::IsLinkValid()
-{
-  bool retVal = false;
-  Unused << mDoc->SendIsLinkValid(mID, &retVal);
-  return retVal;
-}
-
-uint32_t
-ProxyAccessible::AnchorCount(bool* aOk)
-{
-  uint32_t retVal = 0;
-  Unused << mDoc->SendAnchorCount(mID, &retVal, aOk);
-  return retVal;
-}
-
-void
-ProxyAccessible::AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk)
-{
-  Unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk);
-}
-
-ProxyAccessible*
-ProxyAccessible::AnchorAt(uint32_t aIndex)
-{
-  uint64_t id = 0;
-  bool ok = false;
-  Unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok);
-  return ok ? mDoc->GetAccessible(id) : nullptr;
-}
-
-uint32_t
-ProxyAccessible::LinkCount()
-{
-  uint32_t retVal = 0;
-  Unused << mDoc->SendLinkCount(mID, &retVal);
-  return retVal;
-}
-
-ProxyAccessible*
-ProxyAccessible::LinkAt(const uint32_t& aIndex)
-{
-  uint64_t linkID = 0;
-  bool ok = false;
-  Unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok);
-  return ok ? mDoc->GetAccessible(linkID) : nullptr;
-}
-
-int32_t
-ProxyAccessible::LinkIndexOf(ProxyAccessible* aLink)
-{
-  int32_t retVal = -1;
-  if (aLink) {
-    Unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal);
-  }
-
-  return retVal;
-}
-
-int32_t
-ProxyAccessible::LinkIndexAtOffset(uint32_t aOffset)
-{
-  int32_t retVal = -1;
-  Unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal);
-  return retVal;
-}
-
-ProxyAccessible*
-ProxyAccessible::TableOfACell()
-{
-  uint64_t tableID = 0;
-  bool ok = false;
-  Unused << mDoc->SendTableOfACell(mID, &tableID, &ok);
-  return ok ? mDoc->GetAccessible(tableID) : nullptr;
-}
-
-uint32_t
-ProxyAccessible::ColIdx()
-{
-  uint32_t index = 0;
-  Unused << mDoc->SendColIdx(mID, &index);
-  return index;
-}
-
-uint32_t
-ProxyAccessible::RowIdx()
-{
-  uint32_t index = 0;
-  Unused << mDoc->SendRowIdx(mID, &index);
-  return index;
-}
-
-uint32_t
-ProxyAccessible::ColExtent()
-{
-  uint32_t extent = 0;
-  Unused << mDoc->SendColExtent(mID, &extent);
-  return extent;
-}
-
-uint32_t
-ProxyAccessible::RowExtent()
-{
-  uint32_t extent = 0;
-  Unused << mDoc->SendRowExtent(mID, &extent);
-  return extent;
-}
-
-void
-ProxyAccessible::ColHeaderCells(nsTArray<ProxyAccessible*>* aCells)
-{
-  nsTArray<uint64_t> targetIDs;
-  Unused << mDoc->SendColHeaderCells(mID, &targetIDs);
-
-  size_t targetCount = targetIDs.Length();
-  for (size_t i = 0; i < targetCount; i++) {
-    aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
-  }
-}
-
-void
-ProxyAccessible::RowHeaderCells(nsTArray<ProxyAccessible*>* aCells)
-{
-  nsTArray<uint64_t> targetIDs;
-  Unused << mDoc->SendRowHeaderCells(mID, &targetIDs);
-
-  size_t targetCount = targetIDs.Length();
-  for (size_t i = 0; i < targetCount; i++) {
-    aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
-  }
-}
-
-bool
-ProxyAccessible::IsCellSelected()
-{
-  bool selected = false;
-  Unused << mDoc->SendIsCellSelected(mID, &selected);
-  return selected;
-}
-
-ProxyAccessible*
-ProxyAccessible::TableCaption()
-{
-  uint64_t captionID = 0;
-  bool ok = false;
-  Unused << mDoc->SendTableCaption(mID, &captionID, &ok);
-  return ok ? mDoc->GetAccessible(captionID) : nullptr;
-}
-
-void
-ProxyAccessible::TableSummary(nsString& aSummary)
-{
-  Unused << mDoc->SendTableSummary(mID, &aSummary);
-}
-
-uint32_t
-ProxyAccessible::TableColumnCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendTableColumnCount(mID, &count);
-  return count;
-}
-
-uint32_t
-ProxyAccessible::TableRowCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendTableRowCount(mID, &count);
-  return count;
-}
-
-ProxyAccessible*
-ProxyAccessible::TableCellAt(uint32_t aRow, uint32_t aCol)
-{
-  uint64_t cellID = 0;
-  bool ok = false;
-  Unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok);
-  return ok ? mDoc->GetAccessible(cellID) : nullptr;
-}
-
-int32_t
-ProxyAccessible::TableCellIndexAt(uint32_t aRow, uint32_t aCol)
-{
-  int32_t index = 0;
-  Unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index);
-  return index;
-}
-
-int32_t
-ProxyAccessible::TableColumnIndexAt(uint32_t aCellIndex)
-{
-  int32_t index = 0;
-  Unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index);
-  return index;
-}
-
-int32_t
-ProxyAccessible::TableRowIndexAt(uint32_t aCellIndex)
-{
-  int32_t index = 0;
-  Unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index);
-  return index;
-}
-
-void
-ProxyAccessible::TableRowAndColumnIndicesAt(uint32_t aCellIndex,
-                                            int32_t* aRow, int32_t* aCol)
-{
-  Unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol);
-}
-
-uint32_t
-ProxyAccessible::TableColumnExtentAt(uint32_t aRow, uint32_t aCol)
-{
-  uint32_t extent = 0;
-  Unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent);
-  return extent;
-}
-
-uint32_t
-ProxyAccessible::TableRowExtentAt(uint32_t aRow, uint32_t aCol)
-{
-  uint32_t extent = 0;
-  Unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent);
-  return extent;
-}
-
-void
-ProxyAccessible::TableColumnDescription(uint32_t aCol, nsString& aDescription)
-{
-  Unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription);
-}
-
-void
-ProxyAccessible::TableRowDescription(uint32_t aRow, nsString& aDescription)
-{
-  Unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription);
-}
-
-bool
-ProxyAccessible::TableColumnSelected(uint32_t aCol)
-{
-  bool selected = false;
-  Unused << mDoc->SendTableColumnSelected(mID, aCol, &selected);
-  return selected;
-}
-
-bool
-ProxyAccessible::TableRowSelected(uint32_t aRow)
-{
-  bool selected = false;
-  Unused << mDoc->SendTableRowSelected(mID, aRow, &selected);
-  return selected;
-}
-
-bool
-ProxyAccessible::TableCellSelected(uint32_t aRow, uint32_t aCol)
-{
-  bool selected = false;
-  Unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected);
-  return selected;
-}
-
-uint32_t
-ProxyAccessible::TableSelectedCellCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendTableSelectedCellCount(mID, &count);
-  return count;
-}
-
-uint32_t
-ProxyAccessible::TableSelectedColumnCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendTableSelectedColumnCount(mID, &count);
-  return count;
-}
-
-uint32_t
-ProxyAccessible::TableSelectedRowCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendTableSelectedRowCount(mID, &count);
-  return count;
-}
-
-void
-ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
-{
-  AutoTArray<uint64_t, 30> cellIDs;
-  Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
-  aCellIDs->SetCapacity(cellIDs.Length());
-  for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
-    aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i]));
-  }
-}
-
-void
-ProxyAccessible::TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices)
-{
-  Unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices);
-}
-
-void
-ProxyAccessible::TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices)
-{
-  Unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices);
-}
-
-void
-ProxyAccessible::TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices)
-{
-  Unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices);
-}
-
-void
-ProxyAccessible::TableSelectColumn(uint32_t aCol)
-{
-  Unused << mDoc->SendTableSelectColumn(mID, aCol);
-}
-
-void
-ProxyAccessible::TableSelectRow(uint32_t aRow)
-{
-  Unused << mDoc->SendTableSelectRow(mID, aRow);
-}
-
-void
-ProxyAccessible::TableUnselectColumn(uint32_t aCol)
-{
-  Unused << mDoc->SendTableUnselectColumn(mID, aCol);
-}
-
-void
-ProxyAccessible::TableUnselectRow(uint32_t aRow)
-{
-  Unused << mDoc->SendTableUnselectRow(mID, aRow);
-}
-
-bool
-ProxyAccessible::TableIsProbablyForLayout()
-{
-  bool forLayout = false;
-  Unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout);
-  return forLayout;
-}
-
-ProxyAccessible*
-ProxyAccessible::AtkTableColumnHeader(int32_t aCol)
-{
-  uint64_t headerID = 0;
-  bool ok = false;
-  Unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
-  return ok ? mDoc->GetAccessible(headerID) : nullptr;
-}
-
-ProxyAccessible*
-ProxyAccessible::AtkTableRowHeader(int32_t aRow)
-{
-  uint64_t headerID = 0;
-  bool ok = false;
-  Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
-  return ok ? mDoc->GetAccessible(headerID) : nullptr;
-}
-
-void
-ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
-{
-  AutoTArray<uint64_t, 10> itemIDs;
-  Unused << mDoc->SendSelectedItems(mID, &itemIDs);
-  aSelectedItems->SetCapacity(itemIDs.Length());
-  for (size_t i = 0; i < itemIDs.Length(); ++i) {
-    aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i]));
-  }
-}
-
-uint32_t
-ProxyAccessible::SelectedItemCount()
-{
-  uint32_t count = 0;
-  Unused << mDoc->SendSelectedItemCount(mID, &count);
-  return count;
-}
-
-ProxyAccessible*
-ProxyAccessible::GetSelectedItem(uint32_t aIndex)
-{
-  uint64_t selectedItemID = 0;
-  bool ok = false;
-  Unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok);
-  return ok ? mDoc->GetAccessible(selectedItemID) : nullptr;
-}
-
-bool
-ProxyAccessible::IsItemSelected(uint32_t aIndex)
-{
-  bool selected = false;
-  Unused << mDoc->SendIsItemSelected(mID, aIndex, &selected);
-  return selected;
-}
- 
-bool
-ProxyAccessible::AddItemToSelection(uint32_t aIndex)
-{
-  bool success = false;
-  Unused << mDoc->SendAddItemToSelection(mID, aIndex, &success);
-  return success;
-}
-
-bool
-ProxyAccessible::RemoveItemFromSelection(uint32_t aIndex)
-{
-  bool success = false;
-  Unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success);
-  return success;
-}
-
-bool
-ProxyAccessible::SelectAll()
-{
-  bool success = false;
-  Unused << mDoc->SendSelectAll(mID, &success);
-  return success;
-}
-
-bool
-ProxyAccessible::UnselectAll()
-{
-  bool success = false;
-  Unused << mDoc->SendUnselectAll(mID, &success);
-  return success;
-}
-
-void
-ProxyAccessible::TakeSelection()
-{
-  Unused << mDoc->SendTakeSelection(mID);
-}
-
-void
-ProxyAccessible::SetSelected(bool aSelect)
-{
-  Unused << mDoc->SendSetSelected(mID, aSelect);
-}
-
-bool
-ProxyAccessible::DoAction(uint8_t aIndex)
-{
-  bool success = false;
-  Unused << mDoc->SendDoAction(mID, aIndex, &success);
-  return success;
-}
-
-uint8_t
-ProxyAccessible::ActionCount()
-{
-  uint8_t count = 0;
-  Unused << mDoc->SendActionCount(mID, &count);
-  return count;
-}
-
-void
-ProxyAccessible::ActionDescriptionAt(uint8_t aIndex, nsString& aDescription)
-{
-  Unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription);
-}
-
-void
-ProxyAccessible::ActionNameAt(uint8_t aIndex, nsString& aName)
-{
-  Unused << mDoc->SendActionNameAt(mID, aIndex, &aName);
-}
-
-KeyBinding
-ProxyAccessible::AccessKey()
-{
-  uint32_t key = 0;
-  uint32_t modifierMask = 0;
-  Unused << mDoc->SendAccessKey(mID, &key, &modifierMask);
-  return KeyBinding(key, modifierMask);
-}
-
-KeyBinding
-ProxyAccessible::KeyboardShortcut()
-{
-  uint32_t key = 0;
-  uint32_t modifierMask = 0;
-  Unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask);
-  return KeyBinding(key, modifierMask);
-}
-
-void
-ProxyAccessible::AtkKeyBinding(nsString& aBinding)
-{
-  Unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
-}
-
-double
-ProxyAccessible::CurValue()
-{
-  double val = UnspecifiedNaN<double>();
-  Unused << mDoc->SendCurValue(mID, &val);
-  return val;
-}
-
-bool
-ProxyAccessible::SetCurValue(double aValue)
-{
-  bool success = false;
-  Unused << mDoc->SendSetCurValue(mID, aValue, &success);
-  return success;
-}
-
-double
-ProxyAccessible::MinValue()
-{
-  double val = UnspecifiedNaN<double>();
-  Unused << mDoc->SendMinValue(mID, &val);
-  return val;
-}
-
-double
-ProxyAccessible::MaxValue()
-{
-  double val = UnspecifiedNaN<double>();
-  Unused << mDoc->SendMaxValue(mID, &val);
-  return val;
-}
-
-double
-ProxyAccessible::Step()
-{
-  double step = UnspecifiedNaN<double>();
-  Unused << mDoc->SendStep(mID, &step);
-  return step;
-}
-
-void
-ProxyAccessible::TakeFocus()
-{
-  Unused << mDoc->SendTakeFocus(mID);
-}
-
-ProxyAccessible*
-ProxyAccessible::FocusedChild()
-{
-  uint64_t childID = 0;
-  bool ok = false;
-  Unused << mDoc->SendFocusedChild(mID, &childID, &ok);
-  return ok ? mDoc->GetAccessible(childID) : nullptr;
-}
-
-ProxyAccessible*
-ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
-                              Accessible::EWhichChildAtPoint aWhichChild)
-{
-  uint64_t childID = 0;
-  bool ok = false;
-  Unused << mDoc->SendAccessibleAtPoint(mID, aX, aY, false,
-                                        static_cast<uint32_t>(aWhichChild),
-                                        &childID, &ok);
-  return ok ? mDoc->GetAccessible(childID) : nullptr;
-}
-
-nsIntRect
-ProxyAccessible::Bounds()
-{
-  nsIntRect rect;
-  Unused << mDoc->SendExtents(mID, false,
-                              &(rect.x), &(rect.y),
-                              &(rect.width), &(rect.height));
-  return rect;
-}
-
-void
-ProxyAccessible::Language(nsString& aLocale)
-{
-  Unused << mDoc->SendLanguage(mID, &aLocale);
-}
-
-void
-ProxyAccessible::DocType(nsString& aType)
-{
-  Unused << mDoc->SendDocType(mID, &aType);
-}
-
-void
-ProxyAccessible::Title(nsString& aTitle)
-{
-  Unused << mDoc->SendTitle(mID, &aTitle);
-}
-
-void
-ProxyAccessible::URL(nsString& aURL)
-{
-  Unused << mDoc->SendURL(mID, &aURL);
-}
-
-void
-ProxyAccessible::MimeType(nsString aMime)
-{
-  Unused << mDoc->SendMimeType(mID, &aMime);
-}
-
-void
-ProxyAccessible::URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
-                                    nsString& aMimeType)
-{
-  Unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType);
-}
-
-ProxyAccessible*
-ProxyAccessible::AccessibleAtPoint(int32_t aX, int32_t aY,
-                                   bool aNeedsScreenCoords)
-{
-  uint64_t childID = 0;
-  bool ok = false;
-  Unused <<
-    mDoc->SendAccessibleAtPoint(mID, aX, aY, aNeedsScreenCoords,
-                                static_cast<uint32_t>(Accessible::eDirectChild),
-                                &childID, &ok);
-  return ok ? mDoc->GetAccessible(childID) : nullptr;
-}
-
-void
-ProxyAccessible::Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
-                        int32_t* aWidth, int32_t* aHeight)
-{
-  Unused << mDoc->SendExtents(mID, aNeedsScreenCoords, aX, aY, aWidth, aHeight);
-}
-
-void
-ProxyAccessible::DOMNodeID(nsString& aID)
-{
-  Unused << mDoc->SendDOMNodeID(mID, &aID);
-}
-
-}
-}
deleted file mode 100644
--- a/accessible/ipc/other/ProxyAccessible.h
+++ /dev/null
@@ -1,326 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_ProxyAccessible_h
-#define mozilla_a11y_ProxyAccessible_h
-
-#include "Accessible.h"
-#include "mozilla/a11y/ProxyAccessibleBase.h"
-#include "mozilla/a11y/Role.h"
-#include "nsIAccessibleText.h"
-#include "nsIAccessibleTypes.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsRect.h"
-
-namespace mozilla {
-namespace a11y {
-
-class ProxyAccessible : public ProxyAccessibleBase<ProxyAccessible>
-{
-public:
-
-  ProxyAccessible(uint64_t aID, ProxyAccessible* aParent,
-                  DocAccessibleParent* aDoc, role aRole, uint32_t aInterfaces)
-    : ProxyAccessibleBase(aID, aParent, aDoc, aRole, aInterfaces)
-
-  {
-    MOZ_COUNT_CTOR_INHERITED(ProxyAccessible, ProxyAccessibleBase);
-  }
-
-  ~ProxyAccessible()
-  {
-    MOZ_COUNT_DTOR_INHERITED(ProxyAccessible, ProxyAccessibleBase);
-  }
-
-  /*
-   * Return the states for the proxied accessible.
-   */
-  uint64_t State() const;
-
-  /*
-   * Return the native states for the proxied accessible.
-   */
-  uint64_t NativeState() const;
-
-  /*
-   * Set aName to the name of the proxied accessible.
-   */
-  void Name(nsString& aName) const;
-
-  /*
-   * Set aValue to the value of the proxied accessible.
-   */
-  void Value(nsString& aValue) const;
-
-  /*
-   * Set aHelp to the help string of the proxied accessible.
-   */
-  void Help(nsString& aHelp) const;
-
-  /**
-   * Set aDesc to the description of the proxied accessible.
-   */
-  void Description(nsString& aDesc) const;
-
-  /**
-   * Get the set of attributes on the proxied accessible.
-   */
-  void Attributes(nsTArray<Attribute> *aAttrs) const;
-
-  /**
-   * Return set of targets of given relation type.
-   */
-  nsTArray<ProxyAccessible*> RelationByType(RelationType aType) const;
-
-  /**
-   * Get all relations for this accessible.
-   */
-  void Relations(nsTArray<RelationType>* aTypes,
-                 nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) const;
-
-  bool IsSearchbox() const;
-
-  nsIAtom* LandmarkRole() const;
-
-  nsIAtom* ARIARoleAtom() const;
-
-  int32_t GetLevelInternal();
-  void ScrollTo(uint32_t aScrollType);
-  void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY);
-
-  int32_t CaretLineNumber();
-  int32_t CaretOffset();
-  void SetCaretOffset(int32_t aOffset);
-
-  int32_t CharacterCount();
-  int32_t SelectionCount();
-
-  /**
-   * Get the text between the given offsets.
-   */
-  bool TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
-                     nsString& aText) const;
-
-  void GetTextAfterOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
-                          nsString& aText, int32_t* aStartOffset,
-                          int32_t* aEndOffset);
-
-  void GetTextAtOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
-                       nsString& aText, int32_t* aStartOffset,
-                       int32_t* aEndOffset);
-
-  void GetTextBeforeOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
-                           nsString& aText, int32_t* aStartOffset,
-                           int32_t* aEndOffset);
-
-  char16_t CharAt(int32_t aOffset);
-
-  void TextAttributes(bool aIncludeDefAttrs,
-                      const int32_t aOffset,
-                      nsTArray<Attribute>* aAttributes,
-                      int32_t* aStartOffset,
-                      int32_t* aEndOffset);
-  void DefaultTextAttributes(nsTArray<Attribute>* aAttrs);
-
-  nsIntRect TextBounds(int32_t aStartOffset, int32_t aEndOffset,
-                       uint32_t aCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
-
-  nsIntRect CharBounds(int32_t aOffset, uint32_t aCoordType);
-
-  int32_t OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType);
-
-  bool SelectionBoundsAt(int32_t aSelectionNum,
-                         nsString& aData,
-                         int32_t* aStartOffset,
-                         int32_t* aEndOffset);
-
-  bool SetSelectionBoundsAt(int32_t aSelectionNum,
-                            int32_t aStartOffset,
-                            int32_t aEndOffset);
-
-  bool AddToSelection(int32_t aStartOffset,
-                      int32_t aEndOffset);
-
-  bool RemoveFromSelection(int32_t aSelectionNum);
-
-  void ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
-                         uint32_t aScrollType);
-
-  void ScrollSubstringToPoint(int32_t aStartOffset,
-                              int32_t aEndOffset,
-                              uint32_t aCoordinateType,
-                              int32_t aX, int32_t aY);
-
-  void Text(nsString* aText);
-
-  void ReplaceText(const nsString& aText);
-
-  bool InsertText(const nsString& aText, int32_t aPosition);
-
-  bool CopyText(int32_t aStartPos, int32_t aEndPos);
-
-  bool CutText(int32_t aStartPos, int32_t aEndPos);
-
-  bool DeleteText(int32_t aStartPos, int32_t aEndPos);
-
-  bool PasteText(int32_t aPosition);
-
-  nsIntPoint ImagePosition(uint32_t aCoordType);
-
-  nsIntSize ImageSize();
-
-  uint32_t StartOffset(bool* aOk);
-
-  uint32_t EndOffset(bool* aOk);
-
-  bool IsLinkValid();
-
-  // XXX checking mRole alone may not result in same behavior as Accessibles
-  // due to ARIA roles. See bug 1210477.
-  inline bool IsTable() const
-  {
-    return mRole == roles::TABLE || mRole == roles::MATHML_TABLE;
-  }
-  inline bool IsTableRow() const
-  {
-    return (mRole == roles::ROW ||
-            mRole == roles::MATHML_TABLE_ROW ||
-            mRole == roles::MATHML_LABELED_ROW);
-  }
-  inline bool IsTableCell() const
-  {
-    return (mRole == roles::CELL ||
-            mRole == roles::COLUMNHEADER ||
-            mRole == roles::ROWHEADER ||
-            mRole == roles::GRID_CELL ||
-            mRole == roles::MATHML_CELL);
-  }
-
-  uint32_t AnchorCount(bool* aOk);
-
-  void AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk);
-
-  ProxyAccessible* AnchorAt(uint32_t aIndex);
-
-  uint32_t LinkCount();
-
-  ProxyAccessible* LinkAt(const uint32_t& aIndex);
-
-  int32_t LinkIndexOf(ProxyAccessible* aLink);
-
-  int32_t LinkIndexAtOffset(uint32_t aOffset);
-
-  ProxyAccessible* TableOfACell();
-
-  uint32_t ColIdx();
-
-  uint32_t RowIdx();
-
-  uint32_t ColExtent();
-
-  uint32_t RowExtent();
-
-  void ColHeaderCells(nsTArray<ProxyAccessible*>* aCells);
-
-  void RowHeaderCells(nsTArray<ProxyAccessible*>* aCells);
-
-  bool IsCellSelected();
-
-  ProxyAccessible* TableCaption();
-  void TableSummary(nsString& aSummary);
-  uint32_t TableColumnCount();
-  uint32_t TableRowCount();
-  ProxyAccessible* TableCellAt(uint32_t aRow, uint32_t aCol);
-  int32_t TableCellIndexAt(uint32_t aRow, uint32_t aCol);
-  int32_t TableColumnIndexAt(uint32_t aCellIndex);
-  int32_t TableRowIndexAt(uint32_t aCellIndex);
-  void TableRowAndColumnIndicesAt(uint32_t aCellIndex,
-                                  int32_t* aRow, int32_t* aCol);
-  uint32_t TableColumnExtentAt(uint32_t aRow, uint32_t aCol);
-  uint32_t TableRowExtentAt(uint32_t aRow, uint32_t aCol);
-  void TableColumnDescription(uint32_t aCol, nsString& aDescription);
-  void TableRowDescription(uint32_t aRow, nsString& aDescription);
-  bool TableColumnSelected(uint32_t aCol);
-  bool TableRowSelected(uint32_t aRow);
-  bool TableCellSelected(uint32_t aRow, uint32_t aCol);
-  uint32_t TableSelectedCellCount();
-  uint32_t TableSelectedColumnCount();
-  uint32_t TableSelectedRowCount();
-  void TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs);
-  void TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices);
-  void TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices);
-  void TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices);
-  void TableSelectColumn(uint32_t aCol);
-  void TableSelectRow(uint32_t aRow);
-  void TableUnselectColumn(uint32_t aCol);
-  void TableUnselectRow(uint32_t aRow);
-  bool TableIsProbablyForLayout();
-  ProxyAccessible* AtkTableColumnHeader(int32_t aCol);
-  ProxyAccessible* AtkTableRowHeader(int32_t aRow);
-
-  void SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems);
-  uint32_t SelectedItemCount();
-  ProxyAccessible* GetSelectedItem(uint32_t aIndex);
-  bool IsItemSelected(uint32_t aIndex);
-  bool AddItemToSelection(uint32_t aIndex);
-  bool RemoveItemFromSelection(uint32_t aIndex);
-  bool SelectAll();
-  bool UnselectAll();
-
-  void TakeSelection();
-  void SetSelected(bool aSelect);
-
-  bool DoAction(uint8_t aIndex);
-  uint8_t ActionCount();
-  void ActionDescriptionAt(uint8_t aIndex, nsString& aDescription);
-  void ActionNameAt(uint8_t aIndex, nsString& aName);
-  KeyBinding AccessKey();
-  KeyBinding KeyboardShortcut();
-  void AtkKeyBinding(nsString& aBinding);
-
-  double CurValue();
-  bool SetCurValue(double aValue);
-  double MinValue();
-  double MaxValue();
-  double Step();
-
-  void TakeFocus();
-  ProxyAccessible* FocusedChild();
-  ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY,
-                                Accessible::EWhichChildAtPoint aWhichChild);
-  nsIntRect Bounds();
-
-  void Language(nsString& aLocale);
-  void DocType(nsString& aType);
-  void Title(nsString& aTitle);
-  void URL(nsString& aURL);
-  void MimeType(nsString aMime);
-  void URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
-                          nsString& aMimeType);
-
-  ProxyAccessible* AccessibleAtPoint(int32_t aX, int32_t aY,
-                                     bool aNeedsScreenCoords);
-
-  void Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
-               int32_t* aWidth, int32_t* aHeight);
-
-  /**
-   * Return the id of the dom node this accessible represents.  Note this
-   * should probably only be used for testing.
-   */
-  void DOMNodeID(nsString& aID);
-
-protected:
-  explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc)
-    : ProxyAccessibleBase(aThisAsDoc)
-  { MOZ_COUNT_CTOR(ProxyAccessible); }
-};
-
-}
-}
-
-#endif
deleted file mode 100644
--- a/accessible/ipc/other/moz.build
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-IPDL_SOURCES += ['PDocAccessible.ipdl']
-
-# with --disable-accessibility we need to compile PDocAccessible.ipdl, but not
-# the C++.
-if CONFIG['ACCESSIBILITY']:
-    EXPORTS.mozilla.a11y += [
-        'DocAccessibleChild.h',
-        'ProxyAccessible.h',
-    ]
-
-    SOURCES += [
-        'DocAccessibleChild.cpp',
-        'ProxyAccessible.cpp',
-    ]
-
-    LOCAL_INCLUDES += [
-        '../../base',
-        '../../generic',
-        '../../xpcom',
-    ]
-
-    if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-        LOCAL_INCLUDES += [
-            '/accessible/atk',
-        ]
-    elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-        LOCAL_INCLUDES += [
-            '/accessible/mac',
-        ]
-    else:
-        LOCAL_INCLUDES += [
-            '/accessible/other',
-        ]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-if CONFIG['GNU_CXX']:
-    CXXFLAGS += ['-Wno-error=shadow']
-
-FINAL_LIBRARY = 'xul'
-
deleted file mode 100644
--- a/accessible/ipc/win/COMPtrTypes.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/a11y/COMPtrTypes.h"
-
-#include "MainThreadUtils.h"
-#include "mozilla/a11y/Accessible.h"
-#include "mozilla/Move.h"
-#include "mozilla/mscom/MainThreadHandoff.h"
-#include "mozilla/RefPtr.h"
-
-using mozilla::mscom::MainThreadHandoff;
-using mozilla::mscom::STAUniquePtr;
-
-namespace mozilla {
-namespace a11y {
-
-IAccessibleHolder
-CreateHolderFromAccessible(Accessible* aAccToWrap)
-{
-  MOZ_ASSERT(aAccToWrap && NS_IsMainThread());
-  if (!aAccToWrap) {
-    return nullptr;
-  }
-
-  IAccessible* rawNative = nullptr;
-  aAccToWrap->GetNativeInterface((void**)&rawNative);
-  MOZ_ASSERT(rawNative);
-  if (!rawNative) {
-    return nullptr;
-  }
-
-  STAUniquePtr<IAccessible> iaToProxy(rawNative);
-
-  IAccessible* rawIntercepted = nullptr;
-  HRESULT hr = MainThreadHandoff::WrapInterface(iaToProxy, &rawIntercepted);
-  MOZ_ASSERT(SUCCEEDED(hr));
-  if (FAILED(hr)) {
-    return nullptr;
-  }
-
-  IAccessibleHolder::COMPtrType iaIntercepted(rawIntercepted);
-  return IAccessibleHolder(Move(iaIntercepted));
-}
-
-} // namespace a11y
-} // namespace mozilla
deleted file mode 100644
--- a/accessible/ipc/win/COMPtrTypes.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_COMPtrTypes_h
-#define mozilla_a11y_COMPtrTypes_h
-
-#include "mozilla/mscom/COMPtrHolder.h"
-
-#include <oleacc.h>
-
-namespace mozilla {
-namespace a11y {
-
-typedef mozilla::mscom::COMPtrHolder<IAccessible, IID_IAccessible> IAccessibleHolder;
-
-class Accessible;
-
-IAccessibleHolder
-CreateHolderFromAccessible(Accessible* aAccToWrap);
-
-} // namespace a11y
-} // namespace mozilla
-
-#endif // mozilla_a11y_COMPtrTypes_h
deleted file mode 100644
--- a/accessible/ipc/win/DocAccessibleChild.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DocAccessibleChild.h"
-
-#include "Accessible-inl.h"
-#include "mozilla/a11y/PlatformChild.h"
-#include "mozilla/ClearOnShutdown.h"
-
-namespace mozilla {
-namespace a11y {
-
-static StaticAutoPtr<PlatformChild> sPlatformChild;
-
-DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc)
-  : DocAccessibleChildBase(aDoc)
-{
-  MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
-  if (!sPlatformChild) {
-    sPlatformChild = new PlatformChild();
-    ClearOnShutdown(&sPlatformChild, ShutdownPhase::ShutdownThreads);
-  }
-}
-
-DocAccessibleChild::~DocAccessibleChild()
-{
-  MOZ_COUNT_DTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
-}
-
-void
-DocAccessibleChild::SendCOMProxy(const IAccessibleHolder& aProxy)
-{
-  IAccessibleHolder parentProxy;
-  PDocAccessibleChild::SendCOMProxy(aProxy, &parentProxy);
-  mParentProxy.reset(parentProxy.Release());
-  MOZ_ASSERT(mParentProxy);
-}
-
-} // namespace a11y
-} // namespace mozilla
-
deleted file mode 100644
--- a/accessible/ipc/win/DocAccessibleChild.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_DocAccessibleChild_h
-#define mozilla_a11y_DocAccessibleChild_h
-
-#include "mozilla/a11y/COMPtrTypes.h"
-#include "mozilla/a11y/DocAccessibleChildBase.h"
-#include "mozilla/mscom/Ptr.h"
-
-namespace mozilla {
-namespace a11y {
-
-/*
- * These objects handle content side communication for an accessible document,
- * and their lifetime is the same as the document they represent.
- */
-class DocAccessibleChild : public DocAccessibleChildBase
-{
-public:
-  explicit DocAccessibleChild(DocAccessible* aDoc);
-  ~DocAccessibleChild();
-
-  void SendCOMProxy(const IAccessibleHolder& aProxy);
-  IAccessible* GetParentIAccessible() const { return mParentProxy.get(); }
-
-private:
-  mscom::ProxyUniquePtr<IAccessible> mParentProxy;
-};
-
-} // namespace a11y
-} // namespace mozilla
-
-#endif // mozilla_a11y_DocAccessibleChild_h
deleted file mode 100644
--- a/accessible/ipc/win/PlatformChild.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/a11y/PlatformChild.h"
-#include "mozilla/mscom/EnsureMTA.h"
-#include "mozilla/mscom/InterceptorLog.h"
-
-#include "Accessible2.h"
-
-namespace mozilla {
-namespace a11y {
-
-/**
- * Unfortunately the COM interceptor does not intrinsically handle array
- * outparams. Instead we manually define the relevant metadata here, and
- * register it in a call to mozilla::mscom::RegisterArrayData.
- * @see mozilla::mscom::ArrayData
- */
-static const mozilla::mscom::ArrayData sPlatformChildArrayData[] = {
-  {IID_IEnumVARIANT, 3, 1, VT_DISPATCH, IID_IDispatch, 2},
-  {IID_IAccessible2, 30, 1, VT_UNKNOWN | VT_BYREF, IID_IAccessibleRelation, 2},
-  {IID_IAccessibleRelation, 7, 1, VT_UNKNOWN | VT_BYREF, IID_IUnknown, 2}
-};
-
-// Type libraries are thread-neutral, so we can register those from any
-// apartment. OTOH, proxies must be registered from within the apartment where
-// we intend to instantiate them. Therefore RegisterProxy() must be called
-// via EnsureMTA.
-PlatformChild::PlatformChild()
-  : mAccTypelib(mozilla::mscom::RegisterTypelib(L"oleacc.dll",
-        mozilla::mscom::RegistrationFlags::eUseSystemDirectory))
-  , mMiscTypelib(mozilla::mscom::RegisterTypelib(L"Accessible.tlb"))
-{
-  mozilla::mscom::InterceptorLog::Init();
-  mozilla::mscom::RegisterArrayData(sPlatformChildArrayData);
-
-  UniquePtr<mozilla::mscom::RegisteredProxy> ia2Proxy;
-  mozilla::mscom::EnsureMTA([&ia2Proxy]() -> void {
-    ia2Proxy = Move(mozilla::mscom::RegisterProxy(L"ia2marshal.dll"));
-  });
-  mIA2Proxy = Move(ia2Proxy);
-}
-
-} // namespace a11y
-} // namespace mozilla
-
deleted file mode 100644
--- a/accessible/ipc/win/PlatformChild.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_a11y_PlatformChild_h
-#define mozilla_a11y_PlatformChild_h
-
-#include "mozilla/mscom/Registration.h"
-
-namespace mozilla {
-namespace a11y {
-
-class PlatformChild
-{
-public:
-  PlatformChild();
-
-  PlatformChild(PlatformChild&) = delete;
-  PlatformChild(PlatformChild&&) = delete;
-  PlatformChild& operator=(PlatformChild&) = delete;
-  PlatformChild& operator=(PlatformChild&&) = delete;
-
-private:
-  UniquePtr<mozilla::mscom::RegisteredProxy> mIA2Proxy;
-  UniquePtr<mozilla::mscom::RegisteredProxy> mAccTypelib;
-  UniquePtr<mozilla::mscom::RegisteredProxy> mMiscTypelib;
-};
-
-} // namespace mozilla
-} // namespace a11y
-
-#endif // mozilla_a11y_PlatformChild_h
-
deleted file mode 100644
--- a/accessible/ipc/win/moz.build
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DIRS += ['typelib']
-
-IPDL_SOURCES += ['PDocAccessible.ipdl']
-
-# with --disable-accessibility we need to compile PDocAccessible.ipdl, but not
-# the C++.
-if CONFIG['ACCESSIBILITY']:
-    EXPORTS.mozilla.a11y += [
-        'COMPtrTypes.h',
-        'DocAccessibleChild.h',
-        'PlatformChild.h',
-        'ProxyAccessible.h'
-    ]
-
-    SOURCES += [
-        'COMPtrTypes.cpp',
-        'DocAccessibleChild.cpp',
-        'PlatformChild.cpp',
-        'ProxyAccessible.cpp',
-    ]
-
-    LOCAL_INCLUDES += [
-        '/accessible/base',
-        '/accessible/generic',
-        '/accessible/windows/ia2',
-        '/accessible/windows/msaa',
-        '/accessible/xpcom',
-    ]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/accessible/ipc/win/typelib/Accessible.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import "oaidl.idl";
-import "servprov.idl";
-
-[uuid(b4d37cda-0dac-45e6-b613-158a5eb94293)]
-library Accessible
-{
-  interface IEnumVARIANT;
-  interface IServiceProvider;
-};
-
deleted file mode 100644
--- a/accessible/ipc/win/typelib/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c
-
-MIDL_GENERATED_FILES = \
-  Accessible.h \
-  Accessible_i.c \
-  Accessible_p.c \
-  Accessible.tlb \
-  $(NULL)
-
-$(MIDL_GENERATED_FILES): done_gen
-
-done_gen: Accessible.idl
-	$(MIDL) $(MIDL_FLAGS) -Oicf $(srcdir)/Accessible.idl
-	touch $@
-
-export:: done_gen
-
-midl_exports := \
-  Accessible.tlb \
-  $(NULL)
-
-INSTALL_TARGETS += midl_exports
-midl_exports_FILES := $(midl_exports)
-midl_exports_DEST = $(DIST)/bin
-midl_exports_TARGET := export
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/accessible/ipc/win/typelib/moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-FINAL_TARGET_FILES += [
-    '!Accessible.tlb',
-]
-
-GENERATED_FILES += [
-    'Accessible.tlb',
-]
--- a/accessible/mac/moz.build
+++ b/accessible/mac/moz.build
@@ -27,17 +27,16 @@ UNIFIED_SOURCES += [
     'RootAccessibleWrap.mm',
 ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
     '/accessible/html',
     '/accessible/ipc',
-    '/accessible/ipc/other',
     '/accessible/xul',
     '/layout/generic',
     '/layout/xul',
     '/widget',
     '/widget/cocoa',
 ]
 
 FINAL_LIBRARY = 'xul'
--- a/accessible/windows/ProxyWrappers.h
+++ b/accessible/windows/ProxyWrappers.h
@@ -10,55 +10,45 @@
 
 #include "HyperTextAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class ProxyAccessibleWrap : public AccessibleWrap
 {
-public:
+  public:
   ProxyAccessibleWrap(ProxyAccessible* aProxy) :
     AccessibleWrap(nullptr, nullptr)
   {
     mType = eProxyType;
     mBits.proxy = aProxy;
   }
 
   virtual void Shutdown() override
   {
     mBits.proxy = nullptr;
     mStateFlags |= eIsDefunct;
   }
-
-  virtual void GetNativeInterface(void** aOutAccessible) override
-  {
-    mBits.proxy->GetCOMInterface(aOutAccessible);
-  }
 };
 
 class HyperTextProxyAccessibleWrap : public HyperTextAccessibleWrap
 {
 public:
   HyperTextProxyAccessibleWrap(ProxyAccessible* aProxy) :
     HyperTextAccessibleWrap(nullptr, nullptr)
   {
     mType = eProxyType;
     mBits.proxy = aProxy;
   }
 
   virtual void Shutdown() override
   {
     mBits.proxy = nullptr;
-    mStateFlags |= eIsDefunct;
-  }
-
-  virtual void GetNativeInterface(void** aOutAccessible) override
-  {
-    mBits.proxy->GetCOMInterface(aOutAccessible);
+ mStateFlags |= eIsDefunct;
   }
 };
 
 class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap
 {
 public:
   DocProxyAccessibleWrap(ProxyAccessible* aProxy) :
     HyperTextProxyAccessibleWrap(aProxy)
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -68,17 +68,24 @@ ia2Accessible::get_nRelations(long* aNRe
   if (!aNRelations)
     return E_INVALIDARG;
   *aNRelations = 0;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  MOZ_ASSERT(!acc->IsProxy());
+  if (acc->IsProxy()) {
+    // XXX evaluate performance of collecting all relation targets.
+    nsTArray<RelationType> types;
+    nsTArray<nsTArray<ProxyAccessible*>> targetSets;
+    acc->Proxy()->Relations(&types, &targetSets);
+    *aNRelations = types.Length();
+    return S_OK;
+  }
 
   for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
     if (sRelationTypePairs[idx].second == IA2_RELATION_NULL)
       continue;
 
     Relation rel = acc->RelationByType(sRelationTypePairs[idx].first);
     if (rel.Next())
       (*aNRelations)++;
@@ -97,17 +104,43 @@ ia2Accessible::get_relation(long aRelati
   if (!aRelation || aRelationIndex < 0)
     return E_INVALIDARG;
   *aRelation = nullptr;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  MOZ_ASSERT(!acc->IsProxy());
+  if (acc->IsProxy()) {
+    nsTArray<RelationType> types;
+    nsTArray<nsTArray<ProxyAccessible*>> targetSets;
+    acc->Proxy()->Relations(&types, &targetSets);
+
+    size_t targetSetCount = targetSets.Length();
+    for (size_t i = 0; i < targetSetCount; i++) {
+      uint32_t relTypeIdx = static_cast<uint32_t>(types[i]);
+      MOZ_ASSERT(sRelationTypePairs[relTypeIdx].first == types[i]);
+      if (sRelationTypePairs[relTypeIdx].second == IA2_RELATION_NULL)
+        continue;
+
+      if (static_cast<size_t>(aRelationIndex) == i) {
+        nsTArray<RefPtr<Accessible>> targets;
+        size_t targetCount = targetSets[i].Length();
+        for (size_t j = 0; j < targetCount; j++)
+          targets.AppendElement(WrapperFor(targetSets[i][j]));
+
+        RefPtr<ia2AccessibleRelation> rel =
+          new ia2AccessibleRelation(types[i], Move(targets));
+        rel.forget(aRelation);
+        return S_OK;
+      }
+    }
+
+    return E_INVALIDARG;
+  }
 
   long relIdx = 0;
   for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
     if (sRelationTypePairs[idx].second == IA2_RELATION_NULL)
       continue;
 
     RelationType relationType = sRelationTypePairs[idx].first;
     Relation rel = acc->RelationByType(relationType);
@@ -138,17 +171,43 @@ ia2Accessible::get_relations(long aMaxRe
   if (!aRelation || !aNRelations || aMaxRelations <= 0)
     return E_INVALIDARG;
   *aNRelations = 0;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  MOZ_ASSERT(!acc->IsProxy());
+  if (acc->IsProxy()) {
+    nsTArray<RelationType> types;
+    nsTArray<nsTArray<ProxyAccessible*>> targetSets;
+    acc->Proxy()->Relations(&types, &targetSets);
+
+    size_t count = std::min(targetSets.Length(),
+                            static_cast<size_t>(aMaxRelations));
+    size_t i = 0;
+    while (i < count) {
+      uint32_t relTypeIdx = static_cast<uint32_t>(types[i]);
+      if (sRelationTypePairs[relTypeIdx].second == IA2_RELATION_NULL)
+        continue;
+
+      size_t targetCount = targetSets[i].Length();
+      nsTArray<RefPtr<Accessible>> targets(targetCount);
+      for (size_t j = 0; j < targetCount; j++)
+        targets.AppendElement(WrapperFor(targetSets[i][j]));
+
+      RefPtr<ia2AccessibleRelation> rel =
+        new ia2AccessibleRelation(types[i], Move(targets));
+      rel.forget(aRelation + i);
+      i++;
+    }
+
+    *aNRelations = i;
+    return S_OK;
+  }
 
   for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs) &&
        *aNRelations < aMaxRelations; idx++) {
     if (sRelationTypePairs[idx].second == IA2_RELATION_NULL)
       continue;
 
     RelationType relationType = sRelationTypePairs[idx].first;
     Relation rel = acc->RelationByType(relationType);
@@ -179,52 +238,62 @@ ia2Accessible::role(long* aRole)
 
 #define ROLE(_geckoRole, stringRole, atkRole, macRole, \
              msaaRole, ia2Role, nameRule) \
   case roles::_geckoRole: \
     *aRole = ia2Role; \
     break;
 
   a11y::role geckoRole;
-  MOZ_ASSERT(!acc->IsProxy());
-  geckoRole = acc->Role();
+  if (acc->IsProxy())
+    geckoRole = acc->Proxy()->Role();
+  else
+    geckoRole = acc->Role();
   switch (geckoRole) {
 #include "RoleMap.h"
     default:
       MOZ_CRASH("Unknown role.");
   }
 
 #undef ROLE
 
   // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call
   // the IA2 role a ROLE_OUTLINEITEM.
-  MOZ_ASSERT(!acc->IsProxy());
-  if (geckoRole == roles::ROW) {
-    Accessible* xpParent = acc->Parent();
-    if (xpParent && xpParent->Role() == roles::TREE_TABLE)
+  if (acc->IsProxy()) {
+    if (geckoRole == roles::ROW && acc->Proxy()->Parent() &&
+        acc->Proxy()->Parent()->Role() == roles::TREE_TABLE)
       *aRole = ROLE_SYSTEM_OUTLINEITEM;
+  } else {
+    if (geckoRole == roles::ROW) {
+      Accessible* xpParent = acc->Parent();
+      if (xpParent && xpParent->Role() == roles::TREE_TABLE)
+        *aRole = ROLE_SYSTEM_OUTLINEITEM;
+    }
   }
 
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
 {
   A11Y_TRYBLOCK_BEGIN
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  MOZ_ASSERT(!acc->IsProxy());
-  nsCoreUtils::ScrollTo(acc->Document()->PresShell(), acc->GetContent(),
-                        aScrollType);
+  if (acc->IsProxy()) {
+    acc->Proxy()->ScrollTo(aScrollType);
+  } else {
+    nsCoreUtils::ScrollTo(acc->Document()->PresShell(), acc->GetContent(),
+                          aScrollType);
+  }
 
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType,
@@ -235,18 +304,21 @@ ia2Accessible::scrollToPoint(enum IA2Coo
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
 
-  MOZ_ASSERT(!acc->IsProxy());
-  acc->ScrollToPoint(geckoCoordType, aX, aY);
+  if (acc->IsProxy()) {
+    acc->Proxy()->ScrollToPoint(geckoCoordType, aX, aY);
+  } else {
+    acc->ScrollToPoint(geckoCoordType, aX, aY);
+  }
 
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2Accessible::get_groupPosition(long* aGroupLevel,
@@ -296,18 +368,20 @@ ia2Accessible::get_states(AccessibleStat
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct()) {
     *aStates = IA2_STATE_DEFUNCT;
     return S_OK;
   }
 
   uint64_t state;
-  MOZ_ASSERT(!acc->IsProxy());
-  state = acc->State();
+  if (acc->IsProxy())
+    state = acc->Proxy()->State();
+  else
+    state = acc->State();
 
   if (state & states::INVALID)
     *aStates |= IA2_STATE_INVALID_ENTRY;
   if (state & states::REQUIRED)
     *aStates |= IA2_STATE_REQUIRED;
 
   // The following IA2 states are not supported by Gecko
   // IA2_STATE_ARMED
@@ -469,18 +543,20 @@ ia2Accessible::get_indexInParent(long* a
   if (!aIndexInParent)
     return E_INVALIDARG;
   *aIndexInParent = -1;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  MOZ_ASSERT(!acc->IsProxy());
-  *aIndexInParent = acc->IndexInParent();
+  if (acc->IsProxy())
+    *aIndexInParent = acc->Proxy()->IndexInParent();
+  else
+    *aIndexInParent = acc->IndexInParent();
 
   if (*aIndexInParent == -1)
     return S_FALSE;
 
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
@@ -551,18 +627,19 @@ ia2Accessible::get_attributes(BSTR* aAtt
 
   // The format is name:value;name:value; with \ for escaping these
   // characters ":;=,\".
   if (!acc->IsProxy()) {
     nsCOMPtr<nsIPersistentProperties> attributes = acc->Attributes();
     return ConvertToIA2Attributes(attributes, aAttributes);
   }
 
-  MOZ_ASSERT(!acc->IsProxy());
-  return E_UNEXPECTED;
+  nsTArray<Attribute> attrs;
+  acc->Proxy()->Attributes(&attrs);
+  return ConvertToIA2Attributes(&attrs, aAttributes);
 
   A11Y_TRYBLOCK_END
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // IAccessible2_2
 
 STDMETHODIMP
@@ -637,22 +714,31 @@ ia2Accessible::get_relationTargetsOfType
   if (!relationType)
     return E_INVALIDARG;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsTArray<Accessible*> targets;
-  MOZ_ASSERT(!acc->IsProxy());
-  Relation rel = acc->RelationByType(*relationType);
-  Accessible* target = nullptr;
-  while ((target = rel.Next()) &&
-         static_cast<long>(targets.Length()) <= aMaxTargets) {
-    targets.AppendElement(target);
+  if (acc->IsProxy()) {
+    nsTArray<ProxyAccessible*> targetProxies =
+      acc->Proxy()->RelationByType(*relationType);
+
+    size_t targetCount = aMaxTargets;
+    if (targetProxies.Length() < targetCount)
+      targetCount = targetProxies.Length();
+    for (size_t i = 0; i < targetCount; i++)
+      targets.AppendElement(WrapperFor(targetProxies[i]));
+  } else {
+    Relation rel = acc->RelationByType(*relationType);
+    Accessible* target = nullptr;
+    while ((target = rel.Next()) &&
+           static_cast<long>(targets.Length()) <= aMaxTargets)
+      targets.AppendElement(target);
   }
 
   *aNTargets = targets.Length();
   *aTargets = static_cast<IUnknown**>(
     ::CoTaskMemAlloc(sizeof(IUnknown*) * *aNTargets));
   if (!*aTargets)
     return E_OUTOFMEMORY;
 
--- a/accessible/windows/ia2/ia2AccessibleEditableText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleEditableText.cpp
@@ -19,17 +19,19 @@ using namespace mozilla::a11y;
 
 // IAccessibleEditableText
 
 STDMETHODIMP
 ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->CopyText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidRange(aStartOffset, aEndOffset))
     return E_INVALIDARG;
 
@@ -39,17 +41,19 @@ ia2AccessibleEditableText::copyText(long
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+    if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+      return proxy->DeleteText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG;
+    }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidRange(aStartOffset, aEndOffset))
     return E_INVALIDARG;
 
@@ -61,17 +65,19 @@ ia2AccessibleEditableText::deleteText(lo
 
 STDMETHODIMP
 ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText)
 {
   A11Y_TRYBLOCK_BEGIN
 
   uint32_t length = ::SysStringLen(*aText);
   nsAutoString text(*aText, length);
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->InsertText(text, aOffset) ? S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidOffset(aOffset))
     return E_INVALIDARG;
 
@@ -81,17 +87,19 @@ ia2AccessibleEditableText::insertText(lo
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->CutText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidRange(aStartOffset, aEndOffset))
     return E_INVALIDARG;
 
@@ -101,17 +109,19 @@ ia2AccessibleEditableText::cutText(long 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleEditableText::pasteText(long aOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->PasteText(aOffset) ? S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidOffset(aOffset))
     return E_INVALIDARG;
 
--- a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp
+++ b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp
@@ -48,17 +48,27 @@ ia2AccessibleHyperlink::get_anchor(long 
   A11Y_TRYBLOCK_BEGIN
 
   if (!aAnchor)
     return E_INVALIDARG;
 
   VariantInit(aAnchor);
 
   Accessible* thisObj = static_cast<AccessibleWrap*>(this);
-  MOZ_ASSERT(!thisObj->IsProxy());
+  if (thisObj->IsProxy()) {
+    ProxyAccessible* anchor = thisObj->Proxy()->AnchorAt(aIndex);
+    if (!anchor)
+      return S_FALSE;
+
+    IUnknown* tmp = static_cast<IAccessibleHyperlink*>(WrapperFor(anchor));
+    tmp->AddRef();
+    aAnchor->punkVal = tmp;
+    aAnchor->vt = VT_UNKNOWN;
+    return S_OK;
+  }
 
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
   if (!thisObj->IsLink())
@@ -82,45 +92,46 @@ ia2AccessibleHyperlink::get_anchor(long 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  if (!aAnchorTarget) {
+  if (!aAnchorTarget)
     return E_INVALIDARG;
-  }
 
   VariantInit(aAnchorTarget);
 
   Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   nsAutoCString uriStr;
-  MOZ_ASSERT(!thisObj->IsProxy());
-  if (thisObj->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
-  }
+  if (thisObj->IsProxy()) {
+    bool ok;
+    thisObj->Proxy()->AnchorURIAt(aIndex, uriStr, &ok);
+    if (!ok)
+      return S_FALSE;
 
-  if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount())) {
-    return E_INVALIDARG;
-  }
+  } else {
+    if (thisObj->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  if (!thisObj->IsLink()) {
-    return S_FALSE;
-  }
+    if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
+      return E_INVALIDARG;
+
+    if (!thisObj->IsLink())
+      return S_FALSE;
 
-  nsCOMPtr<nsIURI> uri = thisObj->AnchorURIAt(aIndex);
-  if (!uri) {
-    return S_FALSE;
-  }
+    nsCOMPtr<nsIURI> uri = thisObj->AnchorURIAt(aIndex);
+    if (!uri)
+      return S_FALSE;
 
-  nsresult rv = uri->GetSpec(uriStr);
-  if (NS_FAILED(rv)) {
-    return GetHRESULT(rv);
+    nsresult rv = uri->GetSpec(uriStr);
+    if (NS_FAILED(rv))
+      return GetHRESULT(rv);
   }
 
   nsAutoString stringURI;
   AppendUTF8toUTF16(uriStr, stringURI);
 
   aAnchorTarget->vt = VT_BSTR;
   aAnchorTarget->bstrVal = ::SysAllocStringLen(stringURI.get(),
                                                stringURI.Length());
@@ -134,17 +145,21 @@ ia2AccessibleHyperlink::get_startIndex(l
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aIndex)
     return E_INVALIDARG;
 
   *aIndex = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    bool valid;
+    *aIndex = proxy->StartOffset(&valid);
+    return valid ? S_OK : S_FALSE;
+  }
 
   Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
@@ -159,17 +174,21 @@ ia2AccessibleHyperlink::get_endIndex(lon
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aIndex)
     return E_INVALIDARG;
 
   *aIndex = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    bool valid;
+    *aIndex = proxy->EndOffset(&valid);
+    return valid ? S_OK : S_FALSE;
+  }
 
   Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
@@ -184,17 +203,20 @@ ia2AccessibleHyperlink::get_valid(boolea
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aValid)
     return E_INVALIDARG;
 
   *aValid = false;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aValid = proxy->IsLinkValid();
+    return S_OK;
+  }
 
   Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
--- a/accessible/windows/ia2/ia2AccessibleHypertext.cpp
+++ b/accessible/windows/ia2/ia2AccessibleHypertext.cpp
@@ -21,17 +21,20 @@ ia2AccessibleHypertext::get_nHyperlinks(
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aHyperlinkCount)
     return E_INVALIDARG;
 
   *aHyperlinkCount = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aHyperlinkCount = proxy->LinkCount();
+    return S_OK;
+  }
 
   HyperTextAccessibleWrap* hyperText = static_cast<HyperTextAccessibleWrap*>(this);
   if (hyperText->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   *aHyperlinkCount = hyperText->LinkCount();
   return S_OK;
 
@@ -45,24 +48,30 @@ ia2AccessibleHypertext::get_hyperlink(lo
   A11Y_TRYBLOCK_BEGIN
 
   if (!aHyperlink)
     return E_INVALIDARG;
 
   *aHyperlink = nullptr;
 
   AccessibleWrap* hyperLink;
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessibleWrap* hyperText = static_cast<HyperTextAccessibleWrap*>(this);
-  if (hyperText->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    ProxyAccessible* link = proxy->LinkAt(aLinkIndex);
+    if (!link)
+      return E_FAIL;
+
+    hyperLink = WrapperFor(link);
+  } else {
+    HyperTextAccessibleWrap* hyperText = static_cast<HyperTextAccessibleWrap*>(this);
+    if (hyperText->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    hyperLink = static_cast<AccessibleWrap*>(hyperText->LinkAt(aLinkIndex));
   }
 
-  hyperLink = static_cast<AccessibleWrap*>(hyperText->LinkAt(aLinkIndex));
-
   if (!hyperLink)
     return E_FAIL;
 
   *aHyperlink =
     static_cast<IAccessibleHyperlink*>(hyperLink);
   (*aHyperlink)->AddRef();
   return S_OK;
 
@@ -74,17 +83,20 @@ ia2AccessibleHypertext::get_hyperlinkInd
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aHyperlinkIndex)
     return E_INVALIDARG;
 
   *aHyperlinkIndex = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aHyperlinkIndex = proxy->LinkIndexAtOffset(aCharIndex);
+    return S_OK;
+  }
 
   HyperTextAccessibleWrap* hyperAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (hyperAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   *aHyperlinkIndex = hyperAcc->LinkIndexAtOffset(aCharIndex);
   return S_OK;
 
--- a/accessible/windows/ia2/ia2AccessibleText.cpp
+++ b/accessible/windows/ia2/ia2AccessibleText.cpp
@@ -25,17 +25,20 @@ bool ia2AccessibleText::sLastTextChangeW
 
 // IAccessibleText
 
 STDMETHODIMP
 ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->AddToSelection(aStartOffset, aEndOffset) ?
+      S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   return textAcc->AddToSelection(aStartOffset, aEndOffset) ?
     S_OK : E_INVALIDARG;
 
@@ -52,26 +55,31 @@ ia2AccessibleText::get_attributes(long a
     return E_INVALIDARG;
 
   *aStartOffset = 0;
   *aEndOffset = 0;
   *aTextAttributes = nullptr;
 
   int32_t startOffset = 0, endOffset = 0;
   HRESULT hr;
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    AutoTArray<Attribute, 10> attrs;
+    proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
+    hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    nsCOMPtr<nsIPersistentProperties> attributes =
+      textAcc->TextAttributes(true, aOffset, &startOffset, &endOffset);
+
+    hr = AccessibleWrap::ConvertToIA2Attributes(attributes, aTextAttributes);
   }
 
-  nsCOMPtr<nsIPersistentProperties> attributes =
-    textAcc->TextAttributes(true, aOffset, &startOffset, &endOffset);
-
-  hr = AccessibleWrap::ConvertToIA2Attributes(attributes, aTextAttributes);
   if (FAILED(hr))
     return hr;
 
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
 
   return S_OK;
 
@@ -83,24 +91,26 @@ ia2AccessibleText::get_caretOffset(long 
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aOffset)
     return E_INVALIDARG;
 
   *aOffset = -1;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aOffset = proxy->CaretOffset();
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    *aOffset = textAcc->CaretOffset();
   }
 
-  *aOffset = textAcc->CaretOffset();
-
   return *aOffset != -1 ? S_OK : S_FALSE;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleText::get_characterExtents(long aOffset,
                                         enum IA2CoordinateType aCoordType,
@@ -112,22 +122,25 @@ ia2AccessibleText::get_characterExtents(
   if (!aX || !aY || !aWidth || !aHeight)
     return E_INVALIDARG;
   *aX = *aY = *aWidth = *aHeight = 0;
 
   uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
   nsIntRect rect;
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct())
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    rect = proxy->CharBounds(aOffset, geckoCoordType);
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  rect = textAcc->CharBounds(aOffset, geckoCoordType);
+    rect = textAcc->CharBounds(aOffset, geckoCoordType);
+  }
 
   *aX = rect.x;
   *aY = rect.y;
   *aWidth = rect.width;
   *aHeight = rect.height;
   return S_OK;
 
   A11Y_TRYBLOCK_END
@@ -137,24 +150,26 @@ STDMETHODIMP
 ia2AccessibleText::get_nSelections(long* aNSelections)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aNSelections)
     return E_INVALIDARG;
   *aNSelections = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aNSelections = proxy->SelectionCount();
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    *aNSelections = textAcc->SelectionCount();
   }
 
-  *aNSelections = textAcc->SelectionCount();
-
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleText::get_offsetAtPoint(long aX, long aY,
                                      enum IA2CoordinateType aCoordType,
@@ -165,48 +180,54 @@ ia2AccessibleText::get_offsetAtPoint(lon
   if (!aOffset)
     return E_INVALIDARG;
   *aOffset = 0;
 
   uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aOffset = proxy->OffsetAtPoint(aX, aY, geckoCoordType);
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    *aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType);
   }
 
-  *aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType);
-
   return *aOffset == -1 ? S_FALSE : S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset,
                                  long* aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aStartOffset || !aEndOffset)
     return E_INVALIDARG;
   *aStartOffset = *aEndOffset = 0;
 
   int32_t startOffset = 0, endOffset = 0;
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
-  }
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    nsString unused;
+    if (!proxy->SelectionBoundsAt(aSelectionIndex, unused, &startOffset,
+                                  &endOffset))
+      return E_INVALIDARG;
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  if (!textAcc->SelectionBoundsAt(aSelectionIndex, &startOffset, &endOffset)) {
-    return E_INVALIDARG;
+    if (!textAcc->SelectionBoundsAt(aSelectionIndex, &startOffset, &endOffset))
+      return E_INVALIDARG;
   }
 
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
@@ -217,28 +238,31 @@ ia2AccessibleText::get_text(long aStartO
   A11Y_TRYBLOCK_BEGIN
 
   if (!aText)
     return E_INVALIDARG;
 
   *aText = nullptr;
 
   nsAutoString text;
-  MOZ_ASSERT(!HyperTextProxyFor(this));
-  HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
-  if (textAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
-  }
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    if (!proxy->TextSubstring(aStartOffset, aEndOffset, text)) {
+      return E_INVALIDARG;
+    }
+  } else {
+    HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
+    if (textAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
 
-  if (!textAcc->IsValidRange(aStartOffset, aEndOffset)) {
-    return E_INVALIDARG;
+    if (!textAcc->IsValidRange(aStartOffset, aEndOffset))
+      return E_INVALIDARG;
+
+    textAcc->TextSubstring(aStartOffset, aEndOffset, text);
   }
 
-  textAcc->TextSubstring(aStartOffset, aEndOffset, text);
-
   if (text.IsEmpty())
     return S_FALSE;
 
   *aText = ::SysAllocStringLen(text.get(), text.Length());
   return *aText ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
@@ -385,34 +409,39 @@ ia2AccessibleText::get_textAtOffset(long
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleText::removeSelection(long aSelectionIndex)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+    if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+      return proxy->RemoveFromSelection(aSelectionIndex) ? S_OK : E_INVALIDARG;
+    }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   return textAcc->RemoveFromSelection(aSelectionIndex) ?
     S_OK : E_INVALIDARG;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleText::setCaretOffset(long aOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+    if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+      proxy->SetCaretOffset(aOffset);
+      return S_OK;
+    }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidOffset(aOffset))
     return E_INVALIDARG;
 
@@ -423,17 +452,20 @@ ia2AccessibleText::setCaretOffset(long a
 }
 
 STDMETHODIMP
 ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
                                 long aEndOffset)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    return proxy->SetSelectionBoundsAt(aSelectionIndex, aStartOffset,
+                                       aEndOffset) ? S_OK : E_INVALIDARG;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   return textAcc->SetSelectionBoundsAt(aSelectionIndex, aStartOffset, aEndOffset) ?
     S_OK : E_INVALIDARG;
 
@@ -444,17 +476,20 @@ STDMETHODIMP
 ia2AccessibleText::get_nCharacters(long* aNCharacters)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aNCharacters)
     return E_INVALIDARG;
   *aNCharacters = 0;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    *aNCharacters = proxy->CharacterCount();
+    return S_OK;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   *aNCharacters  = textAcc->CharacterCount();
   return S_OK;
 
@@ -462,17 +497,20 @@ ia2AccessibleText::get_nCharacters(long*
 }
 
 STDMETHODIMP
 ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
                                      enum IA2ScrollType aScrollType)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+    if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+      proxy->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType);
+      return S_OK;
+    }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidRange(aStartIndex, aEndIndex))
     return E_INVALIDARG;
 
@@ -488,17 +526,21 @@ ia2AccessibleText::scrollSubstringToPoin
                                           long aX, long aY)
 {
   A11Y_TRYBLOCK_BEGIN
 
   uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
 
-  MOZ_ASSERT(!HyperTextProxyFor(this));
+  if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
+    proxy->ScrollSubstringToPoint(aStartIndex, aEndIndex, geckoCoordType, aX,
+                                  aY);
+    return S_OK;
+  }
 
   HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
   if (textAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!textAcc->IsValidRange(aStartIndex, aEndIndex))
     return E_INVALIDARG;
 
--- a/accessible/windows/ia2/ia2AccessibleValue.cpp
+++ b/accessible/windows/ia2/ia2AccessibleValue.cpp
@@ -50,23 +50,25 @@ ia2AccessibleValue::get_currentValue(VAR
 
   if (!aCurrentValue)
     return E_INVALIDARG;
 
   VariantInit(aCurrentValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
   double currentValue;
-  MOZ_ASSERT(!valueAcc->IsProxy());
-  if (valueAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (valueAcc->IsProxy()) {
+    currentValue = valueAcc->Proxy()->CurValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    currentValue = valueAcc->CurValue();
   }
 
-  currentValue = valueAcc->CurValue();
-
   if (IsNaN(currentValue))
     return S_FALSE;
 
   aCurrentValue->vt = VT_R8;
   aCurrentValue->dblVal = currentValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END
@@ -76,17 +78,18 @@ STDMETHODIMP
 ia2AccessibleValue::setCurrentValue(VARIANT aValue)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (aValue.vt != VT_R8)
     return E_INVALIDARG;
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
-  MOZ_ASSERT(!valueAcc->IsProxy());
+  if (valueAcc->IsProxy())
+    return valueAcc->Proxy()->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
 
   if (valueAcc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   return valueAcc->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
 
   A11Y_TRYBLOCK_END
 }
@@ -98,23 +101,25 @@ ia2AccessibleValue::get_maximumValue(VAR
 
   if (!aMaximumValue)
     return E_INVALIDARG;
 
   VariantInit(aMaximumValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
   double maximumValue;
-  MOZ_ASSERT(!valueAcc->IsProxy());
-  if (valueAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (valueAcc->IsProxy()) {
+    maximumValue = valueAcc->Proxy()->MaxValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    maximumValue = valueAcc->MaxValue();
   }
 
-  maximumValue = valueAcc->MaxValue();
-
   if (IsNaN(maximumValue))
     return S_FALSE;
 
   aMaximumValue->vt = VT_R8;
   aMaximumValue->dblVal = maximumValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END
@@ -127,23 +132,25 @@ ia2AccessibleValue::get_minimumValue(VAR
 
   if (!aMinimumValue)
     return E_INVALIDARG;
 
   VariantInit(aMinimumValue);
 
   AccessibleWrap* valueAcc = static_cast<AccessibleWrap*>(this);
   double minimumValue;
-  MOZ_ASSERT(!valueAcc->IsProxy());
-  if (valueAcc->IsDefunct()) {
-    return CO_E_OBJNOTCONNECTED;
+  if (valueAcc->IsProxy()) {
+    minimumValue = valueAcc->Proxy()->MinValue();
+  } else {
+    if (valueAcc->IsDefunct())
+      return CO_E_OBJNOTCONNECTED;
+
+    minimumValue = valueAcc->MinValue();
   }
 
-  minimumValue = valueAcc->MinValue();
-
   if (IsNaN(minimumValue))
     return S_FALSE;
 
   aMinimumValue->vt = VT_R8;
   aMinimumValue->dblVal = minimumValue;
   return S_OK;
 
   A11Y_TRYBLOCK_END
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -182,16 +182,26 @@ AccessibleWrap::get_accParent( IDispatch
   if (!ppdispParent)
     return E_INVALIDARG;
 
   *ppdispParent = nullptr;
 
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  if (IsProxy()) {
+    ProxyAccessible* proxy = Proxy();
+    ProxyAccessible* parent = proxy->Parent();
+    if (!parent)
+      return S_FALSE;
+
+    *ppdispParent = NativeAccessible(WrapperFor(parent));
+    return S_OK;
+  }
+
   DocAccessible* doc = AsDoc();
   if (doc) {
     // Return window system accessible object for root document and tab document
     // accessibles.
     if (!doc->ParentDocument() ||
         (nsWinUtils::IsWindowEmulationStarted() &&
          nsCoreUtils::IsTabDocument(doc->DocumentNode()))) {
       HWND hwnd = static_cast<HWND>(doc->GetNativeWindow());
@@ -221,16 +231,25 @@ AccessibleWrap::get_accChildCount( long 
   if (!pcountChildren)
     return E_INVALIDARG;
 
   *pcountChildren = 0;
 
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  if (IsProxy()) {
+    ProxyAccessible* proxy = Proxy();
+    if (proxy->MustPruneChildren())
+      return S_OK;
+
+    *pcountChildren = proxy->ChildrenCount();
+    return S_OK;
+  }
+
   if (nsAccUtils::MustPrune(this))
     return S_OK;
 
   *pcountChildren = ChildCount();
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
@@ -285,17 +304,20 @@ AccessibleWrap::get_accName(
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString name;
-  xpAccessible->Name(name);
+  if (xpAccessible->IsProxy())
+    xpAccessible->Proxy()->Name(name);
+  else
+    xpAccessible->Name(name);
 
   // The name was not provided, e.g. no alt attribute for an image. A screen
   // reader may choose to invent its own accessible name, e.g. from an image src
   // attribute. Refer to eNoNameOnPurpose return value.
   if (name.IsVoid())
     return S_FALSE;
 
   *pszName = ::SysAllocStringLen(name.get(), name.Length());
@@ -324,16 +346,20 @@ AccessibleWrap::get_accValue(
 
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  // TODO make this work with proxies.
+  if (IsProxy())
+    return E_NOTIMPL;
+
   nsAutoString value;
   xpAccessible->Value(value);
 
   // See bug 438784: need to expose URL on doc's value attribute. For this,
   // reverting part of fix for bug 425693 to make this MSAA method behave
   // IAccessible2-style.
   if (value.IsEmpty())
     return S_FALSE;
@@ -363,17 +389,20 @@ AccessibleWrap::get_accDescription(VARIA
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString description;
-  xpAccessible->Description(description);
+  if (IsProxy())
+    xpAccessible->Proxy()->Description(description);
+  else
+    xpAccessible->Description(description);
 
   *pszDescription = ::SysAllocStringLen(description.get(),
                                         description.Length());
   return *pszDescription ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
@@ -395,22 +424,26 @@ AccessibleWrap::get_accRole(
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   a11y::role geckoRole;
+  if (xpAccessible->IsProxy()) {
+    geckoRole = xpAccessible->Proxy()->Role();
+  } else {
 #ifdef DEBUG
-  NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible),
-               "Does not support Text when it should");
+    NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible),
+                 "Does not support Text when it should");
 #endif
 
-  geckoRole = xpAccessible->Role();
+    geckoRole = xpAccessible->Role();
+  }
 
   uint32_t msaaRole = 0;
 
 #define ROLE(_geckoRole, stringRole, atkRole, macRole, \
              _msaaRole, ia2Role, nameRule) \
   case roles::_geckoRole: \
     msaaRole = _msaaRole; \
     break;
@@ -421,29 +454,39 @@ AccessibleWrap::get_accRole(
       MOZ_CRASH("Unknown role.");
   }
 
 #undef ROLE
 
   // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call the MSAA role
   // a ROLE_OUTLINEITEM for consistency and compatibility.
   // We need this because ARIA has a role of "row" for both grid and treegrid
-  if (geckoRole == roles::ROW) {
-    Accessible* xpParent = Parent();
-    if (xpParent && xpParent->Role() == roles::TREE_TABLE)
-      msaaRole = ROLE_SYSTEM_OUTLINEITEM;
+  if (xpAccessible->IsProxy()) {
+      if (geckoRole == roles::ROW
+          && xpAccessible->Proxy()->Parent()->Role() == roles::TREE_TABLE)
+        msaaRole = ROLE_SYSTEM_OUTLINEITEM;
+  } else {
+    if (geckoRole == roles::ROW) {
+      Accessible* xpParent = Parent();
+      if (xpParent && xpParent->Role() == roles::TREE_TABLE)
+        msaaRole = ROLE_SYSTEM_OUTLINEITEM;
+    }
   }
-
+  
   // -- Try enumerated role
   if (msaaRole != USE_ROLE_STRING) {
     pvarRole->vt = VT_I4;
     pvarRole->lVal = msaaRole;  // Normal enumerated role
     return S_OK;
   }
 
+  // XXX bug 798492 make this work with proxies?
+  if (IsProxy())
+  return E_FAIL;
+
   // -- Try BSTR role
   // Could not map to known enumerated MSAA role like ROLE_BUTTON
   // Use BSTR role to expose role attribute or tag name + namespace
   nsIContent *content = xpAccessible->GetContent();
   if (!content)
     return E_FAIL;
 
   if (content->IsElement()) {
@@ -504,17 +547,21 @@ AccessibleWrap::get_accState(
   // MSAA only has 31 states and the lowest 31 bits of our state bit mask
   // are the same states as MSAA.
   // Note: we map the following Gecko states to different MSAA states:
   //   REQUIRED -> ALERT_LOW
   //   ALERT -> ALERT_MEDIUM
   //   INVALID -> ALERT_HIGH
   //   CHECKABLE -> MARQUEED
 
-  uint64_t state = State();
+  uint64_t state;
+  if (xpAccessible->IsProxy())
+    state = xpAccessible->Proxy()->State();
+  else
+    state = State();
 
   uint32_t msaaState = 0;
   nsAccUtils::To32States(state, &msaaState, nullptr);
   pvarState->lVal = msaaState;
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
@@ -570,16 +617,20 @@ AccessibleWrap::get_accKeyboardShortcut(
 
   Accessible* acc = GetXPAccessibleFor(varChild);
   if (!acc)
     return E_INVALIDARG;
 
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  // TODO make this work with proxies.
+  if (acc->IsProxy())
+    return E_NOTIMPL;
+
   KeyBinding keyBinding = acc->AccessKey();
   if (keyBinding.IsEmpty())
     keyBinding = acc->KeyboardShortcut();
 
   nsAutoString shortcut;
   keyBinding.ToString(shortcut);
 
   *pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(),
@@ -605,17 +656,23 @@ AccessibleWrap::get_accFocus(
   // VT_I4:       lVal is CHILDID_SELF. The object itself has the keyboard focus.
   // VT_I4:       lVal contains the child ID of the child element with the keyboard focus.
   // VT_DISPATCH: pdispVal member is the address of the IDispatch interface
   //              for the child object with the keyboard focus.
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   // Return the current IAccessible child that has focus
-  Accessible* focusedAccessible = FocusedChild();
+  Accessible* focusedAccessible;
+  if (IsProxy()) {
+    ProxyAccessible* proxy = Proxy()->FocusedChild();
+    focusedAccessible = proxy ? WrapperFor(proxy) : nullptr;
+  } else {
+    focusedAccessible = FocusedChild();
+  }
 
   if (focusedAccessible == this) {
     pvarChild->vt = VT_I4;
     pvarChild->lVal = CHILDID_SELF;
   }
   else if (focusedAccessible) {
     pvarChild->vt = VT_DISPATCH;
     pvarChild->pdispVal = NativeAccessible(focusedAccessible);
@@ -767,19 +824,33 @@ AccessibleWrap::get_accSelection(VARIANT
     return E_INVALIDARG;
 
   VariantInit(pvarChildren);
   pvarChildren->vt = VT_EMPTY;
 
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  // TODO make this work with proxies.
+  if (IsProxy())
+    return E_NOTIMPL;
+
   if (IsSelect()) {
     AutoTArray<Accessible*, 10> selectedItems;
-    SelectedItems(&selectedItems);
+    if (IsProxy()) {
+      nsTArray<ProxyAccessible*> proxies;
+      Proxy()->SelectedItems(&proxies);
+
+      uint32_t selectedCount = proxies.Length();
+      for (uint32_t i = 0; i < selectedCount; i++) {
+        selectedItems.AppendElement(WrapperFor(proxies[i]));
+      }
+    } else {
+      SelectedItems(&selectedItems);
+    }
 
     // 1) Create and initialize the enumeration
     RefPtr<AccessibleEnumerator> pEnum = new AccessibleEnumerator(selectedItems);
     pvarChildren->vt = VT_UNKNOWN;    // this must be VT_UNKNOWN for an IEnumVARIANT
     NS_ADDREF(pvarChildren->punkVal = pEnum);
   }
   return S_OK;
 
@@ -804,17 +875,21 @@ AccessibleWrap::get_accDefaultAction(
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString defaultAction;
-  xpAccessible->ActionNameAt(0, defaultAction);
+  if (xpAccessible->IsProxy()) {
+    xpAccessible->Proxy()->ActionNameAt(0, defaultAction);
+  } else {
+    xpAccessible->ActionNameAt(0, defaultAction);
+  }
 
   *pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
                                           defaultAction.Length());
   return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
@@ -832,32 +907,52 @@ AccessibleWrap::accSelect(
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (flagsSelect & SELFLAG_TAKEFOCUS) {
-    xpAccessible->TakeFocus();
+    if (xpAccessible->IsProxy()) {
+      xpAccessible->Proxy()->TakeFocus();
+    } else {
+      xpAccessible->TakeFocus();
+    }
+
     return S_OK;
   }
 
   if (flagsSelect & SELFLAG_TAKESELECTION) {
-    xpAccessible->TakeSelection();
+    if (xpAccessible->IsProxy()) {
+      xpAccessible->Proxy()->TakeSelection();
+    } else {
+      xpAccessible->TakeSelection();
+    }
+
     return S_OK;
   }
 
   if (flagsSelect & SELFLAG_ADDSELECTION) {
-    xpAccessible->SetSelected(true);
+    if (xpAccessible->IsProxy()) {
+      xpAccessible->Proxy()->SetSelected(true);
+    } else {
+      xpAccessible->SetSelected(true);
+    }
+
     return S_OK;
   }
 
   if (flagsSelect & SELFLAG_REMOVESELECTION) {
-    xpAccessible->SetSelected(false);
+    if (xpAccessible->IsProxy()) {
+      xpAccessible->Proxy()->SetSelected(false);
+    } else {
+      xpAccessible->SetSelected(false);
+    }
+
     return S_OK;
   }
 
   return E_FAIL;
 
   A11Y_TRYBLOCK_END
 }
 
@@ -884,17 +979,22 @@ AccessibleWrap::accLocation(
 
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  nsIntRect rect = xpAccessible->Bounds();
+  nsIntRect rect;
+  if (xpAccessible->IsProxy()) {
+    rect = xpAccessible->Proxy()->Bounds();
+  } else {
+    rect = xpAccessible->Bounds();
+  }
 
   *pxLeft = rect.x;
   *pyTop = rect.y;
   *pcxWidth = rect.width;
   *pcyHeight = rect.height;
   return S_OK;
 
   A11Y_TRYBLOCK_END
@@ -918,32 +1018,16 @@ AccessibleWrap::accNavigate(
 
   Accessible* accessible = GetXPAccessibleFor(varStart);
   if (!accessible)
     return E_INVALIDARG;
 
   if (accessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  // Make sure that varStart != CHILDID_SELF so we don't infinitely recurse
-  if (accessible->IsProxy() && varStart.vt == VT_I4 &&
-      varStart.lVal != CHILDID_SELF) {
-    // Now that we have the starting object, delegate this request to that
-    // object as a self-relative request...
-    RefPtr<IAccessible> comProxy;
-    accessible->GetNativeInterface((void**) getter_AddRefs(comProxy));
-    if (!comProxy) {
-      return E_UNEXPECTED;
-    }
-    VARIANT selfChildId;
-    selfChildId.vt = VT_I4;
-    selfChildId.lVal = CHILDID_SELF;
-    return comProxy->accNavigate(navDir, selfChildId, pvarEndUpAt);
-  }
-
   Accessible* navAccessible = nullptr;
   Maybe<RelationType> xpRelation;
 
 #define RELATIONTYPE(geckoType, stringType, atkType, msaaType, ia2Type) \
   case msaaType: \
     xpRelation.emplace(RelationType::geckoType); \
     break;
 
@@ -991,18 +1075,26 @@ AccessibleWrap::accNavigate(
       return E_INVALIDARG;
   }
 
 #undef RELATIONTYPE
 
   pvarEndUpAt->vt = VT_EMPTY;
 
   if (xpRelation) {
-    Relation rel = RelationByType(*xpRelation);
-    navAccessible = rel.Next();
+    if (accessible->IsProxy()) {
+      nsTArray<ProxyAccessible*> targets =
+        accessible->Proxy()->RelationByType(*xpRelation);
+      if (targets.Length()) {
+        navAccessible = WrapperFor(targets[0]);
+      }
+    } else {
+      Relation rel = RelationByType(*xpRelation);
+      navAccessible = rel.Next();
+    }
   }
 
   if (!navAccessible)
     return E_FAIL;
 
   pvarEndUpAt->pdispVal = NativeAccessible(navAccessible);
   pvarEndUpAt->vt = VT_DISPATCH;
   return S_OK;
@@ -1021,17 +1113,25 @@ AccessibleWrap::accHitTest(
   if (!pvarChild)
     return E_INVALIDARG;
 
   VariantInit(pvarChild);
 
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  Accessible* accessible = ChildAtPoint(xLeft, yTop, eDirectChild);
+  Accessible* accessible = nullptr;
+  if (IsProxy()) {
+    ProxyAccessible* proxy = Proxy()->ChildAtPoint(xLeft, yTop, eDirectChild);
+    if (proxy) {
+      accessible = WrapperFor(proxy);
+    }
+  } else {
+    accessible = ChildAtPoint(xLeft, yTop, eDirectChild);
+  }
 
   // if we got a child
   if (accessible) {
     // if the child is us
     if (accessible == this) {
       pvarChild->vt = VT_I4;
       pvarChild->lVal = CHILDID_SELF;
     } else { // its not create an Accessible for it.
@@ -1059,16 +1159,20 @@ AccessibleWrap::accDoDefaultAction(
 
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  // TODO make this work with proxies.
+  if (xpAccessible->IsProxy())
+    return xpAccessible->Proxy()->DoAction(0) ? S_OK : E_INVALIDARG;
+
   return xpAccessible->DoAction(0) ? S_OK : E_INVALIDARG;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 AccessibleWrap::put_accName(
       /* [optional][in] */ VARIANT varChild,
--- a/accessible/windows/msaa/DocAccessibleWrap.cpp
+++ b/accessible/windows/msaa/DocAccessibleWrap.cpp
@@ -2,17 +2,16 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocAccessibleWrap.h"
 
 #include "Compatibility.h"
-#include "DocAccessibleChild.h"
 #include "nsWinUtils.h"
 #include "mozilla/dom/TabChild.h"
 #include "Role.h"
 #include "RootAccessible.h"
 #include "sdnDocAccessible.h"
 #include "Statistics.h"
 
 #include "nsIDocShell.h"
@@ -40,41 +39,16 @@ IMPL_IUNKNOWN_QUERY_HEAD(DocAccessibleWr
     statistics::ISimpleDOMUsed();
     *aInstancePtr = static_cast<ISimpleDOMDocument*>(new sdnDocAccessible(this));
     static_cast<IUnknown*>(*aInstancePtr)->AddRef();
     return S_OK;
   }
 IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(HyperTextAccessibleWrap)
 
 STDMETHODIMP
-DocAccessibleWrap::get_accParent(
-      /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
-{
-  HRESULT hr = DocAccessible::get_accParent(ppdispParent);
-  if (*ppdispParent) {
-    return hr;
-  }
-
-  // We might be a top-level document in a content process.
-  DocAccessibleChild* ipcDoc = IPCDoc();
-  if (!ipcDoc) {
-    return S_FALSE;
-  }
-  IAccessible* dispParent = ipcDoc->GetParentIAccessible();
-  MOZ_ASSERT(dispParent);
-  if (!dispParent) {
-    return E_UNEXPECTED;
-  }
-
-  dispParent->AddRef();
-  *ppdispParent = static_cast<IDispatch*>(dispParent);
-  return S_OK;
-}
-
-STDMETHODIMP
 DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue)
 {
   A11Y_TRYBLOCK_BEGIN
 
   if (!aValue)
     return E_INVALIDARG;
   *aValue = nullptr;
 
--- a/accessible/windows/msaa/DocAccessibleWrap.h
+++ b/accessible/windows/msaa/DocAccessibleWrap.h
@@ -17,24 +17,20 @@ class DocAccessibleWrap : public DocAcce
 public:
   DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 
   DECL_IUNKNOWN_INHERITED
 
   // IAccessible
 
-  // Override get_accParent for e10s
-  virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accParent(
-      /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispParent) override;
-
-  // Override get_accValue to provide URL when no other value is available
-  virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue(
-      /* [optional][in] */ VARIANT varChild,
-      /* [retval][out] */ BSTR __RPC_FAR *pszValue) override;
+    // Override get_accValue to provide URL when no other value is available
+    virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( 
+        /* [optional][in] */ VARIANT varChild,
+        /* [retval][out] */ BSTR __RPC_FAR *pszValue);
 
   // Accessible
   virtual void Shutdown();
 
   // DocAccessible
   virtual void* GetNativeWindow() const;
 
   /**
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -5,63 +5,38 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Platform.h"
 
 #include "AccEvent.h"
 #include "Compatibility.h"
 #include "HyperTextAccessibleWrap.h"
 #include "ia2AccessibleText.h"
-#include "nsIXULRuntime.h"
 #include "nsWinUtils.h"
 #include "mozilla/a11y/ProxyAccessible.h"
-#include "mozilla/mscom/InterceptorLog.h"
-#include "mozilla/mscom/Registration.h"
-#include "mozilla/StaticPtr.h"
 #include "ProxyWrappers.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
-using namespace mozilla::mscom;
-
-static StaticAutoPtr<RegisteredProxy> gRegProxy;
-static StaticAutoPtr<RegisteredProxy> gRegAccTlb;
-static StaticAutoPtr<RegisteredProxy> gRegMiscTlb;
 
 void
 a11y::PlatformInit()
 {
   Compatibility::Init();
 
   nsWinUtils::MaybeStartWindowEmulation();
   ia2AccessibleText::InitTextChangeData();
-  if (BrowserTabsRemoteAutostart()) {
-    mscom::InterceptorLog::Init();
-    UniquePtr<RegisteredProxy> regProxy(
-        mscom::RegisterProxy(L"ia2marshal.dll"));
-    gRegProxy = regProxy.release();
-    UniquePtr<RegisteredProxy> regAccTlb(
-        mscom::RegisterTypelib(L"oleacc.dll",
-                               RegistrationFlags::eUseSystemDirectory));
-    gRegAccTlb = regAccTlb.release();
-    UniquePtr<RegisteredProxy> regMiscTlb(
-        mscom::RegisterTypelib(L"Accessible.tlb"));
-    gRegMiscTlb = regMiscTlb.release();
-  }
 }
 
 void
 a11y::PlatformShutdown()
 {
   ::DestroyCaret();
 
   nsWinUtils::ShutdownWindowEmulation();
-  gRegProxy = nullptr;
-  gRegAccTlb = nullptr;
-  gRegMiscTlb = nullptr;
 }
 
 void
 a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
   AccessibleWrap* wrapper = nullptr;
   if (aInterfaces & Interfaces::DOCUMENT) {
     wrapper = new DocProxyAccessibleWrap(aProxy);
--- a/accessible/windows/msaa/moz.build
+++ b/accessible/windows/msaa/moz.build
@@ -44,18 +44,16 @@ if CONFIG['MOZ_XUL']:
         'XULMenuAccessibleWrap.cpp',
         'XULTreeGridAccessibleWrap.cpp',
     ]
 
 LOCAL_INCLUDES += [
     '/accessible/base',
     '/accessible/generic',
     '/accessible/html',
-    '/accessible/ipc',
-    '/accessible/ipc/win',
     '/accessible/windows',
     '/accessible/windows/ia2',
     '/accessible/windows/sdn',
     '/accessible/windows/uia',
     '/accessible/xpcom',
     '/accessible/xul',
     '/dom/base',
     '/layout/style',
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -190,30 +190,26 @@ xpcAccessible::GetDOMNode(nsIDOMNode** a
     CallQueryInterface(node, aDOMNode);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetId(nsAString& aID)
 {
-#if defined(XP_WIN)
-  return NS_ERROR_NOT_IMPLEMENTED;
-#else
   ProxyAccessible* proxy = IntlGeneric().AsProxy();
   if (!proxy) {
     return NS_ERROR_FAILURE;
   }
 
   nsString id;
   proxy->DOMNodeID(id);
   aID.Assign(id);
 
   return NS_OK;
-#endif
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDocument(nsIAccessibleDocument** aDocument)
 {
   NS_ENSURE_ARG_POINTER(aDocument);
   *aDocument = nullptr;
 
@@ -477,26 +473,22 @@ xpcAccessible::GetRelationByType(uint32_
     return NS_ERROR_FAILURE;
 
   if (IntlGeneric().IsAccessible()) {
     Relation rel = Intl()->RelationByType(static_cast<RelationType>(aType));
     NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
     return NS_OK;
   }
 
-#if defined(XP_WIN)
-  return NS_ERROR_NOT_IMPLEMENTED;
-#else
   ProxyAccessible* proxy = IntlGeneric().AsProxy();
   nsTArray<ProxyAccessible*> targets =
     proxy->RelationByType(static_cast<RelationType>(aType));
   NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &targets));
 
   return NS_OK;
-#endif
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetRelations(nsIArray** aRelations)
 {
   NS_ENSURE_ARG_POINTER(aRelations);
   *aRelations = nullptr;
 
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -91,17 +91,16 @@ private:
     }
 
     mCache.Remove(aProxy);
   }
 
   friend class DocManager;
   friend class DocAccessible;
   friend class ProxyAccessible;
-  friend class ProxyAccessibleBase<ProxyAccessible>;
 
   xpcAccessibleDocument(const xpcAccessibleDocument&) = delete;
   xpcAccessibleDocument& operator =(const xpcAccessibleDocument&) = delete;
 
   nsRefPtrHashtable<nsPtrHashKey<const void>, xpcAccessibleGeneric> mCache;
   bool mRemote;
 };
 
--- a/accessible/xpcom/xpcAccessibleHyperLink.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp
@@ -16,81 +16,69 @@ xpcAccessibleHyperLink::GetStartIndex(in
   NS_ENSURE_ARG_POINTER(aStartIndex);
   *aStartIndex = 0;
 
   if (Intl().IsNull())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible()) {
     *aStartIndex = Intl().AsAccessible()->StartOffset();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     bool isIndexValid = false;
     uint32_t startOffset = Intl().AsProxy()->StartOffset(&isIndexValid);
     if (!isIndexValid)
       return NS_ERROR_FAILURE;
 
     *aStartIndex = startOffset;
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetEndIndex(int32_t* aEndIndex)
 {
   NS_ENSURE_ARG_POINTER(aEndIndex);
   *aEndIndex = 0;
 
   if (Intl().IsNull())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible()) {
     *aEndIndex = Intl().AsAccessible()->EndOffset();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     bool isIndexValid = false;
     uint32_t endOffset = Intl().AsProxy()->EndOffset(&isIndexValid);
     if (!isIndexValid)
       return NS_ERROR_FAILURE;
 
     *aEndIndex = endOffset;
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetAnchorCount(int32_t* aAnchorCount)
 {
   NS_ENSURE_ARG_POINTER(aAnchorCount);
   *aAnchorCount = 0;
 
   if (Intl().IsNull())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible()) {
     *aAnchorCount = Intl().AsAccessible()->AnchorCount();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     bool isCountValid = false;
     uint32_t anchorCount = Intl().AsProxy()->AnchorCount(&isCountValid);
     if (!isCountValid)
       return NS_ERROR_FAILURE;
 
     *aAnchorCount = anchorCount;
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI)
 {
@@ -103,31 +91,27 @@ xpcAccessibleHyperLink::GetURI(int32_t a
     return NS_ERROR_INVALID_ARG;
 
   if (Intl().IsAccessible()) {
     if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount()))
       return NS_ERROR_INVALID_ARG;
 
     RefPtr<nsIURI>(Intl().AsAccessible()->AnchorURIAt(aIndex)).forget(aURI);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsCString spec;
     bool isURIValid = false;
     Intl().AsProxy()->AnchorURIAt(aIndex, spec, &isURIValid);
     if (!isURIValid)
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIURI> uri;
     nsresult rv = NS_NewURI(getter_AddRefs(uri), spec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     uri.forget(aURI);
-#endif
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
@@ -142,21 +126,17 @@ xpcAccessibleHyperLink::GetAnchor(int32_
     return NS_ERROR_INVALID_ARG;
 
   if (Intl().IsAccessible()) {
     if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount()))
       return NS_ERROR_INVALID_ARG;
 
     NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsAccessible()->AnchorAt(aIndex)));
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsProxy()->AnchorAt(aIndex)));
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetValid(bool* aValid)
 {
@@ -164,17 +144,13 @@ xpcAccessibleHyperLink::GetValid(bool* a
   *aValid = false;
 
   if (Intl().IsNull())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible()) {
     *aValid = Intl().AsAccessible()->IsLinkValid();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aValid = Intl().AsProxy()->IsLinkValid();
-#endif
   }
 
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -42,44 +42,36 @@ xpcAccessibleHyperText::GetCharacterCoun
   *aCharacterCount = 0;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aCharacterCount = Intl()->CharacterCount();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aCharacterCount = mIntl.AsProxy()->CharacterCount();
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetText(int32_t aStartOffset, int32_t aEndOffset,
                                 nsAString& aText)
 {
   aText.Truncate();
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->TextSubstring(aStartOffset, aEndOffset, aText);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text;
     mIntl.AsProxy()->TextSubstring(aStartOffset, aEndOffset, text);
     aText = text;
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextBeforeOffset(int32_t aOffset,
                                             AccessibleTextBoundary aBoundaryType,
                                             int32_t* aStartOffset,
@@ -93,24 +85,20 @@ xpcAccessibleHyperText::GetTextBeforeOff
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->TextBeforeOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset, 
                              aText);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text;
     mIntl.AsProxy()->GetTextBeforeOffset(aOffset, aBoundaryType, text,
                                          aStartOffset, aEndOffset);
     aText = text;
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAtOffset(int32_t aOffset,
                                         AccessibleTextBoundary aBoundaryType,
                                         int32_t* aStartOffset,
@@ -123,24 +111,20 @@ xpcAccessibleHyperText::GetTextAtOffset(
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->TextAtOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset, 
                          aText);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text;
     mIntl.AsProxy()->GetTextAtOffset(aOffset, aBoundaryType, text, 
                                      aStartOffset, aEndOffset);
     aText = text;
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAfterOffset(int32_t aOffset,
                                            AccessibleTextBoundary aBoundaryType,
                                            int32_t* aStartOffset,
@@ -153,24 +137,20 @@ xpcAccessibleHyperText::GetTextAfterOffs
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->TextAfterOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset, 
                             aText);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text;
     mIntl.AsProxy()->GetTextAfterOffset(aOffset, aBoundaryType, text, 
                                         aStartOffset, aEndOffset);
     aText = text;
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCharacterAtOffset(int32_t aOffset,
                                              char16_t* aCharacter)
 {
@@ -178,21 +158,17 @@ xpcAccessibleHyperText::GetCharacterAtOf
   *aCharacter = L'\0';
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aCharacter = Intl()->CharAt(aOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aCharacter = mIntl.AsProxy()->CharAt(aOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAttributes(bool aIncludeDefAttrs,
                                           int32_t aOffset,
                                           int32_t* aStartOffset,
@@ -208,28 +184,24 @@ xpcAccessibleHyperText::GetTextAttribute
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIPersistentProperties> props;
   if (mIntl.IsAccessible()) {
     props = Intl()->TextAttributes(aIncludeDefAttrs, aOffset, aStartOffset,
                                    aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     AutoTArray<Attribute, 10> attrs;
     mIntl.AsProxy()->TextAttributes(aIncludeDefAttrs, aOffset, &attrs,
         aStartOffset, aEndOffset);
     uint32_t attrCount = attrs.Length();
     nsAutoString unused;
     for (uint32_t i = 0; i < attrCount; i++) {
       props->SetStringProperty(attrs[i].Name(), attrs[i].Value(), unused);
     }
-#endif
   }
   props.forget(aAttributes);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetDefaultTextAttributes(nsIPersistentProperties** aAttributes)
@@ -239,27 +211,23 @@ xpcAccessibleHyperText::GetDefaultTextAt
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIPersistentProperties> props;
   if (mIntl.IsAccessible()) {
     props = Intl()->DefaultTextAttributes();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     AutoTArray<Attribute, 10> attrs;
     mIntl.AsProxy()->DefaultTextAttributes(&attrs);
     uint32_t attrCount = attrs.Length();
     nsAutoString unused;
     for (uint32_t i = 0; i < attrCount; i++) {
       props->SetStringProperty(attrs[i].Name(), attrs[i].Value(), unused);
     }
-#endif
   }
   props.forget(aAttributes);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCharacterExtents(int32_t aOffset,
@@ -275,21 +243,17 @@ xpcAccessibleHyperText::GetCharacterExte
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   nsIntRect rect;
   if (mIntl.IsAccessible()) {
     rect = Intl()->CharBounds(aOffset, aCoordType);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     rect = mIntl.AsProxy()->CharBounds(aOffset, aCoordType);
-#endif
   }
   *aX = rect.x; *aY = rect.y;
   *aWidth = rect.width; *aHeight = rect.height;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetRangeExtents(int32_t aStartOffset, int32_t aEndOffset,
@@ -305,21 +269,17 @@ xpcAccessibleHyperText::GetRangeExtents(
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   nsIntRect rect;
   if (mIntl.IsAccessible()) {
     rect = Intl()->TextBounds(aStartOffset, aEndOffset, aCoordType);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     rect = mIntl.AsProxy()->TextBounds(aStartOffset, aEndOffset, aCoordType);
-#endif
   }
   *aX = rect.x; *aY = rect.y;
   *aWidth = rect.width; *aHeight = rect.height;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetOffsetAtPoint(int32_t aX, int32_t aY,
@@ -329,81 +289,65 @@ xpcAccessibleHyperText::GetOffsetAtPoint
   *aOffset = -1;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aOffset = Intl()->OffsetAtPoint(aX, aY, aCoordType);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aOffset = mIntl.AsProxy()->OffsetAtPoint(aX, aY, aCoordType);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCaretOffset(int32_t* aCaretOffset)
 {
   NS_ENSURE_ARG_POINTER(aCaretOffset);
   *aCaretOffset = -1;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aCaretOffset = Intl()->CaretOffset();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aCaretOffset = mIntl.AsProxy()->CaretOffset();
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::SetCaretOffset(int32_t aCaretOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->SetCaretOffset(aCaretOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->SetCaretOffset(aCaretOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetSelectionCount(int32_t* aSelectionCount)
 {
   NS_ENSURE_ARG_POINTER(aSelectionCount);
   *aSelectionCount = 0;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aSelectionCount = Intl()->SelectionCount();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aSelectionCount = mIntl.AsProxy()->SelectionCount();
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetSelectionBounds(int32_t aSelectionNum,
                                            int32_t* aStartOffset,
                                            int32_t* aEndOffset)
@@ -419,23 +363,19 @@ xpcAccessibleHyperText::GetSelectionBoun
     return NS_ERROR_INVALID_ARG;
 
   if (mIntl.IsAccessible()) {
     if (aSelectionNum >= Intl()->SelectionCount())
       return NS_ERROR_INVALID_ARG;
       
     Intl()->SelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString unused;
     mIntl.AsProxy()->SelectionBoundsAt(aSelectionNum, unused, aStartOffset, 
                                        aEndOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::SetSelectionBounds(int32_t aSelectionNum,
                                            int32_t aStartOffset,
                                            int32_t aEndOffset)
@@ -447,80 +387,64 @@ xpcAccessibleHyperText::SetSelectionBoun
     return NS_ERROR_INVALID_ARG;
 
   if (mIntl.IsAccessible()) {
       if (!Intl()->SetSelectionBoundsAt(aSelectionNum, aStartOffset, 
                                         aEndOffset)) {
         return NS_ERROR_INVALID_ARG;
       }
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
       if (!mIntl.AsProxy()->SetSelectionBoundsAt(aSelectionNum, aStartOffset, 
                                                 aEndOffset)) {
         return NS_ERROR_INVALID_ARG;
       }
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::AddSelection(int32_t aStartOffset, int32_t aEndOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->AddToSelection(aStartOffset, aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->AddToSelection(aStartOffset, aEndOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::RemoveSelection(int32_t aSelectionNum)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->RemoveFromSelection(aSelectionNum);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->RemoveFromSelection(aSelectionNum);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::ScrollSubstringTo(int32_t aStartOffset,
                                           int32_t aEndOffset,
                                           uint32_t aScrollType)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::ScrollSubstringToPoint(int32_t aStartOffset,
                                                int32_t aEndOffset,
                                                uint32_t aCoordinateType,
@@ -528,22 +452,18 @@ xpcAccessibleHyperText::ScrollSubstringT
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoordinateType,
                                    aX, aY);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->ScrollSubstringToPoint(aStartOffset, aEndOffset,
                                             aCoordinateType, aX, aY);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetEnclosingRange(nsIAccessibleTextRange** aRange)
 {
   NS_ENSURE_ARG_POINTER(aRange);
@@ -658,113 +578,89 @@ NS_IMETHODIMP
 xpcAccessibleHyperText::SetTextContents(const nsAString& aText)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->ReplaceText(aText);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text(aText);
     mIntl.AsProxy()->ReplaceText(text);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::InsertText(const nsAString& aText, int32_t aOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->InsertText(aText, aOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     nsString text(aText);
     mIntl.AsProxy()->InsertText(text, aOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::CopyText(int32_t aStartOffset, int32_t aEndOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->CopyText(aStartOffset, aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->CopyText(aStartOffset, aEndOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::CutText(int32_t aStartOffset, int32_t aEndOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->CutText(aStartOffset, aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->CutText(aStartOffset, aEndOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::DeleteText(int32_t aStartOffset, int32_t aEndOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->DeleteText(aStartOffset, aEndOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->DeleteText(aStartOffset, aEndOffset);
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::PasteText(int32_t aOffset)
 {
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     Intl()->PasteText(aOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     mIntl.AsProxy()->PasteText(aOffset);
-#endif
   }
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleHyperText
 
 NS_IMETHODIMP
@@ -774,42 +670,34 @@ xpcAccessibleHyperText::GetLinkCount(int
   *aLinkCount = 0;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aLinkCount = Intl()->LinkCount();
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aLinkCount = mIntl.AsProxy()->LinkCount();
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkAt(int32_t aIndex, nsIAccessibleHyperLink** aLink)
 {
   NS_ENSURE_ARG_POINTER(aLink);
   *aLink = nullptr;
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     NS_IF_ADDREF(*aLink = ToXPC(Intl()->LinkAt(aIndex)));
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     NS_IF_ADDREF(*aLink = ToXPC(mIntl.AsProxy()->LinkAt(aIndex)));
-#endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkIndex(nsIAccessibleHyperLink* aLink,
                                      int32_t* aIndex)
 {
@@ -819,26 +707,22 @@ xpcAccessibleHyperText::GetLinkIndex(nsI
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIAccessible> xpcLink(do_QueryInterface(aLink));
   if (Accessible* accLink = xpcLink->ToInternalAccessible()) {
     *aIndex = Intl()->LinkIndexOf(accLink);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     xpcAccessibleHyperText* linkHyperText =
       static_cast<xpcAccessibleHyperText*>(xpcLink.get());
     ProxyAccessible* proxyLink = linkHyperText->mIntl.AsProxy();
     if (proxyLink) {
       *aIndex = mIntl.AsProxy()->LinkIndexOf(proxyLink);
     }
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkIndexAtOffset(int32_t aOffset,
                                              int32_t* aLinkIndex)
@@ -847,16 +731,12 @@ xpcAccessibleHyperText::GetLinkIndexAtOf
   *aLinkIndex = -1; // API says this magic value means 'not found'
 
   if (mIntl.IsNull())
     return NS_ERROR_FAILURE;
 
   if (mIntl.IsAccessible()) {
     *aLinkIndex = Intl()->LinkIndexAtOffset(aOffset);
   } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
     *aLinkIndex = mIntl.AsProxy()->LinkIndexAtOffset(aOffset);
-#endif
   }
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleValue.cpp
+++ b/accessible/xpcom/xpcAccessibleValue.cpp
@@ -20,22 +20,18 @@ xpcAccessibleValue::GetMaximumValue(doub
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
     return NS_ERROR_FAILURE;
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->MaxValue();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     value = Intl().AsProxy()->MaxValue();
-#endif
   }
 
   if (!IsNaN(value))
     *aValue = value;
 
   return NS_OK;
 }
 
@@ -49,22 +45,18 @@ xpcAccessibleValue::GetMinimumValue(doub
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
     return NS_ERROR_FAILURE;
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->MinValue();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     value = Intl().AsProxy()->MinValue();
-#endif
   }
 
   if (!IsNaN(value))
     *aValue = value;
 
   return NS_OK;
 }
 
@@ -78,22 +70,18 @@ xpcAccessibleValue::GetCurrentValue(doub
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
     return NS_ERROR_FAILURE;
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->CurValue();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     value = Intl().AsProxy()->CurValue();
-#endif
   }
 
   if (!IsNaN(value))
     *aValue = value;
 
   return NS_OK;
 }
 
@@ -103,22 +91,18 @@ xpcAccessibleValue::SetCurrentValue(doub
   if (Intl().IsNull())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible()) {
     Intl().AsAccessible()->SetCurValue(aValue);
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     Intl().AsProxy()->SetCurValue(aValue);
-#endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMinimumIncrement(double* aValue)
 {
@@ -129,21 +113,17 @@ xpcAccessibleValue::GetMinimumIncrement(
     return NS_ERROR_FAILURE;
 
   if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
     return NS_ERROR_FAILURE;
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->Step();
-  } else {
-#if defined(XP_WIN)
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
+  } else { 
     value = Intl().AsProxy()->Step();
-#endif
   }
 
   if (!IsNaN(value))
     *aValue = value;
 
   return NS_OK;
 }
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -148,17 +148,16 @@
 @RESPATH@/components/interfaces.xpt
 @RESPATH@/browser/components/prebuilt-interfaces.manifest
 @RESPATH@/browser/components/interfaces.xpt
 #endif
 @RESPATH@/browser/components/components.manifest
 @RESPATH@/components/alerts.xpt
 #ifdef ACCESSIBILITY
 #ifdef XP_WIN32
-@BINPATH@/Accessible.tlb
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 @RESPATH@/components/accessibility.xpt
 #endif
 @RESPATH@/components/appshell.xpt
 @RESPATH@/components/appstartup.xpt
 @RESPATH@/components/autocomplete.xpt