Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / accessible / xul / XULAlertAccessible.cpp
blob64c1fe7aa02d08e8c3b387c72b186a4fdcc9deaf
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"
10 #include "States.h"
12 using namespace mozilla::a11y;
14 ////////////////////////////////////////////////////////////////////////////////
15 // XULAlertAccessible
16 ////////////////////////////////////////////////////////////////////////////////
18 XULAlertAccessible::XULAlertAccessible(nsIContent* aContent,
19 DocAccessible* aDoc)
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.
35 aName.Truncate();
36 return eNameOK;
39 ////////////////////////////////////////////////////////////////////////////////
40 // Widgets
42 bool XULAlertAccessible::IsWidget() const { return true; }
44 LocalAccessible* XULAlertAccessible::ContainerWidget() const { return nullptr; }