Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 5 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_a11y_Accessible_inl_h_ |
michael@0 | 8 | #define mozilla_a11y_Accessible_inl_h_ |
michael@0 | 9 | |
michael@0 | 10 | #include "Accessible.h" |
michael@0 | 11 | #include "ARIAMap.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace a11y { |
michael@0 | 15 | |
michael@0 | 16 | inline mozilla::a11y::role |
michael@0 | 17 | Accessible::Role() |
michael@0 | 18 | { |
michael@0 | 19 | if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) |
michael@0 | 20 | return ARIATransformRole(NativeRole()); |
michael@0 | 21 | |
michael@0 | 22 | return ARIATransformRole(mRoleMapEntry->role); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | inline bool |
michael@0 | 26 | Accessible::IsARIARole(nsIAtom* aARIARole) const |
michael@0 | 27 | { |
michael@0 | 28 | return mRoleMapEntry && mRoleMapEntry->Is(aARIARole); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | inline mozilla::a11y::role |
michael@0 | 32 | Accessible::ARIARole() |
michael@0 | 33 | { |
michael@0 | 34 | if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) |
michael@0 | 35 | return mozilla::a11y::roles::NOTHING; |
michael@0 | 36 | |
michael@0 | 37 | return ARIATransformRole(mRoleMapEntry->role); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | inline bool |
michael@0 | 41 | Accessible::HasGenericType(AccGenericType aType) const |
michael@0 | 42 | { |
michael@0 | 43 | return (mGenericTypes & aType) || |
michael@0 | 44 | (mRoleMapEntry && mRoleMapEntry->IsOfType(aType)); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | inline bool |
michael@0 | 48 | Accessible::HasNumericValue() const |
michael@0 | 49 | { |
michael@0 | 50 | if (mStateFlags & eHasNumericValue) |
michael@0 | 51 | return true; |
michael@0 | 52 | |
michael@0 | 53 | return mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue; |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | } // namespace a11y |
michael@0 | 57 | } // namespace mozilla |
michael@0 | 58 | |
michael@0 | 59 | #endif |