Bug 1064877 - dexpcomify Accessible class, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 16 Sep 2014 13:30:23 -0400
changeset 205509 627909e0506ea91a66b8fe9ced863db7083878d7
parent 205508 dc115b033048677b9f202fcefe12d930dc3f30bd
child 205510 9fc119d95bab10df5d4fb4d7836c94d13bff8181
push id49208
push usersurkov.alexander@gmail.com
push dateTue, 16 Sep 2014 17:27:57 +0000
treeherdermozilla-inbound@627909e0506e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1064877
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1064877 - dexpcomify Accessible class, r=tbsaunde
accessible/atk/nsMaiInterfaceAction.cpp
accessible/atk/nsMaiInterfaceComponent.cpp
accessible/base/nsAccessiblePivot.cpp
accessible/generic/Accessible-inl.h
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
accessible/generic/ApplicationAccessible.cpp
accessible/generic/ApplicationAccessible.h
accessible/generic/BaseAccessibles.cpp
accessible/generic/BaseAccessibles.h
accessible/generic/DocAccessible.cpp
accessible/generic/DocAccessible.h
accessible/generic/FormControlAccessible.cpp
accessible/generic/FormControlAccessible.h
accessible/generic/HyperTextAccessible.h
accessible/generic/ImageAccessible.cpp
accessible/generic/ImageAccessible.h
accessible/generic/OuterDocAccessible.cpp
accessible/generic/OuterDocAccessible.h
accessible/generic/RootAccessible.h
accessible/generic/TableAccessible.h
accessible/generic/TextLeafAccessible.cpp
accessible/generic/TextLeafAccessible.h
accessible/html/HTMLCanvasAccessible.h
accessible/html/HTMLElementAccessibles.h
accessible/html/HTMLFormControlAccessible.cpp
accessible/html/HTMLFormControlAccessible.h
accessible/html/HTMLImageMapAccessible.cpp
accessible/html/HTMLImageMapAccessible.h
accessible/html/HTMLLinkAccessible.cpp
accessible/html/HTMLLinkAccessible.h
accessible/html/HTMLListAccessible.cpp
accessible/html/HTMLListAccessible.h
accessible/html/HTMLSelectAccessible.cpp
accessible/html/HTMLSelectAccessible.h
accessible/html/HTMLTableAccessible.cpp
accessible/html/HTMLTableAccessible.h
accessible/interfaces/nsIAccessible.idl
accessible/mac/mozAccessible.mm
accessible/windows/ia2/ia2Accessible.cpp
accessible/windows/ia2/ia2AccessibleAction.cpp
accessible/windows/ia2/ia2AccessibleComponent.cpp
accessible/windows/msaa/AccessibleWrap.cpp
accessible/windows/msaa/DocAccessibleWrap.cpp
accessible/windows/sdn/sdnTextAccessible.cpp
accessible/xpcom/moz.build
accessible/xpcom/xpcAccessible.cpp
accessible/xpcom/xpcAccessible.h
accessible/xpcom/xpcAccessibleHyperLink.cpp
accessible/xpcom/xpcAccessibleHyperLink.h
accessible/xul/XULAlertAccessible.h
accessible/xul/XULColorPickerAccessible.h
accessible/xul/XULComboboxAccessible.cpp
accessible/xul/XULComboboxAccessible.h
accessible/xul/XULElementAccessibles.cpp
accessible/xul/XULElementAccessibles.h
accessible/xul/XULFormControlAccessible.cpp
accessible/xul/XULFormControlAccessible.h
accessible/xul/XULListboxAccessible.cpp
accessible/xul/XULListboxAccessible.h
accessible/xul/XULMenuAccessible.cpp
accessible/xul/XULMenuAccessible.h
accessible/xul/XULSliderAccessible.cpp
accessible/xul/XULSliderAccessible.h
accessible/xul/XULTabAccessible.cpp
accessible/xul/XULTabAccessible.h
accessible/xul/XULTreeAccessible.cpp
accessible/xul/XULTreeAccessible.h
accessible/xul/XULTreeGridAccessible.cpp
accessible/xul/XULTreeGridAccessible.h
--- a/accessible/atk/nsMaiInterfaceAction.cpp
+++ b/accessible/atk/nsMaiInterfaceAction.cpp
@@ -16,21 +16,17 @@
 using namespace mozilla::a11y;
 
 extern "C" {
 
 static gboolean
 doActionCB(AtkAction *aAction, gint aActionIndex)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
-  if (!accWrap)
-    return FALSE;
- 
-  nsresult rv = accWrap->DoAction(aActionIndex);
-  return (NS_FAILED(rv)) ? FALSE : TRUE;
+  return accWrap && accWrap->DoAction(aActionIndex);
 }
 
 static gint
 getActionCountCB(AtkAction *aAction)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
   return accWrap ? accWrap->ActionCount() : 0;
 }
@@ -46,24 +42,23 @@ getActionDescriptionCB(AtkAction *aActio
   nsresult rv = accWrap->GetActionDescription(aActionIndex, description);
   NS_ENSURE_SUCCESS(rv, nullptr);
   return AccessibleWrap::ReturnString(description);
 }
 
 static const gchar*
 getActionNameCB(AtkAction *aAction, gint aActionIndex)
 {
-    AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
-    if (!accWrap)
-        return nullptr;
+  AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
+  if (!accWrap)
+    return nullptr;
 
-    nsAutoString autoStr;
-    nsresult rv = accWrap->GetActionName(aActionIndex, autoStr);
-    NS_ENSURE_SUCCESS(rv, nullptr);
-    return AccessibleWrap::ReturnString(autoStr);
+  nsAutoString autoStr;
+  accWrap->ActionNameAt(aActionIndex, autoStr);
+  return AccessibleWrap::ReturnString(autoStr);
 }
 
 static const gchar*
 getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
 {
   AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (!acc)
     return nullptr;
--- a/accessible/atk/nsMaiInterfaceComponent.cpp
+++ b/accessible/atk/nsMaiInterfaceComponent.cpp
@@ -34,18 +34,18 @@ getExtentsCB(AtkComponent* aComponent, g
 
 static gboolean
 grabFocusCB(AtkComponent* aComponent)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aComponent));
   if (!accWrap)
     return FALSE;
 
-  nsresult rv = accWrap->TakeFocus();
-  return (NS_FAILED(rv)) ? FALSE : TRUE;
+  accWrap->TakeFocus();
+  return TRUE;
 }
 }
 
 AtkObject*
 refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY,
                            AtkCoordType aCoordType)
 {
   if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
@@ -75,33 +75,31 @@ getExtentsHelper(AccessibleWrap* aAccWra
                  gint* aX, gint* aY, gint* aWidth, gint* aHeight,
                  AtkCoordType aCoordType)
 {
   *aX = *aY = *aWidth = *aHeight = 0;
 
   if (!aAccWrap || aAccWrap->IsDefunct())
     return;
 
-  int32_t x = 0, y = 0, width = 0, height = 0;
-  // Returned in screen coordinates
-  nsresult rv = aAccWrap->GetBounds(&x, &y, &width, &height);
-  if (NS_FAILED(rv))
+  nsIntRect screenRect = aAccWrap->Bounds();
+  if (screenRect.IsEmpty())
     return;
 
   if (aCoordType == ATK_XY_WINDOW) {
     nsIntPoint winCoords =
       nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
-    x -= winCoords.x;
-    y -= winCoords.y;
+    screenRect.x -= winCoords.x;
+    screenRect.y -= winCoords.y;
   }
 
-  *aX = x;
-  *aY = y;
-  *aWidth = width;
-  *aHeight = height;
+  *aX = screenRect.x;
+  *aY = screenRect.y;
+  *aWidth = screenRect.width;
+  *aHeight = screenRect.height;
 }
 
 void
 componentInterfaceInitCB(AtkComponentIface* aIface)
 {
   NS_ASSERTION(aIface, "Invalid Interface");
   if(MOZ_UNLIKELY(!aIface))
     return;
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -579,22 +579,21 @@ nsAccessiblePivot::MoveToPoint(nsIAccess
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Ignore any matching nodes that were below this one
     if (filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE)
       match = nullptr;
 
     // Match if no node below this is a match
     if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
-      int32_t childX, childY, childWidth, childHeight;
-      child->GetBounds(&childX, &childY, &childWidth, &childHeight);
+      nsIntRect childRect = child->Bounds();
       // Double-check child's bounds since the deepest child may have been out
       // of bounds. This assures we don't return a false positive.
-      if (aX >= childX && aX < childX + childWidth &&
-          aY >= childY && aY < childY + childHeight)
+      if (aX >= childRect.x && aX < childRect.x + childRect.width &&
+          aY >= childRect.y && aY < childRect.y + childRect.height)
         match = child;
     }
 
     child = child->Parent();
   }
 
   if (match || !aIgnoreNoMatch)
     *aResult = MovePivotInternal(match, nsIAccessiblePivot::REASON_POINT,
--- a/accessible/generic/Accessible-inl.h
+++ b/accessible/generic/Accessible-inl.h
@@ -2,18 +2,19 @@
 /* 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_Accessible_inl_h_
 #define mozilla_a11y_Accessible_inl_h_
 
-#include "Accessible.h"
+#include "DocAccessible.h"
 #include "ARIAMap.h"
+#include "nsCoreUtils.h"
 
 namespace mozilla {
 namespace a11y {
 
 inline mozilla::a11y::role
 Accessible::Role()
 {
   if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
@@ -54,12 +55,19 @@ inline bool
 Accessible::HasNumericValue() const
 {
   if (mStateFlags & eHasNumericValue)
     return true;
 
   return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue;
 }
 
+inline void
+Accessible::ScrollTo(uint32_t aHow) const
+{
+  if (mContent)
+    nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aHow);
+}
+
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -6,22 +6,18 @@
 #include "Accessible-inl.h"
 
 #include "nsIXBLAccessible.h"
 
 #include "AccCollector.h"
 #include "AccGroupInfo.h"
 #include "AccIterator.h"
 #include "nsAccUtils.h"
-#include "nsAccessibleRelation.h"
 #include "nsAccessibilityService.h"
 #include "ApplicationAccessible.h"
-#include "nsCoreUtils.h"
-#include "nsIAccessibleRelation.h"
-#include "nsIAccessibleRole.h"
 #include "nsEventShell.h"
 #include "nsTextEquivUtils.h"
 #include "Relation.h"
 #include "Role.h"
 #include "RootAccessible.h"
 #include "States.h"
 #include "StyleInfo.h"
 #include "TableAccessible.h"
@@ -137,69 +133,16 @@ Accessible::Accessible(nsIContent* aCont
 #endif
 }
 
 Accessible::~Accessible()
 {
   NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
 }
 
-NS_IMETHODIMP
-Accessible::GetDocument(nsIAccessibleDocument** aDocument)
-{
-  NS_ENSURE_ARG_POINTER(aDocument);
-
-  NS_IF_ADDREF(*aDocument = Document());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetDOMNode(nsIDOMNode** aDOMNode)
-{
-  NS_ENSURE_ARG_POINTER(aDOMNode);
-  *aDOMNode = nullptr;
-
-  nsINode *node = GetNode();
-  if (node)
-    CallQueryInterface(node, aDOMNode);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
-{
-  NS_ENSURE_ARG_POINTER(aRootDocument);
-
-  NS_IF_ADDREF(*aRootDocument = RootAccessible());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetLanguage(nsAString& aLanguage)
-{
-  Language(aLanguage);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetName(nsAString& aName)
-{
-  aName.Truncate();
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsAutoString name;
-  Name(name);
-  aName.Assign(name);
-
-  return NS_OK;
-}
-
 ENameValueFlag
 Accessible::Name(nsString& aName)
 {
   aName.Truncate();
 
   if (!HasOwnContent())
     return eNameOK;
 
@@ -242,29 +185,16 @@ Accessible::Name(nsString& aName)
   }
 
   if (nameFlag != eNoNameOnPurpose)
     aName.SetIsVoid(true);
 
   return nameFlag;
 }
 
-NS_IMETHODIMP
-Accessible::GetDescription(nsAString& aDescription)
-{
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsAutoString desc;
-  Description(desc);
-  aDescription.Assign(desc);
-
-  return NS_OK;
-}
-
 void
 Accessible::Description(nsString& aDescription)
 {
   // There are 4 conditions that make an accessible have no accDescription:
   // 1. it's a text node; or
   // 2. It has no DHTML describedby property
   // 3. it doesn't have an accName; or
   // 4. its title attribute already equals to its accName nsAutoString name;
@@ -313,28 +243,16 @@ Accessible::Description(nsString& aDescr
         if (nameFlag == eNameFromTooltip)
           aDescription.Truncate();
       }
     }
   }
   aDescription.CompressWhitespace();
 }
 
-NS_IMETHODIMP
-Accessible::GetAccessKey(nsAString& aAccessKey)
-{
-  aAccessKey.Truncate();
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  AccessKey().ToString(aAccessKey);
-  return NS_OK;
-}
-
 KeyBinding
 Accessible::AccessKey() const
 {
   if (!HasOwnContent())
     return KeyBinding();
 
   uint32_t key = nsCoreUtils::GetAccessKeyFor(mContent);
   if (!key && mContent->IsElement()) {
@@ -400,161 +318,22 @@ Accessible::AccessKey() const
 }
 
 KeyBinding
 Accessible::KeyboardShortcut() const
 {
   return KeyBinding();
 }
 
-NS_IMETHODIMP
-Accessible::GetParent(nsIAccessible** aParent)
-{
-  NS_ENSURE_ARG_POINTER(aParent);
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aParent = Parent());
-  return *aParent ? NS_OK : NS_ERROR_FAILURE;
-}
-
-  /* readonly attribute nsIAccessible nextSibling; */
-NS_IMETHODIMP
-Accessible::GetNextSibling(nsIAccessible** aNextSibling)
-{
-  NS_ENSURE_ARG_POINTER(aNextSibling);
-  *aNextSibling = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsresult rv = NS_OK;
-  NS_IF_ADDREF(*aNextSibling = GetSiblingAtOffset(1, &rv));
-  return rv;
-}
-
-  /* readonly attribute nsIAccessible previousSibling; */
-NS_IMETHODIMP
-Accessible::GetPreviousSibling(nsIAccessible ** aPreviousSibling)
-{
-  NS_ENSURE_ARG_POINTER(aPreviousSibling);
-  *aPreviousSibling = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsresult rv = NS_OK;
-  NS_IF_ADDREF(*aPreviousSibling = GetSiblingAtOffset(-1, &rv));
-  return rv;
-}
-
-  /* readonly attribute nsIAccessible firstChild; */
-NS_IMETHODIMP
-Accessible::GetFirstChild(nsIAccessible** aFirstChild)
-{
-  NS_ENSURE_ARG_POINTER(aFirstChild);
-  *aFirstChild = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aFirstChild = FirstChild());
-  return NS_OK;
-}
-
-  /* readonly attribute nsIAccessible lastChild; */
-NS_IMETHODIMP
-Accessible::GetLastChild(nsIAccessible** aLastChild)
-{
-  NS_ENSURE_ARG_POINTER(aLastChild);
-  *aLastChild = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aLastChild = LastChild());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetChildAt(int32_t aChildIndex, nsIAccessible** aChild)
-{
-  NS_ENSURE_ARG_POINTER(aChild);
-  *aChild = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  // If child index is negative, then return last child.
-  // XXX: do we really need this?
-  if (aChildIndex < 0)
-    aChildIndex = ChildCount() - 1;
-
-  Accessible* child = GetChildAt(aChildIndex);
-  if (!child)
-    return NS_ERROR_INVALID_ARG;
-
-  NS_ADDREF(*aChild = child);
-  return NS_OK;
-}
-
-// readonly attribute nsIArray children;
-NS_IMETHODIMP
-Accessible::GetChildren(nsIArray** aOutChildren)
-{
-  NS_ENSURE_ARG_POINTER(aOutChildren);
-  *aOutChildren = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsresult rv = NS_OK;
-  nsCOMPtr<nsIMutableArray> children =
-    do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  uint32_t childCount = ChildCount();
-  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
-    nsIAccessible* child = GetChildAt(childIdx);
-    children->AppendElement(child, false);
-  }
-
-  NS_ADDREF(*aOutChildren = children);
-  return NS_OK;
-}
-
 bool
 Accessible::CanHaveAnonChildren()
 {
   return true;
 }
 
-/* readonly attribute long childCount; */
-NS_IMETHODIMP
-Accessible::GetChildCount(int32_t* aChildCount)
-{
-  NS_ENSURE_ARG_POINTER(aChildCount);
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aChildCount = ChildCount();
-  return NS_OK;
-}
-
-/* readonly attribute long indexInParent; */
-NS_IMETHODIMP
-Accessible::GetIndexInParent(int32_t* aIndexInParent)
-{
-  NS_ENSURE_ARG_POINTER(aIndexInParent);
-
-  *aIndexInParent = IndexInParent();
-  return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
-}
-
 void
 Accessible::TranslateString(const nsString& aKey, nsAString& aStringOut)
 {
   nsCOMPtr<nsIStringBundleService> stringBundleService =
     services::GetStringBundleService();
   if (!stringBundleService)
     return;
 
@@ -730,52 +509,39 @@ Accessible::NativelyUnavailable() const
 {
   if (mContent->IsHTML())
     return mContent->AsElement()->State().HasState(NS_EVENT_STATE_DISABLED);
 
   return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled,
                                nsGkAtoms::_true, eCaseMatters);
 }
 
-  /* readonly attribute boolean focusedChild; */
-NS_IMETHODIMP
-Accessible::GetFocusedChild(nsIAccessible** aChild)
-{
-  NS_ENSURE_ARG_POINTER(aChild);
-  *aChild = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aChild = FocusedChild());
-  return NS_OK;
-}
-
 Accessible*
 Accessible::FocusedChild()
 {
   Accessible* focus = FocusMgr()->FocusedAccessible();
   if (focus && (focus == this || focus->Parent() == this))
     return focus;
 
   return nullptr;
 }
 
 Accessible*
 Accessible::ChildAtPoint(int32_t aX, int32_t aY,
                          EWhichChildAtPoint aWhichChild)
 {
   // If we can't find the point in a child, we will return the fallback answer:
   // we return |this| if the point is within it, otherwise nullptr.
-  int32_t x = 0, y = 0, width = 0, height = 0;
-  nsresult rv = GetBounds(&x, &y, &width, &height);
-  NS_ENSURE_SUCCESS(rv, nullptr);
+  nsIntRect rect = Bounds();
+  if (rect.IsEmpty())
+   return nullptr;
 
   Accessible* fallbackAnswer = nullptr;
-  if (aX >= x && aX < x + width && aY >= y && aY < y + height)
+  if (aX >= rect.x && aX < rect.x + rect.width &&
+      aY >= rect.y && aY < rect.y + rect.height)
     fallbackAnswer = this;
 
   if (nsAccUtils::MustPrune(this))  // Do not dig any further
     return fallbackAnswer;
 
   // Search an accessible at the given point starting from accessible document
   // because containing block (see CSS2) for out of flow element (for example,
   // absolutely positioned element) may be different from its DOM parent and
@@ -867,64 +633,33 @@ Accessible::ChildAtPoint(int32_t aX, int
   // point. Skip offscreen or invisible accessibles. This takes care of cases
   // where layout won't walk into things for us, such as image map areas and
   // sub documents (XXX: subdocuments should be handled by methods of
   // OuterDocAccessibles).
   uint32_t childCount = accessible->ChildCount();
   for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = accessible->GetChildAt(childIdx);
 
-    int32_t childX, childY, childWidth, childHeight;
-    child->GetBounds(&childX, &childY, &childWidth, &childHeight);
-    if (aX >= childX && aX < childX + childWidth &&
-        aY >= childY && aY < childY + childHeight &&
+    nsIntRect childRect = child->Bounds();
+    if (aX >= childRect.x && aX < childRect.x + childRect.width &&
+        aY >= childRect.y && aY < childRect.y + childRect.height &&
         (child->State() & states::INVISIBLE) == 0) {
 
       if (aWhichChild == eDeepestChild)
         return child->ChildAtPoint(aX, aY, eDeepestChild);
 
       return child;
     }
   }
 
   return accessible;
 }
 
-// nsIAccessible getChildAtPoint(in long x, in long y)
-NS_IMETHODIMP
-Accessible::GetChildAtPoint(int32_t aX, int32_t aY,
-                            nsIAccessible** aAccessible)
-{
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDirectChild));
-  return NS_OK;
-}
-
-// nsIAccessible getDeepestChildAtPoint(in long x, in long y)
-NS_IMETHODIMP
-Accessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
-                                   nsIAccessible** aAccessible)
-{
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDeepestChild));
-  return NS_OK;
-}
-
-void
-Accessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
+nsRect
+Accessible::RelativeBounds(nsIFrame** aBoundingFrame) const
 {
   nsIFrame* frame = GetFrame();
   if (frame && mContent) {
     bool* hasHitRegionRect = static_cast<bool*>(mContent->GetProperty(nsGkAtoms::hitregion));
 
     if (hasHitRegionRect && mContent->IsElement()) {
       // This is for canvas fallback content
       // Find a canvas frame the found hit region is relative to.
@@ -935,128 +670,100 @@ Accessible::GetBoundsRect(nsRect& aTotal
 
       // make the canvas the bounding frame
       if (canvasFrame) {
         *aBoundingFrame = canvasFrame;
         dom::HTMLCanvasElement *canvas =
           dom::HTMLCanvasElement::FromContent(canvasFrame->GetContent());
 
         // get the bounding rect of the hit region
+        nsRect bounds;
         if (canvas && canvas->CountContexts() &&
-          canvas->GetContextAtIndex(0)->GetHitRegionRect(mContent->AsElement(), aTotalBounds)) {
-          return;
+          canvas->GetContextAtIndex(0)->GetHitRegionRect(mContent->AsElement(), bounds)) {
+          return bounds;
         }
       }
     }
 
     *aBoundingFrame = nsLayoutUtils::GetContainingBlockForClientRect(frame);
-    aTotalBounds = nsLayoutUtils::
+    return nsLayoutUtils::
       GetAllInFlowRectsUnion(frame, *aBoundingFrame,
                              nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
   }
+
+  return nsRect();
 }
 
-/* void getBounds (out long x, out long y, out long width, out long height); */
-NS_IMETHODIMP
-Accessible::GetBounds(int32_t* aX, int32_t* aY,
-                      int32_t* aWidth, int32_t* aHeight)
+nsIntRect
+Accessible::Bounds() const
 {
-  NS_ENSURE_ARG_POINTER(aX);
-  *aX = 0;
-  NS_ENSURE_ARG_POINTER(aY);
-  *aY = 0;
-  NS_ENSURE_ARG_POINTER(aWidth);
-  *aWidth = 0;
-  NS_ENSURE_ARG_POINTER(aHeight);
-  *aHeight = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  // This routine will get the entire rectangle for all the frames in this node.
-  // -------------------------------------------------------------------------
-  //      Primary Frame for node
-  //  Another frame, same node                <- Example
-  //  Another frame, same node
-
-  nsRect unionRectTwips;
   nsIFrame* boundingFrame = nullptr;
-  GetBoundsRect(unionRectTwips, &boundingFrame);   // Unions up all primary frames for this node and all siblings after it
-  NS_ENSURE_STATE(boundingFrame);
-
+  nsRect unionRectTwips = RelativeBounds(&boundingFrame);
+  if (!boundingFrame)
+    return nsIntRect();
+
+  nsIntRect screenRect;
   nsPresContext* presContext = mDoc->PresContext();
-  *aX = presContext->AppUnitsToDevPixels(unionRectTwips.x);
-  *aY = presContext->AppUnitsToDevPixels(unionRectTwips.y);
-  *aWidth = presContext->AppUnitsToDevPixels(unionRectTwips.width);
-  *aHeight = presContext->AppUnitsToDevPixels(unionRectTwips.height);
-
-  // We have the union of the rectangle, now we need to put it in absolute screen coords
+  screenRect.x = presContext->AppUnitsToDevPixels(unionRectTwips.x);
+  screenRect.y = presContext->AppUnitsToDevPixels(unionRectTwips.y);
+  screenRect.width = presContext->AppUnitsToDevPixels(unionRectTwips.width);
+  screenRect.height = presContext->AppUnitsToDevPixels(unionRectTwips.height);
+
+  // We have the union of the rectangle, now we need to put it in absolute
+  // screen coords.
   nsIntRect orgRectPixels = boundingFrame->GetScreenRectInAppUnits().
     ToNearestPixels(presContext->AppUnitsPerDevPixel());
-  *aX += orgRectPixels.x;
-  *aY += orgRectPixels.y;
-
-  return NS_OK;
+  screenRect.x += orgRectPixels.x;
+  screenRect.y += orgRectPixels.y;
+
+  return screenRect;
 }
 
-NS_IMETHODIMP
+void
 Accessible::SetSelected(bool aSelect)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   if (!HasOwnContent())
-    return NS_OK;
+    return;
 
   Accessible* select = nsAccUtils::GetSelectableContainer(this, State());
   if (select) {
     if (select->State() & states::MULTISELECTABLE) {
       if (mRoleMapEntry) {
         if (aSelect) {
-          return mContent->SetAttr(kNameSpaceID_None,
-                                   nsGkAtoms::aria_selected,
-                                   NS_LITERAL_STRING("true"), true);
+          mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_selected,
+                            NS_LITERAL_STRING("true"), true);
+        } else {
+          mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::aria_selected, true);
         }
-        return mContent->UnsetAttr(kNameSpaceID_None,
-                                   nsGkAtoms::aria_selected, true);
       }
-
-      return NS_OK;
+      return;
     }
 
-    return aSelect ? TakeFocus() : NS_ERROR_FAILURE;
+    if (aSelect)
+      TakeFocus();
   }
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Accessible::TakeSelection()
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   Accessible* select = nsAccUtils::GetSelectableContainer(this, State());
   if (select) {
     if (select->State() & states::MULTISELECTABLE)
       select->UnselectAll();
-    return SetSelected(true);
+    SetSelected(true);
   }
-
-  return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
+void
 Accessible::TakeFocus()
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsIFrame *frame = GetFrame();
-  NS_ENSURE_STATE(frame);
+  nsIFrame* frame = GetFrame();
+  if (!frame)
+    return;
 
   nsIContent* focusContent = mContent;
 
   // If the accessible focus is managed by container widget then focus the
   // widget and set the accessible as its current item.
   if (!frame->IsFocusable()) {
     Accessible* widget = ContainerWidget();
     if (widget && widget->AreItemsOperable()) {
@@ -1068,18 +775,16 @@ Accessible::TakeFocus()
       }
     }
   }
 
   nsCOMPtr<nsIDOMElement> element(do_QueryInterface(focusContent));
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
   if (fm)
     fm->SetFocus(element, 0);
-
-  return NS_OK;
 }
 
 void
 Accessible::XULElmName(DocAccessible* aDocument,
                        nsIContent* aElm, nsString& aName)
 {
   /**
    * 3 main cases for XUL Controls to be labeled
@@ -1168,44 +873,16 @@ Accessible::HandleAccEvent(AccEvent* aEv
   if (hasObservers) {
     nsCOMPtr<nsIAccessibleEvent> event = MakeXPCEvent(aEvent);
     return obsService->NotifyObservers(event, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-Accessible::GetRole(uint32_t *aRole)
-{
-  NS_ENSURE_ARG_POINTER(aRole);
-  *aRole = nsIAccessibleRole::ROLE_NOTHING;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aRole = Role();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetAttributes(nsIPersistentProperties** aAttributes)
-{
-  NS_ENSURE_ARG_POINTER(aAttributes);
-  *aAttributes = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIPersistentProperties> attributes = Attributes();
-  attributes.swap(*aAttributes);
-
-  return NS_OK;
-}
-
 already_AddRefed<nsIPersistentProperties>
 Accessible::Attributes()
 {
   nsCOMPtr<nsIPersistentProperties> attributes = NativeAttributes();
   if (!HasOwnContent() || !mContent->IsElement())
     return attributes.forget();
 
   // 'xml-roles' attribute coming from ARIA.
@@ -1414,51 +1091,16 @@ Accessible::GroupPosition()
       if (groupPos.setSize == 0)
         groupPos.setSize = setSize;
     }
   }
 
   return groupPos;
 }
 
-NS_IMETHODIMP
-Accessible::ScriptableGroupPosition(int32_t* aGroupLevel,
-                                    int32_t* aSimilarItemsInGroup,
-                                    int32_t* aPositionInGroup)
-{
-  NS_ENSURE_ARG_POINTER(aGroupLevel);
-  *aGroupLevel = 0;
-
-  NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
-  *aSimilarItemsInGroup = 0;
-
-  NS_ENSURE_ARG_POINTER(aPositionInGroup);
-  *aPositionInGroup = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  GroupPos groupPos = GroupPosition();
-
-  *aGroupLevel = groupPos.level;
-  *aSimilarItemsInGroup = groupPos.setSize;
-  *aPositionInGroup = groupPos.posInSet;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetState(uint32_t* aState, uint32_t* aExtraState)
-{
-  NS_ENSURE_ARG_POINTER(aState);
-
-  nsAccUtils::To32States(State(), aState, aExtraState);
-  return NS_OK;
-}
-
 uint64_t
 Accessible::State()
 {
   if (IsDefunct())
     return states::DEFUNCT;
 
   uint64_t state = NativeState();
   // Apply ARIA states to be sure accessible states will be overridden.
@@ -1610,29 +1252,16 @@ Accessible::ApplyARIAState(uint64_t* aSt
         uint64_t gridState = 0;
         grid->ApplyARIAState(&gridState);
         *aState |= (gridState & (states::READONLY | states::EDITABLE));
       }
     }
   }
 }
 
-NS_IMETHODIMP
-Accessible::GetValue(nsAString& aValue)
-{
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsAutoString value;
-  Value(value);
-  aValue.Assign(value);
-
-  return NS_OK;
-}
-
 void
 Accessible::Value(nsString& aValue)
 {
   if (!mRoleMapEntry)
     return;
 
   if (mRoleMapEntry->valueRule != eNoValue) {
     // aria-valuenow is a number, and aria-valuetext is the optional text
@@ -1722,34 +1351,16 @@ Accessible::SetCurValue(double aValue)
 
   nsAutoString strValue;
   strValue.AppendFloat(aValue);
 
   return NS_SUCCEEDED(
     mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow, strValue, true));
 }
 
-/* void setName (in DOMString name); */
-NS_IMETHODIMP
-Accessible::SetName(const nsAString& aName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-Accessible::GetKeyboardShortcut(nsAString& aKeyBinding)
-{
-  aKeyBinding.Truncate();
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  KeyboardShortcut().ToString(aKeyBinding);
-  return NS_OK;
-}
-
 role
 Accessible::ARIATransformRole(role aRole)
 {
   // XXX: these unfortunate exceptions don't fit into the ARIA table. This is
   // where the accessible role depends on both the role and ARIA state.
   if (aRole == roles::PUSHBUTTON) {
     if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_pressed)) {
       // For simplicity, any existing pressed attribute except "" or "undefined"
@@ -1794,173 +1405,114 @@ Accessible::ARIATransformRole(role aRole
 }
 
 role
 Accessible::NativeRole()
 {
   return roles::NOTHING;
 }
 
-// readonly attribute uint8_t actionCount
-NS_IMETHODIMP
-Accessible::GetActionCount(uint8_t* aActionCount)
-{
-  NS_ENSURE_ARG_POINTER(aActionCount);
-  *aActionCount = 0;
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aActionCount = ActionCount();
-  return NS_OK;
-}
-
 uint8_t
 Accessible::ActionCount()
 {
   return GetActionRule() == eNoAction ? 0 : 1;
 }
 
-/* DOMString getAccActionName (in uint8_t index); */
-NS_IMETHODIMP
-Accessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+Accessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (aIndex != 0)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return;
 
   uint32_t actionRule = GetActionRule();
 
  switch (actionRule) {
    case eActivateAction:
      aName.AssignLiteral("activate");
-     return NS_OK;
+     return;
 
    case eClickAction:
      aName.AssignLiteral("click");
-     return NS_OK;
+     return;
 
    case ePressAction:
      aName.AssignLiteral("press");
-     return NS_OK;
+     return;
 
    case eCheckUncheckAction:
    {
      uint64_t state = State();
      if (state & states::CHECKED)
        aName.AssignLiteral("uncheck");
      else if (state & states::MIXED)
        aName.AssignLiteral("cycle");
      else
        aName.AssignLiteral("check");
-     return NS_OK;
+     return;
    }
 
    case eJumpAction:
      aName.AssignLiteral("jump");
-     return NS_OK;
+     return;
 
    case eOpenCloseAction:
      if (State() & states::COLLAPSED)
        aName.AssignLiteral("open");
      else
        aName.AssignLiteral("close");
-     return NS_OK;
+     return;
 
    case eSelectAction:
      aName.AssignLiteral("select");
-     return NS_OK;
+     return;
 
    case eSwitchAction:
      aName.AssignLiteral("switch");
-     return NS_OK;
+     return;
 
    case eSortAction:
      aName.AssignLiteral("sort");
-     return NS_OK;
+     return;
 
    case eExpandAction:
      if (State() & states::COLLAPSED)
        aName.AssignLiteral("expand");
      else
        aName.AssignLiteral("collapse");
-     return NS_OK;
+     return;
   }
-
-  return NS_ERROR_INVALID_ARG;
 }
 
-// AString getActionDescription(in uint8_t index)
-NS_IMETHODIMP
-Accessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription)
-{
-  // default to localized action name.
-  nsAutoString name;
-  nsresult rv = GetActionName(aIndex, name);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  TranslateString(name, aDescription);
-  return NS_OK;
-}
-
-// void doAction(in uint8_t index)
-NS_IMETHODIMP
+bool
 Accessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != 0)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   if (GetActionRule() != eNoAction) {
     DoCommand();
-    return NS_OK;
+    return true;
   }
 
-  return NS_ERROR_INVALID_ARG;
-}
-
-/* DOMString getHelp (); */
-NS_IMETHODIMP Accessible::GetHelp(nsAString& _retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return false;
 }
 
 nsIContent*
 Accessible::GetAtomicRegion() const
 {
   nsIContent *loopContent = mContent;
   nsAutoString atomic;
   while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic))
     loopContent = loopContent->GetParent();
 
   return atomic.EqualsLiteral("true") ? loopContent : nullptr;
 }
 
-// nsIAccessible getRelationByType()
-NS_IMETHODIMP
-Accessible::GetRelationByType(uint32_t aType, nsIAccessibleRelation** aRelation)
-{
-  NS_ENSURE_ARG_POINTER(aRelation);
-  *aRelation = nullptr;
-
-  NS_ENSURE_ARG(aType <= static_cast<uint32_t>(RelationType::LAST));
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  Relation rel = RelationByType(static_cast<RelationType>(aType));
-  NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
-  return *aRelation ? NS_OK : NS_ERROR_FAILURE;
-}
-
 Relation
 Accessible::RelationByType(RelationType aType)
 {
   if (!HasOwnContent())
     return Relation();
 
   // Relationships are defined on the same content node that the role would be
   // defined on.
@@ -2162,74 +1714,16 @@ Accessible::RelationByType(RelationType 
     case RelationType::CONTAINING_APPLICATION:
       return Relation(ApplicationAcc());
 
     default:
       return Relation();
   }
 }
 
-NS_IMETHODIMP
-Accessible::GetRelations(nsIArray **aRelations)
-{
-  NS_ENSURE_ARG_POINTER(aRelations);
-  *aRelations = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
-
-  static const uint32_t relationTypes[] = {
-    nsIAccessibleRelation::RELATION_LABELLED_BY,
-    nsIAccessibleRelation::RELATION_LABEL_FOR,
-    nsIAccessibleRelation::RELATION_DESCRIBED_BY,
-    nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
-    nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
-    nsIAccessibleRelation::RELATION_NODE_PARENT_OF,
-    nsIAccessibleRelation::RELATION_CONTROLLED_BY,
-    nsIAccessibleRelation::RELATION_CONTROLLER_FOR,
-    nsIAccessibleRelation::RELATION_FLOWS_TO,
-    nsIAccessibleRelation::RELATION_FLOWS_FROM,
-    nsIAccessibleRelation::RELATION_MEMBER_OF,
-    nsIAccessibleRelation::RELATION_SUBWINDOW_OF,
-    nsIAccessibleRelation::RELATION_EMBEDS,
-    nsIAccessibleRelation::RELATION_EMBEDDED_BY,
-    nsIAccessibleRelation::RELATION_POPUP_FOR,
-    nsIAccessibleRelation::RELATION_PARENT_WINDOW_OF,
-    nsIAccessibleRelation::RELATION_DEFAULT_BUTTON,
-    nsIAccessibleRelation::RELATION_CONTAINING_DOCUMENT,
-    nsIAccessibleRelation::RELATION_CONTAINING_TAB_PANE,
-    nsIAccessibleRelation::RELATION_CONTAINING_APPLICATION
-  };
-
-  for (uint32_t idx = 0; idx < ArrayLength(relationTypes); idx++) {
-    nsCOMPtr<nsIAccessibleRelation> relation;
-    nsresult rv = GetRelationByType(relationTypes[idx], getter_AddRefs(relation));
-
-    if (NS_SUCCEEDED(rv) && relation) {
-      uint32_t targets = 0;
-      relation->GetTargetsCount(&targets);
-      if (targets)
-        relations->AppendElement(relation, false);
-    }
-  }
-
-  NS_ADDREF(*aRelations = relations);
-  return NS_OK;
-}
-
-/* void extendSelection (); */
-NS_IMETHODIMP Accessible::ExtendSelection()
-{
-  // XXX Should be implemented, but not high priority
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 /* [noscript] void getNativeInterface(out voidPtr aOutAccessible); */
 NS_IMETHODIMP Accessible::GetNativeInterface(void **aOutAccessible)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 void
 Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
@@ -2297,134 +1791,29 @@ Accessible::DispatchClickEvent(nsIConten
 
   // Simulate a touch interaction by dispatching touch events with mouse events.
   nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget);
   nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget);
   nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget);
   nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, x, y, aContent, frame, presShell, widget);
 }
 
-NS_IMETHODIMP
-Accessible::ScrollTo(uint32_t aHow)
-{
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aHow);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 Accessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY)
 {
-  nsIFrame *frame = GetFrame();
+  nsIFrame* frame = GetFrame();
   if (!frame)
-    return NS_ERROR_FAILURE;
-
-  nsIntPoint coords = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType,
-                                                        this);
-
-  nsIFrame *parentFrame = frame;
+    return;
+
+  nsIntPoint coords =
+    nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this);
+
+  nsIFrame* parentFrame = frame;
   while ((parentFrame = parentFrame->GetParent()))
     nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords);
-
-  return NS_OK;
-}
-
-// nsIAccessibleHyperLink
-// Because of new-atk design, any embedded object in text can implement
-// nsIAccessibleHyperLink, which helps determine where it is located
-// within containing text
-
-// readonly attribute long nsIAccessibleHyperLink::anchorCount
-NS_IMETHODIMP
-Accessible::GetAnchorCount(int32_t *aAnchorCount)
-{
-  NS_ENSURE_ARG_POINTER(aAnchorCount);
-  *aAnchorCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aAnchorCount = AnchorCount();
-  return NS_OK;
-}
-
-// readonly attribute long nsIAccessibleHyperLink::startIndex
-NS_IMETHODIMP
-Accessible::GetStartIndex(int32_t *aStartIndex)
-{
-  NS_ENSURE_ARG_POINTER(aStartIndex);
-  *aStartIndex = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aStartIndex = StartOffset();
-  return NS_OK;
-}
-
-// readonly attribute long nsIAccessibleHyperLink::endIndex
-NS_IMETHODIMP
-Accessible::GetEndIndex(int32_t *aEndIndex)
-{
-  NS_ENSURE_ARG_POINTER(aEndIndex);
-  *aEndIndex = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aEndIndex = EndOffset();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Accessible::GetURI(int32_t aIndex, nsIURI **aURI)
-{
-  NS_ENSURE_ARG_POINTER(aURI);
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
-    return NS_ERROR_INVALID_ARG;
-
-  nsRefPtr<nsIURI>(AnchorURIAt(aIndex)).forget(aURI);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-Accessible::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
-{
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nullptr;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
-    return NS_ERROR_INVALID_ARG;
-
-  NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex));
-  return NS_OK;
-}
-
-// readonly attribute boolean nsIAccessibleHyperLink::valid
-NS_IMETHODIMP
-Accessible::GetValid(bool *aValid)
-{
-  NS_ENSURE_ARG_POINTER(aValid);
-  *aValid = false;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aValid = IsLinkValid();
-  return NS_OK;
 }
 
 void
 Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
                          uint32_t aLength)
 {
   // Return text representation of non-text accessible within hypertext
   // accessible. Text accessible overrides this method to return enclosed text.
@@ -3117,17 +2506,17 @@ Accessible::AttrNumericValue(nsIAtom* aA
     return UnspecifiedNaN<double>();
 
   nsresult error = NS_OK;
   double value = attrValue.ToDouble(&error);
   return NS_FAILED(error) ? UnspecifiedNaN<double>() : value;
 }
 
 uint32_t
-Accessible::GetActionRule()
+Accessible::GetActionRule() const
 {
   if (!HasOwnContent() || (InteractiveState() & states::UNAVAILABLE))
     return eNoAction;
 
   // Return "click" action on elements that have an attached popup menu.
   if (mContent->IsXUL())
     if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
       return eClickAction;
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -6,32 +6,33 @@
 #ifndef _Accessible_H_
 #define _Accessible_H_
 
 #include "mozilla/a11y/AccTypes.h"
 #include "mozilla/a11y/RelationType.h"
 #include "mozilla/a11y/Role.h"
 #include "mozilla/a11y/States.h"
 
-#include "nsIAccessible.h"
-#include "nsIAccessibleHyperLink.h"
+#include "xpcAccessible.h"
+#include "xpcAccessibleHyperLink.h"
 #include "nsIAccessibleStates.h"
 #include "xpcAccessibleSelectable.h"
 #include "xpcAccessibleValue.h"
 
 #include "nsIContent.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsRefPtrHashtable.h"
 
 struct nsRoleMapEntry;
 
 struct nsRect;
 class nsIFrame;
 class nsIAtom;
+struct nsIntRect;
 class nsView;
 
 namespace mozilla {
 namespace a11y {
 
 class Accessible;
 class AccEvent;
 class AccGroupInfo;
@@ -117,31 +118,32 @@ typedef nsRefPtrHashtable<nsPtrHashKey<c
 #define NS_ACCESSIBLE_IMPL_IID                          \
 {  /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */           \
   0x133c8bf4,                                           \
   0x4913,                                               \
   0x4355,                                               \
   { 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad }    \
 }
 
-class Accessible : public nsIAccessible,
-                   public nsIAccessibleHyperLink,
+class Accessible : public xpcAccessible,
+                   public xpcAccessibleHyperLink,
                    public xpcAccessibleSelectable,
                    public xpcAccessibleValue
 {
 public:
   Accessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(Accessible, nsIAccessible)
 
-  NS_DECL_NSIACCESSIBLE
-  NS_DECL_NSIACCESSIBLEHYPERLINK
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID)
 
+  // nsIAccessible
+  NS_IMETHOD GetNativeInterface(void** aOutAccessible);
+
   //////////////////////////////////////////////////////////////////////////////
   // Public methods
 
   /**
    * Return the document accessible for this accessible.
    */
   DocAccessible* Document() const { return mDoc; }
 
@@ -516,19 +518,49 @@ public:
 
   /**
    * Assert if child not in parent's cache if the cache was initialized at this
    * point.
    */
   void TestChildCache(Accessible* aCachedChild) const;
 
   /**
+   * Return boundaries in screen coordinates.
+   */
+  virtual nsIntRect Bounds() const;
+
+  /**
    * Return boundaries rect relative the bounding frame.
    */
-  virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
+  virtual nsRect RelativeBounds(nsIFrame** aRelativeFrame) const;
+
+  /**
+   * Selects the accessible within its container if applicable.
+   */
+  virtual void SetSelected(bool aSelect);
+
+  /**
+   * Select the accessible within its container.
+   */
+  void TakeSelection();
+
+  /**
+   * Focus the accessible.
+   */
+  virtual void TakeFocus();
+
+  /**
+   * Scroll the accessible into view.
+   */
+  void ScrollTo(uint32_t aHow) const;
+
+  /**
+   * Scroll the accessible to the given point.
+   */
+  void ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY);
 
   //////////////////////////////////////////////////////////////////////////////
   // Downcasting and types
 
   inline bool IsAbbreviation() const
   {
     return mContent->IsHTML() &&
       (mContent->Tag() == nsGkAtoms::abbr || mContent->Tag() == nsGkAtoms::acronym);
@@ -617,28 +649,49 @@ public:
   // ActionAccessible
 
   /**
    * Return the number of actions that can be performed on this accessible.
    */
   virtual uint8_t ActionCount();
 
   /**
+   * Return action name at given index.
+   */
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName);
+
+  /**
+   * Default to localized action name.
+   */
+  void ActionDescriptionAt(uint8_t aIndex, nsAString& aDescription)
+  {
+    nsAutoString name;
+    ActionNameAt(aIndex, name);
+    TranslateString(name, aDescription);
+  }
+
+  /**
+   * Invoke the accessible action.
+   */
+  virtual bool DoAction(uint8_t aIndex);
+
+  /**
    * Return access key, such as Alt+D.
    */
   virtual KeyBinding AccessKey() const;
 
   /**
    * Return global keyboard shortcut for default action, such as Ctrl+O for
    * Open file menuitem.
    */
   virtual KeyBinding KeyboardShortcut() const;
 
   //////////////////////////////////////////////////////////////////////////////
-  // HyperLinkAccessible
+  // HyperLinkAccessible (any embedded object in text can implement HyperLink,
+  // which helps determine where it is located within containing text).
 
   /**
    * Return true if the accessible is hyper link accessible.
    */
   virtual bool IsLink();
 
   /**
    * Return the start offset of the link within the parent accessible.
@@ -972,19 +1025,19 @@ protected:
    *
    * @param aARIAProperty  [in] the ARIA property we're using
    * @return  a numeric value
    */
   double AttrNumericValue(nsIAtom* aARIAAttr) const;
 
   /**
    * Return the action rule based on ARIA enum constants EActionRule
-   * (see ARIAMap.h). Used by ActionCount() and GetActionName().
+   * (see ARIAMap.h). Used by ActionCount() and ActionNameAt().
    */
-  uint32_t GetActionRule();
+  uint32_t GetActionRule() const;
 
   /**
    * Return group info.
    */
   AccGroupInfo* GetGroupInfo();
 
   /**
    * Set dirty state of the accessible's group info.
@@ -1023,16 +1076,17 @@ protected:
   uint32_t mStateFlags : kStateFlagsBits;
   uint32_t mContextFlags : kContextFlagsBits;
   uint32_t mType : kTypeBits;
   uint32_t mGenericTypes : kGenericTypesBits;
 
   void StaticAsserts() const;
 
   friend class DocAccessible;
+  friend class xpcAccessible;
 
   nsAutoPtr<mozilla::a11y::EmbeddedObjCollector> mEmbeddedObjCollector;
   int32_t mIndexOfEmbeddedChild;
   friend class EmbeddedObjCollector;
 
   nsAutoPtr<AccGroupInfo> mGroupInfo;
   friend class AccGroupInfo;
 
--- a/accessible/generic/ApplicationAccessible.cpp
+++ b/accessible/generic/ApplicationAccessible.cpp
@@ -34,40 +34,16 @@ ApplicationAccessible::ApplicationAccess
 // nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED(ApplicationAccessible, Accessible,
                             nsIAccessibleApplication)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessible
 
-NS_IMETHODIMP
-ApplicationAccessible::GetParent(nsIAccessible** aAccessible)
-{
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nullptr;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::GetNextSibling(nsIAccessible** aNextSibling)
-{
-  NS_ENSURE_ARG_POINTER(aNextSibling);
-  *aNextSibling = nullptr;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling)
-{
-  NS_ENSURE_ARG_POINTER(aPreviousSibling);
-  *aPreviousSibling = nullptr;
-  return NS_OK;
-}
-
 ENameValueFlag
 ApplicationAccessible::Name(nsString& aName)
 {
   aName.Truncate();
 
   nsCOMPtr<nsIStringBundleService> bundleService =
     mozilla::services::GetStringBundleService();
 
@@ -141,74 +117,20 @@ ApplicationAccessible::FocusedChild()
 }
 
 Relation
 ApplicationAccessible::RelationByType(RelationType aRelationType)
 {
   return Relation();
 }
 
-NS_IMETHODIMP
-ApplicationAccessible::GetBounds(int32_t* aX, int32_t* aY,
-                                 int32_t* aWidth, int32_t* aHeight)
-{
-  NS_ENSURE_ARG_POINTER(aX);
-  *aX = 0;
-  NS_ENSURE_ARG_POINTER(aY);
-  *aY = 0;
-  NS_ENSURE_ARG_POINTER(aWidth);
-  *aWidth = 0;
-  NS_ENSURE_ARG_POINTER(aHeight);
-  *aHeight = 0;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::SetSelected(bool aIsSelected)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::TakeSelection()
+nsIntRect
+ApplicationAccessible::Bounds() const
 {
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::TakeFocus()
-{
-  return NS_OK;
-}
-
-uint8_t
-ApplicationAccessible::ActionCount()
-{
-  return 0;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
-{
-  aName.Truncate();
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::GetActionDescription(uint8_t aIndex,
-                                            nsAString& aDescription)
-{
-  aDescription.Truncate();
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::DoAction(uint8_t aIndex)
-{
-  return NS_OK;
+  return nsIntRect();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleApplication
 
 NS_IMETHODIMP
 ApplicationAccessible::GetAppName(nsAString& aName)
 {
@@ -350,40 +272,8 @@ Accessible*
 ApplicationAccessible::GetSiblingAtOffset(int32_t aOffset,
                                           nsresult* aError) const
 {
   if (aError)
     *aError = NS_OK; // fail peacefully
 
   return nullptr;
 }
-
-////////////////////////////////////////////////////////////////////////////////
-// nsIAccessible
-
-NS_IMETHODIMP
-ApplicationAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
-{
-  NS_ENSURE_ARG_POINTER(aRootDocument);
-  *aRootDocument = nullptr;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::ScrollTo(uint32_t aScrollType)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::ScrollToPoint(uint32_t aCoordinateType,
-                                     int32_t aX, int32_t aY)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ApplicationAccessible::GetLanguage(nsAString& aLanguage)
-{
-  aLanguage.Truncate();
-  return NS_OK;
-}
-
--- a/accessible/generic/ApplicationAccessible.h
+++ b/accessible/generic/ApplicationAccessible.h
@@ -32,57 +32,40 @@ class ApplicationAccessible : public Acc
 {
 public:
 
   ApplicationAccessible();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument);
-  NS_IMETHOD ScrollTo(uint32_t aScrollType);
-  NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY);
-  NS_IMETHOD GetLanguage(nsAString& aLanguage);
-  NS_IMETHOD GetParent(nsIAccessible **aParent);
-  NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
-  NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
-  NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY,
-                       int32_t *aWidth, int32_t *aHeight);
-  NS_IMETHOD SetSelected(bool aIsSelected);
-  NS_IMETHOD TakeSelection();
-  NS_IMETHOD TakeFocus();
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName);
-  NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // nsIAccessibleApplication
   NS_DECL_NSIACCESSIBLEAPPLICATION
 
   // Accessible
   virtual void Shutdown();
+  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
   virtual GroupPos GroupPosition();
   virtual ENameValueFlag Name(nsString& aName);
   virtual void ApplyARIAState(uint64_t* aState) const;
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t State();
-  virtual uint64_t NativeState();
+  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 Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
   virtual Accessible* FocusedChild();
 
   virtual void InvalidateChildren();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
   virtual KeyBinding AccessKey() const;
 
 protected:
   virtual ~ApplicationAccessible() {}
 
   // Accessible
   virtual void CacheChildren();
   virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
--- a/accessible/generic/BaseAccessibles.cpp
+++ b/accessible/generic/BaseAccessibles.cpp
@@ -76,20 +76,23 @@ LinkableAccessible::
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(LinkableAccessible, AccessibleWrap)
 
 ////////////////////////////////////////////////////////////////////////////////
 // LinkableAccessible. nsIAccessible
 
-NS_IMETHODIMP
+void
 LinkableAccessible::TakeFocus()
 {
-  return mActionAcc ? mActionAcc->TakeFocus() : AccessibleWrap::TakeFocus();
+  if (mActionAcc)
+    mActionAcc->TakeFocus();
+  else
+    AccessibleWrap::TakeFocus();
 }
 
 uint64_t
 LinkableAccessible::NativeLinkState() const
 {
   if (mIsLink)
     return states::LINKED | (mActionAcc->LinkState() & states::TRAVERSED);
 
@@ -111,41 +114,35 @@ LinkableAccessible::Value(nsString& aVal
 
 
 uint8_t
 LinkableAccessible::ActionCount()
 {
   return (mIsOnclick || mIsLink) ? 1 : 0;
 }
 
-NS_IMETHODIMP
-LinkableAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+LinkableAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   // Action 0 (default action): Jump to link
   if (aIndex == eAction_Jump) {
-    if (mIsLink) {
+    if (mIsLink)
       aName.AssignLiteral("jump");
-      return NS_OK;
-    }
-    else if (mIsOnclick) {
+    else if (mIsOnclick)
       aName.AssignLiteral("click");
-      return NS_OK;
-    }
-    return NS_ERROR_NOT_IMPLEMENTED;
   }
-  return NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP
+bool
 LinkableAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Jump)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   return mActionAcc ? mActionAcc->DoAction(aIndex) :
     AccessibleWrap::DoAction(aIndex);
 }
 
 KeyBinding
 LinkableAccessible::AccessKey() const
 {
--- a/accessible/generic/BaseAccessibles.h
+++ b/accessible/generic/BaseAccessibles.h
@@ -55,28 +55,26 @@ class LinkableAccessible : public Access
 {
 public:
   enum { eAction_Jump = 0 };
 
   LinkableAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD TakeFocus();
-
   // Accessible
-  virtual void Shutdown();
-  virtual void Value(nsString& aValue);
-  virtual uint64_t NativeLinkState() const;
+  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual void Value(nsString& aValue) MOZ_OVERRIDE;
+  virtual uint64_t NativeLinkState() const MOZ_OVERRIDE;
+  virtual void TakeFocus() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  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;
 
   // HyperLinkAccessible
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
 protected:
   virtual ~LinkableAccessible() {}
 
@@ -99,17 +97,17 @@ class EnumRoleAccessible : public Access
 {
 public:
   EnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc, 
                      a11y::role aRole);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
 protected:
   virtual ~EnumRoleAccessible() { }
 
   a11y::role mRole;
 };
 
 
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -308,30 +308,24 @@ DocAccessible::Attributes()
 Accessible*
 DocAccessible::FocusedChild()
 {
   // Return an accessible for the current global focus, which does not have to
   // be contained within the current document.
   return FocusMgr()->FocusedAccessible();
 }
 
-NS_IMETHODIMP
+void
 DocAccessible::TakeFocus()
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   // Focus the document.
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
-  NS_ENSURE_STATE(fm);
-
   nsCOMPtr<nsIDOMElement> newFocus;
-  return fm->MoveFocus(mDocumentNode->GetWindow(), nullptr,
-                       nsIFocusManager::MOVEFOCUS_ROOT, 0,
-                       getter_AddRefs(newFocus));
+  fm->MoveFocus(mDocumentNode->GetWindow(), nullptr,
+                nsFocusManager::MOVEFOCUS_ROOT, 0, getter_AddRefs(newFocus));
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleDocument
 
 NS_IMETHODIMP
 DocAccessible::GetURL(nsAString& aURL)
@@ -640,55 +634,57 @@ DocAccessible::GetFrame() const
   nsIFrame* root = nullptr;
   if (mPresShell)
     root = mPresShell->GetRootFrame();
 
   return root;
 }
 
 // DocAccessible protected member
-void
-DocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame)
+nsRect
+DocAccessible::RelativeBounds(nsIFrame** aRelativeFrame) const
 {
   *aRelativeFrame = GetFrame();
 
   nsIDocument *document = mDocumentNode;
   nsIDocument *parentDoc = nullptr;
 
+  nsRect bounds;
   while (document) {
     nsIPresShell *presShell = document->GetShell();
-    if (!presShell) {
-      return;
-    }
+    if (!presShell)
+      return nsRect();
 
     nsRect scrollPort;
     nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollableExternal();
     if (sf) {
       scrollPort = sf->GetScrollPortRect();
     } else {
       nsIFrame* rootFrame = presShell->GetRootFrame();
-      if (!rootFrame) {
-        return;
-      }
+      if (!rootFrame)
+        return nsRect();
+
       scrollPort = rootFrame->GetRect();
     }
 
     if (parentDoc) {  // After first time thru loop
       // XXXroc bogus code! scrollPort is relative to the viewport of
       // this document, but we're intersecting rectangles derived from
       // multiple documents and assuming they're all in the same coordinate
       // system. See bug 514117.
-      aBounds.IntersectRect(scrollPort, aBounds);
+      bounds.IntersectRect(scrollPort, bounds);
     }
     else {  // First time through loop
-      aBounds = scrollPort;
+      bounds = scrollPort;
     }
 
     document = parentDoc = document->GetParentDocument();
   }
+
+  return bounds;
 }
 
 // DocAccessible protected member
 nsresult
 DocAccessible::AddEventListeners()
 {
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(mDocumentNode->GetDocShell());
 
--- a/accessible/generic/DocAccessible.h
+++ b/accessible/generic/DocAccessible.h
@@ -54,19 +54,16 @@ class DocAccessible : public HyperTextAc
 
   NS_DECL_NSIACCESSIBLEPIVOTOBSERVER
 
 public:
 
   DocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
                 nsIPresShell* aPresShell);
 
-  // nsIAccessible
-  NS_IMETHOD TakeFocus(void);
-
   // nsIScrollPositionListener
   virtual void ScrollPositionWillChange(nscoord aX, nscoord aY) {}
   virtual void ScrollPositionDidChange(nscoord aX, nscoord aY);
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
   // Accessible
@@ -74,28 +71,30 @@ public:
   virtual void Shutdown();
   virtual nsIFrame* GetFrame() const;
   virtual nsINode* GetNode() const { return mDocumentNode; }
   nsIDocument* DocumentNode() const { return mDocumentNode; }
 
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
   virtual void Description(nsString& aDescription);
   virtual Accessible* FocusedChild();
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
   virtual bool NativelyUnavailable() const;
   virtual void ApplyARIAState(uint64_t* aState) const;
   virtual already_AddRefed<nsIPersistentProperties> Attributes();
 
+  virtual void TakeFocus() MOZ_OVERRIDE;
+
 #ifdef A11Y_LOG
   virtual nsresult HandleAccEvent(AccEvent* aEvent);
 #endif
 
-  virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
+  virtual nsRect RelativeBounds(nsIFrame** aRelativeFrame) const MOZ_OVERRIDE;
 
   // HyperTextAccessible
   virtual already_AddRefed<nsIEditor> GetEditor() const;
 
   // DocAccessible
 
   /**
    * Return presentation shell for this document accessible.
--- a/accessible/generic/FormControlAccessible.cpp
+++ b/accessible/generic/FormControlAccessible.cpp
@@ -169,34 +169,31 @@ RadioButtonAccessible::
 }
 
 uint8_t
 RadioButtonAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-RadioButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+RadioButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Click) {
-    aName.AssignLiteral("select"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Click)
+    aName.AssignLiteral("select");
 }
 
-NS_IMETHODIMP
+bool
 RadioButtonAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 role
 RadioButtonAccessible::NativeRole()
 {
   return roles::RADIOBUTTON;
 }
 
--- a/accessible/generic/FormControlAccessible.h
+++ b/accessible/generic/FormControlAccessible.h
@@ -26,18 +26,18 @@ public:
     mStateFlags |= eHasNumericValue | eIgnoreDOMUIEvent;
     mType = eProgressType;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_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;
 
@@ -52,25 +52,23 @@ protected:
   * Generic class used for radio buttons.
   */
 class RadioButtonAccessible : public LeafAccessible
 {
 
 public:
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
   virtual mozilla::a11y::role NativeRole();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   enum { eAction_Click = 0 };
 
   // Widgets
   virtual bool IsWidget() const;
 };
 
 } // namespace a11y
--- a/accessible/generic/HyperTextAccessible.h
+++ b/accessible/generic/HyperTextAccessible.h
@@ -52,18 +52,18 @@ class HyperTextAccessible : public Acces
 public:
   HyperTextAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
   virtual int32_t GetLevelInternal();
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   virtual void InvalidateChildren();
   virtual bool RemoveChild(Accessible* aAccessible);
 
   // HyperTextAccessible (static helper method)
 
   // Convert content offset to rendered text offset
   nsresult ContentToRenderedOffset(nsIFrame *aFrame, int32_t aContentOffset,
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -104,79 +104,80 @@ ImageAccessible::NativeRole()
 
 uint8_t
 ImageAccessible::ActionCount()
 {
   uint8_t actionCount = LinkableAccessible::ActionCount();
   return HasLongDesc() ? actionCount + 1 : actionCount;
 }
 
-NS_IMETHODIMP
-ImageAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+ImageAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  if (IsLongDescIndex(aIndex) && HasLongDesc()) {
+  if (IsLongDescIndex(aIndex) && HasLongDesc())
     aName.AssignLiteral("showlongdesc"); 
-    return NS_OK;
-  }
-  return LinkableAccessible::GetActionName(aIndex, aName);
+  else
+    LinkableAccessible::ActionNameAt(aIndex, aName);
 }
 
-NS_IMETHODIMP
+bool
 ImageAccessible::DoAction(uint8_t aIndex)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   // Get the long description uri and open in a new window.
   if (!IsLongDescIndex(aIndex))
     return LinkableAccessible::DoAction(aIndex);
 
   nsCOMPtr<nsIURI> uri = GetLongDescURI();
   if (!uri)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   nsAutoCString utf8spec;
   uri->GetSpec(utf8spec);
   NS_ConvertUTF8toUTF16 spec(utf8spec);
 
   nsIDocument* document = mContent->OwnerDoc();
   nsCOMPtr<nsPIDOMWindow> piWindow = document->GetWindow();
   nsCOMPtr<nsIDOMWindow> win = do_QueryInterface(piWindow);
-  NS_ENSURE_STATE(win);
+  if (!win)
+    return false;
 
   nsCOMPtr<nsIDOMWindow> tmp;
-  return win->Open(spec, EmptyString(), EmptyString(),
-                   getter_AddRefs(tmp));
+  return NS_SUCCEEDED(win->Open(spec, EmptyString(), EmptyString(),
+                                getter_AddRefs(tmp)));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleImage
 
 NS_IMETHODIMP
 ImageAccessible::GetImagePosition(uint32_t aCoordType, int32_t* aX, int32_t* aY)
 {
-  int32_t width, height;
-  nsresult rv = GetBounds(aX, aY, &width, &height);
-  if (NS_FAILED(rv))
-    return rv;
+  NS_ENSURE_ARG_POINTER(aX);
+  NS_ENSURE_ARG_POINTER(aY);
 
+  nsIntRect rect = Bounds();
+  *aX = rect.x;
+  *aY = rect.y;
   nsAccUtils::ConvertScreenCoordsTo(aX, aY, aCoordType, this);
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ImageAccessible::GetImageSize(int32_t* aWidth, int32_t* aHeight)
 {
-  int32_t x, y;
-  return GetBounds(&x, &y, aWidth, aHeight);
+  NS_ENSURE_ARG_POINTER(aWidth);
+  NS_ENSURE_ARG_POINTER(aHeight);
+
+  nsIntRect rect = Bounds();
+  *aWidth = rect.width;
+  *aHeight = rect.height;
+
+  return NS_OK;
 }
 
 // Accessible
 already_AddRefed<nsIPersistentProperties>
 ImageAccessible::NativeAttributes()
 {
   nsCOMPtr<nsIPersistentProperties> attributes =
     LinkableAccessible::NativeAttributes();
--- a/accessible/generic/ImageAccessible.h
+++ b/accessible/generic/ImageAccessible.h
@@ -23,30 +23,28 @@ class ImageAccessible : public LinkableA
                         public nsIAccessibleImage
 {
 public:
   ImageAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // nsIAccessibleImage
   NS_DECL_NSIACCESSIBLEIMAGE
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
 protected:
   virtual ~ImageAccessible();
 
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 
 private:
@@ -60,17 +58,17 @@ private:
   }
 
   /**
    * Return an URI for showlongdesc action if any.
    */
   already_AddRefed<nsIURI> GetLongDescURI() const;
 
   /**
-   * Used by GetActionName and DoAction to ensure the index for opening the
+   * Used by ActionNameAt and DoAction to ensure the index for opening the
    * longdesc URL is valid.
    * It is always assumed that the highest possible index opens the longdesc.
    * This doesn't check that there is actually a longdesc, just that the index
    * would be correct if there was one.
    *
    * @param aIndex  The 0-based index to be tested.
    *
    * @returns  true if index is valid for longdesc action.
--- a/accessible/generic/OuterDocAccessible.cpp
+++ b/accessible/generic/OuterDocAccessible.cpp
@@ -46,67 +46,32 @@ OuterDocAccessible::NativeRole()
 {
   return roles::INTERNAL_FRAME;
 }
 
 Accessible*
 OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY,
                                  EWhichChildAtPoint aWhichChild)
 {
-  int32_t docX = 0, docY = 0, docWidth = 0, docHeight = 0;
-  nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
-  NS_ENSURE_SUCCESS(rv, nullptr);
-
-  if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
+  nsIntRect docRect = Bounds();
+  if (aX < docRect.x || aX >= docRect.x + docRect.width ||
+      aY < docRect.y || aY >= docRect.y + docRect.height)
     return nullptr;
 
   // Always return the inner doc as direct child accessible unless bounds
   // outside of it.
   Accessible* child = GetChildAt(0);
   NS_ENSURE_TRUE(child, nullptr);
 
   if (aWhichChild == eDeepestChild)
     return child->ChildAtPoint(aX, aY, eDeepestChild);
   return child;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsIAccessible
-
-uint8_t
-OuterDocAccessible::ActionCount()
-{
-  // Internal frame, which is the doc's parent, should not have a click action.
-  return 0;
-}
-
-NS_IMETHODIMP
-OuterDocAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
-{
-  aName.Truncate();
-
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-OuterDocAccessible::GetActionDescription(uint8_t aIndex,
-                                         nsAString& aDescription)
-{
-  aDescription.Truncate();
-
-  return NS_ERROR_INVALID_ARG;
-}
-
-NS_IMETHODIMP
-OuterDocAccessible::DoAction(uint8_t aIndex)
-{
-  return NS_ERROR_INVALID_ARG;
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // Accessible public
 
 void
 OuterDocAccessible::Shutdown()
 {
   // XXX: sometimes outerdoc accessible is shutdown because of layout style
   // change however the presshell of underlying document isn't destroyed and
   // the document doesn't get pagehide events. Schedule a document rebind
--- a/accessible/generic/OuterDocAccessible.h
+++ b/accessible/generic/OuterDocAccessible.h
@@ -22,34 +22,26 @@ namespace a11y {
 
 class OuterDocAccessible MOZ_FINAL : public AccessibleWrap
 {
 public:
   OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString& aDescription);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
   virtual void Shutdown();
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual void InvalidateChildren();
   virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) MOZ_OVERRIDE;
   virtual bool RemoveChild(Accessible* aAccessible);
 
-  // ActionAccessible
-  virtual uint8_t ActionCount();
-
 protected:
   virtual ~OuterDocAccessible();
 
   // Accessible
   virtual void CacheChildren();
 };
 
 } // namespace a11y
--- a/accessible/generic/RootAccessible.h
+++ b/accessible/generic/RootAccessible.h
@@ -28,17 +28,17 @@ public:
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
 
   // Accessible
   virtual void Shutdown();
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
   virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // RootAccessible
 
   /**
    * Notify that the sub document presshell was activated.
    */
   virtual void DocumentActivated(DocAccessible* aDocument);
 
--- a/accessible/generic/TableAccessible.h
+++ b/accessible/generic/TableAccessible.h
@@ -20,17 +20,17 @@ class Accessible;
  */
 class TableAccessible
 {
 public:
 
   /**
    * Return the caption accessible if any for this table.
    */
-  virtual Accessible* Caption() { return nullptr; }
+  virtual Accessible* Caption() const { return nullptr; }
 
   /**
    * Get the summary for this table.
    */
   virtual void Summary(nsString& aSummary) { aSummary.Truncate(); }
 
   /**
    * Return the number of columns in the table.
--- a/accessible/generic/TextLeafAccessible.cpp
+++ b/accessible/generic/TextLeafAccessible.cpp
@@ -25,17 +25,17 @@ TextLeafAccessible::
 TextLeafAccessible::~TextLeafAccessible()
 {
 }
 
 role
 TextLeafAccessible::NativeRole()
 {
   nsIFrame* frame = GetFrame();
-  if (frame && frame->IsGeneratedContentFrame()) 
+  if (frame && frame->IsGeneratedContentFrame())
     return roles::STATICTEXT;
 
   return roles::TEXT_LEAF;
 }
 
 void
 TextLeafAccessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
                                  uint32_t aLength)
--- a/accessible/generic/TextLeafAccessible.h
+++ b/accessible/generic/TextLeafAccessible.h
@@ -16,17 +16,17 @@ namespace a11y {
  */
 class TextLeafAccessible : public LinkableAccessible
 {
 public:
   TextLeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~TextLeafAccessible();
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
                             uint32_t aLength = UINT32_MAX);
   virtual ENameValueFlag Name(nsString& aName);
 
   // TextLeafAccessible
   void SetText(const nsAString& aText) { mText = aText; }
   const nsString& Text() const { return mText; }
 
--- 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();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLCanvasAccessible() { }
 };
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/html/HTMLElementAccessibles.h
+++ b/accessible/html/HTMLElementAccessibles.h
@@ -18,34 +18,34 @@ namespace a11y {
 class HTMLHRAccessible : public LeafAccessible
 {
 public:
 
   HTMLHRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc) {}
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_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();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 /**
  * Used for HTML label element.
@@ -55,17 +55,17 @@ class HTMLLabelAccessible : public Hyper
 public:
 
   HTMLLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLLabelAccessible() {}
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 /**
@@ -76,17 +76,17 @@ class HTMLOutputAccessible : public Hype
 public:
 
   HTMLOutputAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLOutputAccessible() {}
 };
 
 } // namespace a11y
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -46,43 +46,38 @@ HTMLCheckboxAccessible::NativeRole()
 }
 
 uint8_t
 HTMLCheckboxAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-HTMLCheckboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLCheckboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {    // 0 is the magic value for default action
-    // cycle, check or uncheck
     uint64_t state = NativeState();
-
     if (state & states::CHECKED)
-      aName.AssignLiteral("uncheck"); 
+      aName.AssignLiteral("uncheck");
     else if (state & states::MIXED)
-      aName.AssignLiteral("cycle"); 
+      aName.AssignLiteral("cycle");
     else
-      aName.AssignLiteral("check"); 
-
-    return NS_OK;
+      aName.AssignLiteral("check");
   }
-  return NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP
+bool
 HTMLCheckboxAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != 0)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 uint64_t
 HTMLCheckboxAccessible::NativeState()
 {
   uint64_t state = LeafAccessible::NativeState();
 
   state |= states::CHECKABLE;
@@ -184,34 +179,31 @@ HTMLButtonAccessible::
 }
 
 uint8_t
 HTMLButtonAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-HTMLButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Click) {
-    aName.AssignLiteral("press"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Click)
+    aName.AssignLiteral("press");
 }
 
-NS_IMETHODIMP
+bool
 HTMLButtonAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 uint64_t
 HTMLButtonAccessible::State()
 {
   uint64_t state = HyperTextAccessibleWrap::State();
   if (state == states::DEFUNCT)
     return state;
@@ -288,17 +280,17 @@ HTMLButtonAccessible::IsWidget() const
 HTMLTextFieldAccessible::
   HTMLTextFieldAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HyperTextAccessibleWrap(aContent, aDoc)
 {
   mType = eHTMLTextFieldType;
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(HTMLTextFieldAccessible,
-                            Accessible,                            
+                            Accessible,
                             nsIAccessibleText,
                             nsIAccessibleEditableText)
 
 role
 HTMLTextFieldAccessible::NativeRole()
 {
   if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                             nsGkAtoms::password, eIgnoreCase)) {
@@ -440,33 +432,31 @@ HTMLTextFieldAccessible::NativeState()
 }
 
 uint8_t
 HTMLTextFieldAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-HTMLTextFieldAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLTextFieldAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Click) {
+  if (aIndex == eAction_Click)
     aName.AssignLiteral("activate");
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP
+bool
 HTMLTextFieldAccessible::DoAction(uint8_t aIndex)
 {
-  if (aIndex == 0)
-    return TakeFocus();
+  if (aIndex != 0)
+    return false;
 
-  return NS_ERROR_INVALID_ARG;
+  TakeFocus();
+  return true;
 }
 
 already_AddRefed<nsIEditor>
 HTMLTextFieldAccessible::GetEditor() const
 {
   nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(mContent));
   if (!editableElt)
     return nullptr;
@@ -702,17 +692,17 @@ HTMLGroupboxAccessible::
 
 role
 HTMLGroupboxAccessible::NativeRole()
 {
   return roles::GROUPING;
 }
 
 nsIContent*
-HTMLGroupboxAccessible::GetLegend()
+HTMLGroupboxAccessible::GetLegend() const
 {
   for (nsIContent* legendContent = mContent->GetFirstChild(); legendContent;
        legendContent = legendContent->GetNextSibling()) {
     if (legendContent->NodeInfo()->Equals(nsGkAtoms::legend,
                                           mContent->GetNameSpaceID())) {
       // Either XHTML namespace or no namespace
       return legendContent;
     }
--- a/accessible/html/HTMLFormControlAccessible.h
+++ b/accessible/html/HTMLFormControlAccessible.h
@@ -29,26 +29,24 @@ public:
   HTMLCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     // Ignore "CheckboxStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual uint64_t NativeState();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
 };
 
 
 /**
  * Accessible for HTML input@type="radio" element.
@@ -61,17 +59,17 @@ public:
     RadioButtonAccessible(aContent, aDoc)
   {
     // Ignore "RadioStateChange" DOM event in lieu of document observer
     // state change notification.
     mStateFlags |= eIgnoreDOMUIEvent;
   }
 
   // Accessible
-  virtual uint64_t NativeState();
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
                                           int32_t *aSetSize);
 };
 
 
 /**
  * Accessible for HTML input@type="button", @type="submit", @type="image"
  * and HTML button elements.
@@ -79,27 +77,25 @@ public:
 class HTMLButtonAccessible : public HyperTextAccessibleWrap
 {
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t State();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t State() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
@@ -114,32 +110,30 @@ class HTMLTextFieldAccessible MOZ_FINAL 
 
 public:
   enum { eAction_Click = 0 };
 
   HTMLTextFieldAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // HyperTextAccessible
   virtual already_AddRefed<nsIEditor> GetEditor() const;
 
   // Accessible
   virtual void Value(nsString& aValue);
   virtual void ApplyARIAState(uint64_t* aState) const;
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual Accessible* ContainerWidget() const;
 
 protected:
   virtual ~HTMLTextFieldAccessible() {}
 
@@ -157,17 +151,17 @@ protected:
  * Accessible for input@type="file" element.
  */
 class HTMLFileInputAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFileInputAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual nsresult HandleAccEvent(AccEvent* aAccEvent);
 };
 
 
 /**
  * Used for HTML input@type="number".
  */
 class HTMLSpinnerAccessible : public AccessibleWrap
@@ -200,17 +194,17 @@ public:
   HTMLRangeAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     LeafAccessible(aContent, aDoc)
   {
     mStateFlags |= eHasNumericValue;
   }
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_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;
 
@@ -223,52 +217,52 @@ public:
  * Accessible for HTML fieldset element.
  */
 class HTMLGroupboxAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 
   // HTMLGroupboxAccessible
-  nsIContent* GetLegend();
+  nsIContent* GetLegend() const;
 };
 
 
 /**
  * Accessible for HTML legend element.
  */
 class HTMLLegendAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLLegendAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 };
 
 /**
  * Accessible for HTML5 figure element.
  */
 class HTMLFigureAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFigureAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 
   // HTMLLegendAccessible
   nsIContent* Caption() const;
@@ -279,16 +273,16 @@ protected:
  * Accessible for HTML5 figcaption element.
  */
 class HTMLFigcaptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLFigcaptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -231,29 +231,30 @@ HTMLAreaAccessible::EndOffset()
 // HTMLAreaAccessible: Accessible protected
 
 void
 HTMLAreaAccessible::CacheChildren()
 {
   // No children for aria accessible.
 }
 
-void
-HTMLAreaAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
+nsRect
+HTMLAreaAccessible::RelativeBounds(nsIFrame** aBoundingFrame) const
 {
   nsIFrame* frame = GetFrame();
   if (!frame)
-    return;
+    return nsRect();
 
   nsImageFrame* imageFrame = do_QueryFrame(frame);
   nsImageMap* map = imageFrame->GetImageMap();
 
-  nsresult rv = map->GetBoundsForAreaContent(mContent, aBounds);
+  nsRect bounds;
+  nsresult rv = map->GetBoundsForAreaContent(mContent, bounds);
   if (NS_FAILED(rv))
-    return;
+    return nsRect();
 
   // XXX Areas are screwy; they return their rects as a pair of points, one pair
   // stored into the width and height.
-  aBounds.width -= aBounds.x;
-  aBounds.height -= aBounds.y;
-
   *aBoundingFrame = frame;
+  bounds.width -= bounds.x;
+  bounds.height -= bounds.y;
+  return bounds;
 }
--- a/accessible/html/HTMLImageMapAccessible.h
+++ b/accessible/html/HTMLImageMapAccessible.h
@@ -20,17 +20,17 @@ class HTMLImageMapAccessible MOZ_FINAL :
 {
 public:
   HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports and cycle collector
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
   // HyperLinkAccessible
   virtual uint32_t AnchorCount();
   virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
   /**
    * Update area children of the image map.
@@ -57,17 +57,17 @@ class HTMLAreaAccessible MOZ_FINAL : pub
 public:
 
   HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Description(nsString& aDescription);
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
-  virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
 
   // HyperLinkAccessible
   virtual uint32_t StartOffset();
   virtual uint32_t EndOffset();
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -87,47 +87,43 @@ HTMLLinkAccessible::Value(nsString& aVal
 }
 
 uint8_t
 HTMLLinkAccessible::ActionCount()
 {
   return IsLinked() ? 1 : HyperTextAccessible::ActionCount();
 }
 
-NS_IMETHODIMP
-HTMLLinkAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLLinkAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
-  if (!IsLinked())
-    return HyperTextAccessible::GetActionName(aIndex, aName);
+  if (!IsLinked()) {
+    HyperTextAccessible::ActionNameAt(aIndex, aName);
+    return;
+  }
 
   // Action 0 (default action): Jump to link
-  if (aIndex != eAction_Jump)
-    return NS_ERROR_INVALID_ARG;
-
-  aName.AssignLiteral("jump");
-  return NS_OK;
+  if (aIndex == eAction_Jump)
+    aName.AssignLiteral("jump");
 }
 
-NS_IMETHODIMP
+bool
 HTMLLinkAccessible::DoAction(uint8_t aIndex)
 {
   if (!IsLinked())
     return HyperTextAccessible::DoAction(aIndex);
 
   // Action 0 (default action): Jump to link
   if (aIndex != eAction_Jump)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HyperLinkAccessible
 
 bool
 HTMLLinkAccessible::IsLink()
 {
@@ -140,17 +136,14 @@ HTMLLinkAccessible::AnchorURIAt(uint32_t
 {
   return aAnchorIndex == 0 ? mContent->GetHrefURI() : nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Protected members
 
 bool
-HTMLLinkAccessible::IsLinked()
+HTMLLinkAccessible::IsLinked() const
 {
-  if (IsDefunct())
-    return false;
-
   EventStates state = mContent->AsElement()->State();
   return state.HasAtLeastOneOfStates(NS_EVENT_STATE_VISITED |
                                      NS_EVENT_STATE_UNVISITED);
 }
--- a/accessible/html/HTMLLinkAccessible.h
+++ b/accessible/html/HTMLLinkAccessible.h
@@ -10,44 +10,42 @@
 
 namespace mozilla {
 namespace a11y {
 
 class HTMLLinkAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
- 
+
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeLinkState() const;
-  virtual uint64_t NativeInteractiveState() const;
+  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;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // HyperLinkAccessible
   virtual bool IsLink();
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
 protected:
   virtual ~HTMLLinkAccessible() {}
 
   enum { eAction_Jump = 0 };
 
   /**
    * Returns true if the link has href attribute.
    */
-  bool IsLinked();
+  bool IsLinked() const;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/html/HTMLListAccessible.cpp
+++ b/accessible/html/HTMLListAccessible.cpp
@@ -76,31 +76,28 @@ HTMLLIAccessible::NativeRole()
 }
 
 uint64_t
 HTMLLIAccessible::NativeState()
 {
   return HyperTextAccessibleWrap::NativeState() | states::READONLY;
 }
 
-NS_IMETHODIMP
-HTMLLIAccessible::GetBounds(int32_t* aX, int32_t* aY,
-                            int32_t* aWidth, int32_t* aHeight)
+nsIntRect
+HTMLLIAccessible::Bounds() const
 {
-  nsresult rv = AccessibleWrap::GetBounds(aX, aY, aWidth, aHeight);
-  if (NS_FAILED(rv) || !mBullet || mBullet->IsInside())
-    return rv;
+  nsIntRect rect = AccessibleWrap::Bounds();
+  if (rect.IsEmpty() || !mBullet || mBullet->IsInside())
+    return rect;
 
-  int32_t bulletX = 0, bulletY = 0, bulletWidth = 0, bulletHeight = 0;
-  rv = mBullet->GetBounds(&bulletX, &bulletY, &bulletWidth, &bulletHeight);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsIntRect bulletRect = mBullet->Bounds();
 
-  *aWidth += *aX - bulletX;
-  *aX = bulletX; // Move x coordinate of list item over to cover bullet as well
-  return NS_OK;
+  rect.width += rect.x - bulletRect.x;
+  rect.x = bulletRect.x; // Move x coordinate of list item over to cover bullet as well
+  return rect;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLLIAccessible: public
 
 void
 HTMLLIAccessible::UpdateBullet(bool aHasBullet)
 {
--- 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();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLListAccessible() { }
 };
 
 
 /**
  * Used for HTML list item (e.g. HTML li).
@@ -42,24 +42,21 @@ protected:
 class HTMLLIAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
-                       int32_t* aWidth, int32_t* aHeight);
-
   // Accessible
   virtual void Shutdown();
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // HTMLLIAccessible
   HTMLListBulletAccessible* Bullet() const { return mBullet; }
   void UpdateBullet(bool aHasBullet);
 
 protected:
   virtual ~HTMLLIAccessible() { }
 
@@ -78,18 +75,18 @@ class HTMLListBulletAccessible : public 
 {
 public:
   HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLListBulletAccessible() { }
 
   // Accessible
   virtual nsIFrame* GetFrame() const;
   virtual ENameValueFlag Name(nsString& aName);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
                             uint32_t aLength = UINT32_MAX);
 
   // HTMLListBulletAccessible
 
   /**
    * Return true if the bullet is inside of list item element boundaries.
    */
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -226,26 +226,25 @@ HTMLSelectOptionAccessible::NativeState(
     }
   } else {
     // XXX list frames are weird, don't rely on Accessible's general
     // visibility implementation unless they get reimplemented in layout
     state &= ~states::OFFSCREEN;
     // <select> is not collapsed: compare bounds to calculate OFFSCREEN
     Accessible* listAcc = Parent();
     if (listAcc) {
-      int32_t optionX, optionY, optionWidth, optionHeight;
-      int32_t listX, listY, listWidth, listHeight;
-      GetBounds(&optionX, &optionY, &optionWidth, &optionHeight);
-      listAcc->GetBounds(&listX, &listY, &listWidth, &listHeight);
-      if (optionY < listY || optionY + optionHeight > listY + listHeight) {
+      nsIntRect optionRect = Bounds();
+      nsIntRect listRect = listAcc->Bounds();
+      if (optionRect.y < listRect.y ||
+          optionRect.y + optionRect.height > listRect.y + listRect.height) {
         state |= states::OFFSCREEN;
       }
     }
   }
- 
+
   return state;
 }
 
 uint64_t
 HTMLSelectOptionAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() ?
     states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
@@ -260,64 +259,55 @@ HTMLSelectOptionAccessible::GetLevelInte
     parentContent->NodeInfo()->Equals(nsGkAtoms::optgroup) ? 2 : 1;
 
   if (level == 1 && Role() != roles::HEADING)
     level = 0; // In a single level list, the level is irrelevant
 
   return level;
 }
 
-void
-HTMLSelectOptionAccessible::GetBoundsRect(nsRect& aTotalBounds,
-                                          nsIFrame** aBoundingFrame)
+nsRect
+HTMLSelectOptionAccessible::RelativeBounds(nsIFrame** aBoundingFrame) const
 {
   Accessible* combobox = GetCombobox();
   if (combobox && (combobox->State() & states::COLLAPSED))
-    combobox->GetBoundsRect(aTotalBounds, aBoundingFrame);
-  else
-    HyperTextAccessibleWrap::GetBoundsRect(aTotalBounds, aBoundingFrame);
+    return combobox->RelativeBounds(aBoundingFrame);
+
+  return HyperTextAccessibleWrap::RelativeBounds(aBoundingFrame);
 }
 
-NS_IMETHODIMP
-HTMLSelectOptionAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLSelectOptionAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Select) {
-    aName.AssignLiteral("select"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Select)
+    aName.AssignLiteral("select");
 }
 
 uint8_t
 HTMLSelectOptionAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
+bool
 HTMLSelectOptionAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Select)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
-NS_IMETHODIMP
+void
 HTMLSelectOptionAccessible::SetSelected(bool aSelect)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   HTMLOptionElement* option = HTMLOptionElement::FromContent(mContent);
-  return option ? option->SetSelected(aSelect) : NS_ERROR_FAILURE;
+  if (option)
+    option->SetSelected(aSelect);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectOptionAccessible: Widgets
 
 Accessible*
 HTMLSelectOptionAccessible::ContainerWidget() const
 {
@@ -339,34 +329,34 @@ HTMLSelectOptGroupAccessible::NativeRole
 }
 
 uint64_t
 HTMLSelectOptGroupAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() ? states::UNAVAILABLE : 0;
 }
 
-NS_IMETHODIMP
-HTMLSelectOptGroupAccessible::DoAction(uint8_t index)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-HTMLSelectOptGroupAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 uint8_t
 HTMLSelectOptGroupAccessible::ActionCount()
 {
   return 0;
 }
 
+void
+HTMLSelectOptGroupAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
+{
+  aName.Truncate();
+}
+
+bool
+HTMLSelectOptGroupAccessible::DoAction(uint8_t aIndex)
+{
+  return false;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLComboboxAccessible::
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
@@ -472,51 +462,40 @@ HTMLComboboxAccessible::Value(nsString& 
 }
 
 uint8_t
 HTMLComboboxAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
+bool
 HTMLComboboxAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
-/**
-  * Our action name is the reverse of our state: 
-  *     if we are closed -> open is our name.
-  *     if we are open -> closed is our name.
-  * Uses the frame to get the state, updated on every click
-  */
-NS_IMETHODIMP
-HTMLComboboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+HTMLComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex != HTMLComboboxAccessible::eAction_Click) {
-    return NS_ERROR_INVALID_ARG;
-  }
+  if (aIndex != HTMLComboboxAccessible::eAction_Click)
+    return;
+
   nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
-  if (!comboFrame) {
-    return NS_ERROR_FAILURE;
-  }
+  if (!comboFrame)
+    return;
+
   if (comboFrame->IsDroppedDown())
-    aName.AssignLiteral("close"); 
+    aName.AssignLiteral("close");
   else
-    aName.AssignLiteral("open"); 
-
-  return NS_OK;
+    aName.AssignLiteral("open");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible: Widgets
 
 bool
 HTMLComboboxAccessible::IsWidget() const
 {
@@ -620,47 +599,42 @@ HTMLComboboxListAccessible::NativeState(
   if (comboFrame && comboFrame->IsDroppedDown())
     state |= states::FLOATING;
   else
     state |= states::INVISIBLE;
 
   return state;
 }
 
-/**
-  * Gets the bounds for the areaFrame.
-  *     Walks the Frame tree and checks for proper frames.
-  */
-void
-HTMLComboboxListAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame)
+nsRect
+HTMLComboboxListAccessible::RelativeBounds(nsIFrame** aBoundingFrame) const
 {
   *aBoundingFrame = nullptr;
 
   Accessible* comboAcc = Parent();
   if (!comboAcc)
-    return;
+    return nsRect();
 
   if (0 == (comboAcc->State() & states::COLLAPSED)) {
-    HTMLSelectListAccessible::GetBoundsRect(aBounds, aBoundingFrame);
-    return;
+    return HTMLSelectListAccessible::RelativeBounds(aBoundingFrame);
   }
 
   // Get the first option.
   nsIContent* content = mContent->GetFirstChild();
-  if (!content) {
-    return;
-  }
+  if (!content)
+    return nsRect();
+
   nsIFrame* frame = content->GetPrimaryFrame();
   if (!frame) {
     *aBoundingFrame = nullptr;
-    return;
+    return nsRect();
   }
 
   *aBoundingFrame = frame->GetParent();
-  aBounds = (*aBoundingFrame)->GetRect();
+  return (*aBoundingFrame)->GetRect();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxListAccessible: Widgets
 
 bool
 HTMLComboboxListAccessible::IsActiveWidget() const
 {
--- a/accessible/html/HTMLSelectAccessible.h
+++ b/accessible/html/HTMLSelectAccessible.h
@@ -34,18 +34,18 @@ namespace a11y {
 class HTMLSelectListAccessible : public AccessibleWrap
 {
 public:
 
   HTMLSelectListAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectListAccessible() {}
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // SelectAccessible
   virtual bool SelectAll();
   virtual bool UnselectAll();
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
@@ -65,31 +65,29 @@ protected:
 class HTMLSelectOptionAccessible : public HyperTextAccessibleWrap
 {
 public:
   enum { eAction_Select = 0 };
 
   HTMLSelectOptionAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLSelectOptionAccessible() {}
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD SetSelected(bool aSelect);
-
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   virtual int32_t GetLevelInternal();
-  virtual void GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame);
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
+  virtual void SetSelected(bool aSelect) MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 
@@ -137,26 +135,24 @@ class HTMLSelectOptGroupAccessible : pub
 {
 public:
 
   HTMLSelectOptGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HTMLSelectOptionAccessible(aContent, aDoc)
     { mType = eHTMLOptGroupType; }
   virtual ~HTMLSelectOptGroupAccessible() {}
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 };
 
 /** ------------------------------------------------------ */
 /**  Finally, the Combobox widgets                         */
 /** ------------------------------------------------------ */
 
 class HTMLComboboxListAccessible;
 
@@ -166,30 +162,28 @@ class HTMLComboboxListAccessible;
 class HTMLComboboxAccessible MOZ_FINAL : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~HTMLComboboxAccessible() {}
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-
   // Accessible
   virtual void Shutdown();
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual void InvalidateChildren();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* CurrentItem();
   virtual void SetCurrentItem(Accessible* aItem);
 
@@ -216,19 +210,19 @@ class HTMLComboboxListAccessible : publi
 public:
 
   HTMLComboboxListAccessible(nsIAccessible* aParent, nsIContent* aContent,
                              DocAccessible* aDoc);
   virtual ~HTMLComboboxListAccessible() {}
 
   // Accessible
   virtual nsIFrame* GetFrame() const;
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual void GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame);
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -455,17 +455,17 @@ HTMLTableAccessible::RelationByType(Rela
 
   return rel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableAccessible: nsIAccessibleTable implementation
 
 Accessible*
-HTMLTableAccessible::Caption()
+HTMLTableAccessible::Caption() const
 {
   Accessible* child = mChildren.SafeElementAt(0, nullptr);
   return child && child->Role() == roles::CAPTION ? child : nullptr;
 }
 
 void
 HTMLTableAccessible::Summary(nsString& aSummary)
 {
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -34,19 +34,19 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTableCell
   NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() { return this; }
   virtual void Shutdown();
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  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;
 
   // 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;
@@ -78,17 +78,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();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 };
 
 
 /**
  * HTML table row accessible (html:tr).
  */
 class HTMLTableRowAccessible : public AccessibleWrap
 {
@@ -98,17 +98,17 @@ public:
   {
     mType = eHTMLTableRowType;
     mGenericTypes |= eTableRow;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
 protected:
   virtual ~HTMLTableRowAccessible() { }
 };
 
 
 /**
  * HTML table accessible (html:table).
@@ -133,17 +133,17 @@ public:
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible Table
   NS_FORWARD_NSIACCESSIBLETABLE(xpcAccessibleTable::)
 
   // TableAccessible
-  virtual Accessible* Caption();
+  virtual Accessible* Caption() const;
   virtual void Summary(nsString& aSummary);
   virtual uint32_t ColCount();
   virtual uint32_t RowCount();
   virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex);
   virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx);
   virtual int32_t ColIndexAt(uint32_t aCellIdx);
   virtual int32_t RowIndexAt(uint32_t aCellIdx);
   virtual void RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
@@ -166,18 +166,18 @@ public:
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual bool IsProbablyLayoutTable();
   virtual Accessible* AsAccessible() { return this; }
 
   // Accessible
   virtual void Shutdown();
   virtual TableAccessible* AsTable() { return this; }
   virtual void Description(nsString& aDescription);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  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;
 
 protected:
   virtual ~HTMLTableAccessible() {}
 
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
@@ -229,16 +229,16 @@ class HTMLCaptionAccessible : public Hyp
 public:
   HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     HyperTextAccessibleWrap(aContent, aDoc) { }
   virtual ~HTMLCaptionAccessible() { }
 
   // nsIAccessible
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aRelationType) MOZ_OVERRIDE;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/interfaces/nsIAccessible.idl
+++ b/accessible/interfaces/nsIAccessible.idl
@@ -17,17 +17,17 @@ interface nsIAccessibleRelation;
  * accessibility APIs like MSAA and ATK. Contains the sum of what's needed
  * to support IAccessible as well as ATK's generic accessibility objects.
  * Can also be used by in-process accessibility clients to get information
  * about objects in the accessible tree. The accessible tree is a subset of 
  * nodes in the DOM tree -- such as documents, focusable elements and text.
  * Mozilla creates the implementations of nsIAccessible on demand.
  * See http://www.mozilla.org/projects/ui/accessibility for more information.
  */
-[scriptable, uuid(ee62158b-bb83-424b-a88d-d7d7f9cf460d)]
+[scriptable, uuid(66b110b0-c25a-4784-8623-f6ba40c7cfee)]
 interface nsIAccessible : nsISupports
 {
   /**
    * Parent node in accessible tree.
    */
   readonly attribute nsIAccessible parent;
 
   /**
@@ -91,17 +91,17 @@ interface nsIAccessible : nsISupports
    * specified by ARIA or by native markup. Example of ARIA markup is
    * aria-labelledby attribute placed on element of this accessible. Example
    * of native markup is HTML label linked with HTML element of this accessible.
    *
    * Value can be string or null. A null value indicates that AT may attempt to
    * compute the name. Any string value, including the empty string, should be
    * considered author-intentional, and respected.
    */
-  attribute AString name;
+  readonly attribute AString name;
 
   /**
    * Accessible value -- a number or a secondary text equivalent for this node
    * Widgets that use role attribute can force a value using the valuenow attribute
    */
   readonly attribute AString value;
 
   /**
@@ -193,16 +193,17 @@ interface nsIAccessible : nsISupports
    * @param y  screen's y coordinate
    * @return   the deepest accessible child containing the given point
    */
   nsIAccessible getDeepestChildAtPoint(in long x, in long y);
 
   /**
    * Nth accessible child using zero-based index or last child if index less than zero
    */
+  [binaryname(ScriptableGetChildAt)]
   nsIAccessible getChildAt(in long aChildIndex);
 
   /**
    * Return accessible relation by the given relation type (see.
    * constants defined in nsIAccessibleRelation).
    */
   nsIAccessibleRelation getRelationByType(in unsigned long aRelationType);
 
@@ -215,37 +216,40 @@ interface nsIAccessible : nsISupports
    * Return accessible's x and y coordinates relative to the screen and
    * accessible's width and height.
    */
   void getBounds(out long x, out long y, out long width, out long height);
 
   /**
    * Add or remove this accessible to the current selection
    */
+  [binaryname(ScriptableSetSelected)]
   void setSelected(in boolean isSelected);
 
   /**
    * Extend the current selection from its current accessible anchor node
    * to this accessible
    */
   void extendSelection();
 
   /**
    * Select this accessible node only
    */
+  [binaryname(ScriptableTakeSelection)]
   void takeSelection();
 
   /**
    * Focus this accessible node,
    * The state STATE_FOCUSABLE indicates whether this node is normally focusable.
    * It is the callers responsibility to determine whether this node is focusable.
    * accTakeFocus on a node that is not normally focusable (such as a table),
    * will still set focus on that node, although normally that will not be visually 
    * indicated in most style sheets.
    */
+  [binaryname(ScriptableTakeFocus)]
   void takeFocus();
 
   /**
    * The number of accessible actions associated with this accessible
    */
   readonly attribute uint8_t actionCount;
 
   /**
@@ -257,36 +261,39 @@ interface nsIAccessible : nsISupports
    * The description of the accessible action at the given zero-based index
    */
   AString getActionDescription(in uint8_t aIndex);
 
   /**
    * Perform the accessible action at the given zero-based index
    * Action number 0 is the default action
    */
-  void doAction(in uint8_t index);   
+  [binaryname(ScriptableDoAction)]
+  void doAction(in uint8_t index);
 
   /**
    * Makes an object visible on screen.
    *
    * @param scrollType - defines where the object should be placed on
    *                     the screen (see nsIAccessibleScrollType for
    *                     available constants).
    */
+  [binaryname(ScriptableScrollTo)]
   void scrollTo(in unsigned long aScrollType);
 
   /**
    * Moves the top left of an object to a specified location.
    *
    * @param coordinateType [in] - specifies whether the coordinates are relative to
    *                         the screen or the parent object (for available
    *                         constants refer to nsIAccessibleCoordinateType)
    * @param x [in] - defines the x coordinate
    * @param y [in] - defines the y coordinate
   */
+  [binaryname(ScriptableScrollToPoint)]
   void scrollToPoint(in unsigned long coordinateType, in long x, in long y);
 
   /**
    * Get a pointer to accessibility interface for this node, which is specific 
    * to the OS/accessibility toolkit we're running on.
    */
   [noscript] void getNativeInterface(out voidPtr aOutAccessible);
 };
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -369,23 +369,22 @@ GetClosestInterestingAccessible(id anObj
 
 - (NSValue*)position
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   if (!mGeckoAccessible)
     return nil;
 
-  int32_t x = 0, y = 0, width = 0, height = 0;
-  mGeckoAccessible->GetBounds(&x, &y, &width, &height);
+  nsIntRect rect = mGeckoAccessible->Bounds();
 
   NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
   CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView);
-  NSPoint p = NSMakePoint(static_cast<CGFloat>(x) / scaleFactor,
-                         [mainView frame].size.height - static_cast<CGFloat>(y + height) / scaleFactor);
+  NSPoint p = NSMakePoint(static_cast<CGFloat>(rect.x) / scaleFactor,
+                         [mainView frame].size.height - static_cast<CGFloat>(rect.y + rect.height) / scaleFactor);
 
   return [NSValue valueWithPoint:p];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (NSValue*)size
 {
@@ -605,19 +604,19 @@ GetClosestInterestingAccessible(id anObj
 {
   return mGeckoAccessible && (mGeckoAccessible->InteractiveState() & states::FOCUSABLE);
 }
 
 - (BOOL)focus
 {
   if (!mGeckoAccessible)
     return NO;
-  
-  nsresult rv = mGeckoAccessible->TakeFocus();
-  return NS_SUCCEEDED(rv);
+
+  mGeckoAccessible->TakeFocus();
+  return YES;
 }
 
 - (BOOL)isEnabled
 {
   return mGeckoAccessible && ((mGeckoAccessible->InteractiveState() & states::UNAVAILABLE) == 0);
 }
 
 // The root accessible calls this when the focused node was
--- a/accessible/windows/ia2/ia2Accessible.cpp
+++ b/accessible/windows/ia2/ia2Accessible.cpp
@@ -216,18 +216,18 @@ ia2Accessible::scrollToPoint(enum IA2Coo
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
 
-  nsresult rv = acc->ScrollToPoint(geckoCoordType, aX, aY);
-  return GetHRESULT(rv);
+  acc->ScrollToPoint(geckoCoordType, aX, aY);
+  return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2Accessible::get_groupPosition(long* aGroupLevel,
                                  long* aSimilarItemsInGroup,
                                  long* aPositionInGroup)
--- a/accessible/windows/ia2/ia2AccessibleAction.cpp
+++ b/accessible/windows/ia2/ia2AccessibleAction.cpp
@@ -60,18 +60,17 @@ ia2AccessibleAction::doAction(long aActi
 {
   A11Y_TRYBLOCK_BEGIN
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   uint8_t index = static_cast<uint8_t>(aActionIndex);
-  nsresult rv = acc->DoAction(index);
-  return GetHRESULT(rv);
+  return acc->DoAction(index) ? S_OK : E_INVALIDARG;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
 {
   A11Y_TRYBLOCK_BEGIN
@@ -162,22 +161,19 @@ ia2AccessibleAction::get_name(long aActi
   *aName = nullptr;
 
   AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString name;
   uint8_t index = static_cast<uint8_t>(aActionIndex);
-  nsresult rv = acc->GetActionName(index, name);
-  if (NS_FAILED(rv))
-    return GetHRESULT(rv);
-
+  acc->ActionNameAt(index, name);
   if (name.IsEmpty())
-    return S_FALSE;
+    return E_INVALIDARG;
 
   *aName = ::SysAllocStringLen(name.get(), name.Length());
   return *aName ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
--- a/accessible/windows/ia2/ia2AccessibleComponent.cpp
+++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp
@@ -53,41 +53,32 @@ ia2AccessibleComponent::get_locationInPa
   if (acc->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   // If the object is not on any screen the returned position is (0,0).
   uint64_t state = acc->State();
   if (state & states::INVISIBLE)
     return S_OK;
 
-  int32_t x = 0, y = 0, width = 0, height = 0;
-  nsresult rv = acc->GetBounds(&x, &y, &width, &height);
-  if (NS_FAILED(rv))
-    return GetHRESULT(rv);
-
-  Accessible* parentAcc = acc->Parent();
+  nsIntRect rect = acc->Bounds();
 
   // The coordinates of the returned position are relative to this object's
   // parent or relative to the screen on which this object is rendered if it
   // has no parent.
-  if (!parentAcc) {
-    *aX = x;
-    *aY = y;
+  if (!acc->Parent()) {
+    *aX = rect.x;
+    *aY = rect.y;
     return S_OK;
   }
 
   // The coordinates of the bounding box are given relative to the parent's
   // coordinate system.
-  int32_t parentx = 0, parenty = 0;
-  rv = acc->GetBounds(&parentx, &parenty, &width, &height);
-  if (NS_FAILED(rv))
-    return GetHRESULT(rv);
-
-  *aX = x - parentx;
-  *aY = y - parenty;
+  nsIntRect parentRect = acc->Parent()->Bounds();
+  *aX = rect.x - parentRect.x;
+  *aY = rect.y - parentRect.y;
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
 {
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -773,19 +773,17 @@ AccessibleWrap::get_accDefaultAction(
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   nsAutoString defaultAction;
-  if (NS_FAILED(xpAccessible->GetActionName(0, defaultAction)))
-    return E_FAIL;
-
+  xpAccessible->ActionNameAt(0, defaultAction);
   *pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
                                           defaultAction.Length());
   return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
@@ -854,24 +852,21 @@ AccessibleWrap::accLocation(
 
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  int32_t x, y, width, height;
-  if (NS_FAILED(xpAccessible->GetBounds(&x, &y, &width, &height)))
-    return E_FAIL;
-
-  *pxLeft = x;
-  *pyTop = y;
-  *pcxWidth = width;
-  *pcyHeight = height;
+  nsIntRect rect = xpAccessible->Bounds();
+  *pxLeft = rect.x;
+  *pyTop = rect.y;
+  *pcxWidth = rect.width;
+  *pcyHeight = rect.height;
   return S_OK;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 AccessibleWrap::accNavigate(
       /* [in] */ long navDir,
@@ -999,17 +994,17 @@ AccessibleWrap::accDoDefaultAction(
 
   Accessible* xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_INVALIDARG;
 
   if (xpAccessible->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
-  return GetHRESULT(xpAccessible->DoAction(0));
+  return xpAccessible->DoAction(0) ? S_OK : E_INVALIDARG;
 
   A11Y_TRYBLOCK_END
 }
 
 STDMETHODIMP
 AccessibleWrap::put_accName(
       /* [optional][in] */ VARIANT varChild,
       /* [in] */ BSTR szName)
--- a/accessible/windows/msaa/DocAccessibleWrap.cpp
+++ b/accessible/windows/msaa/DocAccessibleWrap.cpp
@@ -124,32 +124,32 @@ DocAccessibleWrap::DoInitialUpdate()
       mozilla::WindowsHandle nativeData = 0;
       if (tabChild)
         tabChild->SendGetWidgetNativeData(&nativeData);
       else
         nativeData = reinterpret_cast<mozilla::WindowsHandle>(
           rootDocument->GetNativeWindow());
 
       bool isActive = true;
-      int32_t x = CW_USEDEFAULT, y = CW_USEDEFAULT, width = 0, height = 0;
+      nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
       if (Compatibility::IsDolphin()) {
-        GetBounds(&x, &y, &width, &height);
-        int32_t rootX = 0, rootY = 0, rootWidth = 0, rootHeight = 0;
-        rootDocument->GetBounds(&rootX, &rootY, &rootWidth, &rootHeight);
-        x = rootX - x;
-        y -= rootY;
+        rect = Bounds();
+        nsIntRect rootRect = rootDocument->Bounds();
+        rect.x = rootRect.x - rect.x;
+        rect.y -= rootRect.y;
 
         nsCOMPtr<nsISupports> container = mDocumentNode->GetContainer();
         nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
         docShell->GetIsActive(&isActive);
       }
 
       HWND parentWnd = reinterpret_cast<HWND>(nativeData);
       mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
-                                             x, y, width, height, isActive);
+                                             rect.x, rect.y,
+                                             rect.width, rect.height, isActive);
 
       nsWinUtils::sHWNDCache->Put(mHWND, this);
 
     } else {
       DocAccessible* parentDocument = ParentDocument();
       if (parentDocument)
         mHWND = parentDocument->GetNativeWindow();
     }
--- a/accessible/windows/sdn/sdnTextAccessible.cpp
+++ b/accessible/windows/sdn/sdnTextAccessible.cpp
@@ -70,21 +70,18 @@ sdnTextAccessible::get_clippedSubstringB
                                             &x, &y, &width, &height);
   if (FAILED(rv))
     return rv;
 
   DocAccessible* document = mAccessible->Document();
   NS_ASSERTION(document,
                "There must always be a doc accessible, but there isn't. Crash!");
 
-  nscoord docX = 0, docY = 0, docWidth = 0, docHeight = 0;
-  document->GetBounds(&docX, &docY, &docWidth, &docHeight);
-
+  nsIntRect docRect = document->Bounds();
   nsIntRect unclippedRect(x, y, width, height);
-  nsIntRect docRect(docX, docY, docWidth, docHeight);
 
   nsIntRect clippedRect;
   clippedRect.IntersectRect(unclippedRect, docRect);
 
   *aX = clippedRect.x;
   *aY = clippedRect.y;
   *aWidth = clippedRect.width;
   *aHeight = clippedRect.height;
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -1,22 +1,26 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS += [
+    'xpcAccessible.h',
+    'xpcAccessibleHyperLink.h',
     'xpcAccessibleHyperText.h',
     'xpcAccessibleSelectable.h',
     'xpcAccessibleValue.h',
 ]
 
 UNIFIED_SOURCES += [
     'nsAccessibleRelation.cpp',
+    'xpcAccessible.cpp',
+    'xpcAccessibleHyperLink.cpp',
     'xpcAccessibleHyperText.cpp',
     'xpcAccessibleSelectable.cpp',
     'xpcAccessibleTable.cpp',
     'xpcAccessibleTableCell.cpp',
     'xpcAccessibleTextRange.cpp',
     'xpcAccessibleValue.cpp',
 ]
 
new file mode 100644
--- /dev/null
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -0,0 +1,572 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "xpcAccessible.h"
+
+#include "Accessible-inl.h"
+#include "nsAccUtils.h"
+#include "nsIAccessibleRelation.h"
+#include "nsIAccessibleRole.h"
+#include "nsAccessibleRelation.h"
+#include "Relation.h"
+#include "Role.h"
+#include "RootAccessible.h"
+
+#include "nsIMutableArray.h"
+#include "nsIPersistentProperties2.h"
+
+using namespace mozilla::a11y;
+
+NS_IMETHODIMP
+xpcAccessible::GetParent(nsIAccessible** aParent)
+{
+  NS_ENSURE_ARG_POINTER(aParent);
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aParent = static_cast<Accessible*>(this)->Parent());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetNextSibling(nsIAccessible** aNextSibling)
+{
+  NS_ENSURE_ARG_POINTER(aNextSibling);
+  *aNextSibling = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsresult rv = NS_OK;
+  NS_IF_ADDREF(*aNextSibling = static_cast<Accessible*>(this)->GetSiblingAtOffset(1, &rv));
+  return rv;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling)
+{
+  NS_ENSURE_ARG_POINTER(aPreviousSibling);
+  *aPreviousSibling = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsresult rv = NS_OK;
+  NS_IF_ADDREF(*aPreviousSibling = static_cast<Accessible*>(this)->GetSiblingAtOffset(-1, &rv));
+  return rv;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetFirstChild(nsIAccessible** aFirstChild)
+{
+  NS_ENSURE_ARG_POINTER(aFirstChild);
+  *aFirstChild = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aFirstChild = static_cast<Accessible*>(this)->FirstChild());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetLastChild(nsIAccessible** aLastChild)
+{
+  NS_ENSURE_ARG_POINTER(aLastChild);
+  *aLastChild = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aLastChild = static_cast<Accessible*>(this)->LastChild());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetChildCount(int32_t* aChildCount)
+{
+  NS_ENSURE_ARG_POINTER(aChildCount);
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aChildCount = static_cast<Accessible*>(this)->ChildCount();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableGetChildAt(int32_t aChildIndex, nsIAccessible** aChild)
+{
+  NS_ENSURE_ARG_POINTER(aChild);
+  *aChild = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  // If child index is negative, then return last child.
+  // XXX: do we really need this?
+  if (aChildIndex < 0)
+    aChildIndex = static_cast<Accessible*>(this)->ChildCount() - 1;
+
+  Accessible* child = static_cast<Accessible*>(this)->GetChildAt(aChildIndex);
+  if (!child)
+    return NS_ERROR_INVALID_ARG;
+
+  NS_ADDREF(*aChild = child);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetChildren(nsIArray** aChildren)
+{
+  NS_ENSURE_ARG_POINTER(aChildren);
+  *aChildren = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsresult rv = NS_OK;
+  nsCOMPtr<nsIMutableArray> children =
+    do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  uint32_t childCount = static_cast<Accessible*>(this)->ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
+    nsIAccessible* child = static_cast<Accessible*>(this)->GetChildAt(childIdx);
+    children->AppendElement(child, false);
+  }
+
+  NS_ADDREF(*aChildren = children);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
+{
+  NS_ENSURE_ARG_POINTER(aIndexInParent);
+
+  *aIndexInParent = static_cast<Accessible*>(this)->IndexInParent();
+  return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
+{
+  NS_ENSURE_ARG_POINTER(aDOMNode);
+  *aDOMNode = nullptr;
+
+  nsINode *node = static_cast<Accessible*>(this)->GetNode();
+  if (node)
+    CallQueryInterface(node, aDOMNode);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetDocument(nsIAccessibleDocument** aDocument)
+{
+  NS_ENSURE_ARG_POINTER(aDocument);
+
+  NS_IF_ADDREF(*aDocument = static_cast<Accessible*>(this)->Document());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
+{
+  NS_ENSURE_ARG_POINTER(aRootDocument);
+
+  NS_IF_ADDREF(*aRootDocument = static_cast<Accessible*>(this)->RootAccessible());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetRole(uint32_t* aRole)
+{
+  NS_ENSURE_ARG_POINTER(aRole);
+  *aRole = nsIAccessibleRole::ROLE_NOTHING;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aRole = static_cast<Accessible*>(this)->Role();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetState(uint32_t* aState, uint32_t* aExtraState)
+{
+  NS_ENSURE_ARG_POINTER(aState);
+
+  nsAccUtils::To32States(static_cast<Accessible*>(this)->State(),
+                         aState, aExtraState);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetName(nsAString& aName)
+{
+  aName.Truncate();
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsAutoString name;
+  static_cast<Accessible*>(this)->Name(name);
+  aName.Assign(name);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetDescription(nsAString& aDescription)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsAutoString desc;
+  static_cast<Accessible*>(this)->Description(desc);
+  aDescription.Assign(desc);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetLanguage(nsAString& aLanguage)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->Language(aLanguage);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetValue(nsAString& aValue)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsAutoString value;
+  static_cast<Accessible*>(this)->Value(value);
+  aValue.Assign(value);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetHelp(nsAString& aHelp)
+{
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetAccessKey(nsAString& aAccessKey)
+{
+  aAccessKey.Truncate();
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->AccessKey().ToString(aAccessKey);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetKeyboardShortcut(nsAString& aKeyBinding)
+{
+  aKeyBinding.Truncate();
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->KeyboardShortcut().ToString(aKeyBinding);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetAttributes(nsIPersistentProperties** aAttributes)
+{
+  NS_ENSURE_ARG_POINTER(aAttributes);
+  *aAttributes = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIPersistentProperties> attributes =
+    static_cast<Accessible*>(this)->Attributes();
+  attributes.swap(*aAttributes);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetBounds(int32_t* aX, int32_t* aY,
+                         int32_t* aWidth, int32_t* aHeight)
+{
+  NS_ENSURE_ARG_POINTER(aX);
+  *aX = 0;
+  NS_ENSURE_ARG_POINTER(aY);
+  *aY = 0;
+  NS_ENSURE_ARG_POINTER(aWidth);
+  *aWidth = 0;
+  NS_ENSURE_ARG_POINTER(aHeight);
+  *aHeight = 0;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsIntRect rect = static_cast<Accessible*>(this)->Bounds();
+  *aX = rect.x;
+  *aY = rect.y;
+  *aWidth = rect.width;
+  *aHeight = rect.height;;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableGroupPosition(int32_t* aGroupLevel,
+                                       int32_t* aSimilarItemsInGroup,
+                                       int32_t* aPositionInGroup)
+{
+  NS_ENSURE_ARG_POINTER(aGroupLevel);
+  *aGroupLevel = 0;
+
+  NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
+  *aSimilarItemsInGroup = 0;
+
+  NS_ENSURE_ARG_POINTER(aPositionInGroup);
+  *aPositionInGroup = 0;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  GroupPos groupPos = static_cast<Accessible*>(this)->GroupPosition();
+
+  *aGroupLevel = groupPos.level;
+  *aSimilarItemsInGroup = groupPos.setSize;
+  *aPositionInGroup = groupPos.posInSet;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetRelationByType(uint32_t aType,
+                                 nsIAccessibleRelation** aRelation)
+{
+  NS_ENSURE_ARG_POINTER(aRelation);
+  *aRelation = nullptr;
+
+  NS_ENSURE_ARG(aType <= static_cast<uint32_t>(RelationType::LAST));
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  Relation rel = static_cast<Accessible*>(this)->RelationByType(static_cast<RelationType>(aType));
+  NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
+  return *aRelation ? NS_OK : NS_ERROR_FAILURE;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetRelations(nsIArray** aRelations)
+{
+  NS_ENSURE_ARG_POINTER(aRelations);
+  *aRelations = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
+  NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
+
+  static const uint32_t relationTypes[] = {
+    nsIAccessibleRelation::RELATION_LABELLED_BY,
+    nsIAccessibleRelation::RELATION_LABEL_FOR,
+    nsIAccessibleRelation::RELATION_DESCRIBED_BY,
+    nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
+    nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
+    nsIAccessibleRelation::RELATION_NODE_PARENT_OF,
+    nsIAccessibleRelation::RELATION_CONTROLLED_BY,
+    nsIAccessibleRelation::RELATION_CONTROLLER_FOR,
+    nsIAccessibleRelation::RELATION_FLOWS_TO,
+    nsIAccessibleRelation::RELATION_FLOWS_FROM,
+    nsIAccessibleRelation::RELATION_MEMBER_OF,
+    nsIAccessibleRelation::RELATION_SUBWINDOW_OF,
+    nsIAccessibleRelation::RELATION_EMBEDS,
+    nsIAccessibleRelation::RELATION_EMBEDDED_BY,
+    nsIAccessibleRelation::RELATION_POPUP_FOR,
+    nsIAccessibleRelation::RELATION_PARENT_WINDOW_OF,
+    nsIAccessibleRelation::RELATION_DEFAULT_BUTTON,
+    nsIAccessibleRelation::RELATION_CONTAINING_DOCUMENT,
+    nsIAccessibleRelation::RELATION_CONTAINING_TAB_PANE,
+    nsIAccessibleRelation::RELATION_CONTAINING_APPLICATION
+  };
+
+  for (uint32_t idx = 0; idx < ArrayLength(relationTypes); idx++) {
+    nsCOMPtr<nsIAccessibleRelation> relation;
+    nsresult rv = GetRelationByType(relationTypes[idx], getter_AddRefs(relation));
+
+    if (NS_SUCCEEDED(rv) && relation) {
+      uint32_t targets = 0;
+      relation->GetTargetsCount(&targets);
+      if (targets)
+        relations->AppendElement(relation, false);
+    }
+  }
+
+  NS_ADDREF(*aRelations = relations);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetFocusedChild(nsIAccessible** aChild)
+{
+  NS_ENSURE_ARG_POINTER(aChild);
+  *aChild = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aChild = static_cast<Accessible*>(this)->FocusedChild());
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetChildAtPoint(int32_t aX, int32_t aY,
+                               nsIAccessible** aAccessible)
+{
+  NS_ENSURE_ARG_POINTER(aAccessible);
+  *aAccessible = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aAccessible =
+               static_cast<Accessible*>(this)->ChildAtPoint(aX, aY,
+                                                            Accessible::eDirectChild));
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
+                                      nsIAccessible** aAccessible)
+{
+  NS_ENSURE_ARG_POINTER(aAccessible);
+  *aAccessible = nullptr;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  NS_IF_ADDREF(*aAccessible =
+               static_cast<Accessible*>(this)->ChildAtPoint(aX, aY,
+                                                            Accessible::eDeepestChild));
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableSetSelected(bool aSelect)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->SetSelected(aSelect);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ExtendSelection()
+{
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableTakeSelection()
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->TakeSelection();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableTakeFocus()
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->TakeFocus();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetActionCount(uint8_t* aActionCount)
+{
+  NS_ENSURE_ARG_POINTER(aActionCount);
+  *aActionCount = 0;
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aActionCount = static_cast<Accessible*>(this)->ActionCount();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  if (aIndex >= static_cast<Accessible*>(this)->ActionCount())
+    return NS_ERROR_INVALID_ARG;
+
+  static_cast<Accessible*>(this)->ActionNameAt(aIndex, aName);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  if (aIndex >= static_cast<Accessible*>(this)->ActionCount())
+    return NS_ERROR_INVALID_ARG;
+
+  static_cast<Accessible*>(this)->ActionDescriptionAt(aIndex, aDescription);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableDoAction(uint8_t aIndex)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  return static_cast<Accessible*>(this)->DoAction(aIndex) ?
+    NS_OK : NS_ERROR_INVALID_ARG;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableScrollTo(uint32_t aHow)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->ScrollTo(aHow);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessible::ScriptableScrollToPoint(uint32_t aCoordinateType,
+                                       int32_t aX, int32_t aY)
+{
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  static_cast<Accessible*>(this)->ScrollToPoint(aCoordinateType, aX, aY);
+  return NS_OK;
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/accessible/xpcom/xpcAccessible.h
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_a11y_xpcAccessible_h_
+#define mozilla_a11y_xpcAccessible_h_
+
+#include "nsIAccessible.h"
+
+class nsIAccessible;
+
+namespace mozilla {
+namespace a11y {
+
+class xpcAccessible : public nsIAccessible
+{
+public:
+  NS_IMETHOD GetParent(nsIAccessible** aParent) MOZ_FINAL;
+  NS_IMETHOD GetNextSibling(nsIAccessible** aNextSibling) MOZ_FINAL;
+  NS_IMETHOD GetPreviousSibling(nsIAccessible** aPreviousSibling) MOZ_FINAL;
+  NS_IMETHOD GetFirstChild(nsIAccessible** aFirstChild) MOZ_FINAL;
+  NS_IMETHOD GetLastChild(nsIAccessible** aLastChild) MOZ_FINAL;
+  NS_IMETHOD GetChildCount(int32_t* aChildCount) MOZ_FINAL;
+  NS_IMETHOD ScriptableGetChildAt(int32_t aChildIndex,
+                                  nsIAccessible** aChild) MOZ_FINAL;
+  NS_IMETHOD GetChildren(nsIArray** aChildren) MOZ_FINAL;
+  NS_IMETHOD GetIndexInParent(int32_t* aIndexInParent) MOZ_FINAL;
+
+  NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode) MOZ_FINAL;
+  NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument) MOZ_FINAL;
+  NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument) MOZ_FINAL;
+
+  NS_IMETHOD GetRole(uint32_t* aRole) MOZ_FINAL;
+  NS_IMETHOD GetState(uint32_t* aState, uint32_t* aExtraState) MOZ_FINAL;
+
+  NS_IMETHOD GetDescription(nsAString& aDescription) MOZ_FINAL;
+  NS_IMETHOD GetName(nsAString& aName) MOZ_FINAL;
+  NS_IMETHOD GetLanguage(nsAString& aLanguage) MOZ_FINAL;
+  NS_IMETHOD GetValue(nsAString& aValue) MOZ_FINAL;
+  NS_IMETHOD GetHelp(nsAString& aHelp) MOZ_FINAL;
+
+  NS_IMETHOD GetAccessKey(nsAString& aAccessKey) MOZ_FINAL;
+  NS_IMETHOD GetKeyboardShortcut(nsAString& aKeyBinding) MOZ_FINAL;
+
+  NS_IMETHOD GetAttributes(nsIPersistentProperties** aAttributes) MOZ_FINAL;
+  NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
+                       int32_t* aWidth, int32_t* aHeight) MOZ_FINAL;
+  NS_IMETHOD ScriptableGroupPosition(int32_t* aGroupLevel,
+                                     int32_t* aSimilarItemsInGroup,
+                                     int32_t* aPositionInGroup) MOZ_FINAL;
+  NS_IMETHOD GetRelationByType(uint32_t aType,
+                               nsIAccessibleRelation** aRelation) MOZ_FINAL;
+  NS_IMETHOD GetRelations(nsIArray** aRelations) MOZ_FINAL;
+
+  NS_IMETHOD GetFocusedChild(nsIAccessible** aChild) MOZ_FINAL;
+  NS_IMETHOD GetChildAtPoint(int32_t aX, int32_t aY,
+                             nsIAccessible** aAccessible) MOZ_FINAL;
+  NS_IMETHOD GetDeepestChildAtPoint(int32_t aX, int32_t aY,
+                                    nsIAccessible** aAccessible) MOZ_FINAL;
+
+  NS_IMETHOD ScriptableSetSelected(bool aSelect) MOZ_FINAL;
+  NS_IMETHOD ExtendSelection() MOZ_FINAL;
+  NS_IMETHOD ScriptableTakeSelection() MOZ_FINAL;
+  NS_IMETHOD ScriptableTakeFocus() MOZ_FINAL;
+
+  NS_IMETHOD GetActionCount(uint8_t* aActionCount) MOZ_FINAL;
+  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName) MOZ_FINAL;
+  NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString& aDescription) MOZ_FINAL;
+  NS_IMETHOD ScriptableDoAction(uint8_t aIndex) MOZ_FINAL;
+
+  NS_IMETHOD ScriptableScrollTo(uint32_t aHow) MOZ_FINAL;
+  NS_IMETHOD ScriptableScrollToPoint(uint32_t aCoordinateType,
+                                     int32_t aX, int32_t aY) MOZ_FINAL;
+
+private:
+  xpcAccessible() { }
+  friend class Accessible;
+
+  xpcAccessible(const xpcAccessible&) MOZ_DELETE;
+  xpcAccessible& operator =(const xpcAccessible&) MOZ_DELETE;
+};
+
+} // namespace a11y
+} // namespace mozilla
+
+#endif
new file mode 100644
--- /dev/null
+++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "xpcAccessibleHyperLink.h"
+
+#include "Accessible-inl.h"
+
+using namespace mozilla::a11y;
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetStartIndex(int32_t* aStartIndex)
+{
+  NS_ENSURE_ARG_POINTER(aStartIndex);
+  *aStartIndex = 0;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aStartIndex = static_cast<Accessible*>(this)->StartOffset();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetEndIndex(int32_t* aEndIndex)
+{
+  NS_ENSURE_ARG_POINTER(aEndIndex);
+  *aEndIndex = 0;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aEndIndex = static_cast<Accessible*>(this)->EndOffset();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetAnchorCount(int32_t* aAnchorCount)
+{
+  NS_ENSURE_ARG_POINTER(aAnchorCount);
+  *aAnchorCount = 0;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aAnchorCount = static_cast<Accessible*>(this)->AnchorCount();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI)
+{
+  NS_ENSURE_ARG_POINTER(aURI);
+
+  Accessible* thisAcc = static_cast<Accessible*>(this);
+  if (thisAcc->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  if (aIndex < 0 || aIndex >= static_cast<int32_t>(thisAcc->AnchorCount()))
+    return NS_ERROR_INVALID_ARG;
+
+  nsRefPtr<nsIURI>(thisAcc->AnchorURIAt(aIndex)).forget(aURI);
+  return NS_OK;
+}
+
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
+{
+  NS_ENSURE_ARG_POINTER(aAccessible);
+  *aAccessible = nullptr;
+
+  Accessible* thisAcc = static_cast<Accessible*>(this);
+  if (thisAcc->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  if (aIndex < 0 || aIndex >= static_cast<int32_t>(thisAcc->AnchorCount()))
+    return NS_ERROR_INVALID_ARG;
+
+  NS_IF_ADDREF(*aAccessible = thisAcc->AnchorAt(aIndex));
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+xpcAccessibleHyperLink::GetValid(bool* aValid)
+{
+  NS_ENSURE_ARG_POINTER(aValid);
+  *aValid = false;
+
+  if (static_cast<Accessible*>(this)->IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  *aValid = static_cast<Accessible*>(this)->IsLinkValid();
+  return NS_OK;
+}
new file mode 100644
--- /dev/null
+++ b/accessible/xpcom/xpcAccessibleHyperLink.h
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_a11y_xpcAccessibleHyperLink_h_
+#define mozilla_a11y_xpcAccessibleHyperLink_h_
+
+#include "nsIAccessibleHyperLink.h"
+
+class nsIAccessible;
+
+namespace mozilla {
+namespace a11y {
+
+class xpcAccessibleHyperLink : public nsIAccessibleHyperLink
+{
+public:
+  NS_IMETHOD GetAnchorCount(int32_t* aAnchorCount) MOZ_FINAL;
+  NS_IMETHOD GetStartIndex(int32_t* aStartIndex) MOZ_FINAL;
+  NS_IMETHOD GetEndIndex(int32_t* aEndIndex) MOZ_FINAL;
+  NS_IMETHOD GetURI(int32_t aIndex, nsIURI** aURI) MOZ_FINAL;
+  NS_IMETHOD GetAnchor(int32_t aIndex, nsIAccessible** aAccessible) MOZ_FINAL;
+  NS_IMETHOD GetValid(bool* aValid) MOZ_FINAL;
+
+private:
+  xpcAccessibleHyperLink() { }
+  friend class Accessible;
+
+  xpcAccessibleHyperLink(const xpcAccessibleHyperLink&) MOZ_DELETE;
+  xpcAccessibleHyperLink& operator =(const xpcAccessibleHyperLink&) MOZ_DELETE;
+};
+
+} // namespace a11y
+} // namespace mozilla
+
+#endif
--- a/accessible/xul/XULAlertAccessible.h
+++ b/accessible/xul/XULAlertAccessible.h
@@ -19,18 +19,18 @@ class XULAlertAccessible : public Access
 {
 public:
   XULAlertAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual Accessible* ContainerWidget() const;
 
 protected:
   ~XULAlertAccessible();
 };
--- a/accessible/xul/XULColorPickerAccessible.h
+++ b/accessible/xul/XULColorPickerAccessible.h
@@ -17,36 +17,36 @@ namespace a11y {
 class XULColorPickerTileAccessible : public AccessibleWrap
 {
 public:
   XULColorPickerTileAccessible(nsIContent* aContent,
                                DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 };
 
 
 /**
  * Used for colorpicker button (xul:colorpicker@type="button").
  */
 class XULColorPickerAccessible : public XULColorPickerTileAccessible
 {
 public:
   XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 
   virtual bool IsAcceptableChild(Accessible* aPossibleChild) const MOZ_OVERRIDE;
 };
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -115,63 +115,50 @@ XULComboboxAccessible::CanHaveAnonChildr
 
 uint8_t
 XULComboboxAccessible::ActionCount()
 {
   // Just one action (click).
   return 1;
 }
 
-NS_IMETHODIMP
+bool
 XULComboboxAccessible::DoAction(uint8_t aIndex)
 {
-  if (aIndex != XULComboboxAccessible::eAction_Click) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+  if (aIndex != XULComboboxAccessible::eAction_Click)
+    return false;
 
   // Programmaticaly toggle the combo box.
   nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
-  if (!menuList) {
-    return NS_ERROR_FAILURE;
-  }
-  bool isDroppedDown;
+  if (!menuList)
+    return false;
+
+  bool isDroppedDown = false;
   menuList->GetOpen(&isDroppedDown);
-  return menuList->SetOpen(!isDroppedDown);
+  menuList->SetOpen(!isDroppedDown);
+  return true;
 }
 
-NS_IMETHODIMP
-XULComboboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex != XULComboboxAccessible::eAction_Click) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  // Our action name is the reverse of our state:
-  //     if we are close -> open is our name.
-  //     if we are open -> close is our name.
-  // Uses the frame to get the state, updated on every click.
+  aName.Truncate();
+  if (aIndex != XULComboboxAccessible::eAction_Click)
+    return;
 
   nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mContent));
-  if (!menuList) {
-    return NS_ERROR_FAILURE;
-  }
-  bool isDroppedDown;
+  if (!menuList)
+    return;
+
+  bool isDroppedDown = false;
   menuList->GetOpen(&isDroppedDown);
   if (isDroppedDown)
-    aName.AssignLiteral("close"); 
+    aName.AssignLiteral("close");
   else
-    aName.AssignLiteral("open"); 
-
-  return NS_OK;
+    aName.AssignLiteral("open");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Widgets
 
 bool
 XULComboboxAccessible::IsActiveWidget() const
 {
--- a/accessible/xul/XULComboboxAccessible.h
+++ b/accessible/xul/XULComboboxAccessible.h
@@ -16,29 +16,27 @@ namespace a11y {
  */
 class XULComboboxAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
   XULComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t aIndex);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-
   // Accessible
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual uint64_t NativeState();
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -228,39 +228,33 @@ XULLinkAccessible::NativeLinkState() con
 }
 
 uint8_t
 XULLinkAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-XULLinkAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULLinkAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
-  if (aIndex != eAction_Jump)
-    return NS_ERROR_INVALID_ARG;
-
-  aName.AssignLiteral("jump");
-  return NS_OK;
+  if (aIndex == eAction_Jump)
+    aName.AssignLiteral("jump");
 }
 
-NS_IMETHODIMP
+bool
 XULLinkAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Jump)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULLinkAccessible: HyperLinkAccessible
 
 bool
 XULLinkAccessible::IsLink()
 {
--- a/accessible/xul/XULElementAccessibles.h
+++ b/accessible/xul/XULElementAccessibles.h
@@ -19,18 +19,18 @@ class XULLabelTextLeafAccessible;
  */
 class XULLabelAccessible : public HyperTextAccessibleWrap
 {
 public:
   XULLabelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Shutdown();
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
   void UpdateLabelValue(const nsString& aValue);
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
   virtual void CacheChildren() MOZ_OVERRIDE;
@@ -70,39 +70,37 @@ public:
  */
 class XULTooltipAccessible : public LeafAccessible
 {
 
 public:
   XULTooltipAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 };
 
 class XULLinkAccessible : public XULLabelAccessible
 {
 
 public:
   XULLinkAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeLinkState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeLinkState() const MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // HyperLinkAccessible
   virtual bool IsLink();
   virtual uint32_t StartOffset();
   virtual uint32_t EndOffset();
   virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
 protected:
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -60,34 +60,31 @@ NS_IMPL_ISUPPORTS_INHERITED0(XULButtonAc
 // XULButtonAccessible: nsIAccessible
 
 uint8_t
 XULButtonAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-XULButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Click) {
-    aName.AssignLiteral("press"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Click)
+    aName.AssignLiteral("press");
 }
 
-NS_IMETHODIMP
+bool
 XULButtonAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != 0)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible: Accessible
 
 role
 XULButtonAccessible::NativeRole()
 {
@@ -191,17 +188,17 @@ XULButtonAccessible::IsAcceptableChild(A
   return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                                nsGkAtoms::menuButton, eCaseMatters);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible protected
 
 bool
-XULButtonAccessible::ContainsMenu()
+XULButtonAccessible::ContainsMenu() const
 {
   static nsIContent::AttrValuesArray strings[] =
     {&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};
 
   return mContent->FindAttrValueIn(kNameSpaceID_None,
                                    nsGkAtoms::type,
                                    strings, eCaseMatters) >= 0;
 }
@@ -218,17 +215,17 @@ XULDropmarkerAccessible::
 
 uint8_t
 XULDropmarkerAccessible::ActionCount()
 {
   return 1;
 }
 
 bool
-XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen)
+XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen) const
 {
   bool isOpen = false;
 
   nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement =
     do_QueryInterface(mContent->GetFlattenedTreeParent());
 
   if (parentButtonElement) {
     parentButtonElement->GetOpen(&isOpen);
@@ -243,44 +240,36 @@ XULDropmarkerAccessible::DropmarkerOpen(
       if (aToggleOpen)
         parentMenuListElement->SetOpen(!isOpen);
     }
   }
 
   return isOpen;
 }
 
-/**
-  * Return the name of our only action
-  */
-NS_IMETHODIMP
-XULDropmarkerAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULDropmarkerAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
+  aName.Truncate();
   if (aIndex == eAction_Click) {
     if (DropmarkerOpen(false))
       aName.AssignLiteral("close");
     else
       aName.AssignLiteral("open");
-    return NS_OK;
   }
-
-  return NS_ERROR_INVALID_ARG;
 }
 
-/**
-  * Tell the Dropmarker to do its action
-  */
-NS_IMETHODIMP
+bool
 XULDropmarkerAccessible::DoAction(uint8_t index)
 {
   if (index == eAction_Click) {
     DropmarkerOpen(true); // Reverse the open attribute
-    return NS_OK;
+    return true;
   }
-  return NS_ERROR_INVALID_ARG;
+  return false;
 }
 
 role
 XULDropmarkerAccessible::NativeRole()
 {
   return roles::PUSHBUTTON;
 }
 
@@ -307,46 +296,35 @@ XULCheckboxAccessible::NativeRole()
 }
 
 uint8_t
 XULCheckboxAccessible::ActionCount()
 {
   return 1;
 }
 
-/**
-  * Return the name of our only action
-  */
-NS_IMETHODIMP
-XULCheckboxAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULCheckboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {
-    // check or uncheck
-
     if (NativeState() & states::CHECKED)
       aName.AssignLiteral("uncheck");
     else
       aName.AssignLiteral("check");
-
-    return NS_OK;
   }
-  return NS_ERROR_INVALID_ARG;
 }
 
-/**
-  * Tell the checkbox to do its only action -- check( or uncheck) itself
-  */
-NS_IMETHODIMP
+bool
 XULCheckboxAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 uint64_t
 XULCheckboxAccessible::NativeState()
 {
   // Possible states: focused, focusable, unavailable(disabled), checked
   // Get focus and disable status from base class
   uint64_t state = LeafAccessible::NativeState();
--- a/accessible/xul/XULFormControlAccessible.h
+++ b/accessible/xul/XULFormControlAccessible.h
@@ -30,98 +30,92 @@ class XULButtonAccessible : public Acces
 {
 public:
   enum { eAction_Click = 0 };
   XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* ContainerWidget() const;
 
   virtual bool IsAcceptableChild(Accessible* aPossibleChild) const MOZ_OVERRIDE;
 
 protected:
   virtual ~XULButtonAccessible();
 
   // XULButtonAccessible
-  bool ContainsMenu();
+  bool ContainsMenu() const;
 };
 
 
 /**
  * Used for XUL checkbox element.
  */
 class XULCheckboxAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 };
 
 /**
  * Used for XUL dropmarker element.
  */
 class XULDropmarkerAccessible : public LeafAccessible
 {
 public:
   enum { eAction_Click = 0 };
   XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
 private:
-  bool DropmarkerOpen(bool aToggleOpen);
+  bool DropmarkerOpen(bool aToggleOpen) const;
 };
 
 /**
  * Used for XUL groupbox element.
  */
 class XULGroupboxAccessible MOZ_FINAL : public AccessibleWrap
 {
 public:
   XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 /**
@@ -129,51 +123,51 @@ protected:
  */
 class XULRadioButtonAccessible : public RadioButtonAccessible
 {
 
 public:
   XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 };
 
 /**
  * Used for XUL radiogroup element.
  */
 class XULRadioGroupAccessible : public XULSelectControlAccessible
 {
 public:
   XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 };
 
 /**
  * Used for XUL statusbar element.
  */
 class XULStatusBarAccessible : public AccessibleWrap
 {
 public:
   XULStatusBarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
 };
 
 /**
  * Used for XUL toolbarbutton element.
  */
 class XULToolbarButtonAccessible : public XULButtonAccessible
 {
 public:
@@ -191,34 +185,34 @@ public:
  * Used for XUL toolbar element.
  */
 class XULToolbarAccessible : public AccessibleWrap
 {
 public:
   XULToolbarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 /**
  * Used for XUL toolbarseparator element.
  */
 class XULToolbarSeparatorAccessible : public LeafAccessible
 {
 public:
   XULToolbarSeparatorAccessible(nsIContent* aContent,
                                 DocAccessible* aDoc);
 
   // Accessible
-  virtual mozilla::a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual mozilla::a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -71,34 +71,31 @@ XULColumnItemAccessible::NativeState()
 }
 
 uint8_t
 XULColumnItemAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-XULColumnItemAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULColumnItemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  aName.AssignLiteral("click");
-  return NS_OK;
+  if (aIndex == eAction_Click)
+    aName.AssignLiteral("click");
 }
 
-NS_IMETHODIMP
+bool
 XULColumnItemAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand();
-  return NS_OK;
+  return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULListboxAccessible::
   XULListboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
@@ -588,17 +585,17 @@ XULListitemAccessible::
 
 XULListitemAccessible::~XULListitemAccessible()
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(XULListitemAccessible, Accessible)
 
 Accessible*
-XULListitemAccessible::GetListAccessible()
+XULListitemAccessible::GetListAccessible() const
 {
   if (IsDefunct())
     return nullptr;
 
   nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
     do_QueryInterface(mContent);
   if (!listItem)
     return nullptr;
@@ -691,31 +688,26 @@ XULListitemAccessible::NativeState()
 
 uint64_t
 XULListitemAccessible::NativeInteractiveState() const
 {
   return NativelyUnavailable() || (mParent && mParent->NativelyUnavailable()) ?
     states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
 }
 
-NS_IMETHODIMP
-XULListitemAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULListitemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click && mIsCheckbox) {
-    // check or uncheck
     uint64_t states = NativeState();
-
     if (states & states::CHECKED)
       aName.AssignLiteral("uncheck");
     else
       aName.AssignLiteral("check");
-
-    return NS_OK;
   }
-  return NS_ERROR_INVALID_ARG;
 }
 
 bool
 XULListitemAccessible::CanHaveAnonChildren()
 {
   // That indicates we should walk anonymous children for listitems
   return true;
 }
--- a/accessible/xul/XULListboxAccessible.h
+++ b/accessible/xul/XULListboxAccessible.h
@@ -25,39 +25,37 @@ namespace a11y {
  * (xul:treecols and xul:listcols).
  */
 class XULColumAccessible : public AccessibleWrap
 {
 public:
   XULColumAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 };
 
 /**
  * XULColumnItemAccessible are accessibles for list and tree column elements
  * (xul:listcol and xul:treecol).
  */
 class XULColumnItemAccessible : public LeafAccessible
 {
 public:
   XULColumnItemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   enum { eAction_Click = 0 };
 };
 
 /*
  * A class the represents the XUL Listbox widget.
  */
 class XULListboxAccessible : public XULSelectControlAccessible,
@@ -90,18 +88,18 @@ public:
   virtual void SelectRow(uint32_t aRowIdx);
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual Accessible* AsAccessible() { return this; }
 
   // Accessible
   virtual void Shutdown();
   virtual void Value(nsString& aValue);
   virtual TableAccessible* AsTable() { return this; }
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 
   virtual Accessible* ContainerWidget() const;
 
@@ -118,42 +116,41 @@ class XULListitemAccessible : public XUL
 {
 public:
   enum { eAction_Click = 0 };
 
   NS_DECL_ISUPPORTS_INHERITED
 
   XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t index, nsAString& aName);
-  // Don't use XUL menuitems's description attribute
-
   // Accessible
   virtual void Description(nsString& aDesc);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
   virtual bool CanHaveAnonChildren();
 
+  // Actions
+  virtual void ActionNameAt(uint8_t index, nsAString& aName) MOZ_OVERRIDE;
+
   // Widgets
   virtual Accessible* ContainerWidget() const;
 
 protected:
   virtual ~XULListitemAccessible();
 
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 
   // XULListitemAccessible
 
   /**
    * Return listbox accessible for the listitem.
    */
-  Accessible* GetListAccessible();
+  Accessible* GetListAccessible() const;
 
 private:
   bool mIsCheckbox;
 };
 
 /**
  * Class represents xul:listcell.
  */
@@ -170,17 +167,17 @@ public:
 
   // nsIAccessibleTableCell
   NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() { return this; }
   virtual void Shutdown();
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
   // TableCellAccessible
   virtual TableAccessible* Table() const MOZ_OVERRIDE;
   virtual uint32_t ColIdx() const MOZ_OVERRIDE;
   virtual uint32_t RowIdx() const MOZ_OVERRIDE;
   virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) MOZ_OVERRIDE;
   virtual bool Selected() MOZ_OVERRIDE;
 
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -269,36 +269,32 @@ XULMenuitemAccessible::GetLevelInternal(
 
 bool
 XULMenuitemAccessible::CanHaveAnonChildren()
 {
   // That indicates we don't walk anonymous children for menuitems
   return false;
 }
 
-NS_IMETHODIMP
+bool
 XULMenuitemAccessible::DoAction(uint8_t index)
 {
   if (index == eAction_Click) {   // default action
     DoCommand();
-    return NS_OK;
+    return true;
   }
 
-  return NS_ERROR_INVALID_ARG;
+  return false;
 }
 
-/** select us! close combo box if necessary*/
-NS_IMETHODIMP
-XULMenuitemAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULMenuitemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Click) {
-    aName.AssignLiteral("click"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Click)
+    aName.AssignLiteral("click");
 }
 
 uint8_t
 XULMenuitemAccessible::ActionCount()
 {
   return 1;
 }
 
@@ -378,26 +374,26 @@ XULMenuSeparatorAccessible::NativeName(n
 }
 
 role
 XULMenuSeparatorAccessible::NativeRole()
 {
   return roles::SEPARATOR;
 }
 
-NS_IMETHODIMP
+bool
 XULMenuSeparatorAccessible::DoAction(uint8_t index)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return false;
 }
 
-NS_IMETHODIMP
-XULMenuSeparatorAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULMenuSeparatorAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  return NS_ERROR_NOT_IMPLEMENTED;
+  aName.Truncate();
 }
 
 uint8_t
 XULMenuSeparatorAccessible::ActionCount()
 {
   return 0;
 }
 
--- a/accessible/xul/XULMenuAccessible.h
+++ b/accessible/xul/XULMenuAccessible.h
@@ -18,31 +18,29 @@ namespace a11y {
  */
 class XULMenuitemAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Click = 0 };
 
   XULMenuitemAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-
   // Accessible
   virtual void Description(nsString& aDescription);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
   virtual int32_t GetLevelInternal();
 
   virtual bool CanHaveAnonChildren();
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  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 KeyBinding AccessKey() const;
   virtual KeyBinding KeyboardShortcut() const;
 
   // Widgets
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* ContainerWidget() const;
 
@@ -54,44 +52,42 @@ protected:
 /**
  * Used for XUL menuseparator element.
  */
 class XULMenuSeparatorAccessible : public XULMenuitemAccessible
 {
 public:
   XULMenuSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD DoAction(uint8_t index);
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 
 /**
  * Used for XUL menupopup and panel.
  */
 class XULMenupopupAccessible : public XULSelectControlAccessible
 {
 public:
   XULMenupopupAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
 
   // Widgets
   virtual bool IsWidget() const;
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
 
   virtual Accessible* ContainerWidget() const;
 
@@ -104,17 +100,17 @@ protected:
  * Used for XUL menubar element.
  */
 class XULMenubarAccessible : public AccessibleWrap
 {
 public:
   XULMenubarAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
   // Widget
   virtual bool IsActiveWidget() const;
   virtual bool AreItemsOperable() const;
   virtual Accessible* CurrentItem();
   virtual void SetCurrentItem(Accessible* aItem);
 
 protected:
--- a/accessible/xul/XULSliderAccessible.cpp
+++ b/accessible/xul/XULSliderAccessible.cpp
@@ -66,37 +66,35 @@ XULSliderAccessible::Value(nsString& aVa
 }
 
 uint8_t
 XULSliderAccessible::ActionCount()
 {
   return 1;
 }
 
-NS_IMETHODIMP
-XULSliderAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULSliderAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
-
-  NS_ENSURE_ARG(aIndex == 0);
-
-  aName.AssignLiteral("activate");
-  return NS_OK;
+  if (aIndex == 0)
+    aName.AssignLiteral("activate");
 }
 
-NS_IMETHODIMP
+bool
 XULSliderAccessible::DoAction(uint8_t aIndex)
 {
-  NS_ENSURE_ARG(aIndex == 0);
+  if (aIndex != 0)
+    return false;
 
   nsIContent* sliderElm = GetSliderElement();
   if (sliderElm)
     DoCommand(sliderElm);
 
-  return NS_OK;
+  return true;
 }
 
 double
 XULSliderAccessible::MaxValue() const
 {
   double value = AccessibleWrap::MaxValue();
   return IsNaN(value) ? GetSliderAttr(nsGkAtoms::maxpos) : value;
 }
--- a/accessible/xul/XULSliderAccessible.h
+++ b/accessible/xul/XULSliderAccessible.h
@@ -16,36 +16,34 @@ namespace a11y {
 /**
  * Used for XUL slider and scale elements.
  */
 class XULSliderAccessible : public AccessibleWrap
 {
 public:
   XULSliderAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
   virtual bool NativelyUnavailable() const;
   virtual bool CanHaveAnonChildren();
 
   // 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;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
 protected:
   /**
    * Return anonymous slider element.
    */
   nsIContent* GetSliderElement() const;
 
   nsresult GetSliderAttr(nsIAtom *aName, nsAString& aValue) const;
@@ -63,16 +61,16 @@ private:
  * Used for slider's thumb element.
  */
 class XULThumbAccessible : public AccessibleWrap
 {
 public:
   XULThumbAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -34,40 +34,34 @@ XULTabAccessible::
 
 uint8_t
 XULTabAccessible::ActionCount()
 {
   return 1;
 }
 
 /** Return the name of our only action  */
-NS_IMETHODIMP
-XULTabAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULTabAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (aIndex == eAction_Switch) {
-    aName.AssignLiteral("switch"); 
-    return NS_OK;
-  }
-  return NS_ERROR_INVALID_ARG;
+  if (aIndex == eAction_Switch)
+    aName.AssignLiteral("switch");
 }
 
-/** Tell the tab to do its action */
-NS_IMETHODIMP
+bool
 XULTabAccessible::DoAction(uint8_t index)
 {
   if (index == eAction_Switch) {
     nsCOMPtr<nsIDOMXULElement> tab(do_QueryInterface(mContent));
-    if ( tab )
-    {
+    if (tab) {
       tab->Click();
-      return NS_OK;
+      return true;
     }
-    return NS_ERROR_FAILURE;
   }
-  return NS_ERROR_INVALID_ARG;
+  return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTabAccessible: Accessible
 
 role
 XULTabAccessible::NativeRole()
 {
--- a/accessible/xul/XULTabAccessible.h
+++ b/accessible/xul/XULTabAccessible.h
@@ -18,45 +18,43 @@ namespace a11y {
  */
 class XULTabAccessible : public AccessibleWrap
 {
 public:
   enum { eAction_Switch = 0 };
 
   XULTabAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  // nsIAccessible
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t index);
-
   // Accessible
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 };
 
 
 /**
  * A container of tab objects, xul:tabs element.
  */
 class XULTabsAccessible : public XULSelectControlAccessible
 {
 public:
   XULTabsAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
 
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) MOZ_OVERRIDE;
 };
 
 
 /**
@@ -65,34 +63,34 @@ protected:
 class XULTabpanelsAccessible : public AccessibleWrap
 {
 public:
   XULTabpanelsAccessible(nsIContent* aContent, DocAccessible* aDoc) :
     AccessibleWrap(aContent, aDoc)
     { mType = eXULTabpanelsType; }
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 };
 
 
 /**
  * A tabpanel object, child elements of xul:tabpanels element.
  *
  * XXX: we need to move the class logic into generic class since
  * for example we do not create instance of this class for XUL textbox used as
  * a tabpanel.
  */
 class XULTabpanelAccessible : public AccessibleWrap
 {
 public:
   XULTabpanelAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // Accessible
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -728,94 +728,73 @@ NS_IMPL_RELEASE_INHERITED(XULTreeItemAcc
 // XULTreeItemAccessibleBase: nsIAccessible implementation
 
 Accessible*
 XULTreeItemAccessibleBase::FocusedChild()
 {
   return FocusMgr()->FocusedAccessible() == this ? this : nullptr;
 }
 
-NS_IMETHODIMP
-XULTreeItemAccessibleBase::GetBounds(int32_t* aX, int32_t* aY,
-                                     int32_t* aWidth, int32_t* aHeight)
+nsIntRect
+XULTreeItemAccessibleBase::Bounds() const
 {
-  NS_ENSURE_ARG_POINTER(aX);
-  *aX = 0;
-  NS_ENSURE_ARG_POINTER(aY);
-  *aY = 0;
-  NS_ENSURE_ARG_POINTER(aWidth);
-  *aWidth = 0;
-  NS_ENSURE_ARG_POINTER(aHeight);
-  *aHeight = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   // Get x coordinate and width from treechildren element, get y coordinate and
   // height from tree cell.
 
   nsCOMPtr<nsIBoxObject> boxObj = nsCoreUtils::GetTreeBodyBoxObject(mTree);
-  NS_ENSURE_STATE(boxObj);
+  if (!boxObj)
+    return nsIntRect();
 
   nsCOMPtr<nsITreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
 
   int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = mTree->GetCoordsForCellItem(mRow, column, EmptyCString(),
                                             &x, &y, &width, &height);
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (NS_FAILED(rv))
+    return nsIntRect();
 
   boxObj->GetWidth(&width);
 
   int32_t tcX = 0, tcY = 0;
   boxObj->GetScreenX(&tcX);
   boxObj->GetScreenY(&tcY);
 
   x = tcX;
   y += tcY;
 
   nsPresContext* presContext = mDoc->PresContext();
-  *aX = presContext->CSSPixelsToDevPixels(x);
-  *aY = presContext->CSSPixelsToDevPixels(y);
-  *aWidth = presContext->CSSPixelsToDevPixels(width);
-  *aHeight = presContext->CSSPixelsToDevPixels(height);
-
-  return NS_OK;
+  return nsIntRect(presContext->CSSPixelsToDevPixels(x),
+                   presContext->CSSPixelsToDevPixels(y),
+                   presContext->CSSPixelsToDevPixels(width),
+                   presContext->CSSPixelsToDevPixels(height));
 }
 
-NS_IMETHODIMP
+void
 XULTreeItemAccessibleBase::SetSelected(bool aSelect)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
-    bool isSelected;
+    bool isSelected = false;
     selection->IsSelected(mRow, &isSelected);
     if (isSelected != aSelect)
       selection->ToggleSelect(mRow);
   }
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 XULTreeItemAccessibleBase::TakeFocus()
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection)
     selection->SetCurrentIndex(mRow);
 
   // focus event will be fired here
-  return Accessible::TakeFocus();
+  Accessible::TakeFocus();
 }
 
 Relation
 XULTreeItemAccessibleBase::RelationByType(RelationType aType)
 {
 
   switch (aType) {
     case RelationType::NODE_CHILD_OF: {
@@ -850,53 +829,43 @@ XULTreeItemAccessibleBase::RelationByTyp
 uint8_t
 XULTreeItemAccessibleBase::ActionCount()
 {
   // "activate" action is available for all treeitems, "expand/collapse" action
   // is avaible for treeitem which is container.
   return IsExpandable() ? 2 : 1;
 }
 
-NS_IMETHODIMP
-XULTreeItemAccessibleBase::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULTreeItemAccessibleBase::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   if (aIndex == eAction_Click) {
     aName.AssignLiteral("activate");
-    return NS_OK;
+    return;
   }
 
   if (aIndex == eAction_Expand && IsExpandable()) {
-    bool isContainerOpen;
+    bool isContainerOpen = false;
     mTreeView->IsContainerOpen(mRow, &isContainerOpen);
     if (isContainerOpen)
       aName.AssignLiteral("collapse");
     else
       aName.AssignLiteral("expand");
-
-    return NS_OK;
   }
-
-  return NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP
+bool
 XULTreeItemAccessibleBase::DoAction(uint8_t aIndex)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   if (aIndex != eAction_Click &&
       (aIndex != eAction_Expand || !IsExpandable()))
-    return NS_ERROR_INVALID_ARG;
+    return false;
 
   DoCommand(nullptr, aIndex);
-  return NS_OK;
+  return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeItemAccessibleBase: Accessible implementation
 
 void
 XULTreeItemAccessibleBase::Shutdown()
 {
--- a/accessible/xul/XULTreeAccessible.h
+++ b/accessible/xul/XULTreeAccessible.h
@@ -36,18 +36,18 @@ public:
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeAccessible, Accessible)
 
   // Accessible
   virtual void Shutdown();
   virtual void Value(nsString& aValue);
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(uint32_t aIndex) const MOZ_OVERRIDE;
   virtual uint32_t ChildCount() const MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
 
   // SelectAccessible
@@ -141,37 +141,32 @@ public:
                             Accessible* aParent, nsITreeBoxObject* aTree,
                             nsITreeView* aTreeView, int32_t aRow);
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessibleBase,
                                            AccessibleWrap)
 
-  // nsIAccessible
-  NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY,
-                       int32_t *aWidth, int32_t *aHeight);
-
-  NS_IMETHOD SetSelected(bool aSelect);
-  NS_IMETHOD TakeFocus();
-
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // Accessible
-  virtual void Shutdown();
-  virtual GroupPos GroupPosition();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
-  virtual int32_t IndexInParent() const;
+  virtual void Shutdown() MOZ_OVERRIDE;
+  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
+  virtual GroupPos GroupPosition() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
+  virtual int32_t IndexInParent() const MOZ_OVERRIDE;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
-  virtual Accessible* FocusedChild();
+  virtual Accessible* FocusedChild() MOZ_OVERRIDE;
+  virtual void SetSelected(bool aSelect) MOZ_OVERRIDE;
+  virtual void TakeFocus() MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // Widgets
   virtual Accessible* ContainerWidget() const;
 
   // XULTreeItemAccessibleBase
   NS_DECLARE_STATIC_IID_ACCESSOR(XULTREEITEMBASEACCESSIBLE_IMPL_CID)
 
   /**
@@ -235,17 +230,17 @@ public:
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeItemAccessible,
                                            XULTreeItemAccessibleBase)
 
   // Accessible
   virtual void Shutdown();
   virtual ENameValueFlag Name(nsString& aName);
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
   // XULTreeItemAccessibleBase
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx);
 
 protected:
   virtual ~XULTreeItemAccessible();
 
   // Accessible
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -141,23 +141,21 @@ XULTreeGridAccessible::CellAt(uint32_t a
   return rowAcc->GetCellAccessible(column);
 }
 
 void
 XULTreeGridAccessible::ColDescription(uint32_t aColIdx, nsString& aDescription)
 {
   aDescription.Truncate();
 
-  nsCOMPtr<nsIAccessible> treeColumns;
-  Accessible::GetFirstChild(getter_AddRefs(treeColumns));
+  Accessible* treeColumns = Accessible::GetChildAt(0);
   if (treeColumns) {
-    nsCOMPtr<nsIAccessible> treeColumnItem;
-    treeColumns->GetChildAt(aColIdx, getter_AddRefs(treeColumnItem));
+    Accessible* treeColumnItem = treeColumns->GetChildAt(aColIdx);
     if (treeColumnItem)
-      treeColumnItem->GetName(aDescription);
+      treeColumnItem->Name(aDescription);
   }
 }
 
 bool
 XULTreeGridAccessible::IsColSelected(uint32_t aColIdx)
 {
   // If all the row has been selected, then all the columns are selected.
   // Because we can't select a column alone.
@@ -508,56 +506,43 @@ XULTreeGridCellAccessible::Name(nsString
   // something shown in the cell (non-text) such as a star icon; in which case
   // GetCellValue for that cell would return "starred" or "flagged" for example.
   if (aName.IsEmpty())
     mTreeView->GetCellValue(mRow, mColumn, aName);
 
   return eNameOK;
 }
 
-NS_IMETHODIMP
-XULTreeGridCellAccessible::GetBounds(int32_t* aX, int32_t* aY,
-                                     int32_t* aWidth, int32_t* aHeight)
+nsIntRect
+XULTreeGridCellAccessible::Bounds() const
 {
-  NS_ENSURE_ARG_POINTER(aX);
-  *aX = 0;
-  NS_ENSURE_ARG_POINTER(aY);
-  *aY = 0;
-  NS_ENSURE_ARG_POINTER(aWidth);
-  *aWidth = 0;
-  NS_ENSURE_ARG_POINTER(aHeight);
-  *aHeight = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   // Get bounds for tree cell and add x and y of treechildren element to
   // x and y of the cell.
   nsCOMPtr<nsIBoxObject> boxObj = nsCoreUtils::GetTreeBodyBoxObject(mTree);
-  NS_ENSURE_STATE(boxObj);
+  if (!boxObj)
+    return nsIntRect();
 
   int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = mTree->GetCoordsForCellItem(mRow, mColumn,
                                             NS_LITERAL_CSTRING("cell"),
                                             &x, &y, &width, &height);
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (NS_FAILED(rv))
+    return nsIntRect();
 
   int32_t tcX = 0, tcY = 0;
   boxObj->GetScreenX(&tcX);
   boxObj->GetScreenY(&tcY);
   x += tcX;
   y += tcY;
 
   nsPresContext* presContext = mDoc->PresContext();
-  *aX = presContext->CSSPixelsToDevPixels(x);
-  *aY = presContext->CSSPixelsToDevPixels(y);
-  *aWidth = presContext->CSSPixelsToDevPixels(width);
-  *aHeight = presContext->CSSPixelsToDevPixels(height);
-
-  return NS_OK;
+  return nsIntRect(presContext->CSSPixelsToDevPixels(x),
+                   presContext->CSSPixelsToDevPixels(y),
+                   presContext->CSSPixelsToDevPixels(width),
+                   presContext->CSSPixelsToDevPixels(height));
 }
 
 uint8_t
 XULTreeGridCellAccessible::ActionCount()
 {
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler)
@@ -566,74 +551,64 @@ XULTreeGridCellAccessible::ActionCount()
   int16_t type;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX && IsEditable())
     return 1;
 
   return 0;
 }
 
-NS_IMETHODIMP
-XULTreeGridCellAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
+void
+XULTreeGridCellAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
-  if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct() || !mTreeView)
-    return NS_ERROR_FAILURE;
+  if (aIndex != eAction_Click || !mTreeView)
+    return;
 
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler) {
     aName.AssignLiteral("cycle");
-    return NS_OK;
+    return;
   }
 
-  int16_t type;
+  int16_t type = 0;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX && IsEditable()) {
     nsAutoString value;
     mTreeView->GetCellValue(mRow, mColumn, value);
     if (value.EqualsLiteral("true"))
       aName.AssignLiteral("uncheck");
     else
       aName.AssignLiteral("check");
-
-    return NS_OK;
   }
-
-  return NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP
+bool
 XULTreeGridCellAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
-    return NS_ERROR_INVALID_ARG;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+    return false;
 
   bool isCycler = false;
   mColumn->GetCycler(&isCycler);
   if (isCycler) {
     DoCommand();
-    return NS_OK;
+    return true;
   }
 
   int16_t type;
   mColumn->GetType(&type);
   if (type == nsITreeColumn::TYPE_CHECKBOX && IsEditable()) {
     DoCommand();
-    return NS_OK;
+    return true;
   }
 
-  return NS_ERROR_INVALID_ARG;
+  return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridCellAccessible: nsIAccessibleTableCell implementation
 
 TableAccessible*
 XULTreeGridCellAccessible::Table() const
 {
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -52,17 +52,17 @@ public:
   virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
   virtual void SelectRow(uint32_t aRowIdx);
   virtual void UnselectRow(uint32_t aRowIdx);
   virtual Accessible* AsAccessible() { return this; }
 
   // Accessible
   virtual void Shutdown();
   virtual TableAccessible* AsTable() { return this; }
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
 
 protected:
   virtual ~XULTreeGridAccessible();
 
   // XULTreeAccessible
   virtual already_AddRefed<Accessible>
     CreateTreeItemAccessible(int32_t aRow) const MOZ_OVERRIDE;
 };
@@ -83,17 +83,17 @@ public:
 
   // nsISupports and cycle collection
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible,
                                            XULTreeItemAccessibleBase)
 
   // Accessible
   virtual void Shutdown();
-  virtual a11y::role NativeRole();
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
   virtual ENameValueFlag Name(nsString& aName);
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   virtual Accessible* GetChildAt(uint32_t aIndex) const MOZ_OVERRIDE;
   virtual uint32_t ChildCount() const MOZ_OVERRIDE;
 
   // XULTreeItemAccessibleBase
@@ -136,41 +136,36 @@ public:
                             nsITreeBoxObject* aTree, nsITreeView* aTreeView,
                             int32_t aRow, nsITreeColumn* aColumn);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridCellAccessible,
                                            LeafAccessible)
 
-  // nsIAccessible
-
-  NS_IMETHOD GetBounds(int32_t* aX, int32_t* aY,
-                       int32_t* aWidth, int32_t* aHeight);
-
-  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(uint8_t aIndex);
-
   // nsIAccessibleTableCell
   NS_FORWARD_NSIACCESSIBLETABLECELL(xpcAccessibleTableCell::)
 
   // Accessible
   virtual TableCellAccessible* AsTableCell() { return this; }
   virtual void Shutdown();
+  virtual nsIntRect Bounds() const MOZ_OVERRIDE;
   virtual ENameValueFlag Name(nsString& aName);
   virtual Accessible* FocusedChild();
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() MOZ_OVERRIDE;
   virtual int32_t IndexInParent() const;
   virtual Relation RelationByType(RelationType aType) MOZ_OVERRIDE;
-  virtual a11y::role NativeRole();
-  virtual uint64_t NativeState();
-  virtual uint64_t NativeInteractiveState() const;
+  virtual a11y::role NativeRole() MOZ_OVERRIDE;
+  virtual uint64_t NativeState() MOZ_OVERRIDE;
+  virtual uint64_t NativeInteractiveState() const MOZ_OVERRIDE;
 
   // ActionAccessible
-  virtual uint8_t ActionCount();
+  virtual uint8_t ActionCount() MOZ_OVERRIDE;
+  virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) MOZ_OVERRIDE;
+  virtual bool DoAction(uint8_t aIndex) MOZ_OVERRIDE;
 
   // TableCellAccessible
   virtual TableAccessible* Table() const MOZ_OVERRIDE;
   virtual uint32_t ColIdx() const MOZ_OVERRIDE;
   virtual uint32_t RowIdx() const MOZ_OVERRIDE;
   virtual void ColHeaderCells(nsTArray<Accessible*>* aHeaderCells) MOZ_OVERRIDE;
   virtual void RowHeaderCells(nsTArray<Accessible*>* aCells) MOZ_OVERRIDE { }
   virtual bool Selected() MOZ_OVERRIDE;