Merge mc -> pine draft
authorGregor Wagner <anygregor@gmail.com>
Fri, 27 Mar 2015 13:16:58 -0700
changeset 388203 5398f05a4012f97e15bf1cbd4e0a2621e79f5bf4
parent 388202 51cb900c6114e41a030bfc181e53691a1f5affa9 (current diff)
parent 253710 44e454b5e93b64cdb77a025c5d6b8d8ca5c2926e (diff)
child 388204 9d0650a7d7676cecd3607df88c919209af2b6ccb
push id23132
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateFri, 15 Jul 2016 10:07:12 +0000
milestone39.0a1
Merge mc -> pine
b2g/app/b2g.js
b2g/config/gaia.json
browser/components/downloads/DownloadsViewUI.jsm
browser/components/downloads/content/downloads.js
browser/components/loop/content/shared/libs/sdk.js
browser/components/loop/test/shared/vendor/chai-1.9.0.js
browser/components/loop/test/shared/vendor/mocha-2.0.1.css
browser/components/loop/test/shared/vendor/mocha-2.0.1.js
browser/components/loop/test/shared/vendor/sinon-1.12.2.js
browser/devtools/framework/test/browser_toolbox_options_devedition.js
browser/devtools/inspector/test/browser_inspector_menu-01.js
browser/devtools/inspector/test/browser_inspector_menu-02.js
browser/devtools/inspector/test/browser_inspector_update-on-navigation.js
browser/devtools/inspector/test/doc_inspector_menu-01.html
browser/devtools/inspector/test/doc_inspector_menu-02.html
browser/devtools/performance/test/browser_perf-front.js
browser/devtools/webide/modules/remote-resources.js
browser/devtools/webide/themes/prefs.css
browser/themes/shared/readinglist/sidebar.css
configure.in
dom/apps/Webapps.jsm
dom/asmjscache/AsmJSCache.cpp
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/TabChild.cpp
dom/media/MediaDecoderStateMachineScheduler.cpp
dom/media/MediaDecoderStateMachineScheduler.h
dom/media/MediaPromise.cpp
dom/media/test/test_eme_access_control.html
dom/media/test/test_eme_playback.html
dom/system/NetworkGeolocationProvider.js
dom/telephony/ipc/TelephonyIPCService.h
dom/tests/mochitest/fetch/test_fetch_basic_worker.html
dom/tests/mochitest/fetch/test_headers_mainthread.js
dom/tests/mochitest/fetch/worker_test_fetch_basic.js
dom/tests/mochitest/fetch/worker_test_fetch_basic_http.js
dom/tests/mochitest/fetch/worker_test_fetch_cors.js
dom/wifi/WifiWorker.js
dom/workers/RuntimeService.cpp
dom/workers/test/WorkerDebuggerManager_parentWorker.js
dom/workers/test/WorkerDebugger_parentWorker.js
dom/workers/test/fetch/mochitest.ini
dom/workers/test/fetch/test_interfaces.html
dom/workers/test/fetch/test_request.html
dom/workers/test/fetch/test_response.html
dom/workers/test/fetch/worker_interfaces.js
dom/workers/test/fetch/worker_test_request.js
dom/workers/test/fetch/worker_test_response.js
gfx/layers/GrallocImages.cpp
js/src/gc/GCRuntime.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/vm/HelperThreads.cpp
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
layout/base/tests/bidi_numeral_test.js
layout/base/tests/bug441782-1-ref.html
layout/base/tests/bug441782-1.html
layout/base/tests/bug441782-2-ref.html
layout/base/tests/bug441782-2.html
layout/base/tests/bug441782-3-ref.html
layout/base/tests/bug441782-3.html
layout/base/tests/bug441782-4-ref.html
layout/base/tests/bug441782-4.html
layout/base/tests/bug441782-5-ref.html
layout/base/tests/bug441782-5.html
layout/base/tests/bug467672-1-ref.html
layout/base/tests/bug467672-1.html
layout/base/tests/bug467672-2-ref.html
layout/base/tests/bug467672-2.html
layout/base/tests/bug467672-3-ref.html
layout/base/tests/bug467672-3.html
layout/base/tests/bug467672-4-ref.html
layout/base/tests/bug467672-4.html
layout/base/tests/bug467672-5-ref.html
layout/base/tests/bug467672-5.html
layout/base/tests/bug570378-arabic-1-ref.html
layout/base/tests/bug570378-arabic-1.html
layout/base/tests/bug570378-arabic-2-ref.html
layout/base/tests/bug570378-arabic-2.html
layout/base/tests/bug570378-arabic-3-ref.html
layout/base/tests/bug570378-arabic-3.html
layout/base/tests/bug570378-arabic-4-ref.html
layout/base/tests/bug570378-arabic-4.html
layout/base/tests/bug570378-arabic-5-ref.html
layout/base/tests/bug570378-arabic-5.html
layout/base/tests/bug570378-persian-1-ref.html
layout/base/tests/bug570378-persian-1.html
layout/base/tests/bug570378-persian-2-ref.html
layout/base/tests/bug570378-persian-2.html
layout/base/tests/bug570378-persian-3-ref.html
layout/base/tests/bug570378-persian-3.html
layout/base/tests/bug570378-persian-4-ref.html
layout/base/tests/bug570378-persian-4.html
layout/base/tests/bug570378-persian-5-ref.html
layout/base/tests/bug570378-persian-5.html
layout/base/tests/marionette/test_selectioncarets_multiplerange.py
layout/base/tests/test_bug441782-1a.html
layout/base/tests/test_bug441782-1b.html
layout/base/tests/test_bug441782-1c.html
layout/base/tests/test_bug441782-1d.html
layout/base/tests/test_bug441782-1e.html
layout/base/tests/test_bug441782-2a.html
layout/base/tests/test_bug441782-2b.html
layout/base/tests/test_bug441782-2c.html
layout/base/tests/test_bug441782-2d.html
layout/base/tests/test_bug441782-2e.html
layout/base/tests/test_bug441782-3a.html
layout/base/tests/test_bug441782-3b.html
layout/base/tests/test_bug441782-3c.html
layout/base/tests/test_bug441782-3d.html
layout/base/tests/test_bug441782-3e.html
layout/base/tests/test_bug441782-4a.html
layout/base/tests/test_bug441782-4b.html
layout/base/tests/test_bug441782-4c.html
layout/base/tests/test_bug441782-4d.html
layout/base/tests/test_bug441782-4e.html
layout/base/tests/test_bug441782-5a.html
layout/base/tests/test_bug441782-5b.html
layout/base/tests/test_bug441782-5c.html
layout/base/tests/test_bug441782-5d.html
layout/base/tests/test_bug441782-5e.html
layout/base/tests/test_bug467672-1a.html
layout/base/tests/test_bug467672-1b.html
layout/base/tests/test_bug467672-1c.html
layout/base/tests/test_bug467672-1d.html
layout/base/tests/test_bug467672-1e.html
layout/base/tests/test_bug467672-1f.html
layout/base/tests/test_bug467672-1g.html
layout/base/tests/test_bug467672-2a.html
layout/base/tests/test_bug467672-2b.html
layout/base/tests/test_bug467672-2c.html
layout/base/tests/test_bug467672-2d.html
layout/base/tests/test_bug467672-2e.html
layout/base/tests/test_bug467672-2f.html
layout/base/tests/test_bug467672-2g.html
layout/base/tests/test_bug467672-3a.html
layout/base/tests/test_bug467672-3b.html
layout/base/tests/test_bug467672-3c.html
layout/base/tests/test_bug467672-3d.html
layout/base/tests/test_bug467672-3e.html
layout/base/tests/test_bug467672-3f.html
layout/base/tests/test_bug467672-3g.html
layout/base/tests/test_bug467672-4a.html
layout/base/tests/test_bug467672-4b.html
layout/base/tests/test_bug467672-4c.html
layout/base/tests/test_bug467672-4d.html
layout/base/tests/test_bug467672-4e.html
layout/base/tests/test_bug467672-4f.html
layout/base/tests/test_bug467672-4g.html
layout/base/tests/test_bug467672-5a.html
layout/base/tests/test_bug467672-5b.html
layout/base/tests/test_bug467672-5c.html
layout/base/tests/test_bug467672-5d.html
layout/base/tests/test_bug467672-5e.html
layout/base/tests/test_bug467672-5f.html
layout/base/tests/test_bug467672-5g.html
layout/base/tests/test_bug570378-arabic-1a.html
layout/base/tests/test_bug570378-arabic-1b.html
layout/base/tests/test_bug570378-arabic-1c.html
layout/base/tests/test_bug570378-arabic-1d.html
layout/base/tests/test_bug570378-arabic-1e.html
layout/base/tests/test_bug570378-arabic-2a.html
layout/base/tests/test_bug570378-arabic-2b.html
layout/base/tests/test_bug570378-arabic-2c.html
layout/base/tests/test_bug570378-arabic-2d.html
layout/base/tests/test_bug570378-arabic-2e.html
layout/base/tests/test_bug570378-arabic-3a.html
layout/base/tests/test_bug570378-arabic-3b.html
layout/base/tests/test_bug570378-arabic-3c.html
layout/base/tests/test_bug570378-arabic-3d.html
layout/base/tests/test_bug570378-arabic-3e.html
layout/base/tests/test_bug570378-arabic-4a.html
layout/base/tests/test_bug570378-arabic-4b.html
layout/base/tests/test_bug570378-arabic-4c.html
layout/base/tests/test_bug570378-arabic-4d.html
layout/base/tests/test_bug570378-arabic-4e.html
layout/base/tests/test_bug570378-arabic-5a.html
layout/base/tests/test_bug570378-arabic-5b.html
layout/base/tests/test_bug570378-arabic-5c.html
layout/base/tests/test_bug570378-arabic-5d.html
layout/base/tests/test_bug570378-arabic-5e.html
layout/base/tests/test_bug570378-persian-1a.html
layout/base/tests/test_bug570378-persian-1b.html
layout/base/tests/test_bug570378-persian-1c.html
layout/base/tests/test_bug570378-persian-1d.html
layout/base/tests/test_bug570378-persian-1e.html
layout/base/tests/test_bug570378-persian-1f.html
layout/base/tests/test_bug570378-persian-1g.html
layout/base/tests/test_bug570378-persian-2a.html
layout/base/tests/test_bug570378-persian-2b.html
layout/base/tests/test_bug570378-persian-2c.html
layout/base/tests/test_bug570378-persian-2d.html
layout/base/tests/test_bug570378-persian-2e.html
layout/base/tests/test_bug570378-persian-2f.html
layout/base/tests/test_bug570378-persian-2g.html
layout/base/tests/test_bug570378-persian-3a.html
layout/base/tests/test_bug570378-persian-3b.html
layout/base/tests/test_bug570378-persian-3c.html
layout/base/tests/test_bug570378-persian-3d.html
layout/base/tests/test_bug570378-persian-3e.html
layout/base/tests/test_bug570378-persian-3f.html
layout/base/tests/test_bug570378-persian-3g.html
layout/base/tests/test_bug570378-persian-4a.html
layout/base/tests/test_bug570378-persian-4b.html
layout/base/tests/test_bug570378-persian-4c.html
layout/base/tests/test_bug570378-persian-4d.html
layout/base/tests/test_bug570378-persian-4e.html
layout/base/tests/test_bug570378-persian-4f.html
layout/base/tests/test_bug570378-persian-4g.html
layout/base/tests/test_bug570378-persian-5a.html
layout/base/tests/test_bug570378-persian-5b.html
layout/base/tests/test_bug570378-persian-5c.html
layout/base/tests/test_bug570378-persian-5d.html
layout/base/tests/test_bug570378-persian-5e.html
layout/base/tests/test_bug570378-persian-5f.html
layout/base/tests/test_bug570378-persian-5g.html
media/webrtc/signaling/src/sdp/sipcc/ccsdp.c
mobile/android/base/resources/color/overlay_btn_text.xml
mobile/android/base/resources/layout/overlay_share_send_tab_button.xml
mobile/android/base/tests/reader_mode_pages/addons.mozilla.org/en-US/firefox/index.html
mobile/android/base/tests/robocop_login.html
modules/brotli/dec/README
security/patches/reverted-bug-1132496.patch
testing/marionette/marionette-common.js
testing/marionette/marionette-elements.js
testing/marionette/marionette-frame-manager.js
testing/marionette/marionette-listener.js
testing/marionette/marionette-sendkeys.js
testing/marionette/marionette-server.js
testing/marionette/marionette-simpletest.js
testing/web-platform/meta/html/semantics/grouping-content/the-li-element/grouping-li-novalue-MANUAL.html.ini
testing/web-platform/meta/media-source/mediasource-removesourcebuffer.html.ini
testing/web-platform/meta/media-source/mediasource-sourcebufferlist.html.ini
testing/web-platform/tests/DOMEvents/tests/approved/EventListener.dispatch.new.event.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-empty-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-leading-bom-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-leading-whitespace-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-rejected-cache-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-rejected-no-email-collection-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-trailing-pile-of-poo-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-trailing-whitespace-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-turkish-lowercase-dotless-i-novalid.html
testing/web-platform/tests/conformance-checkers/html/elements/meta/name-turkish-uppercase-dotted-i-novalid.html
testing/web-platform/tests/conformance-checkers/tools/meta-extensions
testing/web-platform/tests/conformance-checkers/tools/meta-name.py
testing/web-platform/tests/html/semantics/grouping-content/the-li-element/grouping-li-novalue-MANUAL.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-for-onload.html
testing/web-platform/tests/webstorage/storage_builtins.js
testing/web-platform/tests/webstorage/storage_local_builtins.html
testing/web-platform/tests/webstorage/storage_local_clear.html
testing/web-platform/tests/webstorage/storage_local_clear_js.html
testing/web-platform/tests/webstorage/storage_local_getitem.html
testing/web-platform/tests/webstorage/storage_local_getitem_js.html
testing/web-platform/tests/webstorage/storage_local_in_js.html
testing/web-platform/tests/webstorage/storage_local_index_js.html
testing/web-platform/tests/webstorage/storage_local_key.html
testing/web-platform/tests/webstorage/storage_local_length.html
testing/web-platform/tests/webstorage/storage_local_length_js.html
testing/web-platform/tests/webstorage/storage_local_removeitem.html
testing/web-platform/tests/webstorage/storage_local_removeitem_js.html
testing/web-platform/tests/webstorage/storage_local_setitem.html
testing/web-platform/tests/webstorage/storage_local_setitem_js.html
testing/web-platform/tests/webstorage/storage_session_builtins.html
testing/web-platform/tests/webstorage/storage_session_clear.html
testing/web-platform/tests/webstorage/storage_session_clear_js.html
testing/web-platform/tests/webstorage/storage_session_getitem.html
testing/web-platform/tests/webstorage/storage_session_getitem_js.html
testing/web-platform/tests/webstorage/storage_session_in_js.html
testing/web-platform/tests/webstorage/storage_session_index_js.html
testing/web-platform/tests/webstorage/storage_session_key.html
testing/web-platform/tests/webstorage/storage_session_length.html
testing/web-platform/tests/webstorage/storage_session_length_js.html
testing/web-platform/tests/webstorage/storage_session_removeitem.html
testing/web-platform/tests/webstorage/storage_session_removeitem_js.html
testing/web-platform/tests/webstorage/storage_session_setitem.html
testing/web-platform/tests/webstorage/storage_session_setitem_js.html
toolkit/components/places/tests/queries/stub-test.js
toolkit/components/places/tests/unit/test_398914.js
toolkit/components/places/tests/unit/test_421180.js
toolkit/content/aboutwebrtc/README.txt
toolkit/content/aboutwebrtc/aboutWebrtc.jsx
toolkit/devtools/server/tests/mochitest/test_attachProcess.html
toolkit/devtools/tern/comment.js
toolkit/devtools/tern/condense.js
toolkit/devtools/tern/def.js
toolkit/devtools/tern/infer.js
toolkit/devtools/tern/signal.js
toolkit/devtools/tern/tern.js
--- a/accessible/atk/AccessibleWrap.h
+++ b/accessible/atk/AccessibleWrap.h
@@ -47,21 +47,21 @@ class MaiHyperlink;
  */
 class AccessibleWrap : public Accessible
 {
 public:
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~AccessibleWrap();
   void ShutdownAtkObject();
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 
   // return the atk object for this AccessibleWrap
-  virtual void GetNativeInterface(void** aOutAccessible) MOZ_OVERRIDE;
-  virtual nsresult HandleAccEvent(AccEvent* aEvent) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void** aOutAccessible) override;
+  virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
 
   AtkObject * GetAtkObject(void);
   static AtkObject* GetAtkObject(Accessible* aAccessible);
 
   bool IsValidObject();
 
   // get/set the MaiHyperlink object for this AccessibleWrap
   MaiHyperlink* GetMaiHyperlink(bool aCreate = true);
--- a/accessible/atk/ApplicationAccessibleWrap.h
+++ b/accessible/atk/ApplicationAccessibleWrap.h
@@ -14,22 +14,22 @@ namespace a11y {
 
 class ApplicationAccessibleWrap: public ApplicationAccessible
 {
 public:
   ApplicationAccessibleWrap();
   virtual ~ApplicationAccessibleWrap();
 
   // Accessible
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
-  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) MOZ_OVERRIDE;
-  virtual bool RemoveChild(Accessible* aChild) MOZ_OVERRIDE;
+  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
+  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
+  virtual bool RemoveChild(Accessible* aChild) override;
 
   /**
    * Return the atk object for app root accessible.
    */
-  virtual void GetNativeInterface(void** aOutAccessible) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void** aOutAccessible) override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif   /* __NS_APP_ROOT_ACCESSIBLE_H__ */
--- a/accessible/atk/AtkSocketAccessible.h
+++ b/accessible/atk/AtkSocketAccessible.h
@@ -40,17 +40,17 @@ public:
    * True if the current Atk version supports AtkSocket and it was correctly
    * loaded.
    */
   static bool gCanEmbed;
 
   AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc,
                       const nsCString& aPlugId);
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 
-  virtual void GetNativeInterface(void** aOutAccessible) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void** aOutAccessible) override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/atk/RootAccessibleWrap.h
+++ b/accessible/atk/RootAccessibleWrap.h
@@ -15,17 +15,17 @@ namespace a11y {
 
 typedef RootAccessible RootAccessibleWrap;
 
 /* GtkWindowAccessible is the accessible class for gtk+ native window.
  * The instance of GtkWindowAccessible is a child of MaiAppRoot instance.
  * It is added into root when the toplevel window is created, and removed
  * from root when the toplevel window is destroyed.
  */
-class GtkWindowAccessible MOZ_FINAL : public DummyAccessible
+class GtkWindowAccessible final : public DummyAccessible
 {
 public:
   explicit GtkWindowAccessible(AtkObject* aAccessible);
   virtual ~GtkWindowAccessible();
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/atk/nsMaiInterfaceHypertext.cpp
+++ b/accessible/atk/nsMaiInterfaceHypertext.cpp
@@ -5,69 +5,91 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InterfaceInitFuncs.h"
 
 #include "Accessible-inl.h"
 #include "HyperTextAccessible.h"
 #include "nsMai.h"
 #include "nsMaiHyperlink.h"
+#include "ProxyAccessible.h"
 #include "mozilla/Likely.h"
 
+
 using namespace mozilla::a11y;
 
 extern "C" {
 
 static AtkHyperlink*
 getLinkCB(AtkHypertext *aText, gint aLinkIndex)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
-  if (!accWrap)
-    return nullptr;
+  if (accWrap) {
+    HyperTextAccessible* hyperText = accWrap->AsHyperText();
+    NS_ENSURE_TRUE(hyperText, nullptr);
+
+    Accessible* hyperLink = hyperText->LinkAt(aLinkIndex);
+    if (!hyperLink) {
+      return nullptr;
+    }
 
-  HyperTextAccessible* hyperText = accWrap->AsHyperText();
-  NS_ENSURE_TRUE(hyperText, nullptr);
+    AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
+    AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj);
+    NS_ENSURE_TRUE(accChild, nullptr);
 
-  Accessible* hyperLink = hyperText->LinkAt(aLinkIndex);
-  if (!hyperLink)
+    MaiHyperlink* maiHyperlink = accChild->GetMaiHyperlink();
+    NS_ENSURE_TRUE(maiHyperlink, nullptr);
+    return maiHyperlink->GetAtkHyperlink();
+  }
+
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
+    ProxyAccessible* proxyLink = proxy->LinkAt(aLinkIndex);
+    if (proxyLink) {
+      NS_WARNING("IMPLEMENT ME! See bug 1146518.");
+      // We should somehow get from ProxyAccessible* to AtkHyperlink*.
+    }
     return nullptr;
+  }
 
-  AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
-  AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj);
-  NS_ENSURE_TRUE(accChild, nullptr);
-
-  MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink();
-  NS_ENSURE_TRUE(maiHyperlink, nullptr);
-  return maiHyperlink->GetAtkHyperlink();
+  return nullptr;
 }
 
 static gint
 getLinkCountCB(AtkHypertext *aText)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
-  if (!accWrap)
-    return -1;
+  if (accWrap) {
+    HyperTextAccessible* hyperText = accWrap->AsHyperText();
+    NS_ENSURE_TRUE(hyperText, -1);
+    return hyperText->LinkCount();
+  }
 
-  HyperTextAccessible* hyperText = accWrap->AsHyperText();
-  NS_ENSURE_TRUE(hyperText, -1);
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
+    return proxy->LinkCount();
+  }
 
-  return hyperText->LinkCount();
+  return -1;
 }
 
 static gint
 getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
-  if (!accWrap)
-    return -1;
+  if (accWrap) {
+    HyperTextAccessible* hyperText = accWrap->AsHyperText();
+    NS_ENSURE_TRUE(hyperText, -1);
 
-  HyperTextAccessible* hyperText = accWrap->AsHyperText();
-  NS_ENSURE_TRUE(hyperText, -1);
+    return hyperText->LinkIndexAtOffset(aCharIndex);
+  }
 
-  return hyperText->LinkIndexAtOffset(aCharIndex);
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
+    return proxy->LinkIndexAtOffset(aCharIndex);
+  }
+
+  return -1;
 }
 }
 
 void
 hypertextInterfaceInitCB(AtkHypertextIface* aIface)
 {
   NS_ASSERTION(aIface, "no interface!");
   if (MOZ_UNLIKELY(!aIface))
--- a/accessible/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/atk/nsMaiInterfaceImage.cpp
@@ -7,54 +7,62 @@
 #include "InterfaceInitFuncs.h"
 
 #include "AccessibleWrap.h"
 #include "ImageAccessible.h"
 #include "mozilla/Likely.h"
 #include "nsMai.h"
 #include "nsIAccessibleTypes.h"
 #include "nsIURI.h"
+#include "ProxyAccessible.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 extern "C" {
 const gchar* getDescriptionCB(AtkObject* aAtkObj);
 
 static void
 getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
                    AtkCoordType aCoordType)
 {
-  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
-  if (!accWrap || !accWrap->IsImage())
-    return;
-
-  ImageAccessible* image = accWrap->AsImage();
+  nsIntPoint pos;
   uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
     nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
-  nsIntPoint pos = image->Position(geckoCoordType);
+
+  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
+  if (accWrap && accWrap->IsImage()) {
+    ImageAccessible* image = accWrap->AsImage();
+    pos = image->Position(geckoCoordType);
+  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) {
+    pos = proxy->ImagePosition(geckoCoordType);
+  }
+
   *aAccX = pos.x;
   *aAccY = pos.y;
 }
 
 static const gchar*
 getImageDescriptionCB(AtkImage* aImage)
 {
   return getDescriptionCB(ATK_OBJECT(aImage));
 }
 
 static void
 getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight)
 {
+  nsIntSize size;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
-  if (!accWrap || !accWrap->IsImage())
-    return;
+  if (accWrap && accWrap->IsImage()) {
+    size = accWrap->AsImage()->Size();
+  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) {
+    size = proxy->ImageSize();
+  }
 
-  nsIntSize size = accWrap->AsImage()->Size();
   *aAccWidth = size.width;
   *aAccHeight = size.height;
 }
 
 } // extern "C"
 
 void
 imageInterfaceInitCB(AtkImageIface* aIface)
--- a/accessible/atk/nsMaiInterfaceSelection.cpp
+++ b/accessible/atk/nsMaiInterfaceSelection.cpp
@@ -4,100 +4,139 @@
  * 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 "InterfaceInitFuncs.h"
 
 #include "Accessible-inl.h"
 #include "AccessibleWrap.h"
 #include "nsMai.h"
+#include "ProxyAccessible.h"
 #include "mozilla/Likely.h"
 
 #include <atk/atk.h>
 
 using namespace mozilla::a11y;
 
 extern "C" {
 
 static gboolean
 addSelectionCB(AtkSelection *aSelection, gint i)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return FALSE;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->AddItemToSelection(i);
+  }
 
-  return accWrap->AddItemToSelection(i);
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->AddItemToSelection(i);
+  }
+
+  return FALSE;
 }
 
 static gboolean
 clearSelectionCB(AtkSelection *aSelection)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return FALSE;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->UnselectAll();
+  }
 
-  return accWrap->UnselectAll();
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->UnselectAll();
+  }
+
+  return FALSE;
 }
 
 static AtkObject*
 refSelectionCB(AtkSelection *aSelection, gint i)
 {
+  AtkObject* atkObj = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return nullptr;
+  if (accWrap && accWrap->IsSelect()) {
+    Accessible* selectedItem = accWrap->GetSelectedItem(i);
+    if (!selectedItem) {
+      return nullptr;
+    }
 
-  Accessible* selectedItem = accWrap->GetSelectedItem(i);
-  if (!selectedItem)
-    return nullptr;
+    atkObj = AccessibleWrap::GetAtkObject(selectedItem);
+  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    ProxyAccessible* selectedItem = proxy->GetSelectedItem(i);
+    if (selectedItem) {
+      atkObj = GetWrapperFor(selectedItem);
+    }
+  }
 
-  AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem);
-  if (atkObj)
+  if (atkObj) {
     g_object_ref(atkObj);
+  }
 
   return atkObj;
 }
 
 static gint
 getSelectionCountCB(AtkSelection *aSelection)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return -1;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->SelectedItemCount();
+  }
 
-  return accWrap->SelectedItemCount();
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->SelectedItemCount();
+  }
+
+  return -1;
 }
 
 static gboolean
 isChildSelectedCB(AtkSelection *aSelection, gint i)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return FALSE;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->IsItemSelected(i);
+  }
 
-  return accWrap->IsItemSelected(i);
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->IsItemSelected(i);
+  }
+
+  return FALSE;
 }
 
 static gboolean
 removeSelectionCB(AtkSelection *aSelection, gint i)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return FALSE;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->RemoveItemFromSelection(i);
+  }
 
-  return accWrap->RemoveItemFromSelection(i);
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->RemoveItemFromSelection(i);
+  }
+
+  return FALSE;
 }
 
 static gboolean
 selectAllSelectionCB(AtkSelection *aSelection)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-  if (!accWrap || !accWrap->IsSelect())
-    return FALSE;
+  if (accWrap && accWrap->IsSelect()) {
+    return accWrap->SelectAll();
+  }
 
-  return accWrap->SelectAll();
+  if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
+    return proxy->SelectAll();
+  }
+
+  return FALSE;
 }
 }
 
 void
 selectionInterfaceInitCB(AtkSelectionIface* aIface)
 {
   NS_ASSERTION(aIface, "Invalid aIface");
   if (MOZ_UNLIKELY(!aIface))
--- a/accessible/atk/nsMaiInterfaceValue.cpp
+++ b/accessible/atk/nsMaiInterfaceValue.cpp
@@ -3,98 +3,123 @@
 /* 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 "InterfaceInitFuncs.h"
 
 #include "AccessibleWrap.h"
 #include "nsMai.h"
-
+#include "ProxyAccessible.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 extern "C" {
 
 static void
 getCurrentValueCB(AtkValue *obj, GValue *value)
 {
+  ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
-  if (!accWrap)
-    return;
+  if (!accWrap) {
+    proxy = GetProxy(ATK_OBJECT(obj));
+    if (!proxy) {
+      return;
+    }
+  }
 
   memset (value,  0, sizeof (GValue));
-  double accValue = accWrap->CurValue();
+  double accValue = accWrap ? accWrap->CurValue() : proxy->CurValue();
   if (IsNaN(accValue))
     return;
 
   g_value_init (value, G_TYPE_DOUBLE);
   g_value_set_double (value, accValue);
 }
 
 static void
 getMaximumValueCB(AtkValue *obj, GValue *value)
 {
+  ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
-  if (!accWrap)
-    return;
+  if (!accWrap) {
+    proxy = GetProxy(ATK_OBJECT(obj));
+    if (!proxy) {
+      return;
+    }
+  }
 
   memset(value,  0, sizeof (GValue));
-  double accValue = accWrap->MaxValue();
+  double accValue = accWrap ? accWrap->MaxValue() : proxy->MaxValue();
   if (IsNaN(accValue))
     return;
 
   g_value_init(value, G_TYPE_DOUBLE);
   g_value_set_double(value, accValue);
 }
 
 static void
 getMinimumValueCB(AtkValue *obj, GValue *value)
 {
+  ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
-  if (!accWrap)
-    return;
+  if (!accWrap) {
+    proxy = GetProxy(ATK_OBJECT(obj));
+    if (!proxy) {
+      return;
+    }
+  }
 
   memset(value,  0, sizeof (GValue));
-  double accValue = accWrap->MinValue();
+  double accValue = accWrap ? accWrap->MinValue() : proxy->MinValue();
   if (IsNaN(accValue))
     return;
 
   g_value_init(value, G_TYPE_DOUBLE);
   g_value_set_double(value, accValue);
 }
 
 static void
 getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement)
 {
+  ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
-  if (!accWrap)
-    return;
+  if (!accWrap) {
+    proxy = GetProxy(ATK_OBJECT(obj));
+    if (!proxy) {
+      return;
+    }
+  }
 
   memset(minimumIncrement,  0, sizeof (GValue));
-  double accValue = accWrap->Step();
+  double accValue = accWrap ? accWrap->Step() : proxy->Step();
   if (IsNaN(accValue))
     accValue = 0; // zero if the minimum increment is undefined
 
   g_value_init(minimumIncrement, G_TYPE_DOUBLE);
   g_value_set_double(minimumIncrement, accValue);
 }
 
 static gboolean
 setCurrentValueCB(AtkValue *obj, const GValue *value)
 {
+  ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
-  if (!accWrap)
-    return FALSE;
+  if (!accWrap) {
+    proxy = GetProxy(ATK_OBJECT(obj));
+    if (!proxy) {
+      return FALSE;
+    }
+  }
 
   double accValue =g_value_get_double(value);
-  return accWrap->SetCurValue(accValue);
+  return accWrap ? accWrap->SetCurValue(accValue) : proxy->SetCurValue(accValue);
 }
 }
 
 void
 valueInterfaceInitCB(AtkValueIface* aIface)
 {
   NS_ASSERTION(aIface, "Invalid aIface");
   if (MOZ_UNLIKELY(!aIface))
--- a/accessible/base/AccCollector.h
+++ b/accessible/base/AccCollector.h
@@ -66,30 +66,30 @@ private:
   AccCollector(const AccCollector&);
   AccCollector& operator =(const AccCollector&);
 };
 
 /**
  * Collect embedded objects. Provide quick access to accessible by index and
  * vice versa.
  */
-class EmbeddedObjCollector MOZ_FINAL : public AccCollector
+class EmbeddedObjCollector final : public AccCollector
 {
 public:
   virtual ~EmbeddedObjCollector() { }
 
 public:
-  virtual int32_t GetIndexAt(Accessible* aAccessible) MOZ_OVERRIDE;
+  virtual int32_t GetIndexAt(Accessible* aAccessible) override;
 
 protected:
   // Make sure it's used by Accessible class only.
   explicit EmbeddedObjCollector(Accessible* aRoot) :
     AccCollector(aRoot, filters::GetEmbeddedObject) { }
 
-  virtual void AppendObject(Accessible* aAccessible) MOZ_OVERRIDE;
+  virtual void AppendObject(Accessible* aAccessible) override;
 
   friend class Accessible;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -149,17 +149,17 @@ public:
 
   AccStateChangeEvent(Accessible* aAccessible, uint64_t aState) :
     AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aAccessible,
              eAutoDetect, eCoalesceStateChange), mState(aState)
     { mIsEnabled = (mAccessible->State() & mState) != 0; }
 
   // AccEvent
   static const EventGroup kEventGroup = eStateChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eStateChangeEvent);
   }
 
   // AccStateChangeEvent
   uint64_t GetState() const { return mState; }
   bool IsStateEnabled() const { return mIsEnabled; }
 
@@ -178,17 +178,17 @@ class AccTextChangeEvent: public AccEven
 {
 public:
   AccTextChangeEvent(Accessible* aAccessible, int32_t aStart,
                      const nsAString& aModifiedText, bool aIsInserted,
                      EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
   // AccEvent
   static const EventGroup kEventGroup = eTextChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eTextChangeEvent);
   }
 
   // AccTextChangeEvent
   int32_t GetStartOffset() const { return mStart; }
   uint32_t GetLength() const { return mModifiedText.Length(); }
   bool IsTextInserted() const { return mIsInserted; }
@@ -218,17 +218,17 @@ public:
     // Don't coalesce these since they are coalesced by reorder event. Coalesce
     // contained text change events.
     mParent = mAccessible->Parent();
   }
   virtual ~AccMutationEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eMutationEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eMutationEvent);
   }
 
   // MutationEvent
   bool IsShow() const { return mEventType == nsIAccessibleEvent::EVENT_SHOW; }
   bool IsHide() const { return mEventType == nsIAccessibleEvent::EVENT_HIDE; }
 
@@ -248,17 +248,17 @@ protected:
  */
 class AccHideEvent: public AccMutationEvent
 {
 public:
   AccHideEvent(Accessible* aTarget, nsINode* aTargetNode);
 
   // Event
   static const EventGroup kEventGroup = eHideEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccMutationEvent::GetEventGroups() | (1U << eHideEvent);
   }
 
   // AccHideEvent
   Accessible* TargetParent() const { return mParent; }
   Accessible* TargetNextSibling() const { return mNextSibling; }
   Accessible* TargetPrevSibling() const { return mPrevSibling; }
@@ -276,17 +276,17 @@ protected:
  */
 class AccShowEvent: public AccMutationEvent
 {
 public:
   AccShowEvent(Accessible* aTarget, nsINode* aTargetNode);
 
   // Event
   static const EventGroup kEventGroup = eShowEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccMutationEvent::GetEventGroups() | (1U << eShowEvent);
   }
 };
 
 
 /**
  * Class for reorder accessible event. Takes care about
@@ -296,17 +296,17 @@ class AccReorderEvent : public AccEvent
 public:
   explicit AccReorderEvent(Accessible* aTarget) :
     AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget,
              eAutoDetect, eCoalesceReorder) { }
   virtual ~AccReorderEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eReorderEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eReorderEvent);
   }
 
   /**
    * Get connected with mutation event.
    */
   void AddSubMutationEvent(AccMutationEvent* aEvent)
@@ -349,17 +349,17 @@ public:
                     EIsFromUserInput aIsFromUserInput = eAutoDetect) :
     AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aAccessible,
              aIsFromUserInput),
     mCaretOffset(aCaretOffset) { }
   virtual ~AccCaretMoveEvent() { }
 
   // AccEvent
   static const EventGroup kEventGroup = eCaretMoveEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eCaretMoveEvent);
   }
 
   // AccCaretMoveEvent
   int32_t GetCaretOffset() const { return mCaretOffset; }
 
 private:
@@ -375,17 +375,17 @@ class AccTextSelChangeEvent : public Acc
 public:
   AccTextSelChangeEvent(HyperTextAccessible* aTarget,
                         dom::Selection* aSelection,
                         int32_t aReason);
   virtual ~AccTextSelChangeEvent();
 
   // AccEvent
   static const EventGroup kEventGroup = eTextSelChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eTextSelChangeEvent);
   }
 
   // AccTextSelChangeEvent
 
   /**
    * Return true if the text selection change wasn't caused by pure caret move.
@@ -414,17 +414,17 @@ public:
 
   AccSelChangeEvent(Accessible* aWidget, Accessible* aItem,
                     SelChangeType aSelChangeType);
 
   virtual ~AccSelChangeEvent() { }
 
   // AccEvent
   static const EventGroup kEventGroup = eSelectionChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eSelectionChangeEvent);
   }
 
   // AccSelChangeEvent
   Accessible* Widget() const { return mWidget; }
 
 private:
@@ -444,17 +444,17 @@ private:
 class AccTableChangeEvent : public AccEvent
 {
 public:
   AccTableChangeEvent(Accessible* aAccessible, uint32_t aEventType,
                       int32_t aRowOrColIndex, int32_t aNumRowsOrCols);
 
   // AccEvent
   static const EventGroup kEventGroup = eTableChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eTableChangeEvent);
   }
 
   // AccTableChangeEvent
   uint32_t GetIndex() const { return mRowOrColIndex; }
   uint32_t GetCount() const { return mNumRowsOrCols; }
 
@@ -474,17 +474,17 @@ public:
                    int32_t aOldStart, int32_t aOldEnd,
                    int16_t aReason,
                    EIsFromUserInput aIsFromUserInput = eFromUserInput);
 
   virtual ~AccVCChangeEvent() { }
 
   // AccEvent
   static const EventGroup kEventGroup = eVirtualCursorChangeEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eVirtualCursorChangeEvent);
   }
 
   // AccTableChangeEvent
   Accessible* OldAccessible() const { return mOldAccessible; }
   int32_t OldStartOffset() const { return mOldStart; }
   int32_t OldEndOffset() const { return mOldEnd; }
@@ -504,17 +504,17 @@ class AccObjectAttrChangedEvent: public 
 {
 public:
   AccObjectAttrChangedEvent(Accessible* aAccessible, nsIAtom* aAttribute) :
     AccEvent(::nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED, aAccessible),
     mAttribute(aAttribute) { }
 
   // AccEvent
   static const EventGroup kEventGroup = eObjectAttrChangedEvent;
-  virtual unsigned int GetEventGroups() const MOZ_OVERRIDE
+  virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eObjectAttrChangedEvent);
   }
 
   // AccObjectAttrChangedEvent
   nsIAtom* GetAttribute() const { return mAttribute; }
 
 private:
--- a/accessible/base/AccIterator.h
+++ b/accessible/base/AccIterator.h
@@ -38,17 +38,17 @@ class AccIterator : public AccIterable
 public:
   AccIterator(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc);
   virtual ~AccIterator();
 
   /**
    * Return next accessible complying with filter function. Return the first
    * accessible for the first time.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   AccIterator();
   AccIterator(const AccIterator&);
   AccIterator& operator =(const AccIterator&);
 
   struct IteratorState
   {
@@ -84,17 +84,17 @@ public:
   RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent,
                      nsIAtom* aRelAttr);
 
   virtual ~RelatedAccIterator() { }
 
   /**
    * Return next related accessible for the given dependent accessible.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   RelatedAccIterator();
   RelatedAccIterator(const RelatedAccIterator&);
   RelatedAccIterator& operator = (const RelatedAccIterator&);
 
   DocAccessible* mDocument;
   nsIAtom* mRelAttr;
@@ -118,17 +118,17 @@ public:
   HTMLLabelIterator(DocAccessible* aDocument, const Accessible* aAccessible,
                     LabelFilter aFilter = eAllLabels);
 
   virtual ~HTMLLabelIterator() { }
 
   /**
    * Return next label accessible associated with the given element.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   HTMLLabelIterator();
   HTMLLabelIterator(const HTMLLabelIterator&);
   HTMLLabelIterator& operator = (const HTMLLabelIterator&);
 
   RelatedAccIterator mRelIter;
   // XXX: replace it on weak reference (bug 678429), it's safe to use raw
@@ -145,17 +145,17 @@ class HTMLOutputIterator : public AccIte
 {
 public:
   HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement);
   virtual ~HTMLOutputIterator() { }
 
   /**
    * Return next output accessible associated with the given element.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   HTMLOutputIterator();
   HTMLOutputIterator(const HTMLOutputIterator&);
   HTMLOutputIterator& operator = (const HTMLOutputIterator&);
 
   RelatedAccIterator mRelIter;
 };
@@ -168,17 +168,17 @@ class XULLabelIterator : public AccItera
 {
 public:
   XULLabelIterator(DocAccessible* aDocument, nsIContent* aElement);
   virtual ~XULLabelIterator() { }
 
   /**
    * Return next label accessible associated with the given element.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   XULLabelIterator();
   XULLabelIterator(const XULLabelIterator&);
   XULLabelIterator& operator = (const XULLabelIterator&);
 
   RelatedAccIterator mRelIter;
 };
@@ -191,17 +191,17 @@ class XULDescriptionIterator : public Ac
 {
 public:
   XULDescriptionIterator(DocAccessible* aDocument, nsIContent* aElement);
   virtual ~XULDescriptionIterator() { }
 
   /**
    * Return next description accessible associated with the given element.
    */
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   XULDescriptionIterator();
   XULDescriptionIterator(const XULDescriptionIterator&);
   XULDescriptionIterator& operator = (const XULDescriptionIterator&);
 
   RelatedAccIterator mRelIter;
 };
@@ -229,60 +229,60 @@ public:
   nsIContent* NextElem();
 
   /**
    * Return the element with the given ID.
    */
   nsIContent* GetElem(const nsDependentSubstring& aID);
 
   // AccIterable
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   IDRefsIterator();
   IDRefsIterator(const IDRefsIterator&);
   IDRefsIterator operator = (const IDRefsIterator&);
 
   nsString mIDs;
   nsIContent* mContent;
   DocAccessible* mDoc;
   nsAString::index_type mCurrIdx;
 };
 
 
 /**
  * Iterates over related accessible referred by aria-owns.
  */
-class ARIAOwnedByIterator MOZ_FINAL : public RelatedAccIterator
+class ARIAOwnedByIterator final : public RelatedAccIterator
 {
 public:
   explicit ARIAOwnedByIterator(const Accessible* aDependent);
   virtual ~ARIAOwnedByIterator() { }
 
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   ARIAOwnedByIterator() = delete;
   ARIAOwnedByIterator(const ARIAOwnedByIterator&) = delete;
   ARIAOwnedByIterator& operator = (const ARIAOwnedByIterator&) = delete;
 
   const Accessible* mDependent;
 };
 
 
 /**
  * Iterates over related accessible referred by aria-owns.
  */
-class ARIAOwnsIterator MOZ_FINAL : public AccIterable
+class ARIAOwnsIterator final : public AccIterable
 {
 public:
   explicit ARIAOwnsIterator(const Accessible* aOwner);
   virtual ~ARIAOwnsIterator() { }
 
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   ARIAOwnsIterator() = delete;
   ARIAOwnsIterator(const ARIAOwnsIterator&) = delete;
   ARIAOwnsIterator& operator = (const ARIAOwnsIterator&) = delete;
 
   IDRefsIterator mIter;
   const Accessible* mOwner;
@@ -294,17 +294,17 @@ private:
  * to Next().
  */
 class SingleAccIterator : public AccIterable
 {
 public:
   explicit SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { }
   virtual ~SingleAccIterator() { }
 
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   SingleAccIterator();
   SingleAccIterator(const SingleAccIterator&);
   SingleAccIterator& operator = (const SingleAccIterator&);
 
   nsRefPtr<Accessible> mAcc;
 };
@@ -315,17 +315,17 @@ private:
  */
 class ItemIterator : public AccIterable
 {
 public:
   explicit ItemIterator(Accessible* aItemContainer) :
     mContainer(aItemContainer), mAnchor(nullptr) { }
   virtual ~ItemIterator() { }
 
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   ItemIterator() = delete;
   ItemIterator(const ItemIterator&) = delete;
   ItemIterator& operator = (const ItemIterator&) = delete;
 
   Accessible* mContainer;
   Accessible* mAnchor;
@@ -337,17 +337,17 @@ private:
  */
 class XULTreeItemIterator : public AccIterable
 {
 public:
   XULTreeItemIterator(XULTreeAccessible* aXULTree, nsITreeView* aTreeView,
                       int32_t aRowIdx);
   virtual ~XULTreeItemIterator() { }
 
-  virtual Accessible* Next() MOZ_OVERRIDE;
+  virtual Accessible* Next() override;
 
 private:
   XULTreeItemIterator() = delete;
   XULTreeItemIterator(const XULTreeItemIterator&) = delete;
   XULTreeItemIterator& operator = (const XULTreeItemIterator&) = delete;
 
   XULTreeAccessible* mXULTree;
   nsITreeView* mTreeView;
--- a/accessible/base/MarkupMap.h
+++ b/accessible/base/MarkupMap.h
@@ -200,32 +200,32 @@ MARKUPMAP(munderover_,
           AttrFromDOM(accentunder_, accentunder_),
           AttrFromDOM(align, align))
 
 MARKUPMAP(mmultiscripts_,
           New_HyperText,
           roles::MATHML_MULTISCRIPTS)
 
 MARKUPMAP(mtable_,
-          New_HyperText,
+          New_HTMLTableAccessible,
           roles::MATHML_TABLE,
           AttrFromDOM(align, align),
           AttrFromDOM(columnlines_, columnlines_),
           AttrFromDOM(rowlines_, rowlines_))
 
 MARKUPMAP(mlabeledtr_,
-          New_HyperText,
+          New_HTMLTableRowAccessible,
           roles::MATHML_LABELED_ROW)
 
 MARKUPMAP(mtr_,
-          New_HyperText,
+          New_HTMLTableRowAccessible,
           roles::MATHML_TABLE_ROW)
 
 MARKUPMAP(mtd_,
-          New_HyperText,
+          New_HTMLTableCellAccessible,
           roles::MATHML_CELL)
 
 MARKUPMAP(maction_,
           New_HyperText,
           roles::MATHML_ACTION,
           AttrFromDOM(actiontype_, actiontype_),
           AttrFromDOM(selection_, selection_))
 
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -275,22 +275,29 @@ NotificationController::WillRefresh(mozi
   mObservingState = eRefreshProcessing;
 
   ProcessEventQueue();
 
   if (IPCAccessibilityActive()) {
     size_t newDocCount = newChildDocs.Length();
     for (size_t i = 0; i < newDocCount; i++) {
       DocAccessible* childDoc = newChildDocs[i];
-      DocAccessibleChild* ipcDoc = new DocAccessibleChild(childDoc);
+      Accessible* parent = childDoc->Parent();
+      DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc();
+      uint64_t id = reinterpret_cast<uintptr_t>(parent->UniqueID());
+      MOZ_ASSERT(id);
+      DocAccessibleChild* ipcDoc = childDoc->IPCDoc();
+      if (ipcDoc) {
+        parentIPCDoc->SendBindChildDoc(ipcDoc, id);
+        continue;
+      }
+
+      ipcDoc = new DocAccessibleChild(childDoc);
       childDoc->SetIPCDoc(ipcDoc);
       auto contentChild = dom::ContentChild::GetSingleton();
-      DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc();
-      uint64_t id = reinterpret_cast<uintptr_t>(childDoc->Parent()->UniqueID());
-      MOZ_ASSERT(id);
       contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
     }
   }
 
   mObservingState = eRefreshObserving;
   if (!mDocument)
     return;
 
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -59,17 +59,17 @@ class TNotification : public Notificatio
 {
 public:
   typedef void (Class::*Callback)(Arg*);
 
   TNotification(Class* aInstance, Callback aCallback, Arg* aArg) :
     mInstance(aInstance), mCallback(aCallback), mArg(aArg) { }
   virtual ~TNotification() { mInstance = nullptr; }
 
-  virtual void Process() MOZ_OVERRIDE
+  virtual void Process() override
   {
     (mInstance->*mCallback)(mArg);
 
     mInstance = nullptr;
     mCallback = nullptr;
     mArg = nullptr;
   }
 
@@ -80,24 +80,24 @@ private:
   Class* mInstance;
   Callback mCallback;
   nsRefPtr<Arg> mArg;
 };
 
 /**
  * Used to process notifications from core for the document accessible.
  */
-class NotificationController MOZ_FINAL : public EventQueue,
+class NotificationController final : public EventQueue,
                                          public nsARefreshObserver
 {
 public:
   NotificationController(DocAccessible* aDocument, nsIPresShell* aPresShell);
 
-  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;
-  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;
+  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) override;
+  NS_IMETHOD_(MozExternalRefCountType) Release(void) override;
 
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(NotificationController)
 
   /**
    * Shutdown the notification controller.
    */
   void Shutdown();
 
@@ -198,17 +198,17 @@ protected:
    */
   bool IsUpdatePending();
 
 private:
   NotificationController(const NotificationController&);
   NotificationController& operator = (const NotificationController&);
 
   // nsARefreshObserver
-  virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE;
+  virtual void WillRefresh(mozilla::TimeStamp aTime) override;
 
 private:
   /**
    * Indicates whether we're waiting on an event queue processing from our
    * notification controller to flush events.
    */
   enum eObservingState {
     eNotObservingRefresh,
--- a/accessible/base/SelectionManager.cpp
+++ b/accessible/base/SelectionManager.cpp
@@ -19,17 +19,17 @@
 #include "nsIPresShell.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 using mozilla::dom::Selection;
 
-struct mozilla::a11y::SelData MOZ_FINAL
+struct mozilla::a11y::SelData final
 {
   SelData(Selection* aSel, int32_t aReason) :
     mSel(aSel), mReason(aReason) {}
 
   nsRefPtr<Selection> mSel;
   int16_t mReason;
 
   NS_INLINE_DECL_REFCOUNTING(SelData)
--- a/accessible/base/TextAttrs.h
+++ b/accessible/base/TextAttrs.h
@@ -125,17 +125,17 @@ protected:
   template<class T>
   class TTextAttr : public TextAttr
   {
   public:
     explicit TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {}
 
     // TextAttr
     virtual void Expose(nsIPersistentProperties* aAttributes,
-                        bool aIncludeDefAttrValue) MOZ_OVERRIDE
+                        bool aIncludeDefAttrValue) override
     {
       if (mGetRootValue) {
         if (mIsRootDefined)
           ExposeValue(aAttributes, mRootNativeValue);
         return;
       }
 
       if (mIsDefined) {
@@ -143,17 +143,17 @@ protected:
           ExposeValue(aAttributes, mNativeValue);
         return;
       }
 
       if (aIncludeDefAttrValue && mIsRootDefined)
         ExposeValue(aAttributes, mRootNativeValue);
     }
 
-    virtual bool Equal(Accessible* aAccessible) MOZ_OVERRIDE
+    virtual bool Equal(Accessible* aAccessible) override
     {
       T nativeValue;
       bool isDefined = GetValueFor(aAccessible, &nativeValue);
 
       if (!mIsDefined && !isDefined)
         return true;
 
       if (mIsDefined && isDefined)
@@ -198,19 +198,19 @@ protected:
   public:
     LangTextAttr(HyperTextAccessible* aRoot, nsIContent* aRootElm,
                  nsIContent* aElm);
     virtual ~LangTextAttr();
 
   protected:
 
     // TextAttr
-    virtual bool GetValueFor(Accessible* aAccessible, nsString* aValue) MOZ_OVERRIDE;
+    virtual bool GetValueFor(Accessible* aAccessible, nsString* aValue) override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nsString& aValue) MOZ_OVERRIDE;
+                             const nsString& aValue) override;
 
   private:
     nsCOMPtr<nsIContent> mRootContent;
   };
 
 
   /**
    * Class is used for the 'invalid' text attribute. Note, it calculated
@@ -229,19 +229,19 @@ protected:
     enum {
       eFalse,
       eGrammar,
       eSpelling,
       eTrue
     };
 
     // TextAttr
-    virtual bool GetValueFor(Accessible* aAccessible, uint32_t* aValue) MOZ_OVERRIDE;
+    virtual bool GetValueFor(Accessible* aAccessible, uint32_t* aValue) override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const uint32_t& aValue) MOZ_OVERRIDE;
+                             const uint32_t& aValue) override;
 
   private:
     bool GetValue(nsIContent* aElm, uint32_t* aValue);
     nsIContent* mRootElm;
   };
 
 
   /**
@@ -252,19 +252,19 @@ protected:
   public:
     BGColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~BGColorTextAttr() { }
 
   protected:
 
     // TextAttr
     virtual bool GetValueFor(Accessible* aAccessible, nscolor* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nscolor& aValue) MOZ_OVERRIDE;
+                             const nscolor& aValue) override;
 
   private:
     bool GetColor(nsIFrame* aFrame, nscolor* aColor);
     nsIFrame* mRootFrame;
   };
 
 
   /**
@@ -275,38 +275,38 @@ protected:
   public:
     ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~ColorTextAttr() { }
 
   protected:
 
     // TTextAttr
     virtual bool GetValueFor(Accessible* aAccessible, nscolor* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nscolor& aValue) MOZ_OVERRIDE;
+                             const nscolor& aValue) override;
   };
 
 
   /**
    * Class is used for the work with "font-family" text attribute.
    */
   class FontFamilyTextAttr : public TTextAttr<nsString>
   {
   public:
     FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~FontFamilyTextAttr() { }
 
   protected:
 
     // TTextAttr
     virtual bool GetValueFor(Accessible* aAccessible, nsString* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nsString& aValue) MOZ_OVERRIDE;
+                             const nsString& aValue) override;
 
   private:
 
     bool GetFontFamily(nsIFrame* aFrame, nsString& aFamily);
   };
 
 
   /**
@@ -317,19 +317,19 @@ protected:
   public:
     FontSizeTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~FontSizeTextAttr() { }
 
   protected:
 
     // TTextAttr
     virtual bool GetValueFor(Accessible* aAccessible, nscoord* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nscoord& aValue) MOZ_OVERRIDE;
+                             const nscoord& aValue) override;
 
   private:
     nsDeviceContext* mDC;
   };
 
 
   /**
    * Class is used for the work with "font-style" text attribute.
@@ -339,38 +339,38 @@ protected:
   public:
     FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~FontStyleTextAttr() { }
 
   protected:
 
     // TTextAttr
     virtual bool GetValueFor(Accessible* aContent, nscoord* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const nscoord& aValue) MOZ_OVERRIDE;
+                             const nscoord& aValue) override;
   };
 
 
   /**
    * Class is used for the work with "font-weight" text attribute.
    */
   class FontWeightTextAttr : public TTextAttr<int32_t>
   {
   public:
     FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~FontWeightTextAttr() { }
 
   protected:
 
     // TTextAttr
     virtual bool GetValueFor(Accessible* aAccessible, int32_t* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const int32_t& aValue) MOZ_OVERRIDE;
+                             const int32_t& aValue) override;
 
   private:
     int32_t GetFontWeight(nsIFrame* aFrame);
   };
 
   /**
    * Class is used for the work with 'auto-generated' text attribute.
    */
@@ -379,19 +379,19 @@ protected:
   public:
     AutoGeneratedTextAttr(HyperTextAccessible* aHyperTextAcc,
                           Accessible* aAccessible);
     virtual ~AutoGeneratedTextAttr() { }
 
   protected:
     // TextAttr
     virtual bool GetValueFor(Accessible* aAccessible, bool* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const bool& aValue) MOZ_OVERRIDE;
+                             const bool& aValue) override;
   };
 
 
   /**
    * TextDecorTextAttr class is used for the work with
    * "text-line-through-style", "text-line-through-color",
    * "text-underline-style" and "text-underline-color" text attributes.
    */
@@ -431,19 +431,19 @@ protected:
   public:
     TextDecorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~TextDecorTextAttr() { }
 
   protected:
 
     // TextAttr
     virtual bool GetValueFor(Accessible* aAccessible, TextDecorValue* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const TextDecorValue& aValue) MOZ_OVERRIDE;
+                             const TextDecorValue& aValue) override;
   };
 
   /**
    * Class is used for the work with "text-position" text attribute.
    */
 
   enum TextPosValue {
     eTextPosNone = 0,
@@ -457,19 +457,19 @@ protected:
   public:
     TextPosTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~TextPosTextAttr() { }
 
   protected:
 
     // TextAttr
     virtual bool GetValueFor(Accessible* aAccessible, TextPosValue* aValue)
-      MOZ_OVERRIDE;
+      override;
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const TextPosValue& aValue) MOZ_OVERRIDE;
+                             const TextPosValue& aValue) override;
 
   private:
     TextPosValue GetTextPosValue(nsIFrame* aFrame) const;
   };
 
 }; // TextAttrMgr
 
 } // namespace a11y
--- a/accessible/base/TextRange.h
+++ b/accessible/base/TextRange.h
@@ -19,17 +19,17 @@ namespace mozilla {
 namespace a11y {
 
 class Accessible;
 class HyperTextAccessible;
 
 /**
  * A text point (hyper text + offset), represents a boundary of text range.
  */
-struct TextPoint MOZ_FINAL
+struct TextPoint final
 {
   TextPoint(HyperTextAccessible* aContainer, int32_t aOffset) :
     mContainer(aContainer), mOffset(aOffset) { }
   TextPoint(const TextPoint& aPoint) :
     mContainer(aPoint.mContainer), mOffset(aPoint.mOffset) { }
 
   HyperTextAccessible* mContainer;
   int32_t mOffset;
@@ -37,17 +37,17 @@ struct TextPoint MOZ_FINAL
   bool operator ==(const TextPoint& aPoint) const
     { return mContainer == aPoint.mContainer && mOffset == aPoint.mOffset; }
   bool operator <(const TextPoint& aPoint) const;
 };
 
 /**
  * Represents a text range within the text control or document.
  */
-class TextRange MOZ_FINAL
+class TextRange final
 {
 public:
   TextRange(HyperTextAccessible* aRoot,
             HyperTextAccessible* aStartContainer, int32_t aStartOffset,
             HyperTextAccessible* aEndContainer, int32_t aEndOffset);
   TextRange() {}
   TextRange(TextRange&& aRange) :
     mRoot(mozilla::Move(aRange.mRoot)),
--- a/accessible/base/TreeWalker.h
+++ b/accessible/base/TreeWalker.h
@@ -17,17 +17,17 @@ namespace mozilla {
 namespace a11y {
 
 class Accessible;
 class DocAccessible;
 
 /**
  * This class is used to walk the DOM tree to create accessible tree.
  */
-class TreeWalker MOZ_FINAL
+class TreeWalker final
 {
 public:
   enum {
     // used to walk the existing tree of the given node
     eWalkCache = 1,
     // used to walk the context tree starting from given node
     eWalkContextTree = 2 | eWalkCache
   };
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -131,89 +131,101 @@ MustBeAccessible(nsIContent* aContent, D
     return aDocument->IsDependentID(id);
 
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible constructors
 
-Accessible*
+static Accessible*
 New_HTMLLink(nsIContent* aContent, Accessible* aContext)
 {
   // Only some roles truly enjoy life as HTMLLinkAccessibles, for details
   // see closed bug 494807.
   nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent);
   if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
       roleMapEntry->role != roles::LINK) {
     return new HyperTextAccessibleWrap(aContent, aContext->Document());
   }
 
   return new HTMLLinkAccessible(aContent, aContext->Document());
 }
 
-Accessible* New_HyperText(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HyperText(nsIContent* aContent, Accessible* aContext)
   { return new HyperTextAccessibleWrap(aContent, aContext->Document()); }
 
-Accessible* New_HTMLFigcaption(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLFigcaption(nsIContent* aContent, Accessible* aContext)
   { return new HTMLFigcaptionAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLFigure(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLFigure(nsIContent* aContent, Accessible* aContext)
   { return new HTMLFigureAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLLegend(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLLegend(nsIContent* aContent, Accessible* aContext)
   { return new HTMLLegendAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLOption(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLOption(nsIContent* aContent, Accessible* aContext)
   { return new HTMLSelectOptionAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLOptgroup(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLOptgroup(nsIContent* aContent, Accessible* aContext)
   { return new HTMLSelectOptGroupAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLList(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLList(nsIContent* aContent, Accessible* aContext)
   { return new HTMLListAccessible(aContent, aContext->Document()); }
 
-Accessible*
+static Accessible*
 New_HTMLListitem(nsIContent* aContent, Accessible* aContext)
 {
   // If list item is a child of accessible list then create an accessible for
   // it unconditionally by tag name. nsBlockFrame creates the list item
   // accessible for other elements styled as list items.
   if (aContext->IsList() && aContext->GetContent() == aContent->GetParent())
     return new HTMLLIAccessible(aContent, aContext->Document());
 
   return nullptr;
 }
 
-Accessible*
+static Accessible*
 New_HTMLDefinition(nsIContent* aContent, Accessible* aContext)
 {
   if (aContext->IsList())
     return new HyperTextAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
-Accessible* New_HTMLLabel(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLLabel(nsIContent* aContent, Accessible* aContext)
   { return new HTMLLabelAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
   { return new HTMLOutputAccessible(aContent, aContext->Document()); }
 
-Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext)
+static Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext)
   { return new HTMLProgressMeterAccessible(aContent, aContext->Document()); }
 
-Accessible*
+static Accessible*
+New_HTMLTableAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableAccessible(aContent, aContext->Document()); }
+
+static Accessible*
+New_HTMLTableRowAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableRowAccessible(aContent, aContext->Document()); }
+
+static Accessible*
+New_HTMLTableCellAccessible(nsIContent* aContent, Accessible* aContext)
+  { return new HTMLTableCellAccessible(aContent, aContext->Document()); }
+
+static Accessible*
 New_HTMLTableHeaderCell(nsIContent* aContent, Accessible* aContext)
 {
   if (aContext->IsTableRow() && aContext->GetContent() == aContent->GetParent())
     return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
-Accessible*
+static Accessible*
 New_HTMLTableHeaderCellIfScope(nsIContent* aContent, Accessible* aContext)
 {
   if (aContext->IsTableRow() && aContext->GetContent() == aContent->GetParent() &&
       aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope))
     return new HTMLTableHeaderCellAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
@@ -328,26 +340,26 @@ nsAccessibilityService::GetRootDocumentA
   }
   return nullptr;
 }
 
 #ifdef XP_WIN
 static StaticAutoPtr<nsTArray<nsCOMPtr<nsIContent> > > sPendingPlugins;
 static StaticAutoPtr<nsTArray<nsCOMPtr<nsITimer> > > sPluginTimers;
 
-class PluginTimerCallBack MOZ_FINAL : public nsITimerCallback
+class PluginTimerCallBack final : public nsITimerCallback
 {
   ~PluginTimerCallBack() {}
 
 public:
   PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}
 
   NS_DECL_ISUPPORTS
 
-  NS_IMETHODIMP Notify(nsITimer* aTimer) MOZ_FINAL
+  NS_IMETHODIMP Notify(nsITimer* aTimer) final
   {
     if (!mContent->IsInDoc())
       return NS_OK;
 
     nsIPresShell* ps = mContent->OwnerDoc()->GetShell();
     if (ps) {
       DocAccessible* doc = ps->GetDocAccessible();
       if (doc) {
@@ -516,18 +528,19 @@ nsAccessibilityService::ContentRemoved(n
   DocAccessible* document = GetDocAccessible(aPresShell);
   if (document) {
     // Flatten hierarchy may be broken at this point so we cannot get a true
     // container by traversing up the DOM tree. Find a parent of first accessible
     // from the subtree of the given DOM node, that'll be a container. If no
     // accessibles in subtree then we don't care about the change.
     Accessible* child = document->GetAccessible(aChildNode);
     if (!child) {
-      a11y::TreeWalker walker(document->GetContainerAccessible(aChildNode),
-                              aChildNode, a11y::TreeWalker::eWalkCache);
+      Accessible* container = document->GetContainerAccessible(aChildNode);
+      a11y::TreeWalker walker(container ? container : document, aChildNode,
+                              a11y::TreeWalker::eWalkCache);
       child = walker.NextChild();
     }
 
     if (child) {
       document->ContentRemoved(child->Parent(), aChildNode);
 #ifdef A11Y_LOG
       if (logging::IsEnabled(logging::eTree))
         logging::AccessibleNNode("real container", child->Parent());
--- a/accessible/base/nsAccessibilityService.h
+++ b/accessible/base/nsAccessibilityService.h
@@ -58,17 +58,17 @@ struct MarkupMapInfo {
   New_Accessible* new_func;
   a11y::role role;
   MarkupAttrInfo attrs[4];
 };
 
 } // namespace a11y
 } // namespace mozilla
 
-class nsAccessibilityService MOZ_FINAL : public mozilla::a11y::DocManager,
+class nsAccessibilityService final : public mozilla::a11y::DocManager,
                                          public mozilla::a11y::FocusManager,
                                          public mozilla::a11y::SelectionManager,
                                          public nsIAccessibilityService,
                                          public nsIObserver
 {
 public:
   typedef mozilla::a11y::Accessible Accessible;
   typedef mozilla::a11y::DocAccessible DocAccessible;
@@ -78,29 +78,29 @@ protected:
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIACCESSIBLERETRIEVAL
   NS_DECL_NSIOBSERVER
 
   // nsIAccessibilityService
   virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
-                                                bool aCanCreate) MOZ_OVERRIDE;
+                                                bool aCanCreate) override;
   already_AddRefed<Accessible>
     CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
                            Accessible* aContext);
 
   /**
    * Adds/remove ATK root accessible for gtk+ native window to/from children
    * of the application accessible.
    */
-  virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible) MOZ_OVERRIDE;
-  virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) MOZ_OVERRIDE;
+  virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible) override;
+  virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) override;
 
-  virtual bool HasAccessible(nsIDOMNode* aDOMNode) MOZ_OVERRIDE;
+  virtual bool HasAccessible(nsIDOMNode* aDOMNode) override;
 
   // nsAccesibilityService
   /**
    * Notification used to update the accessible tree when deck panel is
    * switched.
    */
   void DeckPanelSwitched(nsIPresShell* aPresShell, nsIContent* aDeckNode,
                          nsIFrame* aPrevBoxFrame, nsIFrame* aCurrentBoxFrame);
@@ -159,17 +159,17 @@ public:
    */
   virtual void PresShellActivated(nsIPresShell* aPresShell);
 
   /**
    * Recreate an accessible for the given content node in the presshell.
    */
   void RecreateAccessible(nsIPresShell* aPresShell, nsIContent* aContent);
 
-  virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) MOZ_OVERRIDE;
+  virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) override;
 
   // nsAccessibiltiyService
 
   /**
    * Return true if accessibility service has been shutdown.
    */
   static bool IsShutdown() { return gIsShutdown; }
 
@@ -274,18 +274,16 @@ GetAccService()
 }
 
 /**
  * Return true if we're in a content process and not B2G.
  */
 inline bool
 IPCAccessibilityActive()
 {
-	// XXX reenable when crashes are fixed
-	return false;
 #ifdef MOZ_B2G
   return false;
 #else
   return XRE_GetProcessType() == GeckoProcessType_Content &&
     mozilla::Preferences::GetBool("accessibility.ipc_architecture.enabled", true);
 #endif
 }
 
--- a/accessible/base/nsAccessiblePivot.h
+++ b/accessible/base/nsAccessiblePivot.h
@@ -15,17 +15,17 @@
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 class RuleCache;
 
 /**
  * Class represents an accessible pivot.
  */
-class nsAccessiblePivot MOZ_FINAL : public nsIAccessiblePivot
+class nsAccessiblePivot final : public nsIAccessiblePivot
 {
 public:
   typedef mozilla::a11y::Accessible Accessible;
 
   explicit nsAccessiblePivot(Accessible* aRoot);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot)
--- a/accessible/generic/ARIAGridAccessible.h
+++ b/accessible/generic/ARIAGridAccessible.h
@@ -20,37 +20,37 @@ class ARIAGridAccessible : public Access
                            public TableAccessible
 {
 public:
   ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual TableAccessible* AsTable() MOZ_OVERRIDE { return this; }
+  virtual TableAccessible* AsTable() override { return this; }
 
   // TableAccessible
-  virtual uint32_t ColCount() MOZ_OVERRIDE;
-  virtual uint32_t RowCount() MOZ_OVERRIDE;
-  virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) MOZ_OVERRIDE;
-  virtual bool IsColSelected(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual bool IsRowSelected(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual uint32_t SelectedCellCount() MOZ_OVERRIDE;
-  virtual uint32_t SelectedColCount() MOZ_OVERRIDE;
-  virtual uint32_t SelectedRowCount() MOZ_OVERRIDE;
-  virtual void SelectedCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
-  virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) MOZ_OVERRIDE;
-  virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) MOZ_OVERRIDE;
-  virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) MOZ_OVERRIDE;
-  virtual void SelectCol(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual void SelectRow(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual void UnselectCol(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual void UnselectRow(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual Accessible* AsAccessible() MOZ_OVERRIDE { return this; }
+  virtual uint32_t ColCount() override;
+  virtual uint32_t RowCount() override;
+  virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
+  virtual bool IsColSelected(uint32_t aColIdx) override;
+  virtual bool IsRowSelected(uint32_t aRowIdx) override;
+  virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) override;
+  virtual uint32_t SelectedCellCount() override;
+  virtual uint32_t SelectedColCount() override;
+  virtual uint32_t SelectedRowCount() override;
+  virtual void SelectedCells(nsTArray<Accessible*>* aCells) override;
+  virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) override;
+  virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) override;
+  virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
+  virtual void SelectCol(uint32_t aColIdx) override;
+  virtual void SelectRow(uint32_t aRowIdx) override;
+  virtual void UnselectCol(uint32_t aColIdx) override;
+  virtual void UnselectRow(uint32_t aRowIdx) override;
+  virtual Accessible* AsAccessible() override { return this; }
 
 protected:
   virtual ~ARIAGridAccessible() {}
 
   /**
    * Return row accessible at the given row index.
    */
   Accessible* GetRowAt(int32_t aRow);
@@ -80,19 +80,19 @@ class ARIAGridCellAccessible : public Hy
                                public TableCellAccessible
 {
 public:
   ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual TableCellAccessible* AsTableCell() MOZ_OVERRIDE { return this; }
-  virtual void ApplyARIAState(uint64_t* aState) const MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
+  virtual TableCellAccessible* AsTableCell() override { return this; }
+  virtual void ApplyARIAState(uint64_t* aState) const override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
 protected:
   virtual ~ARIAGridCellAccessible() {}
 
   /**
    * Return a containing row.
    */
   Accessible* Row() const
@@ -107,18 +107,18 @@ protected:
   Accessible* TableFor(Accessible* aRow) const;
 
   /**
    * Return index of the given row.
    */
   int32_t RowIndexFor(Accessible* aRow) const;
 
   // TableCellAccessible
-  virtual TableAccessible* Table() const MOZ_OVERRIDE;
-  virtual uint32_t ColIdx() const MOZ_OVERRIDE;
-  virtual uint32_t RowIdx() const MOZ_OVERRIDE;
-  virtual bool Selected() MOZ_OVERRIDE;
+  virtual TableAccessible* Table() const override;
+  virtual uint32_t ColIdx() const override;
+  virtual uint32_t RowIdx() const override;
+  virtual bool Selected() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1718,23 +1718,23 @@ Accessible::RelationByType(RelationType 
 void
 Accessible::GetNativeInterface(void** aNativeAccessible)
 {
 }
 
 void
 Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
 {
-  class Runnable MOZ_FINAL : public nsRunnable
+  class Runnable final : public nsRunnable
   {
   public:
     Runnable(Accessible* aAcc, nsIContent* aContent, uint32_t aIdx) :
       mAcc(aAcc), mContent(aContent), mIdx(aIdx) { }
 
-    NS_IMETHOD Run() MOZ_OVERRIDE
+    NS_IMETHOD Run() override
     {
       if (mAcc)
         mAcc->DispatchClickEvent(mContent, mIdx);
 
       return NS_OK;
     }
 
     void Revoke()
--- a/accessible/generic/ApplicationAccessible.h
+++ b/accessible/generic/ApplicationAccessible.h
@@ -30,37 +30,37 @@ class ApplicationAccessible : public Acc
 {
 public:
 
   ApplicationAccessible();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual GroupPos GroupPosition() MOZ_OVERRIDE;
-  virtual ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
-  virtual void ApplyARIAState(uint64_t* aState) const MOZ_OVERRIDE;
-  virtual void Description(nsString& aDescription) MOZ_OVERRIDE;
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t State() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual nsIntRect Bounds() const override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
+  virtual GroupPos GroupPosition() override;
+  virtual ENameValueFlag Name(nsString& aName) override;
+  virtual void ApplyARIAState(uint64_t* aState) const override;
+  virtual void Description(nsString& aDescription) override;
+  virtual void Value(nsString& aValue) override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t State() override;
+  virtual uint64_t NativeState() override;
+  virtual Relation RelationByType(RelationType aType) override;
 
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
-                                   EWhichChildAtPoint aWhichChild) MOZ_OVERRIDE;
-  virtual Accessible* FocusedChild() MOZ_OVERRIDE;
+                                   EWhichChildAtPoint aWhichChild) override;
+  virtual Accessible* FocusedChild() override;
 
-  virtual void InvalidateChildren() MOZ_OVERRIDE;
+  virtual void InvalidateChildren() override;
 
   // ActionAccessible
-  virtual KeyBinding AccessKey() const MOZ_OVERRIDE;
+  virtual KeyBinding AccessKey() const override;
 
   // ApplicationAccessible
   void AppName(nsAString& aName) const
   {
     nsAutoCString cname;
     mAppInfo->GetName(cname);
     AppendUTF8toUTF16(cname, aName);
   }
@@ -83,19 +83,19 @@ public:
     mAppInfo->GetPlatformVersion(cversion);
     AppendUTF8toUTF16(cversion, aVersion);
   }
 
 protected:
   virtual ~ApplicationAccessible() {}
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
   virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
-                                         nsresult *aError = nullptr) const MOZ_OVERRIDE;
+                                         nsresult *aError = nullptr) const override;
 
 private:
   nsCOMPtr<nsIXULAppInfo> mAppInfo;
 };
 
 inline ApplicationAccessible*
 Accessible::AsApplication()
 {
--- a/accessible/generic/BaseAccessibles.h
+++ b/accessible/generic/BaseAccessibles.h
@@ -29,25 +29,25 @@ public:
 
   LeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
-                                   EWhichChildAtPoint aWhichChild) MOZ_OVERRIDE;
-  virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) MOZ_OVERRIDE MOZ_FINAL;
-  virtual bool RemoveChild(Accessible* aChild) MOZ_OVERRIDE MOZ_FINAL;
+                                   EWhichChildAtPoint aWhichChild) override;
+  virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override final;
+  virtual bool RemoveChild(Accessible* aChild) override final;
 
 protected:
   virtual ~LeafAccessible() {}
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 };
 
 /**
  * Used for text or image accessible nodes contained by link accessibles or
  * accessibles for nodes with registered click event handler. It knows how to
  * report the state of the host link (traveled or not) and can activate (click)
  * the host accessible programmatically.
  */
@@ -56,36 +56,36 @@ class LinkableAccessible : public Access
 public:
   enum { eAction_Jump = 0 };
 
   LinkableAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual uint64_t NativeLinkState() const MOZ_OVERRIDE;
-  virtual void TakeFocus() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual void Value(nsString& aValue) override;
+  virtual uint64_t NativeLinkState() const override;
+  virtual void TakeFocus() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t index) MOZ_OVERRIDE;
-  virtual KeyBinding AccessKey() const MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t index) override;
+  virtual KeyBinding AccessKey() const override;
 
   // HyperLinkAccessible
-  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) MOZ_OVERRIDE;
+  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) override;
 
 protected:
   virtual ~LinkableAccessible() {}
 
   // Accessible
-  virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent) MOZ_OVERRIDE;
-  virtual void UnbindFromParent() MOZ_OVERRIDE;
+  virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent) override;
+  virtual void UnbindFromParent() override;
 
   /**
    * Parent accessible that provides an action for this linkable accessible.
    */
   Accessible* mActionAcc;
   bool mIsLink;
   bool mIsOnclick;
 };
@@ -95,42 +95,42 @@ protected:
  */
 template<a11y::role R>
 class EnumRoleAccessible : public AccessibleWrap
 {
 public:
   EnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc) { }
 
-  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aPtr) MOZ_OVERRIDE
+  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aPtr) override
     { return Accessible::QueryInterface(aIID, aPtr); }
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE { return R; }
+  virtual a11y::role NativeRole() override { return R; }
 
 protected:
   virtual ~EnumRoleAccessible() { }
 };
 
 
 /**
  * A wrapper accessible around native accessible to connect it with
  * crossplatform accessible tree.
  */
 class DummyAccessible : public AccessibleWrap
 {
 public:
   explicit DummyAccessible(DocAccessible* aDocument = nullptr) :
     AccessibleWrap(nullptr, aDocument) { }
 
-  virtual uint64_t NativeState() MOZ_OVERRIDE MOZ_FINAL;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE MOZ_FINAL;
-  virtual uint64_t NativeLinkState() const MOZ_OVERRIDE MOZ_FINAL;
-  virtual bool NativelyUnavailable() const MOZ_OVERRIDE MOZ_FINAL;
-  virtual void ApplyARIAState(uint64_t* aState) const MOZ_OVERRIDE MOZ_FINAL;
+  virtual uint64_t NativeState() override final;
+  virtual uint64_t NativeInteractiveState() const override final;
+  virtual uint64_t NativeLinkState() const override final;
+  virtual bool NativelyUnavailable() const override final;
+  virtual void ApplyARIAState(uint64_t* aState) const override final;
 
 protected:
   virtual ~DummyAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -51,49 +51,49 @@ class DocAccessible : public HyperTextAc
   NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
 
 public:
 
   DocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
                 nsIPresShell* aPresShell);
 
   // nsIScrollPositionListener
-  virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) MOZ_OVERRIDE {}
-  virtual void ScrollPositionDidChange(nscoord aX, nscoord aY) MOZ_OVERRIDE;
+  virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) override {}
+  virtual void ScrollPositionDidChange(nscoord aX, nscoord aY) override;
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
   // Accessible
   virtual void Init();
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual nsIFrame* GetFrame() const MOZ_OVERRIDE;
-  virtual nsINode* GetNode() const MOZ_OVERRIDE { return mDocumentNode; }
+  virtual void Shutdown() override;
+  virtual nsIFrame* GetFrame() const override;
+  virtual nsINode* GetNode() const override { return mDocumentNode; }
   nsIDocument* DocumentNode() const { return mDocumentNode; }
 
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
-  virtual void Description(nsString& aDescription) MOZ_OVERRIDE;
-  virtual Accessible* FocusedChild() MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
-  virtual bool NativelyUnavailable() const MOZ_OVERRIDE;
-  virtual void ApplyARIAState(uint64_t* aState) const MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> Attributes() MOZ_OVERRIDE;
+  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
+  virtual void Description(nsString& aDescription) override;
+  virtual Accessible* FocusedChild() override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeInteractiveState() const override;
+  virtual bool NativelyUnavailable() const override;
+  virtual void ApplyARIAState(uint64_t* aState) const override;
+  virtual already_AddRefed<nsIPersistentProperties> Attributes() override;
 
-  virtual void TakeFocus() MOZ_OVERRIDE;
+  virtual void TakeFocus() override;
 
 #ifdef A11Y_LOG
-  virtual nsresult HandleAccEvent(AccEvent* aEvent) MOZ_OVERRIDE;
+  virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
 #endif
 
-  virtual nsRect RelativeBounds(nsIFrame** aRelativeFrame) const MOZ_OVERRIDE;
+  virtual nsRect RelativeBounds(nsIFrame** aRelativeFrame) const override;
 
   // HyperTextAccessible
-  virtual already_AddRefed<nsIEditor> GetEditor() const MOZ_OVERRIDE;
+  virtual already_AddRefed<nsIEditor> GetEditor() const override;
 
   // DocAccessible
 
   /**
    * Return document URL.
    */
   void URL(nsAString& aURL) const;
 
@@ -339,17 +339,17 @@ public:
   void RecreateAccessible(nsIContent* aContent);
 
 protected:
   virtual ~DocAccessible();
 
   void LastRelease();
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 
   // DocAccessible
   virtual nsresult AddEventListeners();
   virtual nsresult RemoveEventListeners();
 
   /**
    * Marks this document as loaded or loading.
    */
--- a/accessible/generic/FormControlAccessible.h
+++ b/accessible/generic/FormControlAccessible.h
@@ -23,54 +23,54 @@ public:
   {
     // Ignore 'ValueChange' DOM event in lieu of @value attribute change
     // notifications.
     mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent;
     mType = eProgressType;
   }
 
   // Accessible
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual void Value(nsString& aValue) override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
   // Value
-  virtual double MaxValue() const MOZ_OVERRIDE;
-  virtual double MinValue() const MOZ_OVERRIDE;
-  virtual double CurValue() const MOZ_OVERRIDE;
-  virtual double Step() const MOZ_OVERRIDE;
-  virtual bool SetCurValue(double aValue) MOZ_OVERRIDE;
+  virtual double MaxValue() const override;
+  virtual double MinValue() const override;
+  virtual double CurValue() const override;
+  virtual double Step() const override;
+  virtual bool SetCurValue(double aValue) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
 
 protected:
   virtual ~ProgressMeterAccessible() {}
 };
 
 /**
   * Generic class used for radio buttons.
   */
 class RadioButtonAccessible : public LeafAccessible
 {
 
 public:
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   enum { eAction_Click = 0 };
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -49,24 +49,24 @@ const char16_t kForcedNewLineChar = '\n'
 class HyperTextAccessible : public AccessibleWrap
 {
 public:
   HyperTextAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual nsIAtom* LandmarkRole() const MOZ_OVERRIDE;
-  virtual int32_t GetLevelInternal() MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual nsIAtom* LandmarkRole() const override;
+  virtual int32_t GetLevelInternal() override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
-  virtual void InvalidateChildren() MOZ_OVERRIDE;
-  virtual bool RemoveChild(Accessible* aAccessible) MOZ_OVERRIDE;
+  virtual void InvalidateChildren() override;
+  virtual bool RemoveChild(Accessible* aAccessible) override;
 
   // HyperTextAccessible (static helper method)
 
   // Convert content offset to rendered text offset
   nsresult ContentToRenderedOffset(nsIFrame *aFrame, int32_t aContentOffset,
                                    uint32_t *aRenderedOffset) const;
 
   // Convert rendered text offset to content offset
@@ -427,18 +427,18 @@ public:
    * Return DOM selection object for the accessible.
    */
   dom::Selection* DOMSelection() const;
 
 protected:
   virtual ~HyperTextAccessible() { }
 
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
+  virtual void CacheChildren() override;
 
   // HyperTextAccessible
 
   /**
    * Transform magic offset into text offset.
    */
   index_t ConvertMagicOffset(int32_t aOffset) const;
 
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -19,34 +19,34 @@ namespace a11y {
  * - support basic state
  */
 class ImageAccessible : public LinkableAccessible
 {
 public:
   ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // ImageAccessible
   nsIntPoint Position(uint32_t aCoordType);
   nsIntSize Size();
 
 protected:
   virtual ~ImageAccessible();
 
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 
 private:
   /**
    * Return whether the element has a longdesc URI.
    */
   bool HasLongDesc() const
   {
     nsCOMPtr<nsIURI> uri = GetLongDescURI();
--- a/accessible/generic/OuterDocAccessible.h
+++ b/accessible/generic/OuterDocAccessible.h
@@ -15,36 +15,36 @@ namespace a11y {
  * Used for <browser>, <frame>, <iframe>, <page> or editor> elements.
  * 
  * In these variable names, "outer" relates to the OuterDocAccessible as
  * opposed to the DocAccessibleWrap which is "inner". The outer node is
  * a something like tags listed above, whereas the inner node corresponds to
  * the inner document root.
  */
 
-class OuterDocAccessible MOZ_FINAL : public AccessibleWrap
+class OuterDocAccessible final : public AccessibleWrap
 {
 public:
   OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual mozilla::a11y::role NativeRole() override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
-                                   EWhichChildAtPoint aWhichChild) MOZ_OVERRIDE;
+                                   EWhichChildAtPoint aWhichChild) override;
 
-  virtual void InvalidateChildren() MOZ_OVERRIDE;
-  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) MOZ_OVERRIDE;
-  virtual bool RemoveChild(Accessible* aAccessible) MOZ_OVERRIDE;
+  virtual void InvalidateChildren() override;
+  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
+  virtual bool RemoveChild(Accessible* aAccessible) override;
 
 protected:
-  virtual ~OuterDocAccessible() MOZ_OVERRIDE;
+  virtual ~OuterDocAccessible() override;
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif  
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -21,40 +21,40 @@ class RootAccessible : public DocAccessi
 {
   NS_DECL_ISUPPORTS_INHERITED
 
 public:
   RootAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
                  nsIPresShell* aPresShell);
 
   // nsIDOMEventListener
-  NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) MOZ_OVERRIDE;
+  NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) override;
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override;
+  virtual Relation RelationByType(RelationType aType) override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
   // RootAccessible
 
   /**
    * Notify that the sub document presshell was activated.
    */
   virtual void DocumentActivated(DocAccessible* aDocument);
 
 protected:
   virtual ~RootAccessible();
 
   /**
    * Add/remove DOM event listeners.
    */
-  virtual nsresult AddEventListeners() MOZ_OVERRIDE;
-  virtual nsresult RemoveEventListeners() MOZ_OVERRIDE;
+  virtual nsresult AddEventListeners() override;
+  virtual nsresult RemoveEventListeners() override;
 
   /**
    * Process the DOM event.
    */
   void ProcessDOMEvent(nsIDOMEvent* aEvent);
 
   /**
    * Process "popupshown" event. Used by HandleEvent().
--- a/accessible/generic/TextLeafAccessible.h
+++ b/accessible/generic/TextLeafAccessible.h
@@ -16,28 +16,28 @@ namespace a11y {
  */
 class TextLeafAccessible : public LinkableAccessible
 {
 public:
   TextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~TextLeafAccessible();
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
-                            uint32_t aLength = UINT32_MAX) MOZ_OVERRIDE;
-  virtual ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
+                            uint32_t aLength = UINT32_MAX) override;
+  virtual ENameValueFlag Name(nsString& aName) override;
 
   // TextLeafAccessible
   void SetText(const nsAString& aText) { mText = aText; }
   const nsString& Text() const { return mText; }
 
 protected:
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 
 protected:
   nsString mText;
 };
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcast method
--- a/accessible/html/HTMLCanvasAccessible.h
+++ b/accessible/html/HTMLCanvasAccessible.h
@@ -18,17 +18,17 @@ class HTMLCanvasAccessible : public Hype
 {
 public:
   HTMLCanvasAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
 
 protected:
   virtual ~HTMLCanvasAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/html/HTMLElementAccessibles.h
+++ b/accessible/html/HTMLElementAccessibles.h
@@ -18,74 +18,74 @@ namespace a11y {
 class HTMLHRAccessible : public LeafAccessible
 {
 public:
 
   HTMLHRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc) {}
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
 };
 
 /**
  * Used for HTML br element.
  */
 class HTMLBRAccessible : public LeafAccessible
 {
 public:
   HTMLBRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     mType = eHTMLBRType;
   }
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 /**
  * Used for HTML label element.
  */
 class HTMLLabelAccessible : public HyperTextAccessibleWrap
 {
 public:
 
   HTMLLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   virtual ~HTMLLabelAccessible() {}
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 /**
  * Used for HTML output element.
  */
 class HTMLOutputAccessible : public HyperTextAccessibleWrap
 {
 public:
 
   HTMLOutputAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   virtual ~HTMLOutputAccessible() {}
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -30,26 +30,26 @@ public:
     LeafAccessible(aContent, aDoc)
   {
     // Ignore "CheckboxStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
 };
 
 
 /**
  * Accessible for HTML input@type="radio" element.
  */
 class HTMLRadioButtonAccessible : public RadioButtonAccessible
 {
@@ -59,91 +59,91 @@ public:
     RadioButtonAccessible(aContent, aDoc)
   {
     // Ignore "RadioStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() override;
   virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
-                                          int32_t *aSetSize) MOZ_OVERRIDE;
+                                          int32_t *aSetSize) override;
 };
 
 
 /**
  * Accessible for HTML input@type="button", @type="submit", @type="image"
  * and HTML button elements.
  */
 class HTMLButtonAccessible : public HyperTextAccessibleWrap
 {
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t State() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t State() override;
+  virtual uint64_t NativeState() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 };
 
 
 /**
  * Accessible for HTML input@type="text", input@type="password", textarea and
  * other HTML text controls.
  */
-class HTMLTextFieldAccessible MOZ_FINAL : public HyperTextAccessibleWrap
+class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap
 {
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLTextFieldAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // HyperTextAccessible
-  virtual already_AddRefed<nsIEditor> GetEditor() const MOZ_OVERRIDE;
+  virtual already_AddRefed<nsIEditor> GetEditor() const override;
 
   // Accessible
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual void ApplyARIAState(uint64_t* aState) const MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
+  virtual void Value(nsString& aValue) override;
+  virtual void ApplyARIAState(uint64_t* aState) const override;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
-  virtual Accessible* ContainerWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
+  virtual Accessible* ContainerWidget() const override;
 
 protected:
   virtual ~HTMLTextFieldAccessible() {}
 
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 
   /**
    * Return a XUL widget element this input is part of.
    */
   nsIContent* XULWidgetElm() const { return mContent->GetBindingParent(); }
 };
 
 
@@ -151,134 +151,134 @@ protected:
  * Accessible for input@type="file" element.
  */
 class HTMLFileInputAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFileInputAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual nsresult HandleAccEvent(AccEvent* aAccEvent) MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual nsresult HandleAccEvent(AccEvent* aAccEvent) override;
 };
 
 
 /**
  * Used for HTML input@type="number".
  */
 class HTMLSpinnerAccessible : public AccessibleWrap
 {
 public:
   HTMLSpinnerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc)
   {
     mStateFlags |= eHasNumericValue;
 }
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual void Value(nsString& aValue) override;
 
-  virtual double MaxValue() const MOZ_OVERRIDE;
-  virtual double MinValue() const MOZ_OVERRIDE;
-  virtual double CurValue() const MOZ_OVERRIDE;
-  virtual double Step() const MOZ_OVERRIDE;
-  virtual bool SetCurValue(double aValue) MOZ_OVERRIDE;
+  virtual double MaxValue() const override;
+  virtual double MinValue() const override;
+  virtual double CurValue() const override;
+  virtual double Step() const override;
+  virtual bool SetCurValue(double aValue) override;
 };
 
 
 /**
   * Used for input@type="range" element.
   */
 class HTMLRangeAccessible : public LeafAccessible
 {
 public:
   HTMLRangeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     mStateFlags |= eHasNumericValue;
   }
 
   // Accessible
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual void Value(nsString& aValue) override;
+  virtual mozilla::a11y::role NativeRole() override;
 
   // Value
-  virtual double MaxValue() const MOZ_OVERRIDE;
-  virtual double MinValue() const MOZ_OVERRIDE;
-  virtual double CurValue() const MOZ_OVERRIDE;
-  virtual double Step() const MOZ_OVERRIDE;
-  virtual bool SetCurValue(double aValue) MOZ_OVERRIDE;
+  virtual double MaxValue() const override;
+  virtual double MinValue() const override;
+  virtual double CurValue() const override;
+  virtual double Step() const override;
+  virtual bool SetCurValue(double aValue) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
 };
 
 
 /**
  * Accessible for HTML fieldset element.
  */
 class HTMLGroupboxAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual mozilla::a11y::role NativeRole() override;
+  virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 
   // HTMLGroupboxAccessible
   nsIContent* GetLegend() const;
 };
 
 
 /**
  * Accessible for HTML legend element.
  */
 class HTMLLegendAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLLegendAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual Relation RelationByType(RelationType aType) override;
 };
 
 /**
  * Accessible for HTML5 figure element.
  */
 class HTMLFigureAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFigureAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual Relation RelationByType(RelationType aType) override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 
   // HTMLLegendAccessible
   nsIContent* Caption() const;
 };
 
 
 /**
  * Accessible for HTML5 figcaption element.
  */
 class HTMLFigcaptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFigcaptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
+  virtual Relation RelationByType(RelationType aType) override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/html/HTMLImageMapAccessible.h
+++ b/accessible/html/HTMLImageMapAccessible.h
@@ -11,72 +11,72 @@
 #include "nsIDOMHTMLMapElement.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * Used for HTML image maps.
  */
-class HTMLImageMapAccessible MOZ_FINAL : public ImageAccessibleWrap
+class HTMLImageMapAccessible final : public ImageAccessibleWrap
 {
 public:
   HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports and cycle collector
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
 
   // HyperLinkAccessible
-  virtual uint32_t AnchorCount() MOZ_OVERRIDE;
-  virtual Accessible* AnchorAt(uint32_t aAnchorIndex) MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) MOZ_OVERRIDE;
+  virtual uint32_t AnchorCount() override;
+  virtual Accessible* AnchorAt(uint32_t aAnchorIndex) override;
+  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) override;
 
   /**
    * Update area children of the image map.
    */
   void UpdateChildAreas(bool aDoFireEvents = true);
 
   /**
    * Return accessible of child node.
    */
   Accessible* GetChildAccessibleFor(const nsINode* aNode) const;
 
 protected:
   virtual ~HTMLImageMapAccessible() { }
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 };
 
 /**
  * Accessible for image map areas - must be child of image.
  */
-class HTMLAreaAccessible MOZ_FINAL : public HTMLLinkAccessible
+class HTMLAreaAccessible final : public HTMLLinkAccessible
 {
 public:
 
   HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual void Description(nsString& aDescription) MOZ_OVERRIDE;
+  virtual void Description(nsString& aDescription) override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
-                                   EWhichChildAtPoint aWhichChild) MOZ_OVERRIDE;
-  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
+                                   EWhichChildAtPoint aWhichChild) override;
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
 
   // HyperLinkAccessible
-  virtual uint32_t StartOffset() MOZ_OVERRIDE;
-  virtual uint32_t EndOffset() MOZ_OVERRIDE;
+  virtual uint32_t StartOffset() override;
+  virtual uint32_t EndOffset() override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
+  virtual void CacheChildren() override;
 };
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcasting method
 
 inline HTMLImageMapAccessible*
 Accessible::AsImageMap()
--- a/accessible/html/HTMLLinkAccessible.h
+++ b/accessible/html/HTMLLinkAccessible.h
@@ -14,30 +14,30 @@ namespace a11y {
 class HTMLLinkAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual uint64_t NativeLinkState() const MOZ_OVERRIDE;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
+  virtual void Value(nsString& aValue) override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeLinkState() const override;
+  virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // HyperLinkAccessible
-  virtual bool IsLink() MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) MOZ_OVERRIDE;
+  virtual bool IsLink() override;
+  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex) override;
 
 protected:
   virtual ~HTMLLinkAccessible() {}
 
   enum { eAction_Jump = 0 };
 
   /**
    * Returns true if the link has href attribute.
--- a/accessible/html/HTMLListAccessible.h
+++ b/accessible/html/HTMLListAccessible.h
@@ -23,18 +23,18 @@ class HTMLListAccessible : public HyperT
 public:
   HTMLListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
 protected:
   virtual ~HTMLListAccessible() { }
 };
 
 
 /**
  * Used for HTML list item (e.g. HTML li).
@@ -43,52 +43,52 @@ class HTMLLIAccessible : public HyperTex
 {
 public:
   HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual nsIntRect Bounds() const override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
   // HTMLLIAccessible
   HTMLListBulletAccessible* Bullet() const { return mBullet; }
   void UpdateBullet(bool aHasBullet);
 
 protected:
   virtual ~HTMLLIAccessible() { }
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 
 private:
   nsRefPtr<HTMLListBulletAccessible> mBullet;
 };
 
 
 /**
  * Used for bullet of HTML list item element (for example, HTML li).
  */
 class HTMLListBulletAccessible : public LeafAccessible
 {
 public:
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLListBulletAccessible() { }
 
   // Accessible
-  virtual nsIFrame* GetFrame() const MOZ_OVERRIDE;
-  virtual ENameValueFlag Name(nsString& aName) MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual nsIFrame* GetFrame() const override;
+  virtual ENameValueFlag Name(nsString& aName) override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
-                            uint32_t aLength = UINT32_MAX) MOZ_OVERRIDE;
+                            uint32_t aLength = UINT32_MAX) override;
 
   // HTMLListBulletAccessible
 
   /**
    * Return true if the bullet is inside of list item element boundaries.
    */
   bool IsInside() const;
 };
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -34,67 +34,67 @@ namespace a11y {
 class HTMLSelectListAccessible : public AccessibleWrap
 {
 public:
 
   HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectListAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
 
   // SelectAccessible
-  virtual bool SelectAll() MOZ_OVERRIDE;
-  virtual bool UnselectAll() MOZ_OVERRIDE;
+  virtual bool SelectAll() override;
+  virtual bool UnselectAll() override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
-  virtual bool IsActiveWidget() const MOZ_OVERRIDE;
-  virtual bool AreItemsOperable() const MOZ_OVERRIDE;
-  virtual Accessible* CurrentItem() MOZ_OVERRIDE;
-  virtual void SetCurrentItem(Accessible* aItem) MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
+  virtual bool IsActiveWidget() const override;
+  virtual bool AreItemsOperable() const override;
+  virtual Accessible* CurrentItem() override;
+  virtual void SetCurrentItem(Accessible* aItem) override;
 
 protected:
 
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 };
 
 /*
  * Options inside the select, contained within the list
  */
 class HTMLSelectOptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   enum { eAction_Select = 0 };
 
   HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectOptionAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeInteractiveState() const override;
 
-  virtual int32_t GetLevelInternal() MOZ_OVERRIDE;
-  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
-  virtual void SetSelected(bool aSelect) MOZ_OVERRIDE;
+  virtual int32_t GetLevelInternal() override;
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
+  virtual void SetSelected(bool aSelect) override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
-  virtual Accessible* ContainerWidget() const MOZ_OVERRIDE;
+  virtual Accessible* ContainerWidget() const override;
 
 protected:
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
 
 private:
 
   /**
    * Return a select accessible the option belongs to if any.
    */
   Accessible* GetSelect() const
   {
@@ -136,66 +136,66 @@ class HTMLSelectOptGroupAccessible : pub
 public:
 
   HTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HTMLSelectOptionAccessible(aContent, aDoc)
     { mType = eHTMLOptGroupType; }
   virtual ~HTMLSelectOptGroupAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeInteractiveState() const override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 };
 
 /** ------------------------------------------------------ */
 /**  Finally, the Combobox widgets                         */
 /** ------------------------------------------------------ */
 
 class HTMLComboboxListAccessible;
 
 /*
  * A class the represents the HTML Combobox widget.
  */
-class HTMLComboboxAccessible MOZ_FINAL : public AccessibleWrap
+class HTMLComboboxAccessible final : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLComboboxAccessible() {}
 
   // Accessible
-  virtual void Shutdown() MOZ_OVERRIDE;
-  virtual void Description(nsString& aDescription) MOZ_OVERRIDE;
-  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual void InvalidateChildren() MOZ_OVERRIDE;
-  virtual bool RemoveChild(Accessible* aChild) MOZ_OVERRIDE;
+  virtual void Shutdown() override;
+  virtual void Description(nsString& aDescription) override;
+  virtual void Value(nsString& aValue) override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual void InvalidateChildren() override;
+  virtual bool RemoveChild(Accessible* aChild) override;
 
   // ActionAccessible
-  virtual uint8_t ActionCount() MOZ_OVERRIDE;
-  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
-  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
+  virtual uint8_t ActionCount() override;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
+  virtual bool DoAction(uint8_t aIndex) override;
 
   // Widgets
-  virtual bool IsWidget() const MOZ_OVERRIDE;
-  virtual bool IsActiveWidget() const MOZ_OVERRIDE;
-  virtual bool AreItemsOperable() const MOZ_OVERRIDE;
-  virtual Accessible* CurrentItem() MOZ_OVERRIDE;
-  virtual void SetCurrentItem(Accessible* aItem) MOZ_OVERRIDE;
+  virtual bool IsWidget() const override;
+  virtual bool IsActiveWidget() const override;
+  virtual bool AreItemsOperable() const override;
+  virtual Accessible* CurrentItem() override;
+  virtual void SetCurrentItem(Accessible* aItem) override;
 
 protected:
   // Accessible
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual void CacheChildren() override;
 
   /**
    * Return selected option.
    */
   Accessible* SelectedOption() const;
 
 private:
   nsRefPtr<HTMLComboboxListAccessible> mListAccessible;
@@ -210,22 +210,22 @@ class HTMLComboboxListAccessible : publi
 {
 public:
 
   HTMLComboboxListAccessible(Accessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc);
   virtual ~HTMLComboboxListAccessible() {}
 
   // Accessible
-  virtual nsIFrame* GetFrame() const MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
+  virtual nsIFrame* GetFrame() const override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
 
   // Widgets
-  virtual bool IsActiveWidget() const MOZ_OVERRIDE;
-  virtual bool AreItemsOperable() const MOZ_OVERRIDE;
+  virtual bool IsActiveWidget() const override;
+  virtual bool AreItemsOperable() const override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -55,16 +55,19 @@ HTMLTableCellAccessible::
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableCellAccessible, HyperTextAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableCellAccessible: Accessible implementation
 
 role
 HTMLTableCellAccessible::NativeRole()
 {
+  if (mContent->IsMathMLElement(nsGkAtoms::mtd_)) {
+    return roles::MATHML_CELL;
+  }
   return roles::CELL;
 }
 
 uint64_t
 HTMLTableCellAccessible::NativeState()
 {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
@@ -143,18 +146,17 @@ HTMLTableCellAccessible::NativeAttribute
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableCellAccessible: TableCellAccessible implementation
 
 TableAccessible*
 HTMLTableCellAccessible::Table() const
 {
   Accessible* parent = const_cast<HTMLTableCellAccessible*>(this);
   while ((parent = parent->Parent())) {
-    roles::Role role = parent->Role();
-    if (role == roles::TABLE || role == roles::TREE_TABLE)
+    if (parent->IsTable())
       return parent->AsTable();
   }
 
   return nullptr;
 }
 
 uint32_t
 HTMLTableCellAccessible::ColIdx() const
@@ -292,68 +294,70 @@ HTMLTableHeaderCellAccessible::
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableHeaderCellAccessible: Accessible implementation
 
 role
 HTMLTableHeaderCellAccessible::NativeRole()
 {
   // Check value of @scope attribute.
   static nsIContent::AttrValuesArray scopeValues[] =
-    {&nsGkAtoms::col, &nsGkAtoms::row, nullptr};
+    { &nsGkAtoms::col, &nsGkAtoms::colgroup,
+      &nsGkAtoms::row, &nsGkAtoms::rowgroup, nullptr };
   int32_t valueIdx =
     mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::scope,
                               scopeValues, eCaseMatters);
 
   switch (valueIdx) {
     case 0:
+    case 1:
       return roles::COLUMNHEADER;
-    case 1:
+    case 2:
+    case 3:
       return roles::ROWHEADER;
   }
 
-  // Assume it's columnheader if there are headers in siblings, otherwise
-  // rowheader.
-  // This should iterate the flattened tree
-  nsIContent* parentContent = mContent->GetParent();
-  if (!parentContent) {
-    NS_ERROR("Deattached content on alive accessible?");
+  TableAccessible* table = Table();
+  if (!table)
     return roles::NOTHING;
-  }
+
+  // If the cell next to this one is not a header cell then assume this cell is
+  // a row header for it.
+  uint32_t rowIdx = RowIdx(), colIdx = ColIdx();
+  Accessible* cell = table->CellAt(rowIdx, colIdx + ColExtent());
+  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
+    return roles::ROWHEADER;
 
-  for (nsIContent* siblingContent = mContent->GetPreviousSibling(); siblingContent;
-       siblingContent = siblingContent->GetPreviousSibling()) {
-    if (siblingContent->IsElement()) {
-      return nsCoreUtils::IsHTMLTableHeader(siblingContent) ?
-        roles::COLUMNHEADER : roles::ROWHEADER;
-    }
-  }
+  // If the cell below this one is not a header cell then assume this cell is
+  // a column header for it.
+  uint32_t rowExtent = RowExtent();
+  cell = table->CellAt(rowIdx + rowExtent, colIdx);
+  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
+    return roles::COLUMNHEADER;
 
-  for (nsIContent* siblingContent = mContent->GetNextSibling(); siblingContent;
-       siblingContent = siblingContent->GetNextSibling()) {
-    if (siblingContent->IsElement()) {
-      return nsCoreUtils::IsHTMLTableHeader(siblingContent) ?
-       roles::COLUMNHEADER : roles::ROWHEADER;
-    }
-  }
-
-  // No elements in siblings what means the table has one column only. Therefore
-  // it should be column header.
-  return roles::COLUMNHEADER;
+  // Otherwise if this cell is surrounded by header cells only then make a guess
+  // based on its cell spanning. In other words if it is row spanned then assume
+  // it's a row header, otherwise it's a column header.
+  return rowExtent > 1 ? roles::ROWHEADER : roles::COLUMNHEADER;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableRowAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableRowAccessible, Accessible)
 
 role
 HTMLTableRowAccessible::NativeRole()
 {
+  if (mContent->IsMathMLElement(nsGkAtoms::mtr_)) {
+    return roles::MATHML_TABLE_ROW;
+  } else if (mContent->IsMathMLElement(nsGkAtoms::mlabeledtr_)) {
+    return roles::MATHML_LABELED_ROW;
+  }
   return roles::ROW;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessible, Accessible)
@@ -379,16 +383,19 @@ HTMLTableAccessible::CacheChildren()
     }
     AppendChild(child);
   }
 }
 
 role
 HTMLTableAccessible::NativeRole()
 {
+  if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
+    return roles::MATHML_TABLE;
+  }
   return roles::TABLE;
 }
 
 uint64_t
 HTMLTableAccessible::NativeState()
 {
   return Accessible::NativeState() | states::READONLY;
 }
@@ -416,16 +423,21 @@ HTMLTableAccessible::NativeName(nsString
   return eNameOK;
 }
 
 already_AddRefed<nsIPersistentProperties>
 HTMLTableAccessible::NativeAttributes()
 {
   nsCOMPtr<nsIPersistentProperties> attributes =
     AccessibleWrap::NativeAttributes();
+
+  if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
+    GetAccService()->MarkupAttributes(mContent, attributes);
+  }
+
   if (IsProbablyLayoutTable()) {
     nsAutoString unused;
     attributes->SetStringProperty(NS_LITERAL_CSTRING("layout-guess"),
                                   NS_LITERAL_STRING("true"), unused);
   }
 
   return attributes.forget();
 }
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -24,31 +24,31 @@ class HTMLTableCellAccessible : public H
 {
 public:
   HTMLTableCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual TableCellAccessible* AsTableCell() MOZ_OVERRIDE { return this; }
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
+  virtual TableCellAccessible* AsTableCell() override { return this; }
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual uint64_t NativeInteractiveState() const override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // TableCellAccessible
-  virtual TableAccessible* Table() const MOZ_OVERRIDE;
-  virtual uint32_t ColIdx() const MOZ_OVERRIDE;
-  virtual uint32_t RowIdx() const MOZ_OVERRIDE;
-  virtual uint32_t ColExtent() const MOZ_OVERRIDE;
-  virtual uint32_t RowExtent() const MOZ_OVERRIDE;
-  virtual void ColHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
-  virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
-  virtual bool Selected() MOZ_OVERRIDE;
+  virtual TableAccessible* Table() const override;
+  virtual uint32_t ColIdx() const override;
+  virtual uint32_t RowIdx() const override;
+  virtual uint32_t ColExtent() const override;
+  virtual uint32_t RowExtent() const override;
+  virtual void ColHeaderCells(nsTArray<Accessible*>* aCells) override;
+  virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) override;
+  virtual bool Selected() override;
 
 protected:
   virtual ~HTMLTableCellAccessible() {}
 
   /**
    * Return nsITableCellLayout of the table cell frame.
    */
   nsITableCellLayout* GetCellLayout() const;
@@ -64,17 +64,17 @@ protected:
  * HTML table row/column header accessible (html:th or html:td@scope).
  */
 class HTMLTableHeaderCellAccessible : public HTMLTableCellAccessible
 {
 public:
   HTMLTableHeaderCellAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
 };
 
 
 /**
  * HTML table row accessible (html:tr).
  */
 class HTMLTableRowAccessible : public AccessibleWrap
 {
@@ -84,17 +84,17 @@ public:
   {
     mType = eHTMLTableRowType;
     mGenericTypes |= eTableRow;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
 
 protected:
   virtual ~HTMLTableRowAccessible() { }
 };
 
 
 /**
  * HTML table accessible (html:table).
@@ -114,59 +114,59 @@ public:
   {
     mType = eHTMLTableType;
     mGenericTypes |= eTable;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // TableAccessible
-  virtual Accessible* Caption() const MOZ_OVERRIDE;
-  virtual void Summary(nsString& aSummary) MOZ_OVERRIDE;
-  virtual uint32_t ColCount() MOZ_OVERRIDE;
-  virtual uint32_t RowCount() MOZ_OVERRIDE;
-  virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) MOZ_OVERRIDE;
-  virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual int32_t ColIndexAt(uint32_t aCellIdx) MOZ_OVERRIDE;
-  virtual int32_t RowIndexAt(uint32_t aCellIdx) MOZ_OVERRIDE;
+  virtual Accessible* Caption() const override;
+  virtual void Summary(nsString& aSummary) override;
+  virtual uint32_t ColCount() override;
+  virtual uint32_t RowCount() override;
+  virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
+  virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx) override;
+  virtual int32_t ColIndexAt(uint32_t aCellIdx) override;
+  virtual int32_t RowIndexAt(uint32_t aCellIdx) override;
   virtual void RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
-                                  int32_t* aColIdx) MOZ_OVERRIDE;
-  virtual uint32_t ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual uint32_t RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual bool IsColSelected(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual bool IsRowSelected(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual uint32_t SelectedCellCount() MOZ_OVERRIDE;
-  virtual uint32_t SelectedColCount() MOZ_OVERRIDE;
-  virtual uint32_t SelectedRowCount() MOZ_OVERRIDE;
-  virtual void SelectedCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE;
-  virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) MOZ_OVERRIDE;
-  virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) MOZ_OVERRIDE;
-  virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) MOZ_OVERRIDE;
-  virtual void SelectCol(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual void SelectRow(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual void UnselectCol(uint32_t aColIdx) MOZ_OVERRIDE;
-  virtual void UnselectRow(uint32_t aRowIdx) MOZ_OVERRIDE;
-  virtual bool IsProbablyLayoutTable() MOZ_OVERRIDE;
-  virtual Accessible* AsAccessible() MOZ_OVERRIDE { return this; }
+                                  int32_t* aColIdx) override;
+  virtual uint32_t ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx) override;
+  virtual uint32_t RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx) override;
+  virtual bool IsColSelected(uint32_t aColIdx) override;
+  virtual bool IsRowSelected(uint32_t aRowIdx) override;
+  virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx) override;
+  virtual uint32_t SelectedCellCount() override;
+  virtual uint32_t SelectedColCount() override;
+  virtual uint32_t SelectedRowCount() override;
+  virtual void SelectedCells(nsTArray<Accessible*>* aCells) override;
+  virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells) override;
+  virtual void SelectedColIndices(nsTArray<uint32_t>* aCols) override;
+  virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows) override;
+  virtual void SelectCol(uint32_t aColIdx) override;
+  virtual void SelectRow(uint32_t aRowIdx) override;
+  virtual void UnselectCol(uint32_t aColIdx) override;
+  virtual void UnselectRow(uint32_t aRowIdx) override;
+  virtual bool IsProbablyLayoutTable() override;
+  virtual Accessible* AsAccessible() override { return this; }
 
   // Accessible
-  virtual TableAccessible* AsTable() MOZ_OVERRIDE { return this; }
-  virtual void Description(nsString& aDescription) MOZ_OVERRIDE;
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual uint64_t NativeState() MOZ_OVERRIDE;
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual Relation RelationByType(RelationType aRelationType) MOZ_OVERRIDE;
+  virtual TableAccessible* AsTable() override { return this; }
+  virtual void Description(nsString& aDescription) override;
+  virtual a11y::role NativeRole() override;
+  virtual uint64_t NativeState() override;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
+  virtual Relation RelationByType(RelationType aRelationType) override;
 
 protected:
   virtual ~HTMLTableAccessible() {}
 
   // Accessible
-  virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
-  virtual void CacheChildren() MOZ_OVERRIDE;
+  virtual ENameValueFlag NativeName(nsString& aName) override;
+  virtual void CacheChildren() override;
 
   // HTMLTableAccessible
 
   /**
    * Add row or column to selection.
    *
    * @param aIndex   [in] index of row or column to be selected
    * @param aTarget  [in] indicates what should be selected, either row or column
@@ -206,18 +206,18 @@ protected:
  */
 class HTMLCaptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) { }
 
   // Accessible
-  virtual a11y::role NativeRole() MOZ_OVERRIDE;
-  virtual Relation RelationByType(RelationType aRelationType) MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() override;
+  virtual Relation RelationByType(RelationType aRelationType) override;
 
 protected:
   virtual ~HTMLCaptionAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/interfaces/ia2/moz.build
+++ b/accessible/interfaces/ia2/moz.build
@@ -8,13 +8,12 @@ GeckoSharedLibrary('IA2Marshal', linkage
 
 DEFINES['REGISTER_PROXY_DLL'] = True
 
 DEFFILE = SRCDIR + '/IA2Marshal.def'
 
 OS_LIBS += [
     'uuid',
     'kernel32',
-    'rpcns4',
     'rpcrt4',
     'ole32',
     'oleaut32',
 ]
--- a/accessible/interfaces/msaa/moz.build
+++ b/accessible/interfaces/msaa/moz.build
@@ -17,12 +17,11 @@ GENERATED_SOURCES += [
 ]
 
 DEFINES['REGISTER_PROXY_DLL'] = True
 
 DEFFILE = SRCDIR + '/AccessibleMarshal.def'
 
 OS_LIBS += [
     'kernel32',
-    'rpcns4',
     'rpcrt4',
     'oleaut32',
 ]
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -5,18 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocAccessibleChild.h"
 
 #include "Accessible-inl.h"
 #include "ProxyAccessible.h"
 #include "Relation.h"
 #include "HyperTextAccessible-inl.h"
+#include "ImageAccessible.h"
+#include "TableAccessible.h"
+#include "TableCellAccessible.h"
 #include "nsIPersistentProperties2.h"
 #include "nsISimpleEnumerator.h"
+#include "nsAccUtils.h"
 
 namespace mozilla {
 namespace a11y {
 
 static uint32_t
 InterfacesFor(Accessible* aAcc)
 {
   uint32_t interfaces = 0;
@@ -41,27 +45,61 @@ SerializeTree(Accessible* aRoot, nsTArra
     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)
+DocAccessibleChild::IdToAccessible(const uint64_t& aID) const
 {
   return mDoc->GetAccessibleByUniqueID(reinterpret_cast<void*>(aID));
 }
 
+Accessible*
+DocAccessibleChild::IdToAccessibleLink(const uint64_t& aID) const
+{
+  Accessible* acc = IdToAccessible(aID);
+  return acc && acc->IsLink() ? acc : nullptr;
+}
+
+Accessible*
+DocAccessibleChild::IdToAccessibleSelect(const uint64_t& aID) const
+{
+  Accessible* acc = IdToAccessible(aID);
+  return acc && acc->IsSelect() ? acc : nullptr;
+}
+
 HyperTextAccessible*
-DocAccessibleChild::IdToHyperTextAccessible(const uint64_t& aID)
+DocAccessibleChild::IdToHyperTextAccessible(const uint64_t& aID) const
 {
   Accessible* acc = IdToAccessible(aID);
-  MOZ_ASSERT(!acc || acc->IsHyperText());
-  return acc ? acc->AsHyperText() : nullptr;
+  return acc && acc->IsHyperText() ? acc->AsHyperText() : nullptr;
+}
+
+ImageAccessible*
+DocAccessibleChild::IdToImageAccessible(const uint64_t& aID) const
+{
+  Accessible* acc = IdToAccessible(aID);
+  return (acc && acc->IsImage()) ? acc->AsImage() : nullptr;
+}
+
+TableCellAccessible*
+DocAccessibleChild::IdToTableCellAccessible(const uint64_t& aID) const
+{
+  Accessible* acc = IdToAccessible(aID);
+  return (acc && acc->IsTableCell()) ? acc->AsTableCell() : nullptr;
+}
+
+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->GetAccessible()->IndexInParent();
@@ -579,10 +617,1019 @@ DocAccessibleChild::RecvPasteText(const 
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     acc->PasteText(aPosition);
   }
 
   return true;
 }
 
+bool
+DocAccessibleChild::RecvImagePosition(const uint64_t& aID,
+                                      const uint32_t& aCoordType,
+                                      nsIntPoint* aRetVal)
+{
+  ImageAccessible* acc = IdToImageAccessible(aID);
+  if (acc) {
+    *aRetVal = acc->Position(aCoordType);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvImageSize(const uint64_t& aID,
+                                  nsIntSize* aRetVal)
+{
+
+  ImageAccessible* acc = IdToImageAccessible(aID);
+  if (acc) {
+    *aRetVal = acc->Size();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvStartOffset(const uint64_t& aID,
+                                    uint32_t* aRetVal,
+                                    bool* aOk)
+{
+  Accessible* acc = IdToAccessibleLink(aID);
+  if (acc) {
+    *aRetVal = acc->StartOffset();
+    *aOk = true;
+  } else {
+    *aRetVal = 0;
+    *aOk = false;
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvEndOffset(const uint64_t& aID,
+                                  uint32_t* aRetVal,
+                                  bool* aOk)
+{
+  Accessible* acc = IdToAccessibleLink(aID);
+  if (acc) {
+    *aRetVal = acc->EndOffset();
+    *aOk = true;
+  } else {
+    *aRetVal = 0;
+    *aOk = false;
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvIsLinkValid(const uint64_t& aID,
+                                    bool* aRetVal)
+{
+  Accessible* acc = IdToAccessibleLink(aID);
+  if (acc) {
+    *aRetVal = acc->IsLinkValid();
+  } else {
+    *aRetVal = false;
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvAnchorCount(const uint64_t& aID,
+                                    uint32_t* aRetVal,
+                                    bool* aOk)
+{
+  Accessible* acc = IdToAccessibleLink(aID);
+  if (acc) {
+    *aRetVal = acc->AnchorCount();
+    *aOk = true;
+  } else {
+    *aRetVal = 0;
+    *aOk = false;
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvAnchorURIAt(const uint64_t& aID,
+                                    const uint32_t& aIndex,
+                                    nsCString* aURI,
+                                    bool* aOk)
+{
+  Accessible* acc = IdToAccessibleLink(aID);
+  *aOk = false;
+  if (acc) {
+    nsCOMPtr<nsIURI> uri = acc->AnchorURIAt(aIndex);
+    if (uri) {
+      uri->GetSpec(*aURI);
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvAnchorAt(const uint64_t& aID,
+                                 const uint32_t& aIndex,
+                                 uint64_t* aIDOfAnchor,
+                                 bool* aOk)
+{
+  *aIDOfAnchor = 0;
+  *aOk = false;
+  Accessible* acc = IdToAccessibleLink(aID);
+  if (acc) {
+    Accessible* anchor = acc->AnchorAt(aIndex);
+    if (anchor) {
+      *aIDOfAnchor = reinterpret_cast<uint64_t>(anchor->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvLinkCount(const uint64_t& aID,
+                                  uint32_t* aCount)
+{
+  HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
+  *aCount = acc ? acc->LinkCount() : 0;
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvLinkAt(const uint64_t& aID,
+                               const uint32_t& aIndex,
+                               uint64_t* aIDOfLink,
+                               bool* aOk)
+{
+  *aIDOfLink = 0;
+  *aOk = false;
+  HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
+  if (acc) {
+    Accessible* link = acc->LinkAt(aIndex);
+    if (link) {
+      *aIDOfLink = reinterpret_cast<uint64_t>(link->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvLinkIndexOf(const uint64_t& aID,
+                                    const uint64_t& aLinkID,
+                                    int32_t* aIndex)
+{
+  HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
+  Accessible* link = IdToAccessible(aLinkID);
+  *aIndex = -1;
+  if (acc && link) {
+    *aIndex = acc->LinkIndexOf(link);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvLinkIndexAtOffset(const uint64_t& aID,
+                                          const uint32_t& aOffset,
+                                          int32_t* aIndex)
+{
+  HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
+  *aIndex = acc ? acc->LinkIndexAtOffset(aOffset) : -1;
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableOfACell(const uint64_t& aID,
+                                     uint64_t* aTableID,
+                                     bool* aOk)
+{
+  *aTableID = 0;
+  *aOk = false;
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    TableAccessible* table = acc->Table();
+    if (table) {
+      *aTableID = reinterpret_cast<uint64_t>(table->AsAccessible()->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvColIdx(const uint64_t& aID,
+                               uint32_t* aIndex)
+{
+  *aIndex = 0;
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    *aIndex = acc->ColIdx();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvRowIdx(const uint64_t& aID,
+                               uint32_t* aIndex)
+{
+  *aIndex = 0;
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    *aIndex = acc->RowIdx();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvColExtent(const uint64_t& aID,
+                                  uint32_t* aExtent)
+{
+  *aExtent = 0;
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    *aExtent = acc->ColExtent();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvRowExtent(const uint64_t& aID,
+                                  uint32_t* aExtent)
+{
+  *aExtent = 0;
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    *aExtent = acc->RowExtent();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
+                                       nsTArray<uint64_t>* aCells)
+{
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    nsAutoTArray<Accessible*, 10> headerCells;
+    acc->ColHeaderCells(&headerCells);
+    aCells->SetCapacity(headerCells.Length());
+    for (uint32_t i = 0; i < headerCells.Length(); ++i) {
+      aCells->AppendElement(
+        reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
+                                       nsTArray<uint64_t>* aCells)
+{
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  if (acc) {
+    nsAutoTArray<Accessible*, 10> headerCells;
+    acc->RowHeaderCells(&headerCells);
+    aCells->SetCapacity(headerCells.Length());
+    for (uint32_t i = 0; i < headerCells.Length(); ++i) {
+      aCells->AppendElement(
+        reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvIsCellSelected(const uint64_t& aID,
+                                       bool* aSelected)
+{
+  TableCellAccessible* acc = IdToTableCellAccessible(aID);
+  *aSelected = acc && acc->Selected();
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableCaption(const uint64_t& aID,
+                                     uint64_t* aCaptionID,
+                                     bool* aOk)
+{
+  *aCaptionID = 0;
+  *aOk = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    Accessible* caption = acc->Caption();
+    if (caption) {
+      *aCaptionID = reinterpret_cast<uint64_t>(caption->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSummary(const uint64_t& aID,
+                                     nsString* aSummary)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->Summary(*aSummary);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableColumnCount(const uint64_t& aID,
+                                         uint32_t* aColCount)
+{
+  *aColCount = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aColCount = acc->ColCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowCount(const uint64_t& aID,
+                                      uint32_t* aRowCount)
+{
+  *aRowCount = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aRowCount = acc->RowCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableCellAt(const uint64_t& aID,
+                                    const uint32_t& aRow,
+                                    const uint32_t& aCol,
+                                    uint64_t* aCellID,
+                                    bool* aOk)
+{
+  *aCellID = 0;
+  *aOk = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    Accessible* cell = acc->CellAt(aRow, aCol);
+    if (cell) {
+      *aCellID = reinterpret_cast<uint64_t>(cell->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableCellIndexAt(const uint64_t& aID,
+                                         const uint32_t& aRow,
+                                         const uint32_t& aCol,
+                                         int32_t* aIndex)
+{
+  *aIndex = -1;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aIndex = acc->CellIndexAt(aRow, aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableColumnIndexAt(const uint64_t& aID,
+                                           const uint32_t& aCellIndex,
+                                           int32_t* aCol)
+{
+  *aCol = -1;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aCol = acc->ColIndexAt(aCellIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowIndexAt(const uint64_t& aID,
+                                        const uint32_t& aCellIndex,
+                                        int32_t* aRow)
+{
+  *aRow = -1;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aRow = acc->RowIndexAt(aCellIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowAndColumnIndicesAt(const uint64_t& aID,
+                                                  const uint32_t& aCellIndex,
+                                                  int32_t* aRow,
+                                                  int32_t* aCol)
+{
+  *aRow = -1;
+  *aCol = -1;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->RowAndColIndicesAt(aCellIndex, aRow, aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableColumnExtentAt(const uint64_t& aID,
+                                            const uint32_t& aRow,
+                                            const uint32_t& aCol,
+                                            uint32_t* aExtent)
+{
+  *aExtent = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aExtent = acc->ColExtentAt(aRow, aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowExtentAt(const uint64_t& aID,
+                                         const uint32_t& aRow,
+                                         const uint32_t& aCol,
+                                         uint32_t* aExtent)
+{
+  *aExtent = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aExtent = acc->RowExtentAt(aRow, aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableColumnDescription(const uint64_t& aID,
+                                               const uint32_t& aCol,
+                                               nsString* aDescription)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->ColDescription(aCol, *aDescription);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowDescription(const uint64_t& aID,
+                                            const uint32_t& aRow,
+                                            nsString* aDescription)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->RowDescription(aRow, *aDescription);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableColumnSelected(const uint64_t& aID,
+                                            const uint32_t& aCol,
+                                            bool* aSelected)
+{
+  *aSelected = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelected = acc->IsColSelected(aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableRowSelected(const uint64_t& aID,
+                                         const uint32_t& aRow,
+                                         bool* aSelected)
+{
+  *aSelected = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelected = acc->IsRowSelected(aRow);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableCellSelected(const uint64_t& aID,
+                                          const uint32_t& aRow,
+                                          const uint32_t& aCol,
+                                          bool* aSelected)
+{
+  *aSelected = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelected = acc->IsCellSelected(aRow, aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedCellCount(const uint64_t& aID,
+                                               uint32_t* aSelectedCells)
+{
+  *aSelectedCells = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelectedCells = acc->SelectedCellCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedColumnCount(const uint64_t& aID,
+                                                 uint32_t* aSelectedColumns)
+{
+  *aSelectedColumns = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelectedColumns = acc->SelectedColCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedRowCount(const uint64_t& aID,
+                                              uint32_t* aSelectedRows)
+{
+  *aSelectedRows = 0;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aSelectedRows = acc->SelectedRowCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
+                                           nsTArray<uint64_t>* aCellIDs)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    nsAutoTArray<Accessible*, 30> cells;
+    acc->SelectedCells(&cells);
+    aCellIDs->SetCapacity(cells.Length());
+    for (uint32_t i = 0; i < cells.Length(); ++i) {
+      aCellIDs->AppendElement(
+        reinterpret_cast<uint64_t>(cells[i]->UniqueID()));
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedCellIndices(const uint64_t& aID,
+                                                 nsTArray<uint32_t>* aCellIndices)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->SelectedCellIndices(aCellIndices);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedColumnIndices(const uint64_t& aID,
+                                                   nsTArray<uint32_t>* aColumnIndices)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->SelectedColIndices(aColumnIndices);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectedRowIndices(const uint64_t& aID,
+                                                nsTArray<uint32_t>* aRowIndices)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->SelectedRowIndices(aRowIndices);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectColumn(const uint64_t& aID,
+                                          const uint32_t& aCol)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->SelectCol(aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableSelectRow(const uint64_t& aID,
+                                       const uint32_t& aRow)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->SelectRow(aRow);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableUnselectColumn(const uint64_t& aID,
+                                            const uint32_t& aCol)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->UnselectCol(aCol);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableUnselectRow(const uint64_t& aID,
+                                         const uint32_t& aRow)
+{
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    acc->UnselectRow(aRow);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTableIsProbablyForLayout(const uint64_t& aID,
+                                                 bool* aForLayout)
+{
+  *aForLayout = false;
+  TableAccessible* acc = IdToTableAccessible(aID);
+  if (acc) {
+    *aForLayout = acc->IsProbablyLayoutTable();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
+                                      nsTArray<uint64_t>* aSelectedItemIDs)
+{
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    nsAutoTArray<Accessible*, 10> selectedItems;
+    acc->SelectedItems(&selectedItems);
+    aSelectedItemIDs->SetCapacity(selectedItems.Length());
+    for (size_t i = 0; i < selectedItems.Length(); ++i) {
+      aSelectedItemIDs->AppendElement(
+        reinterpret_cast<uint64_t>(selectedItems[i]->UniqueID()));
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvSelectedItemCount(const uint64_t& aID,
+                                          uint32_t* aCount)
+{
+  *aCount = 0;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aCount = acc->SelectedItemCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvGetSelectedItem(const uint64_t& aID,
+                                        const uint32_t& aIndex,
+                                        uint64_t* aSelected,
+                                        bool* aOk)
+{
+  *aSelected = 0;
+  *aOk = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    Accessible* item = acc->GetSelectedItem(aIndex);
+    if (item) {
+      *aSelected = reinterpret_cast<uint64_t>(item->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvIsItemSelected(const uint64_t& aID,
+                                       const uint32_t& aIndex,
+                                       bool* aSelected)
+{
+  *aSelected = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aSelected = acc->IsItemSelected(aIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvAddItemToSelection(const uint64_t& aID,
+                                           const uint32_t& aIndex,
+                                           bool* aSuccess)
+{
+  *aSuccess = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aSuccess = acc->AddItemToSelection(aIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvRemoveItemFromSelection(const uint64_t& aID,
+                                                const uint32_t& aIndex,
+                                                bool* aSuccess)
+{
+  *aSuccess = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aSuccess = acc->RemoveItemFromSelection(aIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvSelectAll(const uint64_t& aID,
+                                  bool* aSuccess)
+{
+  *aSuccess = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aSuccess = acc->SelectAll();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvUnselectAll(const uint64_t& aID,
+                                    bool* aSuccess)
+{
+  *aSuccess = false;
+  Accessible* acc = IdToAccessibleSelect(aID);
+  if (acc) {
+    *aSuccess = acc->UnselectAll();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvDoAction(const uint64_t& aID,
+                                 const uint8_t& aIndex,
+                                 bool* aSuccess)
+{
+  *aSuccess = false;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aSuccess = acc->DoAction(aIndex);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvActionCount(const uint64_t& aID,
+                                    uint8_t* aCount)
+{
+  *aCount = 0;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aCount = acc->ActionCount();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvActionDescriptionAt(const uint64_t& aID,
+                                            const uint8_t& aIndex,
+                                            nsString* aDescription)
+{
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    acc->ActionDescriptionAt(aIndex, *aDescription);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvActionNameAt(const uint64_t& aID,
+                                     const uint8_t& aIndex,
+                                     nsString* aName)
+{
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    acc->ActionNameAt(aIndex, *aName);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvAccessKey(const uint64_t& aID,
+                                  uint32_t* aKey,
+                                  uint32_t* aModifierMask)
+{
+  *aKey = 0;
+  *aModifierMask = 0;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    KeyBinding kb = acc->AccessKey();
+    *aKey = kb.Key();
+    *aModifierMask = kb.ModifierMask();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvKeyboardShortcut(const uint64_t& aID,
+                                         uint32_t* aKey,
+                                         uint32_t* aModifierMask)
+{
+  *aKey = 0;
+  *aModifierMask = 0;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    KeyBinding kb = acc->KeyboardShortcut();
+    *aKey = kb.Key();
+    *aModifierMask = kb.ModifierMask();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvCurValue(const uint64_t& aID,
+                                 double* aValue)
+{
+  *aValue = UnspecifiedNaN<double>();
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aValue = acc->CurValue();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvSetCurValue(const uint64_t& aID,
+                                    const double& aValue,
+                                    bool* aRetVal)
+{
+  *aRetVal = false;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aRetVal = acc->SetCurValue(aValue);
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvMinValue(const uint64_t& aID,
+                                 double* aValue)
+{
+  *aValue = UnspecifiedNaN<double>();
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aValue = acc->MinValue();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvMaxValue(const uint64_t& aID,
+                                 double* aValue)
+{
+  *aValue = UnspecifiedNaN<double>();
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aValue = acc->MaxValue();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvStep(const uint64_t& aID,
+                             double* aStep)
+{
+  *aStep = UnspecifiedNaN<double>();
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    *aStep = acc->Step();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvTakeFocus(const uint64_t& aID)
+{
+  Accessible* acc = IdToAccessible(aID);
+  if (acc) {
+    acc->TakeFocus();
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID,
+                                     const int32_t& aX,
+                                     const int32_t& aY,
+                                     const uint32_t& aWhich,
+                                     uint64_t* aChild,
+                                     bool* aOk)
+{
+  *aChild = 0;
+  *aOk = false;
+  Accessible* acc = IdToAccessible(aID);
+  if (acc && !acc->IsDefunct() && !nsAccUtils::MustPrune(acc)) {
+    Accessible* child =
+      acc->ChildAtPoint(aX, aY,
+                        static_cast<Accessible::EWhichChildAtPoint>(aWhich));
+    if (child) {
+      *aChild = reinterpret_cast<uint64_t>(child->UniqueID());
+      *aOk = true;
+    }
+  }
+
+  return true;
+}
+
+bool
+DocAccessibleChild::RecvBounds(const uint64_t& aID,
+                               nsIntRect* aRect)
+{
+  Accessible* acc = IdToAccessible(aID);
+  if (acc && !acc->IsDefunct()) {
+    *aRect = acc->Bounds();
+  }
+
+  return false;
+}
+
 }
 }
--- a/accessible/ipc/DocAccessibleChild.h
+++ b/accessible/ipc/DocAccessibleChild.h
@@ -10,17 +10,19 @@
 #include "mozilla/a11y/DocAccessible.h"
 #include "mozilla/a11y/PDocAccessibleChild.h"
 #include "nsISupportsImpl.h"
 
 namespace mozilla {
 namespace a11y {
 class Accessible;
 class HyperTextAccessible;
-
+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 PDocAccessibleChild
 {
@@ -29,167 +31,391 @@ public:
     mDoc(aDoc)
   { MOZ_COUNT_CTOR(DocAccessibleChild); }
   ~DocAccessibleChild()
   {
     mDoc->SetIPCDoc(nullptr);
     MOZ_COUNT_DTOR(DocAccessibleChild);
   }
 
-  Accessible* IdToAccessible(const uint64_t& aID);
-  HyperTextAccessible* IdToHyperTextAccessible(const uint64_t& aID);
-
   void ShowEvent(AccShowEvent* aShowEvent);
 
   /*
    * Return the state for the accessible with given ID.
    */
-  virtual bool RecvState(const uint64_t& aID, uint64_t* aState) MOZ_OVERRIDE;
+  virtual bool RecvState(const uint64_t& aID, uint64_t* aState) override;
 
   /*
    * Get the name for the accessible with given id.
    */
-  virtual bool RecvName(const uint64_t& aID, nsString* aName) MOZ_OVERRIDE;
+  virtual bool RecvName(const uint64_t& aID, nsString* aName) override;
 
-  virtual bool RecvValue(const uint64_t& aID, nsString* aValue) MOZ_OVERRIDE;
+  virtual bool RecvValue(const uint64_t& aID, nsString* aValue) override;
   
   /*
    * Get the description for the accessible with given id.
    */
-  virtual bool RecvDescription(const uint64_t& aID, nsString* aDesc) MOZ_OVERRIDE;
+  virtual bool RecvDescription(const uint64_t& aID, nsString* aDesc) override;
   virtual bool RecvRelationByType(const uint64_t& aID, const uint32_t& aType,
-                                  nsTArray<uint64_t>* aTargets) MOZ_OVERRIDE;
+                                  nsTArray<uint64_t>* aTargets) override;
   virtual bool RecvRelations(const uint64_t& aID,
                              nsTArray<RelationTargets>* aRelations)
-    MOZ_OVERRIDE;
+    override;
 
   virtual bool RecvAttributes(const uint64_t& aID,
-                              nsTArray<Attribute> *aAttributes) MOZ_OVERRIDE;
+                              nsTArray<Attribute> *aAttributes) override;
 
   virtual bool RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
-    MOZ_OVERRIDE;
+    override;
   virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset,
-                                  bool* aValid) MOZ_OVERRIDE;
+                                  bool* aValid) override;
 
   virtual bool RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
-     MOZ_OVERRIDE;
+     override;
   virtual bool RecvSelectionCount(const uint64_t& aID, int32_t* aCount)
-     MOZ_OVERRIDE;
+     override;
 
   virtual bool RecvTextSubstring(const uint64_t& aID,
                                  const int32_t& aStartOffset,
                                  const int32_t& aEndOffset, nsString* aText)
-    MOZ_OVERRIDE;
+    override;
 
   virtual bool RecvGetTextAfterOffset(const uint64_t& aID,
                                       const int32_t& aOffset,
                                       const int32_t& aBoundaryType,
                                       nsString* aText, int32_t* aStartOffset,
-                                      int32_t* aEndOffset) MOZ_OVERRIDE;
+                                      int32_t* aEndOffset) override;
   virtual bool RecvGetTextAtOffset(const uint64_t& aID,
                                    const int32_t& aOffset,
                                    const int32_t& aBoundaryType,
                                    nsString* aText, int32_t* aStartOffset,
-                                   int32_t* aEndOffset) MOZ_OVERRIDE;
+                                   int32_t* aEndOffset) override;
   virtual bool RecvGetTextBeforeOffset(const uint64_t& aID,
                                        const int32_t& aOffset,
                                        const int32_t& aBoundaryType,
                                        nsString* aText, int32_t* aStartOffset,
-                                       int32_t* aEndOffset) MOZ_OVERRIDE;
+                                       int32_t* aEndOffset) override;
 
   virtual bool RecvCharAt(const uint64_t& aID,
                           const int32_t& aOffset,
-                          uint16_t* aChar) MOZ_OVERRIDE;
+                          uint16_t* aChar) override;
 
   virtual bool RecvTextAttributes(const uint64_t& aID,
                                   const bool& aIncludeDefAttrs,
                                   const int32_t& aOffset,
                                   nsTArray<Attribute>* aAttributes,
                                   int32_t* aStartOffset,
                                   int32_t* aEndOffset)
-    MOZ_OVERRIDE;
+    override;
 
   virtual bool RecvDefaultTextAttributes(const uint64_t& aID,
                                          nsTArray<Attribute>* aAttributes)
-    MOZ_OVERRIDE;
+    override;
 
   virtual bool RecvTextBounds(const uint64_t& aID,
                               const int32_t& aStartOffset,
                               const int32_t& aEndOffset,
                               const uint32_t& aCoordType,
-                              nsIntRect* aRetVal) MOZ_OVERRIDE;
+                              nsIntRect* aRetVal) override;
 
   virtual bool RecvCharBounds(const uint64_t& aID,
                               const int32_t& aOffset,
                               const uint32_t& aCoordType,
-                              nsIntRect* aRetVal) MOZ_OVERRIDE;
+                              nsIntRect* aRetVal) override;
 
   virtual bool RecvOffsetAtPoint(const uint64_t& aID,
                                  const int32_t& aX,
                                  const int32_t& aY,
                                  const uint32_t& aCoordType,
-                                 int32_t* aRetVal) MOZ_OVERRIDE;
+                                 int32_t* aRetVal) override;
 
   virtual bool RecvSelectionBoundsAt(const uint64_t& aID,
                                      const int32_t& aSelectionNum,
                                      bool* aSucceeded,
                                      nsString* aData,
                                      int32_t* aStartOffset,
-                                     int32_t* aEndOffset) MOZ_OVERRIDE;
+                                     int32_t* aEndOffset) override;
 
   virtual bool RecvSetSelectionBoundsAt(const uint64_t& aID,
                                         const int32_t& aSelectionNum,
                                         const int32_t& aStartOffset,
                                         const int32_t& aEndOffset,
-                                        bool* aSucceeded) MOZ_OVERRIDE;
+                                        bool* aSucceeded) override;
 
   virtual bool RecvAddToSelection(const uint64_t& aID,
                                   const int32_t& aStartOffset,
                                   const int32_t& aEndOffset,
-                                  bool* aSucceeded) MOZ_OVERRIDE;
+                                  bool* aSucceeded) override;
 
   virtual bool RecvRemoveFromSelection(const uint64_t& aID,
                                        const int32_t& aSelectionNum,
-                                       bool* aSucceeded) MOZ_OVERRIDE;
+                                       bool* aSucceeded) override;
 
   virtual bool RecvScrollSubstringTo(const uint64_t& aID,
                                      const int32_t& aStartOffset,
                                      const int32_t& aEndOffset,
-                                     const uint32_t& aScrollType) MOZ_OVERRIDE;
+                                     const uint32_t& aScrollType) override;
 
   virtual bool RecvScrollSubstringToPoint(const uint64_t& aID,
                                           const int32_t& aStartOffset,
                                           const int32_t& aEndOffset,
                                           const uint32_t& aCoordinateType,
                                           const int32_t& aX,
-                                          const int32_t& aY) MOZ_OVERRIDE;
+                                          const int32_t& aY) override;
 
   virtual bool RecvReplaceText(const uint64_t& aID,
-                               const nsString& aText) MOZ_OVERRIDE;
+                               const nsString& aText) override;
 
   virtual bool RecvInsertText(const uint64_t& aID,
                               const nsString& aText,
-                              const int32_t& aPosition) MOZ_OVERRIDE;
+                              const int32_t& aPosition) override;
 
   virtual bool RecvCopyText(const uint64_t& aID,
                             const int32_t& aStartPos,
-                            const int32_t& aEndPos) MOZ_OVERRIDE;
+                            const int32_t& aEndPos) override;
 
   virtual bool RecvCutText(const uint64_t& aID,
                            const int32_t& aStartPos,
-                           const int32_t& aEndPos) MOZ_OVERRIDE;
+                           const int32_t& aEndPos) override;
 
   virtual bool RecvDeleteText(const uint64_t& aID,
                               const int32_t& aStartPos,
-                              const int32_t& aEndPos) MOZ_OVERRIDE;
+                              const int32_t& aEndPos) override;
 
   virtual bool RecvPasteText(const uint64_t& aID,
-                             const int32_t& aPosition) MOZ_OVERRIDE;
+                             const int32_t& aPosition) override;
+
+  virtual bool RecvImagePosition(const uint64_t& aID,
+                                 const uint32_t& aCoordType,
+                                 nsIntPoint* aRetVal) override;
+
+  virtual bool RecvImageSize(const uint64_t& aID,
+                             nsIntSize* aRetVal) override;
+
+  virtual bool RecvStartOffset(const uint64_t& aID,
+                               uint32_t* aRetVal,
+                               bool* aOk) override;
+  virtual bool RecvEndOffset(const uint64_t& aID,
+                             uint32_t* aRetVal,
+                             bool* aOk) override;
+  virtual bool RecvIsLinkValid(const uint64_t& aID,
+                               bool* aRetVal) override;
+  virtual bool RecvAnchorCount(const uint64_t& aID,
+                               uint32_t* aRetVal, bool* aOk) override;
+  virtual bool RecvAnchorURIAt(const uint64_t& aID,
+                               const uint32_t& aIndex,
+                               nsCString* aURI,
+                               bool* aOk) override;
+  virtual bool RecvAnchorAt(const uint64_t& aID,
+                            const uint32_t& aIndex,
+                            uint64_t* aIDOfAnchor,
+                            bool* aOk) override;
+
+  virtual bool RecvLinkCount(const uint64_t& aID,
+                             uint32_t* aCount) override;
+
+  virtual bool RecvLinkAt(const uint64_t& aID,
+                          const uint32_t& aIndex,
+                          uint64_t* aIDOfLink,
+                          bool* aOk) override;
+
+  virtual bool RecvLinkIndexOf(const uint64_t& aID,
+                               const uint64_t& aLinkID,
+                               int32_t* aIndex) override;
+
+  virtual bool RecvLinkIndexAtOffset(const uint64_t& aID,
+                                     const uint32_t& aOffset,
+                                     int32_t* aIndex) override;
+
+  virtual bool RecvTableOfACell(const uint64_t& aID,
+                                uint64_t* aTableID,
+                                bool* aOk) override;
+
+  virtual bool RecvColIdx(const uint64_t& aID, uint32_t* aIndex) override;
+
+  virtual bool RecvRowIdx(const uint64_t& aID, uint32_t* aIndex) override;
+
+  virtual bool RecvColExtent(const uint64_t& aID, uint32_t* aExtent) override;
+
+  virtual bool RecvRowExtent(const uint64_t& aID, uint32_t* aExtent) override;
+
+  virtual bool RecvColHeaderCells(const uint64_t& aID,
+                                  nsTArray<uint64_t>* aCells) override;
+
+  virtual bool RecvRowHeaderCells(const uint64_t& aID,
+                                  nsTArray<uint64_t>* aCells) override;
+
+  virtual bool RecvIsCellSelected(const uint64_t& aID,
+                                  bool* aSelected) override;
 
+  virtual bool RecvTableCaption(const uint64_t& aID,
+                                uint64_t* aCaptionID,
+                                bool* aOk) override;
+  virtual bool RecvTableSummary(const uint64_t& aID,
+                                nsString* aSummary) override;
+  virtual bool RecvTableColumnCount(const uint64_t& aID,
+                                    uint32_t* aColCount) override;
+  virtual bool RecvTableRowCount(const uint64_t& aID,
+                                 uint32_t* aRowCount) override;
+  virtual bool RecvTableCellAt(const uint64_t& aID,
+                               const uint32_t& aRow,
+                               const uint32_t& aCol,
+                               uint64_t* aCellID,
+                               bool* aOk) override;
+  virtual bool RecvTableCellIndexAt(const uint64_t& aID,
+                                    const uint32_t& aRow,
+                                    const uint32_t& aCol,
+                                    int32_t* aIndex) override;
+  virtual bool RecvTableColumnIndexAt(const uint64_t& aID,
+                                      const uint32_t& aCellIndex,
+                                      int32_t* aCol) override;
+  virtual bool RecvTableRowIndexAt(const uint64_t& aID,
+                                   const uint32_t& aCellIndex,
+                                   int32_t* aRow) override;
+  virtual bool RecvTableRowAndColumnIndicesAt(const uint64_t& aID,
+                                             const uint32_t& aCellIndex,
+                                             int32_t* aRow,
+                                             int32_t* aCol) override;
+  virtual bool RecvTableColumnExtentAt(const uint64_t& aID,
+                                       const uint32_t& aRow,
+                                       const uint32_t& aCol,
+                                       uint32_t* aExtent) override;
+  virtual bool RecvTableRowExtentAt(const uint64_t& aID,
+                                    const uint32_t& aRow,
+                                    const uint32_t& aCol,
+                                    uint32_t* aExtent) override;
+  virtual bool RecvTableColumnDescription(const uint64_t& aID,
+                                          const uint32_t& aCol,
+                                          nsString* aDescription) override;
+  virtual bool RecvTableRowDescription(const uint64_t& aID,
+                                       const uint32_t& aRow,
+                                       nsString* aDescription) override;
+  virtual bool RecvTableColumnSelected(const uint64_t& aID,
+                                       const uint32_t& aCol,
+                                       bool* aSelected) override;
+  virtual bool RecvTableRowSelected(const uint64_t& aID,
+                                    const uint32_t& aRow,
+                                    bool* aSelected) override;
+  virtual bool RecvTableCellSelected(const uint64_t& aID,
+                                     const uint32_t& aRow,
+                                     const uint32_t& aCol,
+                                     bool* aSelected) override;
+  virtual bool RecvTableSelectedCellCount(const uint64_t& aID,
+                                          uint32_t* aSelectedCells) override;
+  virtual bool RecvTableSelectedColumnCount(const uint64_t& aID,
+                                            uint32_t* aSelectedColumns) override;
+  virtual bool RecvTableSelectedRowCount(const uint64_t& aID,
+                                         uint32_t* aSelectedRows) override;
+  virtual bool RecvTableSelectedCells(const uint64_t& aID,
+                                      nsTArray<uint64_t>* aCellIDs) override;
+  virtual bool RecvTableSelectedCellIndices(const uint64_t& aID,
+                                            nsTArray<uint32_t>* aCellIndices) override;
+  virtual bool RecvTableSelectedColumnIndices(const uint64_t& aID,
+                                              nsTArray<uint32_t>* aColumnIndices) override;
+  virtual bool RecvTableSelectedRowIndices(const uint64_t& aID,
+                                           nsTArray<uint32_t>* aRowIndices) override;
+  virtual bool RecvTableSelectColumn(const uint64_t& aID,
+                                     const uint32_t& aCol) override;
+  virtual bool RecvTableSelectRow(const uint64_t& aID,
+                                  const uint32_t& aRow) override;
+  virtual bool RecvTableUnselectColumn(const uint64_t& aID,
+                                       const uint32_t& aCol) override;
+  virtual bool RecvTableUnselectRow(const uint64_t& aID,
+                                    const uint32_t& aRow) override;
+  virtual bool RecvTableIsProbablyForLayout(const uint64_t& aID,
+                                            bool* aForLayout) override;
+
+  virtual bool RecvSelectedItems(const uint64_t& aID,
+                                 nsTArray<uint64_t>* aSelectedItemIDs) override;
+
+  virtual bool RecvSelectedItemCount(const uint64_t& aID,
+                                     uint32_t* aCount) override;
+
+  virtual bool RecvGetSelectedItem(const uint64_t& aID,
+                                   const uint32_t& aIndex,
+                                   uint64_t* aSelected,
+                                   bool* aOk) override;
+
+  virtual bool RecvIsItemSelected(const uint64_t& aID,
+                                  const uint32_t& aIndex,
+                                  bool* aSelected) override;
+
+  virtual bool RecvAddItemToSelection(const uint64_t& aID,
+                                      const uint32_t& aIndex,
+                                      bool* aSuccess) override;
+
+  virtual bool RecvRemoveItemFromSelection(const uint64_t& aID,
+                                           const uint32_t& aIndex,
+                                           bool* aSuccess) override;
+
+  virtual bool RecvSelectAll(const uint64_t& aID,
+                             bool* aSuccess) override;
+
+  virtual bool RecvUnselectAll(const uint64_t& aID,
+                               bool* aSuccess) override;
+
+  virtual bool RecvDoAction(const uint64_t& aID,
+                            const uint8_t& aIndex,
+                            bool* aSuccess) override;
+
+  virtual bool RecvActionCount(const uint64_t& aID,
+                               uint8_t* aCount) override;
+
+  virtual bool RecvActionDescriptionAt(const uint64_t& aID,
+                                       const uint8_t& aIndex,
+                                       nsString* aDescription) override;
+
+  virtual bool RecvActionNameAt(const uint64_t& aID,
+                                const uint8_t& aIndex,
+                                nsString* aName) override;
+
+  virtual bool RecvAccessKey(const uint64_t& aID,
+                             uint32_t* aKey,
+                             uint32_t* aModifierMask) override;
+
+  virtual bool RecvKeyboardShortcut(const uint64_t& aID,
+                                    uint32_t* aKey,
+                                    uint32_t* aModifierMask) override;
+
+  virtual bool RecvCurValue(const uint64_t& aID,
+                            double* aValue);
+
+  virtual bool RecvSetCurValue(const uint64_t& aID,
+                               const double& aValue,
+                               bool* aRetVal);
+
+  virtual bool RecvMinValue(const uint64_t& aID,
+                            double* aValue);
+
+  virtual bool RecvMaxValue(const uint64_t& aID,
+                            double* aValue);
+
+  virtual bool RecvStep(const uint64_t& aID,
+                        double* aStep);
+
+  virtual bool RecvTakeFocus(const uint64_t& aID) override;
+
+  virtual bool RecvChildAtPoint(const uint64_t& aID,
+                                const int32_t& aX,
+                                const int32_t& aY,
+                                const uint32_t& aWhich,
+                                uint64_t* aChild,
+                                bool* aOk) override;
+
+  virtual bool RecvBounds(const uint64_t& aID, nsIntRect* aRect) override;
 private:
+
+  Accessible* IdToAccessible(const uint64_t& aID) const;
+  Accessible* IdToAccessibleLink(const uint64_t& aID) const;
+  Accessible* IdToAccessibleSelect(const uint64_t& aID) const;
+  HyperTextAccessible* IdToHyperTextAccessible(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;
 };
 
 }
 }
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -132,29 +132,43 @@ DocAccessibleParent::RecvEvent(const uin
   if (!e) {
     NS_ERROR("no proxy for event!");
     return true;
   }
 
   ProxyEvent(e->mProxy, aEventType);
   return true;
 }
+
+bool
+DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
+{
+  auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
+  DebugOnly<bool> result = AddChildDoc(childDoc, aID, false);
+  MOZ_ASSERT(result);
+  return true;
+}
+
 bool
 DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
-                                 uint64_t aParentID)
+                                 uint64_t aParentID, bool aCreating)
 {
   ProxyAccessible* outerDoc = mAccessibles.GetEntry(aParentID)->mProxy;
   if (!outerDoc)
     return false;
 
   aChildDoc->mParent = outerDoc;
   outerDoc->SetChildDoc(aChildDoc);
   mChildDocs.AppendElement(aChildDoc);
   aChildDoc->mParentDoc = this;
-  ProxyCreated(aChildDoc, 0);
+
+  if (aCreating) {
+    ProxyCreated(aChildDoc, 0);
+  }
+
   return true;
 }
 
 PLDHashOperator
 DocAccessibleParent::ShutdownAccessibles(ProxyEntry* entry, void*)
 {
   ProxyDestroyed(entry->mProxy);
   return PL_DHASH_REMOVE;
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -35,39 +35,48 @@ public:
     MOZ_ASSERT(!mParentDoc);
   }
 
   /*
    * Called when a message from a document in a child process notifies the main
    * process it is firing an event.
    */
   virtual bool RecvEvent(const uint64_t& aID, const uint32_t& aType)
-    MOZ_OVERRIDE;
+    override;
+
+  virtual bool RecvShowEvent(const ShowEventData& aData) override;
+  virtual bool RecvHideEvent(const uint64_t& aRootID) override;
 
-  virtual bool RecvShowEvent(const ShowEventData& aData) MOZ_OVERRIDE;
-  virtual bool RecvHideEvent(const uint64_t& aRootID) MOZ_OVERRIDE;
+  virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
+  void Unbind()
+  {
+    mParent = nullptr;
+    mParentDoc->mChildDocs.RemoveElement(this);
+    mParentDoc = nullptr;
+  }
 
   void Destroy();
-  virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE
+  virtual void ActorDestroy(ActorDestroyReason aWhy) override
   {
     if (!mShutdown)
       Destroy();
   }
 
   /*
    * Return the main processes representation of the parent document (if any)
    * of the document this object represents.
    */
   DocAccessibleParent* Parent() const { return mParentDoc; }
 
   /*
    * Called when a document in a content process notifies the main process of a
    * new child document.
    */
-  bool AddChildDoc(DocAccessibleParent* aChildDoc, uint64_t aParentID);
+  bool AddChildDoc(DocAccessibleParent* aChildDoc, uint64_t aParentID,
+                   bool aCreating = true);
 
   /*
    * Called when the document in the content process this object represents
    * notifies the main process a child document has been removed.
    */
   void RemoveChildDoc(DocAccessibleParent* aChildDoc)
   {
     aChildDoc->mParent->SetChildDoc(nullptr);
--- a/accessible/ipc/PDocAccessible.ipdl
+++ b/accessible/ipc/PDocAccessible.ipdl
@@ -3,16 +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/. */
 
 include protocol PContent;
 
 include "mozilla/GfxMessageUtils.h";
 
+using struct nsIntPoint from "nsRect.h";
+using struct nsIntSize from "nsRect.h";
 using struct nsIntRect from "nsRect.h";
 
 namespace mozilla {
 namespace a11y {
 
 struct AccessibleData
 {
   uint64_t ID;
@@ -50,16 +52,22 @@ parent:
   /*
    * Notify the parent process the document in the child process is firing an
    * event.
    */
   Event(uint64_t aID, uint32_t type);
   ShowEvent(ShowEventData data);
   HideEvent(uint64_t aRootID);
 
+  /*
+   * Tell the parent document to bind the existing document as a new child
+   * document.
+   */
+  BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
+
 child:
   // Accessible
   prio(high) sync State(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 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)
@@ -116,12 +124,92 @@ child:
                          int32_t aX, int32_t aY);
 
   prio(high) sync ReplaceText(uint64_t aID, nsString aText);
   prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition);
   prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos);
   prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos);
   prio(high) sync DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos);
   prio(high) sync PasteText(uint64_t aID, int32_t aPosition);
+
+  prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(nsIntPoint aRetVal);
+  prio(high) sync ImageSize(uint64_t aID) returns(nsIntSize 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 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);
+
+  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 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);
+
+  prio(high) sync TakeFocus(uint64_t aID);
+  prio(high) sync ChildAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aWhich)
+    returns(uint64_t aChild, bool aOk);
+  prio(high) sync Bounds(uint64_t aID) returns(nsIntRect aRect);
 };
 
 }
 }
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -24,17 +24,17 @@ ProxyAccessible::Shutdown()
   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!");
 
-    static_cast<DocAccessibleParent*>(mChildren[0])->Destroy();
+    static_cast<DocAccessibleParent*>(mChildren[0])->Unbind();
   }
 
   mChildren.Clear();
   ProxyDestroyed(this);
   mDoc->RemoveAccessible(this);
 }
 
 void
@@ -358,10 +358,558 @@ ProxyAccessible::DeleteText(int32_t aSta
 }
 
 void
 ProxyAccessible::PasteText(int32_t aPosition)
 {
   unused << mDoc->SendPasteText(mID, aPosition);
 }
 
+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<uint64_t>* aCells)
+{
+  unused << mDoc->SendColHeaderCells(mID, aCells);
+}
+
+void
+ProxyAccessible::RowHeaderCells(nsTArray<uint64_t>* aCells)
+{
+  unused << mDoc->SendRowHeaderCells(mID, aCells);
+}
+
+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)
+{
+  nsAutoTArray<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;
+}
+
+void
+ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
+{
+  nsAutoTArray<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;
+}
+
+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);
+}
+
+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::ChildAtPoint(int32_t aX, int32_t aY,
+                              Accessible::EWhichChildAtPoint aWhichChild)
+{
+  uint64_t childID = 0;
+  bool ok = false;
+  unused << mDoc->SendChildAtPoint(mID, aX, aY,
+                                   static_cast<uint32_t>(aWhichChild),
+                                   &childID, &ok);
+  return ok ? mDoc->GetAccessible(childID) : nullptr;
+}
+
+nsIntRect
+ProxyAccessible::Bounds()
+{
+  nsIntRect rect;
+  unused << mDoc->SendBounds(mID, &rect);
+  return rect;
+}
+
 }
 }
--- a/accessible/ipc/ProxyAccessible.h
+++ b/accessible/ipc/ProxyAccessible.h
@@ -4,19 +4,21 @@
  * 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 "mozilla/a11y/Role.h"
 #include "nsIAccessibleText.h"
+#include "Accessible.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsRect.h"
+#include "Accessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class Attribute;
 class DocAccessibleParent;
 enum class RelationType;
 
@@ -37,16 +39,19 @@ public:
     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]; }
+
+  // XXX evaluate if this is fast enough.
+  size_t IndexInParent() const { return mParent->mChildren.IndexOf(this); }
   bool MustPruneChildren() const;
 
   void Shutdown();
 
   void SetChildDoc(DocAccessibleParent*);
 
   /**
    * Remove The given child.
@@ -169,16 +174,113 @@ public:
   void CopyText(int32_t aStartPos, int32_t aEndPos);
 
   void CutText(int32_t aStartPos, int32_t aEndPos);
 
   void DeleteText(int32_t aStartPos, int32_t aEndPos);
 
   void PasteText(int32_t aPosition);
 
+  nsIntPoint ImagePosition(uint32_t aCoordType);
+
+  nsIntSize ImageSize();
+
+  uint32_t StartOffset(bool* aOk);
+
+  uint32_t EndOffset(bool* aOk);
+
+  bool IsLinkValid();
+
+  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<uint64_t>* aCells);
+
+  void RowHeaderCells(nsTArray<uint64_t>* 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();
+
+  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();
+
+  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();
+
+  double CurValue();
+  bool SetCurValue(double aValue);
+  double MinValue();
+  double MaxValue();
+  double Step();
+
+  void TakeFocus();
+  ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY,
+                                Accessible::EWhichChildAtPoint aWhichChild);
+  nsIntRect Bounds();
+
   /**
    * 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.
--- a/accessible/ipc/moz.build
+++ b/accessible/ipc/moz.build
@@ -21,13 +21,31 @@ if CONFIG['ACCESSIBILITY']:
         'ProxyAccessible.cpp'
     ]
 
     LOCAL_INCLUDES += [
         '../base',
         '../generic',
     ]
 
+    if CONFIG['MOZ_ENABLE_GTK']:
+        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',
+        ]
+
     FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FAIL_ON_WARNINGS = True
--- a/accessible/jsat/Utils.jsm
+++ b/accessible/jsat/Utils.jsm
@@ -296,46 +296,46 @@ this.Utils = { // jshint ignore:line
   getVirtualCursor: function getVirtualCursor(aDocument) {
     let doc = (aDocument instanceof Ci.nsIAccessible) ? aDocument :
       this.AccRetrieval.getAccessibleFor(aDocument);
 
     return doc.QueryInterface(Ci.nsIAccessibleDocument).virtualCursor;
   },
 
   getContentResolution: function _getContentResolution(aAccessible) {
-    let resX = { value: 1 }, resY = { value: 1 };
+    let res = { value: 1 };
     aAccessible.document.window.QueryInterface(
       Ci.nsIInterfaceRequestor).getInterface(
-      Ci.nsIDOMWindowUtils).getResolution(resX, resY);
-    return [resX.value, resY.value];
+      Ci.nsIDOMWindowUtils).getResolution(res);
+    return res.value;
   },
 
   getBounds: function getBounds(aAccessible, aPreserveContentScale) {
     let objX = {}, objY = {}, objW = {}, objH = {};
     aAccessible.getBounds(objX, objY, objW, objH);
 
-    let [scaleX, scaleY] = aPreserveContentScale ? [1, 1] :
+    let scale = aPreserveContentScale ? 1 :
       this.getContentResolution(aAccessible);
 
     return new Rect(objX.value, objY.value, objW.value, objH.value).scale(
-      scaleX, scaleY);
+      scale, scale);
   },
 
   getTextBounds: function getTextBounds(aAccessible, aStart, aEnd,
                                         aPreserveContentScale) {
     let accText = aAccessible.QueryInterface(Ci.nsIAccessibleText);
     let objX = {}, objY = {}, objW = {}, objH = {};
     accText.getRangeExtents(aStart, aEnd, objX, objY, objW, objH,
       Ci.nsIAccessibleCoordinateType.COORDTYPE_SCREEN_RELATIVE);
 
-    let [scaleX, scaleY] = aPreserveContentScale ? [1, 1] :
+    let scale = aPreserveContentScale ? 1 :
       this.getContentResolution(aAccessible);
 
     return new Rect(objX.value, objY.value, objW.value, objH.value).scale(
-      scaleX, scaleY);
+      scale, scale);
   },
 
   /**
    * Get current display DPI.
    */
   get dpi() {
     delete this.dpi;
     this.dpi = this.winUtils.displayDPI;
--- a/accessible/mac/AccessibleWrap.h
+++ b/accessible/mac/AccessibleWrap.h
@@ -31,32 +31,32 @@ class AccessibleWrap : public Accessible
 {
 public: // construction, destruction
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~AccessibleWrap();
 
   /**
    * Get the native Obj-C object (mozAccessible).
    */
-  virtual void GetNativeInterface(void** aOutAccessible) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void** aOutAccessible) override;
 
   /**
    * The objective-c |Class| type that this accessible's native object
    * should be instantied with.   used on runtime to determine the
    * right type for this accessible's associated native object.
    */
   virtual Class GetNativeType ();
 
-  virtual void Shutdown () MOZ_OVERRIDE;
-  virtual void InvalidateChildren() MOZ_OVERRIDE;
+  virtual void Shutdown () override;
+  virtual void InvalidateChildren() override;
 
-  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) MOZ_OVERRIDE;
-  virtual bool RemoveChild(Accessible* aAccessible) MOZ_OVERRIDE;
+  virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
+  virtual bool RemoveChild(Accessible* aAccessible) override;
 
-  virtual nsresult HandleAccEvent(AccEvent* aEvent) MOZ_OVERRIDE;
+  virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
 
   /**
    * Ignored means that the accessible might still have children, but is not
    * displayed to the user. it also has no native accessible object represented
    * for it.
    */
   bool IsIgnored();
   
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -365,17 +365,18 @@ function testAccessibleTree(aAccOrElmOrI
     accTree = {
       role: nsIAccessibleRole[roleName],
       children: accTree[key]
     };
   }
 
   // Test accessible properties.
   for (var prop in accTree) {
-    var msg = "Wrong value of property '" + prop + "' for " + prettyName(acc) + ".";
+    var msg = "Wrong value of property '" + prop + "' for " +
+               prettyName(acc) + ".";
 
     switch (prop) {
     case "actions": {
       testActionNames(acc, accTree.actions);
       break;
     }
 
     case "attributes":
@@ -446,20 +447,39 @@ function testAccessibleTree(aAccOrElmOrI
     }
   }
 
   // Test children.
   if ("children" in accTree && accTree["children"] instanceof Array) {
     var children = acc.children;
     var childCount = children.length;
 
-    is(childCount, accTree.children.length,
-       "Different amount of expected children of " + prettyName(acc) + ".");
 
-    if (accTree.children.length == childCount) {
+    if (accTree.children.length != childCount) {
+      for (var i = 0; i < Math.max(accTree.children.length, childCount); i++) {
+        var accChild;
+        try {
+          accChild = children.queryElementAt(i, nsIAccessible);
+          if (!accTree.children[i]) {
+            ok(false, prettyName(acc) + " has an extra child at index " + i +
+              " : " + prettyName(accChild));
+          }
+          if (accChild.role !== accTree.children[i].role) {
+            ok(false, prettyName(accTree) + " and " + prettyName(acc) +
+              " have different children at index " + i + " : " +
+              prettyName(accTree.children[i]) + ", " + prettyName(accChild));
+          }
+          info("Matching " + prettyName(accTree) + " and " + prettyName(acc) +
+               " child at index " + i + " : " + prettyName(accChild));
+        } catch (e) {
+          ok(false, prettyName(accTree) + " has an extra child at index " + i +
+             " : " + prettyName(accTree.children[i]));
+        }
+      }
+    } else {
       if (aFlags & kSkipTreeFullCheck) {
         for (var i = 0; i < childCount; i++) {
           var child = children.queryElementAt(i, nsIAccessible);
           testAccessibleTree(child, accTree.children[i], aFlags);
         }
         return;
       }
 
@@ -532,17 +552,18 @@ function isAccessibleInCache(aNodeOrId)
  * @param  aNodeOrId  [in] the DOM node identifier for the defunct accessible
  */
 function testDefunctAccessible(aAcc, aNodeOrId)
 {
   if (aNodeOrId)
     ok(!isAccessible(aNodeOrId),
        "Accessible for " + aNodeOrId + " wasn't properly shut down!");
 
-  var msg = " doesn't fail for shut down accessible " + prettyName(aNodeOrId) + "!";
+  var msg = " doesn't fail for shut down accessible " +
+             prettyName(aNodeOrId) + "!";
 
   // firstChild
   var success = false;
   try {
     aAcc.firstChild;
   } catch (e) {
     success = (e.result == Components.results.NS_ERROR_FAILURE)
   }
@@ -715,16 +736,20 @@ function prettyName(aIdentifier)
     msg += "]";
 
     return msg;
   }
 
   if (aIdentifier instanceof nsIDOMNode)
     return "[ " + getNodePrettyName(aIdentifier) + " ]";
 
+  if (aIdentifier && typeof aIdentifier === "object" ) {
+    return JSON.stringify(aIdentifier);
+  }
+
   return " '" + aIdentifier + "' ";
 }
 
 /**
  * Shorten a long string if it exceeds MAX_TRIM_LENGTH.
  * @param aString the string to shorten.
  * @returns the shortened string.
  */
--- a/accessible/tests/mochitest/table.js
+++ b/accessible/tests/mochitest/table.js
@@ -23,43 +23,61 @@ const kSpanned = kRowSpanned | kColSpann
 /**
  * Constants to define column header type.
  */
 const kNoColumnHeader = 0;
 const kListboxColumnHeader = 1;
 const kTreeColumnHeader = 2;
 
 /**
+ * Constants to define table type.
+ */
+const kTable = 0;
+const kTreeTable = 1;
+const kMathTable = 2;
+
+/**
  * Test table structure and related methods.
  *
  * @param  aIdentifier     [in] table accessible identifier
  * @param  aCellsArray     [in] two dimensional array (row X columns) of
  *                          cell types (see constants defined above).
  * @param  aColHeaderType  [in] specifies wether column header cells are
  *                          arranged into the list.
  * @param  aCaption        [in] caption text if any
  * @param  aSummary        [in] summary text if any
- * @param  aIsTreeTable    [in] specifies whether given table is tree table
+ * @param  aTableType      [in] specifies the table type.
+ * @param  aRowRoles       [in] array of row roles.
  */
 function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
-                         aCaption, aSummary, aIsTreeTable)
+                         aCaption, aSummary, aTableType, aRowRoles)
 {
   var tableNode = getNode(aIdentifier);
   var isGrid = tableNode.getAttribute("role") == "grid" ||
     tableNode.getAttribute("role") == "treegrid" ||
     tableNode.localName == "tree";
 
   var rowCount = aCellsArray.length;
   var colsCount = aCellsArray[0] ? aCellsArray[0].length : 0;
 
   // Test table accessible tree.
   var tableObj = {
-    role: aIsTreeTable ? ROLE_TREE_TABLE : ROLE_TABLE,
     children: []
   };
+  switch (aTableType) {
+    case kTable:
+      tableObj.role = ROLE_TABLE;
+      break;
+    case kTreeTable:
+      tableObj.role = ROLE_TREE_TABLE;
+      break;
+    case kMathTable:
+      tableObj.role = ROLE_MATHML_TABLE;
+      break;
+  }
 
   // caption accessible handling
   if (aCaption) {
     var captionObj = {
       role: ROLE_CAPTION,
       children: [
         {
           role: ROLE_TEXT_LEAF,
@@ -94,27 +112,28 @@ function testTableStruct(aIdentifier, aC
     }
 
     tableObj.children.push(headersObj);
   }
 
   // rows and cells accessibles
   for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     var rowObj = {
-      role: ROLE_ROW,
+      role: aRowRoles ? aRowRoles[rowIdx] : ROLE_ROW,
       children: []
     };
 
     for (var colIdx = 0; colIdx < colsCount; colIdx++) {
       var celltype = aCellsArray[rowIdx][colIdx];
 
       var role = ROLE_NOTHING;
       switch (celltype) {
         case kDataCell:
-          role = (isGrid ? ROLE_GRID_CELL : ROLE_CELL);
+          role = (aTableType == kMathTable ? ROLE_MATHML_CELL :
+                  (isGrid ? ROLE_GRID_CELL : ROLE_CELL));
           break;
         case kRowHeaderCell:
           role = ROLE_ROWHEADER;
           break;
         case kColHeaderCell:
           role = ROLE_COLUMNHEADER;
           break;
       }
@@ -690,19 +709,19 @@ function testHeaderCells(aHeaderInfoMap)
        "Wrong number of row header cells for the cell " +
        prettyName(dataCellIdentifier));
 
     if (actualRowHeaderCellsCount == rowHeaderCellsCount) {
       for (var idx = 0; idx < rowHeaderCellsCount; idx++) {
         var rowHeaderCell = getAccessible(rowHeaderCells[idx]);
         var actualRowHeaderCell =
           actualRowHeaderCells.queryElementAt(idx, nsIAccessible);
-        ok(actualRowHeaderCell, rowHeaderCell,
-           "Wrong row header cell at index " + idx + " for the cell " +
-           prettyName(rowHeaderCells[idx]));
+        isObject(actualRowHeaderCell, rowHeaderCell,
+                 "Wrong row header cell at index " + idx + " for the cell " +
+                 dataCellIdentifier);
       }
     }
 
     // column header cells
     var colHeaderCells = aHeaderInfoMap[testIdx].columnHeaderCells;
     var colHeaderCellsCount = colHeaderCells.length;
     var actualColHeaderCells = dataCell.columnHeaderCells;
     var actualColHeaderCellsCount = actualColHeaderCells.length;
@@ -711,19 +730,19 @@ function testHeaderCells(aHeaderInfoMap)
        "Wrong number of column header cells for the cell " +
        prettyName(dataCellIdentifier));
 
     if (actualColHeaderCellsCount == colHeaderCellsCount) {
       for (var idx = 0; idx < colHeaderCellsCount; idx++) {
         var colHeaderCell = getAccessible(colHeaderCells[idx]);
         var actualColHeaderCell =
           actualColHeaderCells.queryElementAt(idx, nsIAccessible);
-        ok(actualColHeaderCell, colHeaderCell,
-           "Wrong column header cell at index " + idx + " for the cell " +
-           prettyName(colHeaderCells[idx]));
+        isObject(actualColHeaderCell, colHeaderCell,
+                 "Wrong column header cell at index " + idx + " for the cell " +
+                 dataCellIdentifier);
       }
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // private implementation
 
--- a/accessible/tests/mochitest/table/a11y.ini
+++ b/accessible/tests/mochitest/table/a11y.ini
@@ -4,16 +4,17 @@
 [test_headers_listbox.xul]
 [test_headers_table.html]
 [test_headers_tree.xul]
 [test_indexes_ariagrid.html]
 [test_indexes_listbox.xul]
 [test_indexes_table.html]
 [test_indexes_tree.xul]
 [test_layoutguess.html]
+[test_mtable.html]
 [test_sels_ariagrid.html]
 [test_sels_listbox.xul]
 [test_sels_table.html]
 [test_sels_tree.xul]
 [test_struct_ariagrid.html]
 [test_struct_ariatreegrid.html]
 [test_struct_listbox.xul]
 [test_struct_table.html]
--- a/accessible/tests/mochitest/table/test_headers_table.html
+++ b/accessible/tests/mochitest/table/test_headers_table.html
@@ -151,16 +151,288 @@
           cell: "table6_cell",
           rowHeaderCells: [ "table6_rh" ],
           columnHeaderCells: [ "table6_ch" ]
         }
       ];
 
       testHeaderCells(headerInfoMap);
 
+      //////////////////////////////////////////////////////////////////////////
+      // @scope="rowgroup" and @scope="row"
+
+      headerInfoMap = [
+        {
+          cell: "t7_r1c1",
+          rowHeaderCells: [ "t7_Mary", "t7_Females" ],
+          columnHeaderCells: [ "t7_1km" ]
+        },
+        {
+          cell: "t7_r1c2",
+          rowHeaderCells: [ "t7_Mary", "t7_Females" ],
+          columnHeaderCells: [ "t7_5km" ]
+        },
+        {
+          cell: "t7_r1c3",
+          rowHeaderCells: [ "t7_Mary", "t7_Females" ],
+          columnHeaderCells: [ "t7_10km" ]
+        },
+        {
+          cell: "t7_r2c1",
+          rowHeaderCells: [ "t7_Betsy", "t7_Females" ],
+          columnHeaderCells: [ "t7_1km" ]
+        },
+        {
+          cell: "t7_r2c2",
+          rowHeaderCells: [ "t7_Betsy", "t7_Females" ],
+          columnHeaderCells: [ "t7_5km" ]
+        },
+        {
+          cell: "t7_r2c3",
+          rowHeaderCells: [ "t7_Betsy", "t7_Females" ],
+          columnHeaderCells: [ "t7_10km" ]
+        },
+        {
+          cell: "t7_r3c1",
+          rowHeaderCells: [ "t7_Matt", "t7_Males" ],
+          columnHeaderCells: [ "t7_1km" ]
+        },
+        {
+          cell: "t7_r3c2",
+          rowHeaderCells: [ "t7_Matt", "t7_Males" ],
+          columnHeaderCells: [ "t7_5km" ]
+        },
+        {
+          cell: "t7_r3c3",
+          rowHeaderCells: [ "t7_Matt", "t7_Males" ],
+          columnHeaderCells: [ "t7_10km" ]
+        },
+        {
+          cell: "t7_r4c1",
+          rowHeaderCells: [ "t7_Todd", "t7_Males" ],
+          columnHeaderCells: [ "t7_1km" ]
+        },
+        {
+          cell: "t7_r4c2",
+          rowHeaderCells: [ "t7_Todd", "t7_Males" ],
+          columnHeaderCells: [ "t7_5km" ]
+        },
+        {
+          cell: "t7_r4c3",
+          rowHeaderCells: [ "t7_Todd", "t7_Males" ],
+          columnHeaderCells: [ "t7_10km" ]
+        }
+      ];
+
+      testHeaderCells(headerInfoMap);
+
+      //////////////////////////////////////////////////////////////////////////
+      // @scope="colgroup" and @scope="col"
+
+      headerInfoMap = [
+        {
+          cell: "t8_r1c1",
+          rowHeaderCells: [ "t8_1km" ],
+          columnHeaderCells: [ "t8_Mary", "t8_Females" ]
+        },
+        {
+          cell: "t8_r1c2",
+          rowHeaderCells: [ "t8_1km" ],
+          columnHeaderCells: [ "t8_Betsy", "t8_Females" ]
+        },
+        {
+          cell: "t8_r1c3",
+          rowHeaderCells: [ "t8_1km" ],
+          columnHeaderCells: [ "t8_Matt", "t8_Males" ]
+        },
+        {
+          cell: "t8_r1c4",
+          rowHeaderCells: [ "t8_1km" ],
+          columnHeaderCells: [ "t8_Todd", "t8_Males" ]
+        },
+        {
+          cell: "t8_r2c1",
+          rowHeaderCells: [ "t8_5km" ],
+          columnHeaderCells: [ "t8_Mary", "t8_Females" ]
+        },
+        {
+          cell: "t8_r2c2",
+          rowHeaderCells: [ "t8_5km" ],
+          columnHeaderCells: [ "t8_Betsy", "t8_Females" ]
+        },
+        {
+          cell: "t8_r2c3",
+          rowHeaderCells: [ "t8_5km" ],
+          columnHeaderCells: [ "t8_Matt", "t8_Males" ]
+        },
+        {
+          cell: "t8_r2c4",
+          rowHeaderCells: [ "t8_5km" ],
+          columnHeaderCells: [ "t8_Todd", "t8_Males" ]
+        },
+        {
+          cell: "t8_r3c1",
+          rowHeaderCells: [ "t8_10km" ],
+          columnHeaderCells: [ "t8_Mary", "t8_Females" ]
+        },
+        {
+          cell: "t8_r3c2",
+          rowHeaderCells: [ "t8_10km" ],
+          columnHeaderCells: [ "t8_Betsy", "t8_Females" ]
+        },
+        {
+          cell: "t8_r3c3",
+          rowHeaderCells: [ "t8_10km" ],
+          columnHeaderCells: [ "t8_Matt", "t8_Males" ]
+        },
+        {
+          cell: "t8_r3c4",
+          rowHeaderCells: [ "t8_10km" ],
+          columnHeaderCells: [ "t8_Todd", "t8_Males" ]
+        }
+      ];
+
+      testHeaderCells(headerInfoMap);
+
+      //////////////////////////////////////////////////////////////////////////
+      // spanned table header cells (v1), @headers define header order
+
+      headerInfoMap = [
+        {
+          cell: "t9_r1c1",
+          rowHeaderCells: [ "t9_females", "t9_mary" ],
+          columnHeaderCells: [ "t9_1km" ]
+        },
+        {
+          cell: "t9_r1c2",
+          rowHeaderCells: [ "t9_females", "t9_mary" ],
+          columnHeaderCells: [ "t9_5km" ]
+        },
+        {
+          cell: "t9_r1c3",
+          rowHeaderCells: [ "t9_females", "t9_mary" ],
+          columnHeaderCells: [ "t9_10km" ]
+        },
+        {
+          cell: "t9_r2c1",
+          rowHeaderCells: [ "t9_females", "t9_betsy" ],
+          columnHeaderCells: [ "t9_1km" ]
+        },
+        {
+          cell: "t9_r2c2",
+          rowHeaderCells: [ "t9_females", "t9_betsy" ],
+          columnHeaderCells: [ "t9_5km" ]
+        },
+        {
+          cell: "t9_r2c3",
+          rowHeaderCells: [ "t9_females", "t9_betsy" ],
+          columnHeaderCells: [ "t9_10km" ]
+        },
+        {
+          cell: "t9_r3c1",
+          rowHeaderCells: [ "t9_males", "t9_matt" ],
+          columnHeaderCells: [ "t9_1km" ]
+        },
+        {
+          cell: "t9_r3c2",
+          rowHeaderCells: [ "t9_males", "t9_matt" ],
+          columnHeaderCells: [ "t9_5km" ]
+        },
+        {
+          cell: "t9_r3c3",
+          rowHeaderCells: [ "t9_males", "t9_matt" ],
+          columnHeaderCells: [ "t9_10km" ]
+        },
+        {
+          cell: "t9_r4c1",
+          rowHeaderCells: [ "t9_males", "t9_todd" ],
+          columnHeaderCells: [ "t9_1km" ]
+        },
+        {
+          cell: "t9_r4c2",
+          rowHeaderCells: [ "t9_males", "t9_todd" ],
+          columnHeaderCells: [ "t9_5km" ]
+        },
+        {
+          cell: "t9_r4c3",
+          rowHeaderCells: [ "t9_males", "t9_todd" ],
+          columnHeaderCells: [ "t9_10km" ]
+        }
+      ];
+
+      testHeaderCells(headerInfoMap);
+
+      //////////////////////////////////////////////////////////////////////////
+      // spanned table header cells (v2), @headers define header order
+
+      headerInfoMap = [
+        {
+          cell: "t10_r1c1",
+          rowHeaderCells: [ "t10_1km" ],
+          columnHeaderCells: [ "t10_females", "t10_mary" ]
+        },
+        {
+          cell: "t10_r1c2",
+          rowHeaderCells: [ "t10_1km" ],
+          columnHeaderCells: [ "t10_females", "t10_betsy" ]
+        },
+        {
+          cell: "t10_r1c3",
+          rowHeaderCells: [ "t10_1km" ],
+          columnHeaderCells: [ "t10_males", "t10_matt" ]
+        },
+        {
+          cell: "t10_r1c4",
+          rowHeaderCells: [ "t10_1km" ],
+          columnHeaderCells: [ "t10_males", "t10_todd" ]
+        },
+        {
+          cell: "t10_r2c1",
+          rowHeaderCells: [ "t10_5km" ],
+          columnHeaderCells: [ "t10_females", "t10_mary" ]
+        },
+        {
+          cell: "t10_r2c2",
+          rowHeaderCells: [ "t10_5km" ],
+          columnHeaderCells: [ "t10_females", "t10_betsy" ]
+        },
+        {
+          cell: "t10_r2c3",
+          rowHeaderCells: [ "t10_5km" ],
+          columnHeaderCells: [ "t10_males", "t10_matt" ]
+        },
+        {
+          cell: "t10_r2c4",
+          rowHeaderCells: [ "t10_5km" ],
+          columnHeaderCells: [ "t10_males", "t10_todd" ]
+        },
+        {
+          cell: "t10_r3c1",
+          rowHeaderCells: [ "t10_10km" ],
+          columnHeaderCells: [ "t10_females", "t10_mary" ]
+        },
+        {
+          cell: "t10_r3c2",
+          rowHeaderCells: [ "t10_10km" ],
+          columnHeaderCells: [ "t10_females", "t10_betsy" ]
+        },
+        {
+          cell: "t10_r3c3",
+          rowHeaderCells: [ "t10_10km" ],
+          columnHeaderCells: [ "t10_males", "t10_matt" ]
+        },
+        {
+          cell: "t10_r3c4",
+          rowHeaderCells: [ "t10_10km" ],
+          columnHeaderCells: [ "t10_males", "t10_todd" ]
+        }
+      ];
+
+      testHeaderCells(headerInfoMap);
+
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 
@@ -170,16 +442,21 @@
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424">
     Bug 512424
   </a>
   <a target="_blank"
      title="Table headers not associated when header is a td element with no scope"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=704465">
     Bug 704465
   </a>
+  <a target="_blank"
+     title="Support rowgroup and colgroup HTML scope"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1141978">
+    Bug 1141978
+  </a>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <table id="table1" border="1">
     <thead>
@@ -270,10 +547,167 @@
       <td>empty cell</th>
       <td id="table6_ch">colheader</td>
     </tr>
     <tr>
       <td id="table6_rh">rowheader</th>
       <td id="table6_cell" headers="table6_ch table6_rh">cell</td>
     </tr>
   </table>
+
+  <table id="table7" class="data complex" border="1">
+    <caption>Version 1 with rowgroup</caption>
+    <thead>
+    <tr>
+      <td colspan="2">&nbsp;</td>
+      <th id="t7_1km" scope="col">1 km</th>
+      <th id="t7_5km" scope="col">5 km</th>
+      <th id="t7_10km" scope="col">10 km</th>
+    </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <th id="t7_Females" rowspan="2" scope="rowgroup">Females</th>
+        <th id="t7_Mary" scope="row">Mary</th>
+        <td id="t7_r1c1">8:32</td>
+        <td id="t7_r1c2">28:04</td>
+        <td id="t7_r1c3">1:01:16</td>
+      </tr>
+      <tr>
+        <th id="t7_Betsy" scope="row">Betsy</th>
+        <td id="t7_r2c1">7:43</td>
+        <td id="t7_r2c2">26:47</td>
+        <td id="t7_r2c3">55:38</td>
+      </tr>
+      <tr>
+        <th id="t7_Males" rowspan="2" scope="rowgroup">Males</th>
+        <th id="t7_Matt" scope="row">Matt</th>
+        <td id="t7_r3c1">7:55</td>
+        <td id="t7_r3c2">27:29</td>
+        <td id="t7_r3c3">57:04</td>
+      </tr>
+      <tr>
+        <th id="t7_Todd" scope="row">Todd</th>
+        <td id="t7_r4c1">7:01</td>
+        <td id="t7_r4c2">24:21</td>
+        <td id="t7_r4c3">50:35</td>
+      </tr>
+    </tbody>
+  </table>
+
+  <table id="table8" class="data complex" border="1">
+    <caption>Version 2 with colgroup</caption>
+    <thead>
+      <tr>
+        <td rowspan="2">&nbsp;</td>
+        <th id="t8_Females" colspan="2" scope="colgroup">Females</th>
+        <th id="t8_Males" colspan="2" scope="colgroup">Males</th>
+      </tr>
+      <tr>
+        <th id="t8_Mary" scope="col">Mary</th>
+        <th id="t8_Betsy" scope="col">Betsy</th>
+        <th id="t8_Matt" scope="col">Matt</th>
+        <th id="t8_Todd" scope="col">Todd</th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <th id="t8_1km" scope="row">1 km</th>
+        <td id="t8_r1c1">8:32</td>
+        <td id="t8_r1c2">7:43</td>
+        <td id="t8_r1c3">7:55</td>
+        <td id="t8_r1c4">7:01</td>
+      </tr>
+      <tr>
+        <th id="t8_5km" scope="row">5 km</th>
+        <td id="t8_r2c1">28:04</td>
+        <td id="t8_r2c2">26:47</td>
+        <td id="t8_r2c3">27:27</td>
+        <td id="t8_r2c4">24:21</td>
+      </tr>
+      <tr>
+        <th id="t8_10km" scope="row">10 km</th>
+        <td id="t8_r3c1">1:01:16</td>
+        <td id="t8_r3c2">55:38</td>
+        <td id="t8_r3c3">57:04</td>
+        <td id="t8_r3c4">50:35</td>
+      </tr>
+
+    </tbody>
+  </table>
+
+  <table id="table9" border="1">
+    <caption>
+      Example 1 (row group headers):
+    </caption>
+    <tr>
+      <td colspan="2"><span class="offscreen">empty</span></td>
+      <th id="t9_1km" width="40">1 km</th>
+      <th id="t9_5km" width="35">5 km</th>
+      <th id="t9_10km" width="42">10 km</th>
+    </tr>
+    <tr>
+      <th id="t9_females" width="56" rowspan="2">Females</th>
+      <th id="t9_mary" width="39">Mary</th>
+      <td id="t9_r1c1" headers="t9_females t9_mary t9_1km">8:32</td>
+      <td id="t9_r1c2" headers="t9_females t9_mary t9_5km">28:04</td>
+      <td id="t9_r1c3" headers="t9_females t9_mary t9_10km">1:01:16</td>
+    </tr>
+    <tr>
+      <th id="t9_betsy">Betsy</th>
+      <td id="t9_r2c1" headers="t9_females t9_betsy t9_1km">7:43</td>
+      <td id="t9_r2c2" headers="t9_females t9_betsy t9_5km">26:47</td>
+      <td id="t9_r2c3" headers="t9_females t9_betsy t9_10km">55:38</td>
+    </tr>
+    <tr>
+      <th id="t9_males" rowspan="2">Males</th>
+      <th id="t9_matt">Matt</th>
+      <td id="t9_r3c1" headers="t9_males t9_matt t9_1km">7:55</td>
+      <td id="t9_r3c2" headers="t9_males t9_matt t9_5km">27:29</td>
+      <td id="t9_r3c3" headers="t9_males t9_matt t9_10km">57:04</td>
+    </tr>
+    <tr>
+      <th id="t9_todd">Todd</th>
+      <td id="t9_r4c1" headers="t9_males t9_todd t9_1km">7:01</td>
+      <td id="t9_r4c2" headers="t9_males t9_todd t9_5km">24:21</td>
+      <td id="t9_r4c3" headers="t9_males t9_todd t9_10km">50:35</td>
+    </tr>
+  </table>
+
+  <table id="table10" border="1">
+    <caption>
+      Example 2 (column group headers):
+    </caption>
+    <tr>
+      <td rowspan="2"><span class="offscreen">empty</span></td>
+      <th colspan="2" id="t10_females">Females</th>
+      <th colspan="2" id="t10_males">Males</th>
+    </tr>
+    <tr>
+      <th width="40" id="t10_mary">Mary</th>
+      <th width="35" id="t10_betsy">Betsy</th>
+      <th width="42" id="t10_matt">Matt</th>
+      <th width="42" id="t10_todd">Todd</th>
+    </tr>
+    <tr>
+      <th width="39" id="t10_1km">1 km</th>
+      <td headers="t10_females t10_mary t10_1km" id="t10_r1c1">8:32</td>
+      <td headers="t10_females t10_betsy t10_1km" id="t10_r1c2">7:43</td>
+      <td headers="t10_males t10_matt t10_1km" id="t10_r1c3">7:55</td>
+      <td headers="t10_males t10_todd t10_1km" id="t10_r1c4">7:01</td>
+    </tr>
+    <tr>
+      <th id="t10_5km">5 km</th>
+      <td headers="t10_females t10_mary t10_5km" id="t10_r2c1">28:04</td>
+      <td headers="t10_females t10_betsy t10_5km" id="t10_r2c2">26:47</td>
+      <td headers="t10_males t10_matt t10_5km" id="t10_r2c3">27:29</td>
+      <td headers="t10_males t10_todd t10_5km" id="t10_r2c4">24:21</td>
+    </tr>
+    <tr>
+      <th id="t10_10km">10 km</th>
+      <td headers="t10_females t10_mary t10_10km" id="t10_r3c1">1:01:16</td>
+      <td headers="t10_females t10_betsy t10_10km" id="t10_r3c2">55:38</td>
+      <td headers="t10_males t10_matt t10_10km" id="t10_r3c3">57:04</td>
+      <td headers="t10_males t10_todd t10_10km" id="t10_r3c4">50:35</td>
+    </tr>
+  </table>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/table/test_mtable.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>MathML table tests</title>
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../role.js"></script>
+  <script type="application/javascript"
+          src="../table.js"></script>
+
+  <script type="application/javascript">
+    function doTest()
+    {
+      // 'Simple' table
+      var idxes = [
+        [0, 1],
+        [2, 3]
+      ];
+      testTableIndexes("simple", idxes);
+      var cellsArray = [
+        [kDataCell, kDataCell],
+        [kDataCell, kDataCell]
+      ];
+      var rowsArray = [ROLE_MATHML_TABLE_ROW, ROLE_MATHML_TABLE_ROW];
+      testTableStruct("simple", cellsArray, kNoColumnHeader,
+                      "", "", kMathTable, rowsArray);
+
+      // 'Complex' table
+      idxes = [
+        [0, 0, 0],
+        [1, 1, 2],
+        [1, 1, 3]
+      ];
+      testTableIndexes("complex", idxes);
+      cellsArray = [
+        [kDataCell,   kColSpanned, kColSpanned],
+        [kDataCell,   kColSpanned, kDataCell],
+        [kRowSpanned, kSpanned,    kDataCell],
+      ];
+      rowsArray = [
+        ROLE_MATHML_TABLE_ROW,
+        ROLE_MATHML_TABLE_ROW,
+        ROLE_MATHML_TABLE_ROW
+      ];
+      testTableStruct("complex", cellsArray, kNoColumnHeader,
+                      "", "", kMathTable, rowsArray);
+
+      // 'Simple' table with mlabeledtr
+      // At the moment we do not implement mlabeledtr but just hide the label
+      // with display: none. Thus we just test the role for now. See bug 689641.
+      var idxes = [[0]];
+      testTableIndexes("simple_label", idxes);
+      var cellsArray = [[kDataCell]];
+      rowsArray = [ROLE_MATHML_LABELED_ROW];
+      testTableStruct("simple_label", cellsArray, kNoColumnHeader,
+                      "", "", kMathTable, rowsArray);
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  </script>
+</head>
+<body>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <math>
+    <mtable id="simple">
+      <mtr>
+        <mtd>
+          <mn>1</mn>
+        </mtd>
+        <mtd>
+          <mn>0</mn>
+        </mtd>
+      </mtr>
+      <mtr>
+        <mtd>
+          <mn>0</mn>
+        </mtd>
+        <mtd>
+          <mn>1</mn>
+        </mtd>
+      </mtr>
+    </mtable>
+
+    <mtable id="complex">
+      <mtr>
+        <mtd columnspan="3">
+          <mtext>1 x 3</mtext>
+        </mtd>
+      </mtr>
+      <mtr>
+        <mtd rowspan="2" columnspan="2">
+          <mtext>2 x 2</mtext>
+        </mtd>
+        <mtd>
+          <mtext>1 x 1</mtext>
+        </mtd>
+      </mtr>
+      <mtr>
+        <mtd>
+          <mtext>1 x 1</mtext>
+        </mtd>
+      </mtr>
+    </mtable>
+
+    <mtable id="simple_label">
+      <mlabeledtr>
+        <mtd><mtext>1</mtext></mtd>
+        <mtd><mtext>label</mtext></mtd>
+      </mlabeledtr>
+    </mtable>
+  </math>
+
+</body>
+</html>
--- a/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
+++ b/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
@@ -23,17 +23,18 @@
       // HTML based ARIA tree grid
 
       var cellsArray = [
         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
         [kDataCell,      kDataCell,      kDataCell],
         [kDataCell,      kDataCell,      kDataCell]
       ];
 
-      testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "", true);
+      testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "",
+                      kTreeTable);
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -11,24 +11,27 @@
 #include "AccessibleRole.h"
 #include "AccessibleStates.h"
 
 #include "Compatibility.h"
 #include "ia2AccessibleRelation.h"
 #include "IUnknownImpl.h"
 #include "nsCoreUtils.h"
 #include "nsIAccessibleTypes.h"
+#include "mozilla/a11y/PDocAccessible.h"
 #include "Relation.h"
 
 #include "nsIPersistentProperties2.h"
 #include "nsISimpleEnumerator.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
+template<typename String> static void EscapeAttributeChars(String& aStr);
+
 ////////////////////////////////////////////////////////////////////////////////
 // ia2Accessible
 ////////////////////////////////////////////////////////////////////////////////
 
 STDMETHODIMP
 ia2Accessible::QueryInterface(REFIID iid, void** ppv)
 {
   if (!ppv)
@@ -60,16 +63,25 @@ 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;
 
+  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)++;
   }
@@ -79,24 +91,52 @@ ia2Accessible::get_nRelations(long* aNRe
 }
 
 STDMETHODIMP
 ia2Accessible::get_relation(long aRelationIndex,
                             IAccessibleRelation** aRelation)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  if (!aRelation)
+  if (!aRelation || aRelationIndex < 0)
     return E_INVALIDARG;
   *aRelation = nullptr;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  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<nsRefPtr<Accessible>> targets;
+        size_t targetCount = targetSets[i].Length();
+        for (size_t j = 0; j < targetCount; j++)
+          targets.AppendElement(WrapperFor(targetSets[i][j]));
+
+        nsRefPtr<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);
     nsRefPtr<ia2AccessibleRelation> ia2Relation =
@@ -118,24 +158,52 @@ ia2Accessible::get_relation(long aRelati
 
 STDMETHODIMP
 ia2Accessible::get_relations(long aMaxRelations,
                              IAccessibleRelation** aRelation,
                              long *aNRelations)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  if (!aRelation || !aNRelations)
+  if (!aRelation || !aNRelations || aMaxRelations <= 0)
     return E_INVALIDARG;
   *aNRelations = 0;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
+  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<nsRefPtr<Accessible>> targets(targetCount);
+      for (size_t j = 0; j < targetCount; j++)
+        targets.AppendElement(WrapperFor(targetSets[i][j]));
+
+      nsRefPtr<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);
     nsRefPtr<ia2AccessibleRelation> ia2Rel =
@@ -164,31 +232,41 @@ ia2Accessible::role(long* aRole)
     return CO_E_OBJNOTCONNECTED;
 
 #define ROLE(_geckoRole, stringRole, atkRole, macRole, \
              msaaRole, ia2Role, nameRule) \
   case roles::_geckoRole: \
     *aRole = ia2Role; \
     break;
 
-  a11y::role geckoRole = acc->Role();
+  a11y::role geckoRole;
+  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.
-  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
@@ -269,17 +347,26 @@ ia2Accessible::get_states(AccessibleStat
 
   if (!aStates)
     return E_INVALIDARG;
   *aStates = 0;
 
   // XXX: bug 344674 should come with better approach that we have here.
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
-  uint64_t state = acc->State();
+  if (acc->IsDefunct()) {
+    *aStates = IA2_STATE_DEFUNCT;
+    return CO_E_OBJNOTCONNECTED;
+  }
+
+  uint64_t 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
@@ -441,17 +528,21 @@ 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;
 
-  *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
 }
 
@@ -516,18 +607,39 @@ ia2Accessible::get_attributes(BSTR* aAtt
   *aAttributes = nullptr;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   // The format is name:value;name:value; with \ for escaping these
   // characters ":;=,\".
-  nsCOMPtr<nsIPersistentProperties> attributes = acc->Attributes();
-  return ConvertToIA2Attributes(attributes, aAttributes);
+  if (!acc->IsProxy()) {
+    nsCOMPtr<nsIPersistentProperties> attributes = acc->Attributes();
+    return ConvertToIA2Attributes(attributes, aAttributes);
+  }
+
+  nsTArray<Attribute> attrs;
+  acc->Proxy()->Attributes(&attrs);
+  nsString attrStr;
+  size_t attrCount = attrs.Length();
+  for (size_t i = 0; i < attrCount; i++) {
+    EscapeAttributeChars(attrs[i].Name());
+    EscapeAttributeChars(attrs[i].Value());
+    AppendUTF8toUTF16(attrs[i].Name(), attrStr);
+    attrStr.Append(':');
+    attrStr.Append(attrs[i].Value());
+    attrStr.Append(';');
+  }
+
+  if (attrStr.IsEmpty())
+    return S_FALSE;
+
+  *aAttributes = ::SysAllocStringLen(attrStr.get(), attrStr.Length());
+  return *aAttributes ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // IAccessible2_2
 
 STDMETHODIMP
@@ -562,17 +674,17 @@ ia2Accessible::get_accessibleWithCaret(I
 STDMETHODIMP
 ia2Accessible::get_relationTargetsOfType(BSTR aType,
                                          long aMaxTargets,
                                          IUnknown*** aTargets,
                                          long* aNTargets)
 {
   A11Y_TRYBLOCK_BEGIN
 
-  if (!aTargets || !aNTargets)
+  if (!aTargets || !aNTargets || aMaxTargets < 0)
     return E_INVALIDARG;
   *aNTargets = 0;
 
   Maybe<RelationType> relationType;
   for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
     if (wcscmp(aType, sRelationTypePairs[idx].second) == 0) {
       relationType.emplace(sRelationTypePairs[idx].first);
       break;
@@ -580,23 +692,33 @@ ia2Accessible::get_relationTargetsOfType
   }
   if (!relationType)
     return E_INVALIDARG;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  Relation rel = acc->RelationByType(*relationType);
+  nsTArray<Accessible*> targets;
+  if (acc->IsProxy()) {
+    nsTArray<ProxyAccessible*> targetProxies =
+      acc->Proxy()->RelationByType(*relationType);
 
-  nsTArray<Accessible*> targets;
-  Accessible* target = nullptr;
-  while ((target = rel.Next()) &&
-         static_cast<long>(targets.Length()) <= aMaxTargets)
-    targets.AppendElement(target);
+    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;
 
   for (int32_t i = 0; i < *aNTargets; i++) {
@@ -608,16 +730,28 @@ ia2Accessible::get_relationTargetsOfType
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Helpers
 
+template<typename String>
+static inline void
+EscapeAttributeChars(String& aStr)
+{
+  int32_t offset = 0;
+  static const char kCharsToEscape[] = ":;=,\\";
+  while ((offset = aStr.FindCharInSet(kCharsToEscape, offset)) != kNotFound) {
+    aStr.Insert('\\', offset);
+    offset += 2;
+  }
+}
+
 HRESULT
 ia2Accessible::ConvertToIA2Attributes(nsIPersistentProperties* aAttributes,
                                       BSTR* aIA2Attributes)
 {
   *aIA2Attributes = nullptr;
 
   // The format is name:value;name:value; with \ for escaping these
   // characters ":;=,\".
@@ -627,46 +761,36 @@ ia2Accessible::ConvertToIA2Attributes(ns
 
   nsCOMPtr<nsISimpleEnumerator> propEnum;
   aAttributes->Enumerate(getter_AddRefs(propEnum));
   if (!propEnum)
     return E_FAIL;
 
   nsAutoString strAttrs;
 
-  const char kCharsToEscape[] = ":;=,\\";
-
   bool hasMore = false;
   while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
     nsCOMPtr<nsISupports> propSupports;
     propEnum->GetNext(getter_AddRefs(propSupports));
 
     nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(propSupports));
     if (!propElem)
       return E_FAIL;
 
     nsAutoCString name;
     if (NS_FAILED(propElem->GetKey(name)))
       return E_FAIL;
 
-    int32_t offset = 0;
-    while ((offset = name.FindCharInSet(kCharsToEscape, offset)) != kNotFound) {
-      name.Insert('\\', offset);
-      offset += 2;
-    }
+    EscapeAttributeChars(name);
 
     nsAutoString value;
     if (NS_FAILED(propElem->GetValue(value)))
       return E_FAIL;
 
-    offset = 0;
-    while ((offset = value.FindCharInSet(kCharsToEscape, offset)) != kNotFound) {
-      value.Insert('\\', offset);
-      offset += 2;
-    }
+    EscapeAttributeChars(value);
 
     AppendUTF8toUTF16(name, strAttrs);
     strAttrs.Append(':');
     strAttrs.Append(value);
     strAttrs.Append(';');
   }
 
   if (strAttrs.IsEmpty())
--- a/accessible/windows/ia2/ia2AccessibleRelation.h
+++ b/accessible/windows/ia2/ia2AccessibleRelation.h
@@ -14,21 +14,25 @@
 #include <utility>
 #include "nsTArray.h"
 
 #include "AccessibleRelation.h"
 
 namespace mozilla {
 namespace a11y {
 
-class ia2AccessibleRelation MOZ_FINAL : public IAccessibleRelation
+class ia2AccessibleRelation final : public IAccessibleRelation
 {
 public:
   ia2AccessibleRelation(RelationType aType, Relation* aRel);
 
+  ia2AccessibleRelation(RelationType aType,
+                        nsTArray<nsRefPtr<Accessible>>&& aTargets) :
+    mType(aType), mTargets(Move(aTargets)) {}
+
   // IUnknown
   DECL_IUNKNOWN
 
   // IAccessibleRelation
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType(
       /* [retval][out] */ BSTR *relationType);
 
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType(
--- a/accessible/windows/ia2/moz.build
+++ b/accessible/windows/ia2/moz.build
@@ -47,8 +47,10 @@ LOCAL_INCLUDES += [
 FINAL_LIBRARY = 'xul'
 
 # The midl generated code include Windows headers which defines min and max
 # macros which conflicts with std::min/max.  Suppress the macros:
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['NOMINMAX'] = True
 
 FAIL_ON_WARNINGS = True
+
+include('/ipc/chromium/chromium-config.mozbuild')
--- a/accessible/windows/msaa/ARIAGridAccessibleWrap.h
+++ b/accessible/windows/msaa/ARIAGridAccessibleWrap.h
@@ -29,17 +29,17 @@ public:
     ARIAGridAccessible(aContent, aDoc), ia2AccessibleTable(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 /**
  * IA2 wrapper class for ARIAGridCellAccessible implementing
  * IAccessibleTableCell interface.
  */
 class ARIAGridCellAccessibleWrap : public ARIAGridCellAccessible,
                                    public ia2AccessibleTableCell
@@ -51,15 +51,15 @@ public:
     ARIAGridCellAccessible(aContent, aDoc), ia2AccessibleTableCell(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -652,17 +652,17 @@ AccessibleWrap::get_accFocus(
 
   A11Y_TRYBLOCK_END
 }
 
 /**
  * This helper class implements IEnumVARIANT for a nsTArray containing
  * accessible objects.
  */
-class AccessibleEnumerator MOZ_FINAL : public IEnumVARIANT
+class AccessibleEnumerator final : public IEnumVARIANT
 {
 public:
   AccessibleEnumerator(const nsTArray<Accessible*>& aArray) :
     mArray(aArray), mCurIndex(0) { }
   AccessibleEnumerator(const AccessibleEnumerator& toCopy) :
     mArray(toCopy.mArray), mCurIndex(toCopy.mCurIndex) { }
   ~AccessibleEnumerator() { }
 
--- a/accessible/windows/msaa/AccessibleWrap.h
+++ b/accessible/windows/msaa/AccessibleWrap.h
@@ -166,17 +166,17 @@ public: // construction, destruction
    */
   void UpdateSystemCaretFor(Accessible* aAccessible);
 
   /**
    * Find an accessible by the given child ID in cached documents.
    */
   Accessible* GetXPAccessibleFor(const VARIANT& aVarChild);
 
-  virtual void GetNativeInterface(void **aOutAccessible) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void **aOutAccessible) override;
 
   static IDispatch* NativeAccessible(Accessible* aAccessible);
 
 protected:
   virtual ~AccessibleWrap() { }
 
   /**
    * Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
--- a/accessible/windows/msaa/ApplicationAccessibleWrap.h
+++ b/accessible/windows/msaa/ApplicationAccessibleWrap.h
@@ -20,17 +20,17 @@ class ApplicationAccessibleWrap: public 
 {
   ~ApplicationAccessibleWrap() {}
 
 public:
   // nsISupporst
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsAccessible
-  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
+  virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
 
   // IUnknown
   STDMETHODIMP QueryInterface(REFIID, void**);
 
   // IAccessibleApplication
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_appName(
             /* [retval][out] */ BSTR *name);
 
--- a/accessible/windows/msaa/EnumVariant.h
+++ b/accessible/windows/msaa/EnumVariant.h
@@ -11,17 +11,17 @@
 #include "IUnknownImpl.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * Used to fetch accessible children.
  */
-class ChildrenEnumVariant MOZ_FINAL : public IEnumVARIANT
+class ChildrenEnumVariant final : public IEnumVARIANT
 {
 public:
   ChildrenEnumVariant(AccessibleWrap* aAnchor) : mAnchorAcc(aAnchor),
     mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0) { }
 
   // IUnknown
   DECL_IUNKNOWN
 
--- a/accessible/windows/msaa/HTMLTableAccessibleWrap.h
+++ b/accessible/windows/msaa/HTMLTableAccessibleWrap.h
@@ -30,17 +30,17 @@ public:
     HTMLTableAccessible(aContent, aDoc), ia2AccessibleTable(this)  {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 
 /**
  * IA2 wrapper class for HTMLTableCellAccessible implementing
  * IAccessibleTableCell interface.
  */
 class HTMLTableCellAccessibleWrap : public HTMLTableCellAccessible,
@@ -53,17 +53,17 @@ public:
     HTMLTableCellAccessible(aContent, aDoc), ia2AccessibleTableCell(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 
 /**
  * IA2 wrapper class for HTMLTableHeaderCellAccessible implementing
  * IAccessibleTableCell interface.
  */
 class HTMLTableHeaderCellAccessibleWrap : public HTMLTableHeaderCellAccessible,
@@ -78,16 +78,16 @@ public:
   {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/windows/msaa/HTMLWin32ObjectAccessible.h
+++ b/accessible/windows/msaa/HTMLWin32ObjectAccessible.h
@@ -50,17 +50,17 @@ protected:
   *   from the windows system from the window handle.
   */
 class HTMLWin32ObjectAccessible : public DummyAccessible
 {
 public:
   HTMLWin32ObjectAccessible(void* aHwnd, DocAccessible* aDoc);
   virtual ~HTMLWin32ObjectAccessible() {}
 
-  virtual void GetNativeInterface(void** aNativeAccessible) MOZ_OVERRIDE;
+  virtual void GetNativeInterface(void** aNativeAccessible) override;
 
 protected:
   void* mHwnd;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/windows/msaa/IUnknownImpl.h
+++ b/accessible/windows/msaa/IUnknownImpl.h
@@ -46,23 +46,23 @@ private:
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #define DECL_IUNKNOWN                                                          \
 public:                                                                        \
   virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**);            \
-  virtual ULONG STDMETHODCALLTYPE AddRef() MOZ_FINAL                           \
+  virtual ULONG STDMETHODCALLTYPE AddRef() final                           \
   {                                                                            \
     MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                       \
     ++mRefCnt;                                                                 \
     return mRefCnt;                                                            \
   }                                                                            \
-  virtual ULONG STDMETHODCALLTYPE Release() MOZ_FINAL                          \
+  virtual ULONG STDMETHODCALLTYPE Release() final                          \
   {                                                                            \
      MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                          \
      --mRefCnt;                                                                \
      if (mRefCnt)                                                              \
        return mRefCnt;                                                         \
                                                                                \
      delete this;                                                              \
      return 0;                                                                 \
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -40,17 +40,17 @@ class ProxyAccessibleWrap : public Acces
   public:
   ProxyAccessibleWrap(ProxyAccessible* aProxy) :
     AccessibleWrap(nullptr, nullptr)
   {
     mType = eProxyType;
     mBits.proxy = aProxy;
   }
 
-  virtual void Shutdown() MOZ_OVERRIDE
+  virtual void Shutdown() override
   {
     mBits.proxy = nullptr;
   }
 };
 
 void
 a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t)
 {
--- a/accessible/windows/msaa/ServiceProvider.h
+++ b/accessible/windows/msaa/ServiceProvider.h
@@ -10,17 +10,17 @@
 #include <servprov.h>
 
 #include "AccessibleWrap.h"
 #include "IUnknownImpl.h"
 
 namespace mozilla {
 namespace a11y {
 
-class ServiceProvider MOZ_FINAL : public IServiceProvider
+class ServiceProvider final : public IServiceProvider
 {
 public:
   ServiceProvider(AccessibleWrap* aAcc) : mAccessible(aAcc) {}
   ~ServiceProvider() {}
 
   DECL_IUNKNOWN
 
   // IServiceProvider
--- a/accessible/windows/msaa/XULListboxAccessibleWrap.h
+++ b/accessible/windows/msaa/XULListboxAccessibleWrap.h
@@ -28,17 +28,17 @@ public:
     XULListboxAccessible(aContent, aDoc), ia2AccessibleTable(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 /**
  * IA2 wrapper class for XULListCellAccessible class, implements
  * IAccessibleTableCell interface.
  */
 class XULListCellAccessibleWrap : public XULListCellAccessible,
                                   public ia2AccessibleTableCell
@@ -50,15 +50,15 @@ public:
     XULListCellAccessible(aContent, aDoc), ia2AccessibleTableCell(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/windows/msaa/XULTreeGridAccessibleWrap.h
+++ b/accessible/windows/msaa/XULTreeGridAccessibleWrap.h
@@ -29,17 +29,17 @@ public:
     XULTreeGridAccessible(aContent, aDoc, aTree), ia2AccessibleTable(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 /**
  * IA2 wrapper class for XULTreeGridCellAccessible class, implements
  * IAccessibleTableCell interface.
  */
 class XULTreeGridCellAccessibleWrap : public XULTreeGridCellAccessible,
                                       public ia2AccessibleTableCell
@@ -57,15 +57,15 @@ public:
                               aColumn), ia2AccessibleTableCell(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/windows/sdn/sdnAccessible.h
+++ b/accessible/windows/sdn/sdnAccessible.h
@@ -11,17 +11,17 @@
 #include "AccessibleWrap.h"
 #include "IUnknownImpl.h"
 
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace a11y {
 
-class sdnAccessible MOZ_FINAL : public ISimpleDOMNode
+class sdnAccessible final : public ISimpleDOMNode
 {
 public:
   sdnAccessible(nsINode* aNode) :
     mNode(aNode)
   {
     if (!mNode)
       MOZ_CRASH();
   }
--- a/accessible/windows/sdn/sdnDocAccessible.h
+++ b/accessible/windows/sdn/sdnDocAccessible.h
@@ -10,17 +10,17 @@
 #include "ISimpleDOMDocument.h"
 #include "IUnknownImpl.h"
 
 #include "DocAccessibleWrap.h"
 
 namespace mozilla {
 namespace a11y {
 
-class sdnDocAccessible MOZ_FINAL : public ISimpleDOMDocument
+class sdnDocAccessible final : public ISimpleDOMDocument
 {
 public:
   sdnDocAccessible(DocAccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
   ~sdnDocAccessible() { };
 
   DECL_IUNKNOWN
 
   // ISimpleDOMDocument
--- a/accessible/windows/sdn/sdnTextAccessible.h
+++ b/accessible/windows/sdn/sdnTextAccessible.h
@@ -13,17 +13,17 @@
 #include "AccessibleWrap.h"
 
 class nsIFrame;
 struct nsPoint;
 
 namespace mozilla {
 namespace a11y {
  
-class sdnTextAccessible MOZ_FINAL : public ISimpleDOMText
+class sdnTextAccessible final : public ISimpleDOMText
 {
 public:
   sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
   ~sdnTextAccessible() {}
 
   DECL_IUNKNOWN
 
   // ISimpleDOMText
--- a/accessible/windows/uia/uiaRawElmProvider.h
+++ b/accessible/windows/uia/uiaRawElmProvider.h
@@ -15,17 +15,17 @@
 namespace mozilla {
 namespace a11y {
 
 class AccessibleWrap;
 
 /**
  * IRawElementProviderSimple implementation (maintains IAccessibleEx approach).
  */
-class uiaRawElmProvider MOZ_FINAL : public IAccessibleEx,
+class uiaRawElmProvider final : public IAccessibleEx,
                                     public IRawElementProviderSimple
 {
 public:
   uiaRawElmProvider(AccessibleWrap* aAcc) : mAcc(aAcc) { }
 
   // IUnknown
   DECL_IUNKNOWN
 
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -56,17 +56,17 @@ def print_header_file(fd, conf):
         fd.write("#include \"nsIAccessible%s.h\"\n" % e)
     for e in conf.simple_events:
         idl, idl_path = loadEventIDL(p, options.incdirs, e)
         idl_paths.add(idl_path)
         for iface in filter(lambda p: p.kind == "interface", idl.productions):
             classname = ("xpcAcc%s" % e)
             baseinterfaces = interfaces(iface)
 
-            fd.write("\nclass %s MOZ_FINAL : public %s\n" % (classname, iface.name))
+            fd.write("\nclass %s final : public %s\n" % (classname, iface.name))
             fd.write("{\n")
             fd.write("public:\n")
 
             attributes = allAttributes(iface)
             args = map(writeAttributeParams, attributes)
             fd.write("  %s(%s) :\n" % (classname, ", ".join(args)))
 
             initializers = []
--- a/accessible/xpcom/nsAccessibleRelation.h
+++ b/accessible/xpcom/nsAccessibleRelation.h
@@ -15,17 +15,17 @@
 namespace mozilla {
 namespace a11y {
 
 class Relation;
 
 /**
  * Class represents an accessible relation.
  */
-class nsAccessibleRelation MOZ_FINAL : public nsIAccessibleRelation
+class nsAccessibleRelation final : public nsIAccessibleRelation
 {
 public:
   nsAccessibleRelation(uint32_t aType, Relation* aRel);
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIACCESSIBLERELATION
 
 private:
--- a/accessible/xpcom/xpcAccessible.h
+++ b/accessible/xpcom/xpcAccessible.h
@@ -19,78 +19,78 @@ class Accessible;
 /**
  * XPCOM nsIAccessible interface implementation, used by xpcAccessibleGeneric
  * class.
  */
 class xpcAccessible : public nsIAccessible
 {
 public:
   // nsIAccessible
-  NS_IMETHOD GetParent(nsIAccessible** aParent) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetNextSibling(nsIAccessible** aNextSibling) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetParent(nsIAccessible** aParent) final override;
+  NS_IMETHOD GetNextSibling(nsIAccessible** aNextSibling) final override;
   NS_IMETHOD GetPreviousSibling(nsIAccessible** aPreviousSibling)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetFirstChild(nsIAccessible** aFirstChild) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetLastChild(nsIAccessible** aLastChild) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetChildCount(int32_t* aChildCount) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetFirstChild(nsIAccessible** aFirstChild) final override;
+  NS_IMETHOD GetLastChild(nsIAccessible** aLastChild) final override;
+  NS_IMETHOD GetChildCount(int32_t* aChildCount) final override;
   NS_IMETHOD GetChildAt(int32_t aChildIndex, nsIAccessible** aChild)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetChildren(nsIArray** aChildren) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetIndexInParent(int32_t* aIndexInParent) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetChildren(nsIArray** aChildren) final override;
+  NS_IMETHOD GetIndexInParent(int32_t* aIndexInParent) final override;
 
-  NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode) final override;
+  NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument) final override;
   NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
 
-  NS_IMETHOD GetRole(uint32_t* aRole) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetRole(uint32_t* aRole) final override;
   NS_IMETHOD GetState(uint32_t* aState, uint32_t* aExtraState)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
 
-  NS_IMETHOD GetDescription(nsAString& aDescription) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetName(nsAString& aName) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetLanguage(nsAString& aLanguage) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetValue(nsAString& aValue) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetHelp(nsAString& aHelp) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetDescription(nsAString& aDescription) final override;
+  NS_IMETHOD GetName(nsAString& aName) final override;
+  NS_IMETHOD GetLanguage(nsAString& aLanguage) final override;
+  NS_IMETHOD GetValue(nsAString& aValue) final override;
+  NS_IMETHOD GetHelp(nsAString& aHelp) final override;
 
-  NS_IMETHOD GetAccessKey(nsAString& aAccessKey) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetKeyboardShortcut(nsAString& aKeyBinding) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetAccessKey(nsAString& aAccessKey) final override;
+  NS_IMETHOD GetKeyboardShortcut(nsAString& aKeyBinding) final override;
 
   NS_IMETHOD GetAttributes(nsIPersistentProperties** aAttributes)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
-                       int32_t* aWidth, int32_t* aHeight) MOZ_FINAL MOZ_OVERRIDE;
+                       int32_t* aWidth, int32_t* aHeight) final override;
   NS_IMETHOD GroupPosition(int32_t* aGroupLevel, int32_t* aSimilarItemsInGroup,
-                           int32_t* aPositionInGroup) MOZ_FINAL MOZ_OVERRIDE;
+                           int32_t* aPositionInGroup) final override;
   NS_IMETHOD GetRelationByType(uint32_t aType,
                                nsIAccessibleRelation** aRelation)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetRelations(nsIArray** aRelations) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetRelations(nsIArray** aRelations) final override;
 
-  NS_IMETHOD GetFocusedChild(nsIAccessible** aChild) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetFocusedChild(nsIAccessible** aChild) final override;
   NS_IMETHOD GetChildAtPoint(int32_t aX, int32_t aY,
-                             nsIAccessible** aAccessible) MOZ_FINAL MOZ_OVERRIDE;
+                             nsIAccessible** aAccessible) final override;
   NS_IMETHOD GetDeepestChildAtPoint(int32_t aX, int32_t aY,
                                     nsIAccessible** aAccessible)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
 
-  NS_IMETHOD SetSelected(bool aSelect) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD ExtendSelection() MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD TakeSelection() MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD TakeFocus() MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD SetSelected(bool aSelect) final override;
+  NS_IMETHOD ExtendSelection() final override;
+  NS_IMETHOD TakeSelection() final override;
+  NS_IMETHOD TakeFocus() final override;
 
-  NS_IMETHOD GetActionCount(uint8_t* aActionCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetActionCount(uint8_t* aActionCount) final override;
+  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName) final override;
   NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString& aDescription)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD DoAction(uint8_t aIndex) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD DoAction(uint8_t aIndex) final override;
 
-  NS_IMETHOD ScrollTo(uint32_t aHow) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD ScrollTo(uint32_t aHow) final override;
   NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType,
-                           int32_t aX, int32_t aY) MOZ_FINAL MOZ_OVERRIDE;
+                           int32_t aX, int32_t aY) final override;
 
 protected:
   xpcAccessible() { }
   virtual ~xpcAccessible() {}
 
 private:
   Accessible* Intl();
 
--- a/accessible/xpcom/xpcAccessibleApplication.h
+++ b/accessible/xpcom/xpcAccessibleApplication.h
@@ -22,20 +22,20 @@ class xpcAccessibleApplication : public 
 {
 public:
   explicit xpcAccessibleApplication(Accessible* aIntl) :
     xpcAccessibleGeneric(aIntl) { }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleApplication
-  NS_IMETHOD GetAppName(nsAString& aName) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetAppVersion(nsAString& aVersion) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetPlatformName(nsAString& aName) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetPlatformVersion(nsAString& aVersion) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetAppName(nsAString& aName) final override;
+  NS_IMETHOD GetAppVersion(nsAString& aVersion) final override;
+  NS_IMETHOD GetPlatformName(nsAString& aName) final override;
+  NS_IMETHOD GetPlatformVersion(nsAString& aVersion) final override;
 
 protected:
   virtual ~xpcAccessibleApplication() {}
 
 private:
   ApplicationAccessible* Intl() { return mIntl->AsApplication(); }
 
   xpcAccessibleApplication(const xpcAccessibleApplication&) = delete;
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -27,37 +27,37 @@ public:
   explicit xpcAccessibleDocument(DocAccessible* aIntl) :
     xpcAccessibleHyperText(aIntl), mCache(kDefaultCacheLength) { }
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(xpcAccessibleDocument,
                                            xpcAccessibleGeneric)
 
   // nsIAccessibleDocument
-  NS_IMETHOD GetURL(nsAString& aURL) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetTitle(nsAString& aTitle) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetMimeType(nsAString& aType) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetDocType(nsAString& aType) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetDOMDocument(nsIDOMDocument** aDOMDocument) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetWindow(nsIDOMWindow** aDOMWindow) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetURL(nsAString& aURL) final override;
+  NS_IMETHOD GetTitle(nsAString& aTitle) final override;
+  NS_IMETHOD GetMimeType(nsAString& aType) final override;
+  NS_IMETHOD GetDocType(nsAString& aType) final override;
+  NS_IMETHOD GetDOMDocument(nsIDOMDocument** aDOMDocument) final override;
+  NS_IMETHOD GetWindow(nsIDOMWindow** aDOMWindow) final override;
   NS_IMETHOD GetParentDocument(nsIAccessibleDocument** aDocument)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) final override;
   NS_IMETHOD GetChildDocumentAt(uint32_t aIndex,
                                 nsIAccessibleDocument** aDocument)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
 
   /**
    * Return XPCOM wrapper for the internal accessible.
    */
   xpcAccessibleGeneric* GetAccessible(Accessible* aAccessible);
 
-  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Shutdown() override;
 
 protected:
   virtual ~xpcAccessibleDocument() {}
 
 private:
   DocAccessible* Intl() { return mIntl->AsDoc(); }
 
   void NotifyOfShutdown(Accessible* aAccessible)
--- a/accessible/xpcom/xpcAccessibleGeneric.h
+++ b/accessible/xpcom/xpcAccessibleGeneric.h
@@ -36,17 +36,17 @@ public:
     if (mIntl->IsLink())
       mSupportedIfaces |= eHyperLink;
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(xpcAccessibleGeneric, nsIAccessible)
 
   // nsIAccessible
-  virtual Accessible* ToInternalAccessible() const MOZ_FINAL MOZ_OVERRIDE;
+  virtual Accessible* ToInternalAccessible() const final override;
 
   // xpcAccessibleGeneric
   virtual void Shutdown();
 
 protected:
   virtual ~xpcAccessibleGeneric() {}
 
   Accessible* mIntl;
--- a/accessible/xpcom/xpcAccessibleHyperLink.h
+++ b/accessible/xpcom/xpcAccessibleHyperLink.h
@@ -18,23 +18,23 @@ class Accessible;
 
 /**
  * XPCOM nsIAccessibleHyperLink implementation, used by xpcAccessibleGeneric
  * class.
  */
 class xpcAccessibleHyperLink : public nsIAccessibleHyperLink
 {
 public:
-  NS_IMETHOD GetAnchorCount(int32_t* aAnchorCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetStartIndex(int32_t* aStartIndex) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetEndIndex(int32_t* aEndIndex) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetURI(int32_t aIndex, nsIURI** aURI) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetAnchorCount(int32_t* aAnchorCount) final override;
+  NS_IMETHOD GetStartIndex(int32_t* aStartIndex) final override;
+  NS_IMETHOD GetEndIndex(int32_t* aEndIndex) final override;
+  NS_IMETHOD GetURI(int32_t aIndex, nsIURI** aURI) final override;
   NS_IMETHOD GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetValid(bool* aValid) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetValid(bool* aValid) final override;
 
 protected:
   xpcAccessibleHyperLink() { }
   virtual ~xpcAccessibleHyperLink() {}
 
 private:
   xpcAccessibleHyperLink(const xpcAccessibleHyperLink&) = delete;
   xpcAccessibleHyperLink& operator =(const xpcAccessibleHyperLink&) = delete;
--- a/accessible/xpcom/xpcAccessibleImage.h
+++ b/accessible/xpcom/xpcAccessibleImage.h
@@ -19,18 +19,18 @@ class xpcAccessibleImage : public xpcAcc
 {
 public:
   explicit xpcAccessibleImage(Accessible* aIntl) :
     xpcAccessibleGeneric(aIntl) { }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_IMETHOD GetImagePosition(uint32_t aCoordType,
-                              int32_t* aX, int32_t* aY) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetImageSize(int32_t* aWidth, int32_t* aHeight) MOZ_FINAL MOZ_OVERRIDE;
+                              int32_t* aX, int32_t* aY) final override;
+  NS_IMETHOD GetImageSize(int32_t* aWidth, int32_t* aHeight) final override;
 
 protected:
   virtual ~xpcAccessibleImage() {}
 
 private:
   ImageAccessible* Intl() { return mIntl->AsImage(); }
 
   xpcAccessibleImage(const xpcAccessibleImage&) = delete;
--- a/accessible/xpcom/xpcAccessibleSelectable.h
+++ b/accessible/xpcom/xpcAccessibleSelectable.h
@@ -20,27 +20,27 @@ class Accessible;
 /**
  * XPCOM nsIAccessibleSelectable inteface implementation, used by
  * xpcAccessibleGeneric class.
  */
 class xpcAccessibleSelectable : public nsIAccessibleSelectable
 {
 public:
   // nsIAccessibleSelectable
-  NS_IMETHOD GetSelectedItems(nsIArray** aSelectedItems) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetSelectedItems(nsIArray** aSelectedItems) final override;
   NS_IMETHOD GetSelectedItemCount(uint32_t* aSelectedItemCount)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedItemAt(uint32_t aIndex, nsIAccessible** aItem)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD IsItemSelected(uint32_t aIndex, bool* aIsSelected)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD AddItemToSelection(uint32_t aIndex) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD RemoveItemFromSelection(uint32_t aIndex) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD SelectAll(bool* aIsMultiSelect) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD UnselectAll() MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD AddItemToSelection(uint32_t aIndex) final override;
+  NS_IMETHOD RemoveItemFromSelection(uint32_t aIndex) final override;
+  NS_IMETHOD SelectAll(bool* aIsMultiSelect) final override;
+  NS_IMETHOD UnselectAll() final override;
 
 protected:
   xpcAccessibleSelectable() { }
   virtual ~xpcAccessibleSelectable() {}
 
 private:
   xpcAccessibleSelectable(const xpcAccessibleSelectable&) = delete;
   xpcAccessibleSelectable& operator =(const xpcAccessibleSelectable&) = delete;
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -263,17 +263,17 @@ NS_IMETHODIMP
 xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
 {
   NS_ENSURE_ARG_POINTER(aSelectedCells);
   *aSelectedCells = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
-  NS_IMETHODIMP rv = NS_OK;
+  nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> selCells =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
   Intl()->SelectedCells(&cellsArray);
 
   uint32_t totalCount = cellsArray.Length();
--- a/accessible/xpcom/xpcAccessibleTable.h
+++ b/accessible/xpcom/xpcAccessibleTable.h
@@ -1,9 +1,9 @@
-/* -*- Mode: C++ MOZ_FINAL; tab-width: 2 MOZ_FINAL; indent-tabs-mode: nil MOZ_FINAL; c-basic-offset: 2 -*- */
+/* -*- Mode: C++ final; tab-width: 2 final; indent-tabs-mode: nil final; 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_xpcAccessibleTable_h_
 #define mozilla_a11y_xpcAccessibleTable_h_
 
@@ -21,65 +21,65 @@ class xpcAccessibleTable : public xpcAcc
 {
 public:
   explicit xpcAccessibleTable(Accessible* aIntl) :
     xpcAccessibleGeneric(aIntl) { }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
-  NS_IMETHOD GetCaption(nsIAccessible** aCaption) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetSummary(nsAString& aSummary) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetColumnCount(int32_t* aColumnCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetRowCount(int32_t* aRowCount) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetCaption(nsIAccessible** aCaption) final override;
+  NS_IMETHOD GetSummary(nsAString& aSummary) final override;
+  NS_IMETHOD GetColumnCount(int32_t* aColumnCount) final override;
+  NS_IMETHOD GetRowCount(int32_t* aRowCount) final override;
   NS_IMETHOD GetCellAt(int32_t aRowIndex, int32_t aColumnIndex,
-                       nsIAccessible** aCell) MOZ_FINAL MOZ_OVERRIDE;
+                       nsIAccessible** aCell) final override;
   NS_IMETHOD GetCellIndexAt(int32_t aRowIndex, int32_t aColumnIndex,
-                            int32_t* aCellIndex) MOZ_FINAL MOZ_OVERRIDE;
+                            int32_t* aCellIndex) final override;
   NS_IMETHOD GetColumnIndexAt(int32_t aCellIndex, int32_t* aColumnIndex)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetRowIndexAt(int32_t aCellIndex, int32_t* aRowIndex)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetRowAndColumnIndicesAt(int32_t aCellIndex, int32_t* aRowIndex,
                                       int32_t* aColumnIndex)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetColumnExtentAt(int32_t row, int32_t column,
-                               int32_t* aColumnExtent) MOZ_FINAL MOZ_OVERRIDE;
+                               int32_t* aColumnExtent) final override;
   NS_IMETHOD GetRowExtentAt(int32_t row, int32_t column,
-                            int32_t* aRowExtent) MOZ_FINAL MOZ_OVERRIDE;
+                            int32_t* aRowExtent) final override;
   NS_IMETHOD GetColumnDescription(int32_t aColIdx, nsAString& aDescription)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetRowDescription(int32_t aRowIdx, nsAString& aDescription)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD IsColumnSelected(int32_t aColIdx, bool* _retval)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD IsRowSelected(int32_t aRowIdx, bool* _retval)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD IsCellSelected(int32_t aRowIdx, int32_t aColIdx, bool* _retval)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedCellCount(uint32_t* aSelectedCellCount)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedColumnCount(uint32_t* aSelectedColumnCount)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedRowCount(uint32_t* aSelectedRowCount)
-    MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetSelectedCells(nsIArray** aSelectedCell) MOZ_FINAL MOZ_OVERRIDE;
+    final override;
+  NS_IMETHOD GetSelectedCells(nsIArray** aSelectedCell) final override;
   NS_IMETHOD GetSelectedCellIndices(uint32_t* aCellsArraySize,
                                     int32_t** aCellsArray)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedColumnIndices(uint32_t* aColsArraySize,
                                       int32_t** aColsArray)
-    MOZ_FINAL MOZ_OVERRIDE;
+    final override;
   NS_IMETHOD GetSelectedRowIndices(uint32_t* aRowsArraySize,
-                                   int32_t** aRowsArray) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD SelectColumn(int32_t aColIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD SelectRow(int32_t aRowIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD UnselectColumn(int32_t aColIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD UnselectRow(int32_t aRowIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD IsProbablyForLayout(bool* aIsForLayout) MOZ_FINAL MOZ_OVERRIDE;
+                                   int32_t** aRowsArray) final override;
+  NS_IMETHOD SelectColumn(int32_t aColIdx) final override;
+  NS_IMETHOD SelectRow(int32_t aRowIdx) final override;
+  NS_IMETHOD UnselectColumn(int32_t aColIdx) final override;
+  NS_IMETHOD UnselectRow(int32_t aRowIdx) final override;
+  NS_IMETHOD IsProbablyForLayout(bool* aIsForLayout) final override;
 
 protected:
   virtual ~xpcAccessibleTable() {}
 
 private:
   TableAccessible* Intl() { return mIntl->AsTable(); }
 
   xpcAccessibleTable(const xpcAccessibleTable&) = delete;
--- a/accessible/xpcom/xpcAccessibleTableCell.h
+++ b/accessible/xpcom/xpcAccessibleTableCell.h
@@ -22,24 +22,24 @@ class xpcAccessibleTableCell : public xp
 {
 public:
   explicit xpcAccessibleTableCell(Accessible* aIntl) :
     xpcAccessibleHyperText(aIntl) { }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTableCell
-  NS_IMETHOD GetTable(nsIAccessibleTable** aTable) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetColumnIndex(int32_t* aColIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetRowIndex(int32_t* aRowIdx) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetColumnExtent(int32_t* aExtent) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetRowExtent(int32_t* aExtent) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetColumnHeaderCells(nsIArray** aHeaderCells) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetRowHeaderCells(nsIArray** aHeaderCells) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD IsSelected(bool* aSelected) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetTable(nsIAccessibleTable** aTable) final override;
+  NS_IMETHOD GetColumnIndex(int32_t* aColIdx) final override;
+  NS_IMETHOD GetRowIndex(int32_t* aRowIdx) final override;
+  NS_IMETHOD GetColumnExtent(int32_t* aExtent) final override;
+  NS_IMETHOD GetRowExtent(int32_t* aExtent) final override;
+  NS_IMETHOD GetColumnHeaderCells(nsIArray** aHeaderCells) final override;
+  NS_IMETHOD GetRowHeaderCells(nsIArray** aHeaderCells) final override;
+  NS_IMETHOD IsSelected(bool* aSelected) final override;
 
 protected:
   virtual ~xpcAccessibleTableCell() {}
 
 private:
   TableCellAccessible* Intl() { return mIntl->AsTableCell(); }
 
   xpcAccessibleTableCell(const xpcAccessibleTableCell&) = delete;
--- a/accessible/xpcom/xpcAccessibleTextRange.h
+++ b/accessible/xpcom/xpcAccessibleTextRange.h
@@ -21,47 +21,47 @@ class TextRange;
 #define NS_ACCESSIBLETEXTRANGE_IMPL_IID                 \
 {  /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */           \
   0xb17652d9,                                           \
   0x4f54,                                               \
   0x4c56,                                               \
   { 0xbb, 0x62, 0x6d, 0x5b, 0xf1, 0xef, 0x91, 0x0c }    \
 }
 
-class xpcAccessibleTextRange MOZ_FINAL : public nsIAccessibleTextRange
+class xpcAccessibleTextRange final : public nsIAccessibleTextRange
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(xpcAccessibleTextRange)
 
-  NS_IMETHOD GetStartContainer(nsIAccessibleText** aAnchor) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetStartOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetEndContainer(nsIAccessibleText** aAnchor) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetEndOffset(int32_t* aOffset) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetContainer(nsIAccessible** aContainer) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetEmbeddedChildren(nsIArray** aList) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD Compare(nsIAccessibleTextRange* aOtherRange, bool* aResult) MOZ_FINAL MOZ_OVERRIDE;
+  NS_IMETHOD GetStartContainer(nsIAccessibleText** aAnchor) final override;
+  NS_IMETHOD GetStartOffset(int32_t* aOffset) final override;
+  NS_IMETHOD GetEndContainer(nsIAccessibleText** aAnchor) final override;
+  NS_IMETHOD GetEndOffset(int32_t* aOffset) final override;
+  NS_IMETHOD GetContainer(nsIAccessible** aContainer) final override;
+  NS_IMETHOD GetEmbeddedChildren(nsIArray** aList) final override;
+  NS_IMETHOD Compare(nsIAccessibleTextRange* aOtherRange, bool* aResult) final override;
   NS_IMETHOD CompareEndPoints(uint32_t aEndPoint,
                               nsIAccessibleTextRange* aOtherRange,
                               uint32_t aOtherRangeEndPoint,
-                              int32_t* aResult) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetText(nsAString& aText) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD GetBounds(nsIArray** aRectList) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD Move(uint32_t aUnit, int32_t aCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD MoveStart(uint32_t aUnit, int32_t aCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD MoveEnd(uint32_t aUnit, int32_t aCount) MOZ_FINAL MOZ_OVERRIDE;
-  NS_IMETHOD Normalize(uint32_t aUnit) MOZ_FINAL MOZ_OVERRIDE;
+                              int32_t* aResult) final override;
+  NS_IMETHOD GetText(nsAString& aText) final override;
+  NS_IMETHOD GetBounds(nsIArray** aRectList) final override;
+  NS_IMETHOD Move(