diff --git a/accessible/src/base/nsAccUtils.cpp b/accessible/src/base/nsAccUtils.cpp index ba1b1b33e14..e45ed6015cb 100644 --- a/accessible/src/base/nsAccUtils.cpp +++ b/accessible/src/base/nsAccUtils.cpp @@ -239,7 +239,7 @@ nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState) Accessible* parent = aAccessible; while ((parent = parent->Parent()) && !parent->IsSelect()) { - if (Role(parent) == nsIAccessibleRole::ROLE_PANE) + if (parent->Role() == roles::PANE) return nullptr; } return parent; diff --git a/accessible/src/base/nsAccUtils.h b/accessible/src/base/nsAccUtils.h index 1038efaabdb..9601b04ed41 100644 --- a/accessible/src/base/nsAccUtils.h +++ b/accessible/src/base/nsAccUtils.h @@ -6,8 +6,7 @@ #ifndef nsAccUtils_h_ #define nsAccUtils_h_ -#include "nsIAccessible.h" -#include "nsIAccessibleRole.h" +#include "mozilla/a11y/Accessible.h" #include "nsIAccessibleText.h" #include "nsAccessibilityService.h" @@ -192,18 +191,6 @@ public: */ static nsIntPoint GetScreenCoordsForParent(Accessible* aAccessible); - /** - * Return the role of the given accessible. - */ - static uint32_t Role(nsIAccessible *aAcc) - { - uint32_t role = nsIAccessibleRole::ROLE_NOTHING; - if (aAcc) - aAcc->GetRole(&role); - - return role; - } - /** * Get the ARIA attribute characteristics for a given ARIA attribute. * @@ -240,12 +227,12 @@ public: /** * Return true if the given accessible is embedded object. */ - static bool IsEmbeddedObject(nsIAccessible *aAcc) + static bool IsEmbeddedObject(Accessible* aAcc) { - uint32_t role = Role(aAcc); - return role != nsIAccessibleRole::ROLE_TEXT_LEAF && - role != nsIAccessibleRole::ROLE_WHITESPACE && - role != nsIAccessibleRole::ROLE_STATICTEXT; + uint32_t role = aAcc->Role(); + return role != roles::TEXT_LEAF && + role != roles::WHITESPACE && + role != roles::STATICTEXT; } /** diff --git a/accessible/src/generic/Accessible.cpp b/accessible/src/generic/Accessible.cpp index 37d5b949c84..4534f44316c 100644 --- a/accessible/src/generic/Accessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -14,6 +14,7 @@ #include "nsAccessibleRelation.h" #include "nsAccessibilityService.h" #include "nsIAccessibleRelation.h" +#include "nsIAccessibleRole.h" #include "nsEventShell.h" #include "nsTextEquivUtils.h" #include "Relation.h"