2012-04-13 18:17:03 +04:00
|
|
|
/* -*- 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_Accessible_inl_h_
|
|
|
|
#define mozilla_a11y_Accessible_inl_h_
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
#include "Accessible.h"
|
2013-04-25 07:48:26 +04:00
|
|
|
#include "ARIAMap.h"
|
2012-04-13 18:17:03 +04:00
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
2012-04-13 18:17:03 +04:00
|
|
|
inline mozilla::a11y::role
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible::Role()
|
2012-04-13 18:17:03 +04:00
|
|
|
{
|
|
|
|
if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
|
|
|
|
return ARIATransformRole(NativeRole());
|
|
|
|
|
|
|
|
return ARIATransformRole(mRoleMapEntry->role);
|
|
|
|
}
|
|
|
|
|
2013-11-13 17:58:12 +04:00
|
|
|
inline bool
|
|
|
|
Accessible::IsARIARole(nsIAtom* aARIARole) const
|
|
|
|
{
|
|
|
|
return mRoleMapEntry && mRoleMapEntry->Is(aARIARole);
|
|
|
|
}
|
|
|
|
|
2014-08-16 00:49:02 +04:00
|
|
|
inline bool
|
|
|
|
Accessible::HasStrongARIARole() const
|
|
|
|
{
|
|
|
|
return mRoleMapEntry && mRoleMapEntry->roleRule == kUseMapRole;
|
|
|
|
}
|
|
|
|
|
2012-04-13 18:17:03 +04:00
|
|
|
inline mozilla::a11y::role
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible::ARIARole()
|
2012-04-13 18:17:03 +04:00
|
|
|
{
|
|
|
|
if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole)
|
|
|
|
return mozilla::a11y::roles::NOTHING;
|
|
|
|
|
|
|
|
return ARIATransformRole(mRoleMapEntry->role);
|
|
|
|
}
|
|
|
|
|
2012-12-21 07:16:44 +04:00
|
|
|
inline bool
|
|
|
|
Accessible::HasGenericType(AccGenericType aType) const
|
2012-11-11 06:16:17 +04:00
|
|
|
{
|
2012-12-21 07:16:44 +04:00
|
|
|
return (mGenericTypes & aType) ||
|
|
|
|
(mRoleMapEntry && mRoleMapEntry->IsOfType(aType));
|
2012-11-11 06:16:17 +04:00
|
|
|
}
|
|
|
|
|
2012-10-04 18:34:56 +04:00
|
|
|
inline bool
|
|
|
|
Accessible::HasNumericValue() const
|
|
|
|
{
|
2012-12-11 07:31:42 +04:00
|
|
|
if (mStateFlags & eHasNumericValue)
|
2012-10-04 18:34:56 +04:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue;
|
|
|
|
}
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-04-13 18:17:03 +04:00
|
|
|
#endif
|