1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "XULAlertAccessible.h"
8 #include "LocalAccessible-inl.h"
9 #include "mozilla/a11y/Role.h"
12 using namespace mozilla::a11y
;
14 ////////////////////////////////////////////////////////////////////////////////
16 ////////////////////////////////////////////////////////////////////////////////
18 XULAlertAccessible::XULAlertAccessible(nsIContent
* aContent
,
20 : AccessibleWrap(aContent
, aDoc
) {
21 mGenericTypes
|= eAlert
;
24 XULAlertAccessible::~XULAlertAccessible() {}
26 role
XULAlertAccessible::NativeRole() const { return roles::ALERT
; }
28 uint64_t XULAlertAccessible::NativeState() const {
29 return LocalAccessible::NativeState() | states::ALERT
;
32 ENameValueFlag
XULAlertAccessible::Name(nsString
& aName
) const {
33 // Screen readers need to read contents of alert, not the accessible name.
34 // If we have both some screen readers will read the alert twice.
39 ////////////////////////////////////////////////////////////////////////////////
42 bool XULAlertAccessible::IsWidget() const { return true; }
44 LocalAccessible
* XULAlertAccessible::ContainerWidget() const { return nullptr; }