2005-03-15 18:44:02 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2005-03-15 18:44:02 +03:00
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
#include "XULAlertAccessible.h"
|
2005-03-15 18:44:02 +03:00
|
|
|
|
2012-12-21 07:16:44 +04:00
|
|
|
#include "Accessible-inl.h"
|
2012-01-12 07:07:35 +04:00
|
|
|
#include "Role.h"
|
2011-04-10 03:38:06 +04:00
|
|
|
#include "States.h"
|
2005-03-15 18:44:02 +03:00
|
|
|
|
2011-07-27 16:43:01 +04:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-11 03:44:50 +04:00
|
|
|
// XULAlertAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2005-03-15 18:44:02 +03:00
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
XULAlertAccessible::XULAlertAccessible(nsIContent* aContent,
|
|
|
|
DocAccessible* aDoc)
|
2012-05-29 05:18:45 +04:00
|
|
|
: AccessibleWrap(aContent, aDoc) {
|
2016-02-29 18:08:40 +03:00
|
|
|
mGenericTypes |= eAlert;
|
2005-03-15 18:44:02 +03:00
|
|
|
}
|
|
|
|
|
2014-07-09 01:23:18 +04:00
|
|
|
XULAlertAccessible::~XULAlertAccessible() {}
|
|
|
|
|
2018-05-07 22:05:50 +03:00
|
|
|
role XULAlertAccessible::NativeRole() const { return roles::ALERT; }
|
2005-03-15 18:44:02 +03:00
|
|
|
|
2018-05-15 21:04:50 +03:00
|
|
|
uint64_t XULAlertAccessible::NativeState() const {
|
2012-05-29 05:18:45 +04:00
|
|
|
return Accessible::NativeState() | states::ALERT;
|
2005-03-15 18:44:02 +03:00
|
|
|
}
|
|
|
|
|
2018-05-15 19:13:02 +03:00
|
|
|
ENameValueFlag XULAlertAccessible::Name(nsString& aName) const {
|
2008-01-24 02:49:10 +03:00
|
|
|
// Screen readers need to read contents of alert, not the accessible name.
|
|
|
|
// If we have both some screen readers will read the alert twice.
|
|
|
|
aName.Truncate();
|
2012-05-01 07:08:31 +04:00
|
|
|
return eNameOK;
|
2008-01-24 02:49:10 +03:00
|
|
|
}
|
2011-09-28 05:46:11 +04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Widgets
|
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
bool XULAlertAccessible::IsWidget() const { return true; }
|
2011-09-28 05:46:11 +04:00
|
|
|
|
2012-06-11 03:44:50 +04:00
|
|
|
Accessible* XULAlertAccessible::ContainerWidget() const { return nullptr; }
|