Bug 1695765 - Use Accessible base type in XPCOM instead of AccessibleOrProxy. r=morgan
☠☠ backed out by 705b3d8a8d8c ☠ ☠
authorEitan Isaacson <eitan@monotonous.org>
Fri, 05 Mar 2021 05:47:16 +0000
changeset 569773 fd254f9f8ae1d6590d151a803243dbc224f4b4d5
parent 569772 c69b2c1ef6f9c9eb8b7f192495d4f190525255a0
child 569774 705b3d8a8d8caca11244f7ce9914761a2cbdb499
push id38266
push userdluca@mozilla.com
push dateFri, 05 Mar 2021 21:41:18 +0000
treeherdermozilla-central@95b6c826ad97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan
bugs1695765
milestone88.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1695765 - Use Accessible base type in XPCOM instead of AccessibleOrProxy. r=morgan Differential Revision: https://phabricator.services.mozilla.com/D104927
accessible/base/AccessibleOrProxy.h
accessible/base/nsAccessiblePivot.cpp
accessible/ipc/DocAccessibleParent.cpp
accessible/xpcom/moz.build
accessible/xpcom/xpcAccessible.cpp
accessible/xpcom/xpcAccessible.h
accessible/xpcom/xpcAccessibleApplication.h
accessible/xpcom/xpcAccessibleDocument.cpp
accessible/xpcom/xpcAccessibleDocument.h
accessible/xpcom/xpcAccessibleGeneric.cpp
accessible/xpcom/xpcAccessibleGeneric.h
accessible/xpcom/xpcAccessibleHyperLink.cpp
accessible/xpcom/xpcAccessibleHyperLink.h
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleHyperText.h
accessible/xpcom/xpcAccessibleImage.h
accessible/xpcom/xpcAccessibleTable.h
accessible/xpcom/xpcAccessibleTableCell.h
accessible/xpcom/xpcAccessibleValue.cpp
accessible/xpcom/xpcAccessibleValue.h
--- a/accessible/base/AccessibleOrProxy.h
+++ b/accessible/base/AccessibleOrProxy.h
@@ -17,16 +17,24 @@ namespace mozilla {
 namespace a11y {
 
 /**
  * This class stores a LocalAccessible* or a RemoteAccessible* in a safe manner
  * with size sizeof(void*).
  */
 class AccessibleOrProxy {
  public:
+  // XXX: A temporary constructor to aid in the transition to
+  // an Accessible base class.
+  MOZ_IMPLICIT AccessibleOrProxy(Accessible* aAcc)
+      : mBits(aAcc ? (aAcc->IsRemote()
+                          ? reinterpret_cast<uintptr_t>(aAcc->AsRemote()) |
+                                IS_PROXY
+                          : reinterpret_cast<uintptr_t>(aAcc->AsLocal()))
+                   : 0) {}
   MOZ_IMPLICIT AccessibleOrProxy(LocalAccessible* aAcc)
       : mBits(reinterpret_cast<uintptr_t>(aAcc)) {}
   MOZ_IMPLICIT AccessibleOrProxy(RemoteAccessible* aProxy)
       : mBits(aProxy ? (reinterpret_cast<uintptr_t>(aProxy) | IS_PROXY) : 0) {}
   MOZ_IMPLICIT AccessibleOrProxy(decltype(nullptr)) : mBits(0) {}
   MOZ_IMPLICIT AccessibleOrProxy() : mBits(0) {}
 
   bool IsProxy() const { return mBits & IS_PROXY; }
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -522,13 +522,23 @@ uint16_t RuleCache::Match(const Accessib
     }
 
     if (!matchesRole) {
       return result;
     }
   }
 
   uint16_t matchResult = nsIAccessibleTraversalRule::FILTER_IGNORE;
-  DebugOnly<nsresult> rv = mRule->Match(ToXPC(aAccOrProxy), &matchResult);
-  MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+  // XXX: ToXPC takes an Accessible. This can go away when pivot
+  // removes AoP too.
+  if (aAccOrProxy.IsProxy()) {
+    DebugOnly<nsresult> rv =
+        mRule->Match(ToXPC(aAccOrProxy.AsProxy()), &matchResult);
+    MOZ_ASSERT(NS_SUCCEEDED(rv));
+  } else {
+    DebugOnly<nsresult> rv =
+        mRule->Match(ToXPC(aAccOrProxy.AsAccessible()), &matchResult);
+    MOZ_ASSERT(NS_SUCCEEDED(rv));
+  }
 
   return result | matchResult;
 }
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -802,17 +802,17 @@ bool DocAccessibleParent::CheckDocTree()
   return true;
 }
 
 xpcAccessibleGeneric* DocAccessibleParent::GetXPCAccessible(
     RemoteAccessible* aProxy) {
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   MOZ_ASSERT(doc);
 
-  return doc->GetXPCAccessible(aProxy);
+  return doc->GetAccessible(aProxy);
 }
 
 #if defined(XP_WIN)
 void DocAccessibleParent::MaybeInitWindowEmulation() {
   if (!nsWinUtils::IsWindowEmulationStarted()) {
     return;
   }
 
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -27,16 +27,17 @@ SOURCES += [
 
 EXPORTS += [
     "!xpcAccEvents.h",
     "xpcAccessibilityService.h",
 ]
 
 LOCAL_INCLUDES += [
     "/accessible/base",
+    "/accessible/basetypes",
     "/accessible/generic",
 ]
 
 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
     LOCAL_INCLUDES += [
         "/accessible/atk",
     ]
 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -24,159 +24,138 @@
 #endif
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessible::GetParent(nsIAccessible** aParent) {
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nullptr;
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  AccessibleOrProxy parent = IntlGeneric().Parent();
+  Accessible* parent = IntlGeneric()->Parent();
   NS_IF_ADDREF(*aParent = ToXPC(parent));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetNextSibling(nsIAccessible** aNextSibling) {
   NS_ENSURE_ARG_POINTER(aNextSibling);
   *aNextSibling = nullptr;
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (IntlGeneric().IsAccessible()) {
-    nsresult rv = NS_OK;
-    NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
-    return rv;
-  }
+  NS_IF_ADDREF(*aNextSibling = ToXPC(IntlGeneric()->NextSibling()));
 
-  RemoteAccessible* proxy = IntlGeneric().AsProxy();
-  NS_ENSURE_STATE(proxy);
-
-  NS_IF_ADDREF(*aNextSibling = ToXPC(proxy->RemoteNextSibling()));
-  return *aNextSibling ? NS_OK : NS_ERROR_FAILURE;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling) {
   NS_ENSURE_ARG_POINTER(aPreviousSibling);
   *aPreviousSibling = nullptr;
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (IntlGeneric().IsAccessible()) {
-    nsresult rv = NS_OK;
-    NS_IF_ADDREF(*aPreviousSibling =
-                     ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
-    return rv;
-  }
+  NS_IF_ADDREF(*aPreviousSibling = ToXPC(IntlGeneric()->PrevSibling()));
 
-  RemoteAccessible* proxy = IntlGeneric().AsProxy();
-  NS_ENSURE_STATE(proxy);
-
-  NS_IF_ADDREF(*aPreviousSibling = ToXPC(proxy->RemotePrevSibling()));
-  return *aPreviousSibling ? NS_OK : NS_ERROR_FAILURE;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetFirstChild(nsIAccessible** aFirstChild) {
   NS_ENSURE_ARG_POINTER(aFirstChild);
   *aFirstChild = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aFirstChild = ToXPC(IntlGeneric().FirstChild()));
+  NS_IF_ADDREF(*aFirstChild = ToXPC(IntlGeneric()->FirstChild()));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetLastChild(nsIAccessible** aLastChild) {
   NS_ENSURE_ARG_POINTER(aLastChild);
   *aLastChild = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aLastChild = ToXPC(IntlGeneric().LastChild()));
+  NS_IF_ADDREF(*aLastChild = ToXPC(IntlGeneric()->LastChild()));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetChildCount(int32_t* aChildCount) {
   NS_ENSURE_ARG_POINTER(aChildCount);
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  *aChildCount = IntlGeneric().ChildCount();
+  *aChildCount = IntlGeneric()->ChildCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetChildAt(int32_t aChildIndex, nsIAccessible** aChild) {
   NS_ENSURE_ARG_POINTER(aChild);
   *aChild = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   // If child index is negative, then return last child.
   // XXX: do we really need this?
-  if (aChildIndex < 0) aChildIndex = IntlGeneric().ChildCount() - 1;
+  if (aChildIndex < 0) aChildIndex = IntlGeneric()->ChildCount() - 1;
 
-  AccessibleOrProxy child = IntlGeneric().ChildAt(aChildIndex);
-  if (child.IsNull()) return NS_ERROR_INVALID_ARG;
+  Accessible* child = IntlGeneric()->ChildAt(aChildIndex);
+  if (!child) return NS_ERROR_INVALID_ARG;
 
   NS_ADDREF(*aChild = ToXPC(child));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetChildren(nsIArray** aChildren) {
   NS_ENSURE_ARG_POINTER(aChildren);
   *aChildren = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> children =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  uint32_t childCount = IntlGeneric().ChildCount();
+  uint32_t childCount = IntlGeneric()->ChildCount();
   for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
-    AccessibleOrProxy child = IntlGeneric().ChildAt(childIdx);
+    Accessible* child = IntlGeneric()->ChildAt(childIdx);
     children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)));
   }
 
   children.forget(aChildren);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent) {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
   *aIndexInParent = -1;
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (IntlGeneric().IsAccessible()) {
-    *aIndexInParent = Intl()->IndexInParent();
-  } else if (IntlGeneric().IsProxy()) {
-    *aIndexInParent = IntlGeneric().AsProxy()->IndexInParent();
-  }
+  *aIndexInParent = IntlGeneric()->IndexInParent();
 
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetUniqueID(int64_t* aUniqueID) {
   NS_ENSURE_ARG_POINTER(aUniqueID);
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (IntlGeneric().IsAccessible()) {
+  if (IntlGeneric()->IsLocal()) {
     *aUniqueID = reinterpret_cast<uintptr_t>(Intl()->UniqueID());
-  } else if (IntlGeneric().IsProxy()) {
-    *aUniqueID = IntlGeneric().AsProxy()->ID();
+  } else if (IntlGeneric()->IsRemote()) {
+    *aUniqueID = IntlGeneric()->AsRemote()->ID();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDOMNode(nsINode** aDOMNode) {
   NS_ENSURE_ARG_POINTER(aDOMNode);
@@ -187,17 +166,21 @@ xpcAccessible::GetDOMNode(nsINode** aDOM
   nsCOMPtr<nsINode> node = Intl()->GetNode();
   node.forget(aDOMNode);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetId(nsAString& aID) {
-  RemoteAccessible* proxy = IntlGeneric().AsProxy();
+  if (!IntlGeneric()) {
+    return NS_ERROR_FAILURE;
+  }
+
+  RemoteAccessible* proxy = IntlGeneric()->AsRemote();
   if (!proxy) {
     return NS_ERROR_FAILURE;
   }
 
   nsString id;
   proxy->DOMNodeID(id);
   aID.Assign(id);
 
@@ -226,109 +209,109 @@ xpcAccessible::GetRootDocument(nsIAccess
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetRole(uint32_t* aRole) {
   NS_ENSURE_ARG_POINTER(aRole);
   *aRole = nsIAccessibleRole::ROLE_NOTHING;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  *aRole = IntlGeneric().Role();
+  *aRole = IntlGeneric()->Role();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetState(uint32_t* aState, uint32_t* aExtraState) {
   NS_ENSURE_ARG_POINTER(aState);
 
-  if (IntlGeneric().IsNull()) {
+  if (!IntlGeneric()) {
     nsAccUtils::To32States(states::DEFUNCT, aState, aExtraState);
   } else if (Intl()) {
     nsAccUtils::To32States(Intl()->State(), aState, aExtraState);
   } else {
-    nsAccUtils::To32States(IntlGeneric().AsProxy()->State(), aState,
+    nsAccUtils::To32States(IntlGeneric()->AsRemote()->State(), aState,
                            aExtraState);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetName(nsAString& aName) {
   aName.Truncate();
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsAutoString name;
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
     proxy->Name(name);
   } else {
     Intl()->Name(name);
   }
 
   aName.Assign(name);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDescription(nsAString& aDescription) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsAutoString desc;
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
     proxy->Description(desc);
   } else {
     Intl()->Description(desc);
   }
 
   aDescription.Assign(desc);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetLanguage(nsAString& aLanguage) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsAutoString lang;
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
     proxy->Language(lang);
   } else {
     Intl()->Language(lang);
   }
 
   aLanguage.Assign(lang);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetValue(nsAString& aValue) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsAutoString value;
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
     proxy->Value(value);
   } else {
     Intl()->Value(value);
   }
 
   aValue.Assign(value);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetHelp(nsAString& aHelp) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsAutoString help;
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->Help(help);
 #endif
   } else {
     Intl()->Help(help);
   }
@@ -337,64 +320,64 @@ xpcAccessible::GetHelp(nsAString& aHelp)
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetAccessKey(nsAString& aAccessKey) {
   aAccessKey.Truncate();
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->AccessKey().ToString(aAccessKey);
 #endif
   } else {
     Intl()->AccessKey().ToString(aAccessKey);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetKeyboardShortcut(nsAString& aKeyBinding) {
   aKeyBinding.Truncate();
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->KeyboardShortcut().ToString(aKeyBinding);
 #endif
   } else {
     Intl()->KeyboardShortcut().ToString(aKeyBinding);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetAttributes(nsIPersistentProperties** aAttributes) {
   NS_ENSURE_ARG_POINTER(aAttributes);
   *aAttributes = nullptr;
 
-  if (IntlGeneric().IsNull()) {
+  if (!IntlGeneric()) {
     return NS_ERROR_FAILURE;
   }
 
   if (LocalAccessible* acc = Intl()) {
     nsCOMPtr<nsIPersistentProperties> attributes = acc->Attributes();
     attributes.swap(*aAttributes);
     return NS_OK;
   }
 
-  RemoteAccessible* proxy = IntlGeneric().AsProxy();
+  RemoteAccessible* proxy = IntlGeneric()->AsRemote();
   AutoTArray<Attribute, 10> attrs;
   proxy->Attributes(&attrs);
 
   RefPtr<nsPersistentProperties> props = new nsPersistentProperties();
   uint32_t attrCount = attrs.Length();
   nsAutoString unused;
   for (uint32_t i = 0; i < attrCount; i++) {
     props->SetStringProperty(attrs[i].Name(), attrs[i].Value(), unused);
@@ -429,23 +412,23 @@ xpcAccessible::GetBounds(int32_t* aX, in
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
   *aHeight = 0;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsIntRect rect;
-  if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
+  if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
     rect = acc->Bounds();
   } else {
-    rect = IntlGeneric().AsProxy()->Bounds();
+    rect = IntlGeneric()->AsRemote()->Bounds();
   }
 
   rect.GetRect(aX, aY, aWidth, aHeight);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetBoundsInCSSPixels(int32_t* aX, int32_t* aY, int32_t* aWidth,
@@ -454,25 +437,25 @@ xpcAccessible::GetBoundsInCSSPixels(int3
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
   *aHeight = 0;
 
-  if (IntlGeneric().IsNull()) {
+  if (!IntlGeneric()) {
     return NS_ERROR_FAILURE;
   }
 
   nsIntRect rect;
-  if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
+  if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
     rect = acc->BoundsInCSSPixels();
   } else {
-    rect = IntlGeneric().AsProxy()->BoundsInCSSPixels();
+    rect = IntlGeneric()->AsRemote()->BoundsInCSSPixels();
   }
 
   rect.GetRect(aX, aY, aWidth, aHeight);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GroupPosition(int32_t* aGroupLevel,
@@ -483,23 +466,23 @@ xpcAccessible::GroupPosition(int32_t* aG
 
   NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
   *aSimilarItemsInGroup = 0;
 
   NS_ENSURE_ARG_POINTER(aPositionInGroup);
   *aPositionInGroup = 0;
 
   GroupPos groupPos;
-  if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
+  if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
     groupPos = acc->GroupPosition();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    groupPos = IntlGeneric().AsProxy()->GroupPosition();
+    groupPos = IntlGeneric()->AsRemote()->GroupPosition();
 #endif
   }
 
   *aGroupLevel = groupPos.level;
   *aSimilarItemsInGroup = groupPos.setSize;
   *aPositionInGroup = groupPos.posInSet;
 
   return NS_OK;
@@ -508,38 +491,38 @@ xpcAccessible::GroupPosition(int32_t* aG
 NS_IMETHODIMP
 xpcAccessible::GetRelationByType(uint32_t aType,
                                  nsIAccessibleRelation** aRelation) {
   NS_ENSURE_ARG_POINTER(aRelation);
   *aRelation = nullptr;
 
   NS_ENSURE_ARG(aType <= static_cast<uint32_t>(RelationType::LAST));
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (IntlGeneric().IsAccessible()) {
+  if (IntlGeneric()->IsLocal()) {
     Relation rel = Intl()->RelationByType(static_cast<RelationType>(aType));
     NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
     return NS_OK;
   }
 
-  RemoteAccessible* proxy = IntlGeneric().AsProxy();
+  RemoteAccessible* proxy = IntlGeneric()->AsRemote();
   nsTArray<RemoteAccessible*> targets =
       proxy->RelationByType(static_cast<RelationType>(aType));
   NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &targets));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetRelations(nsIArray** aRelations) {
   NS_ENSURE_ARG_POINTER(aRelations);
   *aRelations = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
 
   static const uint32_t relationTypes[] = {
       nsIAccessibleRelation::RELATION_LABELLED_BY,
       nsIAccessibleRelation::RELATION_LABEL_FOR,
       nsIAccessibleRelation::RELATION_DESCRIBED_BY,
@@ -577,19 +560,19 @@ xpcAccessible::GetRelations(nsIArray** a
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetFocusedChild(nsIAccessible** aChild) {
   NS_ENSURE_ARG_POINTER(aChild);
   *aChild = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     NS_IF_ADDREF(*aChild = ToXPC(proxy->FocusedChild()));
 #endif
   } else {
     NS_IF_ADDREF(*aChild = ToXPC(Intl()->FocusedChild()));
   }
@@ -598,125 +581,125 @@ xpcAccessible::GetFocusedChild(nsIAccess
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetChildAtPoint(int32_t aX, int32_t aY,
                                nsIAccessible** aAccessible) {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric().ChildAtPoint(
+  NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric()->ChildAtPoint(
                    aX, aY, Accessible::EWhichChildAtPoint::DirectChild)));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
                                       nsIAccessible** aAccessible) {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric().ChildAtPoint(
+  NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric()->ChildAtPoint(
                    aX, aY, Accessible::EWhichChildAtPoint::DeepestChild)));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDeepestChildAtPointInProcess(int32_t aX, int32_t aY,
                                                nsIAccessible** aAccessible) {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
-  AccessibleOrProxy generic = IntlGeneric();
-  if (generic.IsNull() || generic.IsProxy()) {
+  Accessible* generic = IntlGeneric();
+  if (!generic || generic->IsRemote()) {
     return NS_ERROR_FAILURE;
   }
 
   NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->LocalChildAtPoint(
                    aX, aY, Accessible::EWhichChildAtPoint::DeepestChild)));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::SetSelected(bool aSelect) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->SetSelected(aSelect);
 #endif
   } else {
     Intl()->SetSelected(aSelect);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::TakeSelection() {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->TakeSelection();
 #endif
   } else {
     Intl()->TakeSelection();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::TakeFocus() {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
     proxy->TakeFocus();
   } else {
     Intl()->TakeFocus();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetActionCount(uint8_t* aActionCount) {
   NS_ENSURE_ARG_POINTER(aActionCount);
   *aActionCount = 0;
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     *aActionCount = proxy->ActionCount();
 #endif
   } else {
     *aActionCount = Intl()->ActionCount();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetActionName(uint8_t aIndex, nsAString& aName) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsString name;
     proxy->ActionNameAt(aIndex, name);
     aName.Assign(name);
 #endif
   } else {
@@ -725,19 +708,19 @@ xpcAccessible::GetActionName(uint8_t aIn
     Intl()->ActionNameAt(aIndex, aName);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsString description;
     proxy->ActionDescriptionAt(aIndex, description);
     aDescription.Assign(description);
 #endif
   } else {
@@ -746,67 +729,67 @@ xpcAccessible::GetActionDescription(uint
     Intl()->ActionDescriptionAt(aIndex, aDescription);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::DoAction(uint8_t aIndex) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     return proxy->DoAction(aIndex) ? NS_OK : NS_ERROR_INVALID_ARG;
 #endif
   } else {
     return Intl()->DoAction(aIndex) ? NS_OK : NS_ERROR_INVALID_ARG;
   }
 }
 
 NS_IMETHODIMP
 xpcAccessible::ScrollTo(uint32_t aHow) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->ScrollTo(aHow);
 #endif
   } else {
     RefPtr<LocalAccessible> intl = Intl();
     intl->ScrollTo(aHow);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY) {
-  if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
+  if (!IntlGeneric()) return NS_ERROR_FAILURE;
 
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     proxy->ScrollToPoint(aCoordinateType, aX, aY);
 #endif
   } else {
     Intl()->ScrollToPoint(aCoordinateType, aX, aY);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::Announce(const nsAString& aAnnouncement, uint16_t aPriority) {
-  if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
+  if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsString announcement(aAnnouncement);
     proxy->Announce(announcement, aPriority);
 #endif
   } else {
     Intl()->Announce(aAnnouncement, aPriority);
--- a/accessible/xpcom/xpcAccessible.h
+++ b/accessible/xpcom/xpcAccessible.h
@@ -9,18 +9,18 @@
 
 #include "nsIAccessible.h"
 
 class nsIAccessible;
 
 namespace mozilla {
 namespace a11y {
 
+class Accessible;
 class LocalAccessible;
-class AccessibleOrProxy;
 
 /**
  * XPCOM nsIAccessible interface implementation, used by xpcAccessibleGeneric
  * class.
  */
 class xpcAccessible : public nsIAccessible {
  public:
   // nsIAccessible
@@ -92,17 +92,17 @@ class xpcAccessible : public nsIAccessib
   NS_IMETHOD Announce(const nsAString& aAnnouncement, uint16_t aPriority) final;
 
  protected:
   xpcAccessible() {}
   virtual ~xpcAccessible() {}
 
  private:
   LocalAccessible* Intl();
-  AccessibleOrProxy IntlGeneric();
+  Accessible* IntlGeneric();
 
   xpcAccessible(const xpcAccessible&) = delete;
   xpcAccessible& operator=(const xpcAccessible&) = delete;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
--- a/accessible/xpcom/xpcAccessibleApplication.h
+++ b/accessible/xpcom/xpcAccessibleApplication.h
@@ -15,34 +15,32 @@ namespace mozilla {
 namespace a11y {
 
 /**
  * XPCOM wrapper around ApplicationAccessible class.
  */
 class xpcAccessibleApplication : public xpcAccessibleGeneric,
                                  public nsIAccessibleApplication {
  public:
-  explicit xpcAccessibleApplication(LocalAccessible* aIntl)
+  explicit xpcAccessibleApplication(Accessible* aIntl)
       : xpcAccessibleGeneric(aIntl) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleApplication
   NS_IMETHOD GetAppName(nsAString& aName) final;
   NS_IMETHOD GetAppVersion(nsAString& aVersion) final;
   NS_IMETHOD GetPlatformName(nsAString& aName) final;
   NS_IMETHOD GetPlatformVersion(nsAString& aVersion) final;
 
  protected:
   virtual ~xpcAccessibleApplication() { Shutdown(); }
 
  private:
-  ApplicationAccessible* Intl() {
-    return mIntl.AsAccessible()->AsApplication();
-  }
+  ApplicationAccessible* Intl() { return mIntl->AsLocal()->AsApplication(); }
 
   xpcAccessibleApplication(const xpcAccessibleApplication&) = delete;
   xpcAccessibleApplication& operator=(const xpcAccessibleApplication&) = delete;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -21,23 +21,22 @@ using namespace mozilla::a11y;
 NS_IMPL_QUERY_INTERFACE_INHERITED(xpcAccessibleDocument, xpcAccessibleHyperText,
                                   nsIAccessibleDocument)
 NS_IMPL_ADDREF_INHERITED(xpcAccessibleDocument, xpcAccessibleHyperText)
 NS_IMETHODIMP_(MozExternalRefCountType) xpcAccessibleDocument::Release(void) {
   nsrefcnt r = xpcAccessibleHyperText::Release();
   NS_LOG_RELEASE(this, r, "xpcAccessibleDocument");
 
   // The only reference to the xpcAccessibleDocument is in DocManager's cache.
-  if (r == 1 && !mIntl.IsNull() && mCache.Count() == 0) {
-    if (mIntl.IsAccessible()) {
-      GetAccService()->RemoveFromXPCDocumentCache(
-          mIntl.AsAccessible()->AsDoc());
+  if (r == 1 && !!mIntl && mCache.Count() == 0) {
+    if (mIntl->IsLocal()) {
+      GetAccService()->RemoveFromXPCDocumentCache(mIntl->AsLocal()->AsDoc());
     } else {
       GetAccService()->RemoveFromRemoteXPCDocumentCache(
-          mIntl.AsProxy()->AsDoc());
+          mIntl->AsRemote()->AsDoc());
     }
   }
   return r;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleDocument
 
@@ -142,19 +141,26 @@ xpcAccessibleDocument::GetVirtualCursor(
   NS_ADDREF(*aVirtualCursor = Intl()->VirtualCursor());
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // xpcAccessibleDocument
 
 xpcAccessibleGeneric* xpcAccessibleDocument::GetAccessible(
-    LocalAccessible* aAccessible) {
-  MOZ_ASSERT(!mRemote);
-  if (ToXPCDocument(aAccessible->Document()) != this) {
+    Accessible* aAccessible) {
+  if (aAccessible->IsLocal() &&
+      ToXPCDocument(aAccessible->AsLocal()->Document()) != this) {
+    NS_ERROR(
+        "This XPCOM document is not related with given internal accessible!");
+    return nullptr;
+  }
+
+  if (aAccessible->IsRemote() &&
+      ToXPCDocument(aAccessible->AsRemote()->Document()) != this) {
     NS_ERROR(
         "This XPCOM document is not related with given internal accessible!");
     return nullptr;
   }
 
   if (aAccessible->IsDoc()) return this;
 
   return mCache.LookupOrInsertWith(aAccessible, [&]() -> xpcAccessibleGeneric* {
@@ -170,57 +176,15 @@ xpcAccessibleGeneric* xpcAccessibleDocum
     if (aAccessible->IsHyperText()) {
       return new xpcAccessibleHyperText(aAccessible);
     }
 
     return new xpcAccessibleGeneric(aAccessible);
   });
 }
 
-xpcAccessibleGeneric* xpcAccessibleDocument::GetXPCAccessible(
-    RemoteAccessible* aProxy) {
-  MOZ_ASSERT(mRemote);
-  MOZ_ASSERT(aProxy->Document() == mIntl.AsProxy());
-  if (aProxy->IsDoc()) {
-    return this;
-  }
-
-  return mCache.LookupOrInsertWith(aProxy, [&]() -> xpcAccessibleGeneric* {
-    // XXX support exposing optional interfaces.
-  // XXX support exposing optional interfaces.
-    uint8_t interfaces = 0;
-    if (aProxy->HasNumericValue()) {
-      interfaces |= eValue;
-    }
-
-    if (aProxy->IsLink()) {
-      interfaces |= eHyperLink;
-    }
-
-    if (aProxy->IsHyperText()) {
-      interfaces |= eText;
-      return new xpcAccessibleHyperText(aProxy, interfaces);
-    }
-
-    return new xpcAccessibleGeneric(aProxy, interfaces);
-  });
-}
-
 void xpcAccessibleDocument::Shutdown() {
   for (auto iter = mCache.Iter(); !iter.Done(); iter.Next()) {
     iter.Data()->Shutdown();
     iter.Remove();
   }
   xpcAccessibleGeneric::Shutdown();
 }
-
-xpcAccessibleGeneric* a11y::ToXPC(AccessibleOrProxy aAcc) {
-  if (aAcc.IsNull()) {
-    return nullptr;
-  }
-
-  if (aAcc.IsAccessible()) {
-    return ToXPC(aAcc.AsAccessible());
-  }
-
-  xpcAccessibleDocument* doc = ToXPCDocument(aAcc.AsProxy()->Document());
-  return doc->GetXPCAccessible(aAcc.AsProxy());
-}
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -46,86 +46,75 @@ class xpcAccessibleDocument : public xpc
   NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) final;
   NS_IMETHOD GetChildDocumentAt(uint32_t aIndex,
                                 nsIAccessibleDocument** aDocument) final;
   NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) final;
 
   /**
    * Return XPCOM wrapper for the internal accessible.
    */
-  xpcAccessibleGeneric* GetAccessible(LocalAccessible* aAccessible);
-  xpcAccessibleGeneric* GetXPCAccessible(RemoteAccessible* aProxy);
+  xpcAccessibleGeneric* GetAccessible(Accessible* aAccessible);
 
   virtual void Shutdown() override;
 
  protected:
   virtual ~xpcAccessibleDocument() {}
 
  private:
   DocAccessible* Intl() {
-    if (LocalAccessible* acc = mIntl.AsAccessible()) {
+    if (LocalAccessible* acc = mIntl->AsLocal()) {
       return acc->AsDoc();
     }
 
     return nullptr;
   }
 
-  void NotifyOfShutdown(LocalAccessible* aAccessible) {
-    MOZ_ASSERT(!mRemote);
+  void NotifyOfShutdown(Accessible* aAccessible) {
     xpcAccessibleGeneric* xpcAcc = mCache.Get(aAccessible);
     if (xpcAcc) {
       xpcAcc->Shutdown();
     }
 
     mCache.Remove(aAccessible);
     if (mCache.Count() == 0 && mRefCnt == 1) {
-      GetAccService()->RemoveFromXPCDocumentCache(
-          mIntl.AsAccessible()->AsDoc());
-    }
-  }
-
-  void NotifyOfShutdown(RemoteAccessible* aProxy) {
-    MOZ_ASSERT(mRemote);
-    xpcAccessibleGeneric* xpcAcc = mCache.Get(aProxy);
-    if (xpcAcc) {
-      xpcAcc->Shutdown();
-    }
-
-    mCache.Remove(aProxy);
-    if (mCache.Count() == 0 && mRefCnt == 1) {
-      GetAccService()->RemoveFromRemoteXPCDocumentCache(
-          mIntl.AsProxy()->AsDoc());
+      if (mIntl->IsLocal()) {
+        GetAccService()->RemoveFromXPCDocumentCache(mIntl->AsLocal()->AsDoc());
+      } else {
+        GetAccService()->RemoveFromRemoteXPCDocumentCache(
+            mIntl->AsRemote()->AsDoc());
+      }
     }
   }
 
   friend class DocManager;
   friend class DocAccessible;
   friend class RemoteAccessible;
   friend class RemoteAccessibleBase<RemoteAccessible>;
   friend class xpcAccessibleGeneric;
 
   xpcAccessibleDocument(const xpcAccessibleDocument&) = delete;
   xpcAccessibleDocument& operator=(const xpcAccessibleDocument&) = delete;
 
   nsDataHashtable<nsPtrHashKey<const void>, xpcAccessibleGeneric*> mCache;
   bool mRemote;
 };
 
-inline xpcAccessibleGeneric* ToXPC(LocalAccessible* aAccessible) {
+inline xpcAccessibleGeneric* ToXPC(Accessible* aAccessible) {
   if (!aAccessible) return nullptr;
 
   if (aAccessible->IsApplication()) return XPCApplicationAcc();
 
   xpcAccessibleDocument* xpcDoc =
-      GetAccService()->GetXPCDocument(aAccessible->Document());
+      aAccessible->IsLocal()
+          ? GetAccService()->GetXPCDocument(aAccessible->AsLocal()->Document())
+          : GetAccService()->GetXPCDocument(
+                aAccessible->AsRemote()->Document());
   return xpcDoc ? xpcDoc->GetAccessible(aAccessible) : nullptr;
 }
 
-xpcAccessibleGeneric* ToXPC(AccessibleOrProxy aAcc);
-
 inline xpcAccessibleHyperText* ToXPCText(HyperTextAccessible* aAccessible) {
   if (!aAccessible) return nullptr;
 
   xpcAccessibleDocument* xpcDoc =
       GetAccService()->GetXPCDocument(aAccessible->Document());
   return static_cast<xpcAccessibleHyperText*>(
       xpcDoc->GetAccessible(aAccessible));
 }
--- a/accessible/xpcom/xpcAccessibleGeneric.cpp
+++ b/accessible/xpcom/xpcAccessibleGeneric.cpp
@@ -23,39 +23,39 @@ NS_INTERFACE_MAP_BEGIN(xpcAccessibleGene
                                      mSupportedIfaces & eHyperLink)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAccessible)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(xpcAccessibleGeneric)
 NS_IMPL_RELEASE(xpcAccessibleGeneric)
 
 xpcAccessibleGeneric::~xpcAccessibleGeneric() {
-  if (mIntl.IsNull()) {
+  if (!mIntl) {
     return;
   }
 
   xpcAccessibleDocument* xpcDoc = nullptr;
-  if (mIntl.IsAccessible()) {
-    LocalAccessible* acc = mIntl.AsAccessible();
+  if (mIntl->IsLocal()) {
+    LocalAccessible* acc = mIntl->AsLocal();
     if (!acc->IsDoc() && !acc->IsApplication()) {
       xpcDoc = GetAccService()->GetXPCDocument(acc->Document());
       xpcDoc->NotifyOfShutdown(acc);
     }
   } else {
-    RemoteAccessible* proxy = mIntl.AsProxy();
+    RemoteAccessible* proxy = mIntl->AsRemote();
     if (!proxy->IsDoc()) {
       xpcDoc = GetAccService()->GetXPCDocument(proxy->Document());
       xpcDoc->NotifyOfShutdown(proxy);
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessible
 
 LocalAccessible* xpcAccessibleGeneric::ToInternalAccessible() const {
-  return mIntl.AsAccessible();
+  return mIntl->AsLocal();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // xpcAccessibleGeneric
 
 void xpcAccessibleGeneric::Shutdown() { mIntl = nullptr; }
--- a/accessible/xpcom/xpcAccessibleGeneric.h
+++ b/accessible/xpcom/xpcAccessibleGeneric.h
@@ -8,30 +8,30 @@
 #define mozilla_a11y_xpcAccessibleGeneric_h_
 
 #include "xpcAccessible.h"
 #include "xpcAccessibleHyperLink.h"
 #include "xpcAccessibleSelectable.h"
 #include "xpcAccessibleValue.h"
 
 #include "LocalAccessible.h"
-#include "AccessibleOrProxy.h"
+#include "mozilla/a11y/Accessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * XPCOM wrapper around Accessible class.
  */
 class xpcAccessibleGeneric : public xpcAccessible,
                              public xpcAccessibleHyperLink,
                              public xpcAccessibleSelectable,
                              public xpcAccessibleValue {
  public:
-  explicit xpcAccessibleGeneric(LocalAccessible* aInternal)
+  explicit xpcAccessibleGeneric(Accessible* aInternal)
       : mIntl(aInternal), mSupportedIfaces(0) {
     if (aInternal->IsSelect()) mSupportedIfaces |= eSelectable;
     if (aInternal->HasNumericValue()) mSupportedIfaces |= eValue;
     if (aInternal->IsLink()) mSupportedIfaces |= eHyperLink;
   }
 
   xpcAccessibleGeneric(RemoteAccessible* aProxy, uint8_t aInterfaces)
       : mIntl(aProxy), mSupportedIfaces(aInterfaces) {}
@@ -42,17 +42,17 @@ class xpcAccessibleGeneric : public xpcA
   LocalAccessible* ToInternalAccessible() const final;
 
   // xpcAccessibleGeneric
   virtual void Shutdown();
 
  protected:
   virtual ~xpcAccessibleGeneric();
 
-  AccessibleOrProxy mIntl;
+  Accessible* mIntl;
 
   enum {
     eSelectable = 1 << 0,
     eValue = 1 << 1,
     eHyperLink = 1 << 2,
     eText = 1 << 3
   };
   uint8_t mSupportedIfaces;
@@ -64,31 +64,37 @@ class xpcAccessibleGeneric : public xpcA
   friend class xpcAccessibleSelectable;
   friend class xpcAccessibleValue;
 
   xpcAccessibleGeneric(const xpcAccessibleGeneric&) = delete;
   xpcAccessibleGeneric& operator=(const xpcAccessibleGeneric&) = delete;
 };
 
 inline LocalAccessible* xpcAccessible::Intl() {
-  return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
+  if (!static_cast<xpcAccessibleGeneric*>(this)->mIntl) {
+    return nullptr;
+  }
+  return static_cast<xpcAccessibleGeneric*>(this)->mIntl->AsLocal();
 }
 
-inline AccessibleOrProxy xpcAccessible::IntlGeneric() {
+inline Accessible* xpcAccessible::IntlGeneric() {
   return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
 }
 
-inline AccessibleOrProxy xpcAccessibleHyperLink::Intl() {
+inline Accessible* xpcAccessibleHyperLink::Intl() {
   return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
 }
 
 inline LocalAccessible* xpcAccessibleSelectable::Intl() {
-  return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
+  if (!static_cast<xpcAccessibleGeneric*>(this)->mIntl) {
+    return nullptr;
+  }
+  return static_cast<xpcAccessibleGeneric*>(this)->mIntl->AsLocal();
 }
 
-inline AccessibleOrProxy xpcAccessibleValue::Intl() {
+inline Accessible* xpcAccessibleValue::Intl() {
   return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
 }
 
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif
--- a/accessible/xpcom/xpcAccessibleHyperLink.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp
@@ -12,104 +12,104 @@
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetStartIndex(int32_t* aStartIndex) {
   NS_ENSURE_ARG_POINTER(aStartIndex);
   *aStartIndex = 0;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible()) {
-    *aStartIndex = Intl().AsAccessible()->StartOffset();
+  if (Intl()->IsLocal()) {
+    *aStartIndex = Intl()->AsLocal()->StartOffset();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     bool isIndexValid = false;
-    uint32_t startOffset = Intl().AsProxy()->StartOffset(&isIndexValid);
+    uint32_t startOffset = Intl()->AsRemote()->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()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible()) {
-    *aEndIndex = Intl().AsAccessible()->EndOffset();
+  if (Intl()->IsLocal()) {
+    *aEndIndex = Intl()->AsLocal()->EndOffset();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     bool isIndexValid = false;
-    uint32_t endOffset = Intl().AsProxy()->EndOffset(&isIndexValid);
+    uint32_t endOffset = Intl()->AsRemote()->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()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible()) {
-    *aAnchorCount = Intl().AsAccessible()->AnchorCount();
+  if (Intl()->IsLocal()) {
+    *aAnchorCount = Intl()->AsLocal()->AnchorCount();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     bool isCountValid = false;
-    uint32_t anchorCount = Intl().AsProxy()->AnchorCount(&isCountValid);
+    uint32_t anchorCount = Intl()->AsRemote()->AnchorCount(&isCountValid);
     if (!isCountValid) return NS_ERROR_FAILURE;
 
     *aAnchorCount = anchorCount;
 #endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI) {
   NS_ENSURE_ARG_POINTER(aURI);
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aIndex < 0) return NS_ERROR_INVALID_ARG;
 
-  if (Intl().IsAccessible()) {
-    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
+  if (Intl()->IsLocal()) {
+    if (aIndex >= static_cast<int32_t>(Intl()->AsLocal()->AnchorCount())) {
       return NS_ERROR_INVALID_ARG;
     }
 
-    RefPtr<nsIURI>(Intl().AsAccessible()->AnchorURIAt(aIndex)).forget(aURI);
+    RefPtr<nsIURI>(Intl()->AsLocal()->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);
+    Intl()->AsRemote()->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
@@ -118,48 +118,48 @@ xpcAccessibleHyperLink::GetURI(int32_t a
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible) {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aIndex < 0) return NS_ERROR_INVALID_ARG;
 
-  if (Intl().IsAccessible()) {
-    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
+  if (Intl()->IsLocal()) {
+    if (aIndex >= static_cast<int32_t>(Intl()->AsLocal()->AnchorCount())) {
       return NS_ERROR_INVALID_ARG;
     }
 
-    NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsAccessible()->AnchorAt(aIndex)));
+    NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->AsLocal()->AnchorAt(aIndex)));
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsProxy()->AnchorAt(aIndex)));
+    NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->AsRemote()->AnchorAt(aIndex)));
 #endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperLink::GetValid(bool* aValid) {
   NS_ENSURE_ARG_POINTER(aValid);
   *aValid = false;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible()) {
-    *aValid = Intl().AsAccessible()->IsLinkValid();
+  if (Intl()->IsLocal()) {
+    *aValid = Intl()->AsLocal()->IsLinkValid();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aValid = Intl().AsProxy()->IsLinkValid();
+    *aValid = Intl()->AsRemote()->IsLinkValid();
 #endif
   }
 
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleHyperLink.h
+++ b/accessible/xpcom/xpcAccessibleHyperLink.h
@@ -4,17 +4,17 @@
  * 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_xpcAccessibleHyperLink_h_
 #define mozilla_a11y_xpcAccessibleHyperLink_h_
 
 #include "nsIAccessibleHyperLink.h"
 
-#include "AccessibleOrProxy.h"
+#include "mozilla/a11y/Accessible.h"
 
 class nsIAccessible;
 
 namespace mozilla {
 namespace a11y {
 
 class LocalAccessible;
 
@@ -34,15 +34,15 @@ class xpcAccessibleHyperLink : public ns
  protected:
   xpcAccessibleHyperLink() {}
   virtual ~xpcAccessibleHyperLink() {}
 
  private:
   xpcAccessibleHyperLink(const xpcAccessibleHyperLink&) = delete;
   xpcAccessibleHyperLink& operator=(const xpcAccessibleHyperLink&) = delete;
 
-  AccessibleOrProxy Intl();
+  Accessible* Intl();
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -37,162 +37,162 @@ NS_IMPL_RELEASE_INHERITED(xpcAccessibleH
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleText
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCharacterCount(int32_t* aCharacterCount) {
   NS_ENSURE_ARG_POINTER(aCharacterCount);
   *aCharacterCount = 0;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aCharacterCount = Intl()->CharacterCount();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aCharacterCount = mIntl.AsProxy()->CharacterCount();
+    *aCharacterCount = mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->TextSubstring(aStartOffset, aEndOffset, aText);
   } else {
     nsString text;
-    mIntl.AsProxy()->TextSubstring(aStartOffset, aEndOffset, text);
+    mIntl->AsRemote()->TextSubstring(aStartOffset, aEndOffset, text);
     aText = text;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextBeforeOffset(
     int32_t aOffset, AccessibleTextBoundary aBoundaryType,
     int32_t* aStartOffset, int32_t* aEndOffset, nsAString& aText) {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
   aText.Truncate();
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->TextBeforeOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
                              aText);
   } else {
     nsString text;
-    mIntl.AsProxy()->GetTextBeforeOffset(aOffset, aBoundaryType, text,
-                                         aStartOffset, aEndOffset);
+    mIntl->AsRemote()->GetTextBeforeOffset(aOffset, aBoundaryType, text,
+                                           aStartOffset, aEndOffset);
     aText = text;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAtOffset(int32_t aOffset,
                                         AccessibleTextBoundary aBoundaryType,
                                         int32_t* aStartOffset,
                                         int32_t* aEndOffset, nsAString& aText) {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
   aText.Truncate();
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->TextAtOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
                          aText);
   } else {
     nsString text;
-    mIntl.AsProxy()->GetTextAtOffset(aOffset, aBoundaryType, text, aStartOffset,
-                                     aEndOffset);
+    mIntl->AsRemote()->GetTextAtOffset(aOffset, aBoundaryType, text,
+                                       aStartOffset, aEndOffset);
     aText = text;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAfterOffset(int32_t aOffset,
                                            AccessibleTextBoundary aBoundaryType,
                                            int32_t* aStartOffset,
                                            int32_t* aEndOffset,
                                            nsAString& aText) {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
   aText.Truncate();
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->TextAfterOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
                             aText);
   } else {
     nsString text;
-    mIntl.AsProxy()->GetTextAfterOffset(aOffset, aBoundaryType, text,
-                                        aStartOffset, aEndOffset);
+    mIntl->AsRemote()->GetTextAfterOffset(aOffset, aBoundaryType, text,
+                                          aStartOffset, aEndOffset);
     aText = text;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCharacterAtOffset(int32_t aOffset,
                                              char16_t* aCharacter) {
   NS_ENSURE_ARG_POINTER(aCharacter);
   *aCharacter = L'\0';
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aCharacter = Intl()->CharAt(aOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aCharacter = mIntl.AsProxy()->CharAt(aOffset);
+    *aCharacter = mIntl->AsRemote()->CharAt(aOffset);
 #endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetTextAttributes(
     bool aIncludeDefAttrs, int32_t aOffset, int32_t* aStartOffset,
     int32_t* aEndOffset, nsIPersistentProperties** aAttributes) {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   NS_ENSURE_ARG_POINTER(aAttributes);
   *aStartOffset = *aEndOffset = 0;
   *aAttributes = nullptr;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIPersistentProperties> props;
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     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);
+    mIntl->AsRemote()->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);
@@ -201,27 +201,27 @@ xpcAccessibleHyperText::GetTextAttribute
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetDefaultTextAttributes(
     nsIPersistentProperties** aAttributes) {
   NS_ENSURE_ARG_POINTER(aAttributes);
   *aAttributes = nullptr;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIPersistentProperties> props;
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     props = Intl()->DefaultTextAttributes();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     AutoTArray<Attribute, 10> attrs;
-    mIntl.AsProxy()->DefaultTextAttributes(&attrs);
+    mIntl->AsRemote()->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);
@@ -235,26 +235,26 @@ xpcAccessibleHyperText::GetCharacterExte
                                             int32_t* aHeight,
                                             uint32_t aCoordType) {
   NS_ENSURE_ARG_POINTER(aX);
   NS_ENSURE_ARG_POINTER(aY);
   NS_ENSURE_ARG_POINTER(aWidth);
   NS_ENSURE_ARG_POINTER(aHeight);
   *aX = *aY = *aWidth = *aHeight;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   nsIntRect rect;
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     rect = Intl()->CharBounds(aOffset, aCoordType);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    rect = mIntl.AsProxy()->CharBounds(aOffset, aCoordType);
+    rect = mIntl->AsRemote()->CharBounds(aOffset, aCoordType);
 #endif
   }
   rect.GetRect(aX, aY, aWidth, aHeight);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetRangeExtents(int32_t aStartOffset,
@@ -262,200 +262,200 @@ xpcAccessibleHyperText::GetRangeExtents(
                                         int32_t* aY, int32_t* aWidth,
                                         int32_t* aHeight, uint32_t aCoordType) {
   NS_ENSURE_ARG_POINTER(aX);
   NS_ENSURE_ARG_POINTER(aY);
   NS_ENSURE_ARG_POINTER(aWidth);
   NS_ENSURE_ARG_POINTER(aHeight);
   *aX = *aY = *aWidth = *aHeight = 0;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   nsIntRect rect;
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     rect = Intl()->TextBounds(aStartOffset, aEndOffset, aCoordType);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    rect = mIntl.AsProxy()->TextBounds(aStartOffset, aEndOffset, aCoordType);
+    rect = mIntl->AsRemote()->TextBounds(aStartOffset, aEndOffset, aCoordType);
 #endif
   }
   rect.GetRect(aX, aY, aWidth, aHeight);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetOffsetAtPoint(int32_t aX, int32_t aY,
                                          uint32_t aCoordType,
                                          int32_t* aOffset) {
   NS_ENSURE_ARG_POINTER(aOffset);
   *aOffset = -1;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aOffset = Intl()->OffsetAtPoint(aX, aY, aCoordType);
   } else {
-    *aOffset = mIntl.AsProxy()->OffsetAtPoint(aX, aY, aCoordType);
+    *aOffset = mIntl->AsRemote()->OffsetAtPoint(aX, aY, aCoordType);
   }
   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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aCaretOffset = Intl()->CaretOffset();
   } else {
-    *aCaretOffset = mIntl.AsProxy()->CaretOffset();
+    *aCaretOffset = mIntl->AsRemote()->CaretOffset();
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::SetCaretOffset(int32_t aCaretOffset) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->SetCaretOffset(aCaretOffset);
   } else {
-    mIntl.AsProxy()->SetCaretOffset(aCaretOffset);
+    mIntl->AsRemote()->SetCaretOffset(aCaretOffset);
   }
   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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aSelectionCount = Intl()->SelectionCount();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aSelectionCount = mIntl.AsProxy()->SelectionCount();
+    *aSelectionCount = mIntl->AsRemote()->SelectionCount();
 #endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetSelectionBounds(int32_t aSelectionNum,
                                            int32_t* aStartOffset,
                                            int32_t* aEndOffset) {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   if (aSelectionNum < 0) return NS_ERROR_INVALID_ARG;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     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);
+    mIntl->AsRemote()->SelectionBoundsAt(aSelectionNum, unused, aStartOffset,
+                                         aEndOffset);
 #endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::SetSelectionBounds(int32_t aSelectionNum,
                                            int32_t aStartOffset,
                                            int32_t aEndOffset) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   if (aSelectionNum < 0) return NS_ERROR_INVALID_ARG;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     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)) {
+    if (!mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->AddToSelection(aStartOffset, aEndOffset);
   } else {
-    mIntl.AsProxy()->AddToSelection(aStartOffset, aEndOffset);
+    mIntl->AsRemote()->AddToSelection(aStartOffset, aEndOffset);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::RemoveSelection(int32_t aSelectionNum) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->RemoveFromSelection(aSelectionNum);
   } else {
-    mIntl.AsProxy()->RemoveFromSelection(aSelectionNum);
+    mIntl->AsRemote()->RemoveFromSelection(aSelectionNum);
   }
   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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
   } else {
-    mIntl.AsProxy()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
+    mIntl->AsRemote()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::ScrollSubstringToPoint(int32_t aStartOffset,
                                                int32_t aEndOffset,
                                                uint32_t aCoordinateType,
                                                int32_t aX, int32_t aY) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoordinateType,
                                    aX, aY);
   } else {
-    mIntl.AsProxy()->ScrollSubstringToPoint(aStartOffset, aEndOffset,
-                                            aCoordinateType, aX, aY);
+    mIntl->AsRemote()->ScrollSubstringToPoint(aStartOffset, aEndOffset,
+                                              aCoordinateType, aX, aY);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetEnclosingRange(nsIAccessibleTextRange** aRange) {
   NS_ENSURE_ARG_POINTER(aRange);
   *aRange = nullptr;
@@ -553,194 +553,194 @@ xpcAccessibleHyperText::GetRangeAtPoint(
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleEditableText
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::SetTextContents(const nsAString& aText) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->ReplaceText(aText);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsString text(aText);
-    mIntl.AsProxy()->ReplaceText(text);
+    mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->InsertText(aText, aOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsString text(aText);
-    mIntl.AsProxy()->InsertText(text, aOffset);
+    mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->CopyText(aStartOffset, aEndOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    mIntl.AsProxy()->CopyText(aStartOffset, aEndOffset);
+    mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->CutText(aStartOffset, aEndOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    mIntl.AsProxy()->CutText(aStartOffset, aEndOffset);
+    mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     Intl()->DeleteText(aStartOffset, aEndOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    mIntl.AsProxy()->DeleteText(aStartOffset, aEndOffset);
+    mIntl->AsRemote()->DeleteText(aStartOffset, aEndOffset);
 #endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::PasteText(int32_t aOffset) {
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     RefPtr<HyperTextAccessible> acc = Intl();
     acc->PasteText(aOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    mIntl.AsProxy()->PasteText(aOffset);
+    mIntl->AsRemote()->PasteText(aOffset);
 #endif
   }
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleHyperText
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkCount(int32_t* aLinkCount) {
   NS_ENSURE_ARG_POINTER(aLinkCount);
   *aLinkCount = 0;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aLinkCount = Intl()->LinkCount();
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aLinkCount = mIntl.AsProxy()->LinkCount();
+    *aLinkCount = mIntl->AsRemote()->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) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     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)));
+    NS_IF_ADDREF(*aLink = ToXPC(mIntl->AsRemote()->LinkAt(aIndex)));
 #endif
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkIndex(nsIAccessibleHyperLink* aLink,
                                      int32_t* aIndex) {
   NS_ENSURE_ARG_POINTER(aLink);
   NS_ENSURE_ARG_POINTER(aIndex);
   *aIndex = -1;
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIAccessible> xpcLink(do_QueryInterface(aLink));
   if (LocalAccessible* 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());
-    RemoteAccessible* proxyLink = linkHyperText->mIntl.AsProxy();
+    RemoteAccessible* proxyLink = linkHyperText->mIntl->AsRemote();
     if (proxyLink) {
-      *aIndex = mIntl.AsProxy()->LinkIndexOf(proxyLink);
+      *aIndex = mIntl->AsRemote()->LinkIndexOf(proxyLink);
     }
 #endif
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetLinkIndexAtOffset(int32_t aOffset,
                                              int32_t* aLinkIndex) {
   NS_ENSURE_ARG_POINTER(aLinkIndex);
   *aLinkIndex = -1;  // API says this magic value means 'not found'
 
-  if (mIntl.IsNull()) return NS_ERROR_FAILURE;
+  if (!mIntl) return NS_ERROR_FAILURE;
 
-  if (mIntl.IsAccessible()) {
+  if (mIntl->IsLocal()) {
     *aLinkIndex = Intl()->LinkIndexAtOffset(aOffset);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
-    *aLinkIndex = mIntl.AsProxy()->LinkIndexAtOffset(aOffset);
+    *aLinkIndex = mIntl->AsRemote()->LinkIndexAtOffset(aOffset);
 #endif
   }
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleHyperText.h
+++ b/accessible/xpcom/xpcAccessibleHyperText.h
@@ -17,21 +17,19 @@
 namespace mozilla {
 namespace a11y {
 
 class xpcAccessibleHyperText : public xpcAccessibleGeneric,
                                public nsIAccessibleText,
                                public nsIAccessibleEditableText,
                                public nsIAccessibleHyperText {
  public:
-  explicit xpcAccessibleHyperText(LocalAccessible* aIntl)
+  explicit xpcAccessibleHyperText(Accessible* aIntl)
       : xpcAccessibleGeneric(aIntl) {
-    if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole()) {
-      mSupportedIfaces |= eText;
-    }
+    if (aIntl->IsHyperText() && aIntl->IsTextRole()) mSupportedIfaces |= eText;
   }
 
   xpcAccessibleHyperText(RemoteAccessible* aProxy, uint32_t aInterfaces)
       : xpcAccessibleGeneric(aProxy, aInterfaces) {
     mSupportedIfaces |= eText;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -40,17 +38,17 @@ class xpcAccessibleHyperText : public xp
   NS_DECL_NSIACCESSIBLEHYPERTEXT
   NS_DECL_NSIACCESSIBLEEDITABLETEXT
 
  protected:
   virtual ~xpcAccessibleHyperText() {}
 
  private:
   HyperTextAccessible* Intl() {
-    if (LocalAccessible* acc = mIntl.AsAccessible()) {
+    if (LocalAccessible* acc = mIntl->AsLocal()) {
       return acc->AsHyperText();
     }
 
     return nullptr;
   }
 
   xpcAccessibleHyperText(const xpcAccessibleHyperText&) = delete;
   xpcAccessibleHyperText& operator=(const xpcAccessibleHyperText&) = delete;
--- a/accessible/xpcom/xpcAccessibleImage.h
+++ b/accessible/xpcom/xpcAccessibleImage.h
@@ -12,34 +12,31 @@
 #include "xpcAccessibleGeneric.h"
 
 namespace mozilla {
 namespace a11y {
 
 class xpcAccessibleImage : public xpcAccessibleGeneric,
                            public nsIAccessibleImage {
  public:
-  explicit xpcAccessibleImage(LocalAccessible* aIntl)
+  explicit xpcAccessibleImage(Accessible* aIntl)
       : xpcAccessibleGeneric(aIntl) {}
 
-  xpcAccessibleImage(RemoteAccessible* aProxy, uint32_t aInterfaces)
-      : xpcAccessibleGeneric(aProxy, aInterfaces) {}
-
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_IMETHOD GetImagePosition(uint32_t aCoordType, int32_t* aX,
                               int32_t* aY) final;
   NS_IMETHOD GetImageSize(int32_t* aWidth, int32_t* aHeight) final;
 
  protected:
   virtual ~xpcAccessibleImage() {}
 
  private:
   ImageAccessible* Intl() {
-    return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsImage() : nullptr;
+    return mIntl->IsLocal() ? mIntl->AsLocal()->AsImage() : nullptr;
   }
 
   xpcAccessibleImage(const xpcAccessibleImage&) = delete;
   xpcAccessibleImage& operator=(const xpcAccessibleImage&) = delete;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
--- a/accessible/xpcom/xpcAccessibleTable.h
+++ b/accessible/xpcom/xpcAccessibleTable.h
@@ -14,17 +14,17 @@ namespace mozilla {
 namespace a11y {
 
 /**
  * XPCOM wrapper around TableAccessible class.
  */
 class xpcAccessibleTable : public xpcAccessibleHyperText,
                            public nsIAccessibleTable {
  public:
-  explicit xpcAccessibleTable(LocalAccessible* aIntl)
+  explicit xpcAccessibleTable(Accessible* aIntl)
       : xpcAccessibleHyperText(aIntl) {}
 
   xpcAccessibleTable(RemoteAccessible* aProxy, uint32_t aInterfaces)
       : xpcAccessibleHyperText(aProxy, aInterfaces) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
@@ -64,17 +64,17 @@ class xpcAccessibleTable : public xpcAcc
   NS_IMETHOD UnselectRow(int32_t aRowIdx) final;
   NS_IMETHOD IsProbablyForLayout(bool* aIsForLayout) final;
 
  protected:
   virtual ~xpcAccessibleTable() {}
 
  private:
   TableAccessible* Intl() {
-    return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsTable() : nullptr;
+    return mIntl->IsLocal() ? mIntl->AsLocal()->AsTable() : nullptr;
   }
 
   xpcAccessibleTable(const xpcAccessibleTable&) = delete;
   xpcAccessibleTable& operator=(const xpcAccessibleTable&) = delete;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
--- a/accessible/xpcom/xpcAccessibleTableCell.h
+++ b/accessible/xpcom/xpcAccessibleTableCell.h
@@ -15,17 +15,17 @@ namespace mozilla {
 namespace a11y {
 
 /**
  * XPCOM wrapper around TableAccessibleCell class.
  */
 class xpcAccessibleTableCell : public xpcAccessibleHyperText,
                                public nsIAccessibleTableCell {
  public:
-  explicit xpcAccessibleTableCell(LocalAccessible* aIntl)
+  explicit xpcAccessibleTableCell(Accessible* aIntl)
       : xpcAccessibleHyperText(aIntl) {}
 
   xpcAccessibleTableCell(RemoteAccessible* aProxy, uint32_t aInterfaces)
       : xpcAccessibleHyperText(aProxy, aInterfaces) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTableCell
@@ -38,17 +38,17 @@ class xpcAccessibleTableCell : public xp
   NS_IMETHOD GetRowHeaderCells(nsIArray** aHeaderCells) final;
   NS_IMETHOD IsSelected(bool* aSelected) final;
 
  protected:
   virtual ~xpcAccessibleTableCell() {}
 
  private:
   TableCellAccessible* Intl() {
-    if (LocalAccessible* acc = mIntl.AsAccessible()) {
+    if (LocalAccessible* acc = mIntl->AsLocal()) {
       return acc->AsTableCell();
     }
 
     return nullptr;
   }
 
   xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
   xpcAccessibleTableCell& operator=(const xpcAccessibleTableCell&) = delete;
--- a/accessible/xpcom/xpcAccessibleValue.cpp
+++ b/accessible/xpcom/xpcAccessibleValue.cpp
@@ -10,111 +10,111 @@
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMaximumValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
+  if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
     return NS_ERROR_FAILURE;
   }
 
   double value;
-  if (Intl().IsAccessible()) {
-    value = Intl().AsAccessible()->MaxValue();
+  if (Intl()->IsLocal()) {
+    value = Intl()->AsLocal()->MaxValue();
   } else {
-    value = Intl().AsProxy()->MaxValue();
+    value = Intl()->AsRemote()->MaxValue();
   }
 
   if (!IsNaN(value)) *aValue = value;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMinimumValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
+  if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
     return NS_ERROR_FAILURE;
   }
 
   double value;
-  if (Intl().IsAccessible()) {
-    value = Intl().AsAccessible()->MinValue();
+  if (Intl()->IsLocal()) {
+    value = Intl()->AsLocal()->MinValue();
   } else {
-    value = Intl().AsProxy()->MinValue();
+    value = Intl()->AsRemote()->MinValue();
   }
 
   if (!IsNaN(value)) *aValue = value;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetCurrentValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
+  if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
     return NS_ERROR_FAILURE;
   }
 
   double value;
-  if (Intl().IsAccessible()) {
-    value = Intl().AsAccessible()->CurValue();
+  if (Intl()->IsLocal()) {
+    value = Intl()->AsLocal()->CurValue();
   } else {
-    value = Intl().AsProxy()->CurValue();
+    value = Intl()->AsRemote()->CurValue();
   }
 
   if (!IsNaN(value)) *aValue = value;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::SetCurrentValue(double aValue) {
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
+  if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
     return NS_ERROR_FAILURE;
   }
 
-  if (Intl().IsAccessible()) {
-    Intl().AsAccessible()->SetCurValue(aValue);
+  if (Intl()->IsLocal()) {
+    Intl()->AsLocal()->SetCurValue(aValue);
   } else {
-    Intl().AsProxy()->SetCurValue(aValue);
+    Intl()->AsRemote()->SetCurValue(aValue);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMinimumIncrement(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
-  if (Intl().IsNull()) return NS_ERROR_FAILURE;
+  if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
+  if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
     return NS_ERROR_FAILURE;
   }
 
   double value;
-  if (Intl().IsAccessible()) {
-    value = Intl().AsAccessible()->Step();
+  if (Intl()->IsLocal()) {
+    value = Intl()->AsLocal()->Step();
   } else {
-    value = Intl().AsProxy()->Step();
+    value = Intl()->AsRemote()->Step();
   }
 
   if (!IsNaN(value)) *aValue = value;
 
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleValue.h
+++ b/accessible/xpcom/xpcAccessibleValue.h
@@ -26,17 +26,17 @@ class xpcAccessibleValue : public nsIAcc
   NS_IMETHOD SetCurrentValue(double aValue) final;
   NS_IMETHOD GetMinimumIncrement(double* aMinIncrement) final;
 
  protected:
   xpcAccessibleValue() {}
   virtual ~xpcAccessibleValue() {}
 
  private:
-  AccessibleOrProxy Intl();
+  Accessible* Intl();
 
   xpcAccessibleValue(const xpcAccessibleValue&) = delete;
   xpcAccessibleValue& operator=(const xpcAccessibleValue&) = delete;
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 #endif