2001-10-10 01:52:36 +04: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/. */
|
2001-10-10 01:52:36 +04:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
#include "XULFormControlAccessible.h"
|
2010-04-27 10:52:03 +04:00
|
|
|
|
2012-04-13 18:17:03 +04:00
|
|
|
#include "Accessible-inl.h"
|
2012-04-12 15:11:40 +04:00
|
|
|
#include "HTMLFormControlAccessible.h"
|
2010-04-27 10:52:03 +04:00
|
|
|
#include "nsAccUtils.h"
|
|
|
|
#include "nsCoreUtils.h"
|
2012-05-27 13:01:40 +04:00
|
|
|
#include "DocAccessible.h"
|
2012-04-12 15:11:40 +04:00
|
|
|
#include "nsIAccessibleRelation.h"
|
2011-08-10 05:44:00 +04:00
|
|
|
#include "Relation.h"
|
2012-01-12 07:07:35 +04:00
|
|
|
#include "Role.h"
|
2011-04-10 03:38:06 +04:00
|
|
|
#include "States.h"
|
2012-11-19 13:20:09 +04:00
|
|
|
#include "TreeWalker.h"
|
2012-06-11 03:44:50 +04:00
|
|
|
#include "XULMenuAccessible.h"
|
2010-04-27 10:52:03 +04:00
|
|
|
|
2006-11-29 19:10:31 +03:00
|
|
|
#include "nsIDOMNSEditableElement.h"
|
2001-10-10 01:52:36 +04:00
|
|
|
#include "nsIDOMXULButtonElement.h"
|
|
|
|
#include "nsIDOMXULCheckboxElement.h"
|
2002-01-11 06:48:02 +03:00
|
|
|
#include "nsIDOMXULMenuListElement.h"
|
2001-11-07 03:12:16 +03:00
|
|
|
#include "nsIDOMXULSelectCntrlItemEl.h"
|
2004-06-02 09:32:45 +04:00
|
|
|
#include "nsIDOMXULTextboxElement.h"
|
2007-08-14 20:25:24 +04:00
|
|
|
#include "nsIEditor.h"
|
2006-07-12 17:14:53 +04:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsITextControlFrame.h"
|
2011-09-28 05:46:11 +04:00
|
|
|
#include "nsMenuPopupFrame.h"
|
2014-02-28 03:04:46 +04:00
|
|
|
#include "nsNameSpaceManager.h"
|
2013-09-11 02:18:59 +04:00
|
|
|
#include "mozilla/dom/Element.h"
|
2001-10-10 01:52:36 +04:00
|
|
|
|
2011-07-27 16:43:01 +04:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULButtonAccessible
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2002-01-09 13:02:29 +03:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-05-29 05:18:45 +04:00
|
|
|
AccessibleWrap(aContent, aDoc)
|
2009-11-10 08:58:52 +03:00
|
|
|
{
|
2014-04-04 12:01:19 +04:00
|
|
|
if (ContainsMenu()) {
|
2012-12-18 09:22:26 +04:00
|
|
|
mGenericTypes |= eMenuButton;
|
2014-04-04 12:01:19 +04:00
|
|
|
} else {
|
|
|
|
mGenericTypes |= eButton;
|
|
|
|
}
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2014-07-09 01:23:18 +04:00
|
|
|
XULButtonAccessible::~XULButtonAccessible()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULButtonAccessible: nsISupports
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
NS_IMPL_ISUPPORTS_INHERITED0(XULButtonAccessible, Accessible)
|
2009-11-10 08:58:52 +03:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULButtonAccessible: nsIAccessible
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::ActionCount()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2011-06-05 23:35:43 +04:00
|
|
|
return 1;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
void
|
|
|
|
XULButtonAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2014-09-16 21:30:23 +04:00
|
|
|
if (aIndex == eAction_Click)
|
|
|
|
aName.AssignLiteral("press");
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
bool
|
2012-08-22 19:56:38 +04:00
|
|
|
XULButtonAccessible::DoAction(uint8_t aIndex)
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2010-01-25 18:09:25 +03:00
|
|
|
if (aIndex != 0)
|
2014-09-16 21:30:23 +04:00
|
|
|
return false;
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2010-01-25 18:09:25 +03:00
|
|
|
DoCommand();
|
2014-09-16 21:30:23 +04:00
|
|
|
return true;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-05-29 05:18:45 +04:00
|
|
|
// XULButtonAccessible: Accessible
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::NativeRole()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::PUSHBUTTON;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::NativeState()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2009-11-10 08:58:52 +03:00
|
|
|
// Possible states: focused, focusable, unavailable(disabled).
|
|
|
|
|
2001-11-07 03:12:16 +03:00
|
|
|
// get focus and disable status from base class
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t state = Accessible::NativeState();
|
2002-01-09 13:02:29 +03:00
|
|
|
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
// Buttons can be checked -- they simply appear pressed in rather than checked
|
2010-06-11 12:23:18 +04:00
|
|
|
nsCOMPtr<nsIDOMXULButtonElement> xulButtonElement(do_QueryInterface(mContent));
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
if (xulButtonElement) {
|
2007-05-06 18:50:03 +04:00
|
|
|
nsAutoString type;
|
|
|
|
xulButtonElement->GetType(type);
|
|
|
|
if (type.EqualsLiteral("checkbox") || type.EqualsLiteral("radio")) {
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::CHECKABLE;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool checked = false;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t checkState = 0;
|
2007-05-06 18:50:03 +04:00
|
|
|
xulButtonElement->GetChecked(&checked);
|
|
|
|
if (checked) {
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::PRESSED;
|
2007-05-06 18:50:03 +04:00
|
|
|
xulButtonElement->GetCheckState(&checkState);
|
|
|
|
if (checkState == nsIDOMXULButtonElement::CHECKSTATE_MIXED) {
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::MIXED;
|
2007-05-06 18:50:03 +04:00
|
|
|
}
|
|
|
|
}
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-10 08:58:52 +03:00
|
|
|
if (ContainsMenu())
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::HASPOPUP;
|
2005-04-02 05:00:20 +04:00
|
|
|
|
2011-06-04 01:35:17 +04:00
|
|
|
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::_default))
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::DEFAULT;
|
2002-03-10 08:14:24 +03:00
|
|
|
|
2011-04-10 03:38:06 +04:00
|
|
|
return state;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2011-09-28 05:46:11 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULButtonAccessible: Widgets
|
2011-09-28 05:46:11 +04:00
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::IsWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::IsActiveWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return FocusMgr()->HasDOMFocus(mContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::AreItemsOperable() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
if (IsMenuButton()) {
|
2012-07-30 18:20:58 +04:00
|
|
|
Accessible* menuPopup = mChildren.SafeElementAt(0, nullptr);
|
2011-09-28 05:46:11 +04:00
|
|
|
if (menuPopup) {
|
|
|
|
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(menuPopup->GetFrame());
|
|
|
|
return menuPopupFrame->IsOpen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false; // no items
|
|
|
|
}
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible*
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible::ContainerWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
if (IsMenuButton() && mParent && mParent->IsAutoComplete())
|
|
|
|
return mParent;
|
2012-07-30 18:20:58 +04:00
|
|
|
return nullptr;
|
2011-09-28 05:46:11 +04:00
|
|
|
}
|
|
|
|
|
2013-09-06 23:27:07 +04:00
|
|
|
bool
|
|
|
|
XULButtonAccessible::IsAcceptableChild(Accessible* aPossibleChild) const
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2009-11-10 08:58:52 +03:00
|
|
|
// In general XUL button has not accessible children. Nevertheless menu
|
|
|
|
// buttons can have button (@type="menu-button") and popup accessibles
|
2013-06-21 04:01:57 +04:00
|
|
|
// (@type="menu-button", @type="menu" or columnpicker.
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2009-12-10 22:12:19 +03:00
|
|
|
// XXX: no children until the button is menu button. Probably it's not
|
|
|
|
// totally correct but in general AT wants to have leaf buttons.
|
2013-09-06 23:27:07 +04:00
|
|
|
roles::Role role = aPossibleChild->Role();
|
2013-06-21 04:01:57 +04:00
|
|
|
|
2013-09-06 23:27:07 +04:00
|
|
|
// Get an accessible for menupopup or panel elements.
|
|
|
|
if (role == roles::MENUPOPUP)
|
|
|
|
return true;
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2013-09-06 23:27:07 +04:00
|
|
|
// Button type="menu-button" contains a real button. Get an accessible
|
|
|
|
// for it. Ignore dropmarker button which is placed as a last child.
|
|
|
|
if (role != roles::PUSHBUTTON ||
|
2015-03-03 14:08:59 +03:00
|
|
|
aPossibleChild->GetContent()->IsXULElement(nsGkAtoms::dropMarker))
|
2013-09-06 23:27:07 +04:00
|
|
|
return false;
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2013-09-06 23:27:07 +04:00
|
|
|
return mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
|
|
|
|
nsGkAtoms::menuButton, eCaseMatters);
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULButtonAccessible protected
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2014-09-16 21:30:23 +04:00
|
|
|
XULButtonAccessible::ContainsMenu() const
|
2009-11-10 08:58:52 +03:00
|
|
|
{
|
|
|
|
static nsIContent::AttrValuesArray strings[] =
|
2012-07-30 18:20:58 +04:00
|
|
|
{&nsGkAtoms::menu, &nsGkAtoms::menuButton, nullptr};
|
2009-11-10 08:58:52 +03:00
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
return mContent->FindAttrValueIn(kNameSpaceID_None,
|
2011-06-04 01:35:17 +04:00
|
|
|
nsGkAtoms::type,
|
2010-06-11 12:23:18 +04:00
|
|
|
strings, eCaseMatters) >= 0;
|
2009-11-10 08:58:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULDropmarkerAccessible
|
2009-11-10 08:58:52 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2002-01-09 13:02:29 +03:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULDropmarkerAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULDropmarkerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-06-04 16:32:29 +04:00
|
|
|
LeafAccessible(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULDropmarkerAccessible::ActionCount()
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2011-06-05 23:35:43 +04:00
|
|
|
return 1;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
bool
|
2014-09-16 21:30:23 +04:00
|
|
|
XULDropmarkerAccessible::DropmarkerOpen(bool aToggleOpen) const
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2011-09-29 10:19:26 +04:00
|
|
|
bool isOpen = false;
|
2002-01-09 13:02:29 +03:00
|
|
|
|
2015-10-13 19:19:41 +03:00
|
|
|
nsIContent* parent = mContent->GetFlattenedTreeParent();
|
|
|
|
|
|
|
|
while (parent) {
|
|
|
|
nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement =
|
|
|
|
do_QueryInterface(parent);
|
|
|
|
if (parentButtonElement) {
|
|
|
|
parentButtonElement->GetOpen(&isOpen);
|
|
|
|
if (aToggleOpen)
|
|
|
|
parentButtonElement->SetOpen(!isOpen);
|
|
|
|
return isOpen;
|
|
|
|
}
|
2002-01-09 13:02:29 +03:00
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
nsCOMPtr<nsIDOMXULMenuListElement> parentMenuListElement =
|
2015-10-13 19:19:41 +03:00
|
|
|
do_QueryInterface(parent);
|
2002-01-11 06:48:02 +03:00
|
|
|
if (parentMenuListElement) {
|
|
|
|
parentMenuListElement->GetOpen(&isOpen);
|
|
|
|
if (aToggleOpen)
|
|
|
|
parentMenuListElement->SetOpen(!isOpen);
|
2015-10-13 19:19:41 +03:00
|
|
|
return isOpen;
|
2002-01-11 06:48:02 +03:00
|
|
|
}
|
2015-10-13 19:19:41 +03:00
|
|
|
parent = parent->GetFlattenedTreeParent();
|
2002-01-11 06:48:02 +03:00
|
|
|
}
|
2002-01-09 13:02:29 +03:00
|
|
|
|
|
|
|
return isOpen;
|
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
void
|
|
|
|
XULDropmarkerAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2014-09-16 21:30:23 +04:00
|
|
|
aName.Truncate();
|
2007-02-25 06:43:20 +03:00
|
|
|
if (aIndex == eAction_Click) {
|
2011-10-17 18:59:28 +04:00
|
|
|
if (DropmarkerOpen(false))
|
2007-02-25 06:43:20 +03:00
|
|
|
aName.AssignLiteral("close");
|
2002-01-09 13:02:29 +03:00
|
|
|
else
|
2007-02-25 06:43:20 +03:00
|
|
|
aName.AssignLiteral("open");
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
bool
|
2012-08-22 19:56:38 +04:00
|
|
|
XULDropmarkerAccessible::DoAction(uint8_t index)
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
|
|
|
if (index == eAction_Click) {
|
2011-10-17 18:59:28 +04:00
|
|
|
DropmarkerOpen(true); // Reverse the open attribute
|
2014-09-16 21:30:23 +04:00
|
|
|
return true;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
2014-09-16 21:30:23 +04:00
|
|
|
return false;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULDropmarkerAccessible::NativeRole()
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::PUSHBUTTON;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULDropmarkerAccessible::NativeState()
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
return DropmarkerOpen(false) ? states::PRESSED : 0;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULCheckboxAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2001-10-10 01:52:36 +04:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULCheckboxAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULCheckboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-06-04 16:32:29 +04:00
|
|
|
LeafAccessible(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULCheckboxAccessible::NativeRole()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::CHECKBUTTON;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULCheckboxAccessible::ActionCount()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2011-06-05 23:35:43 +04:00
|
|
|
return 1;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
void
|
|
|
|
XULCheckboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2007-02-25 06:43:20 +03:00
|
|
|
if (aIndex == eAction_Click) {
|
2011-04-10 03:38:06 +04:00
|
|
|
if (NativeState() & states::CHECKED)
|
2007-02-25 06:43:20 +03:00
|
|
|
aName.AssignLiteral("uncheck");
|
2001-10-10 01:52:36 +04:00
|
|
|
else
|
2007-02-25 06:43:20 +03:00
|
|
|
aName.AssignLiteral("check");
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-16 21:30:23 +04:00
|
|
|
bool
|
2012-08-22 19:56:38 +04:00
|
|
|
XULCheckboxAccessible::DoAction(uint8_t aIndex)
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2010-01-25 18:09:25 +03:00
|
|
|
if (aIndex != eAction_Click)
|
2014-09-16 21:30:23 +04:00
|
|
|
return false;
|
2010-01-25 18:09:25 +03:00
|
|
|
|
|
|
|
DoCommand();
|
2014-09-16 21:30:23 +04:00
|
|
|
return true;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULCheckboxAccessible::NativeState()
|
2001-10-10 01:52:36 +04:00
|
|
|
{
|
2011-04-10 03:38:06 +04:00
|
|
|
// Possible states: focused, focusable, unavailable(disabled), checked
|
2001-11-07 03:12:16 +03:00
|
|
|
// Get focus and disable status from base class
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t state = LeafAccessible::NativeState();
|
2007-05-06 18:50:03 +04:00
|
|
|
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::CHECKABLE;
|
2007-05-06 18:50:03 +04:00
|
|
|
|
2001-10-10 01:52:36 +04:00
|
|
|
// Determine Checked state
|
2010-06-11 12:23:18 +04:00
|
|
|
nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement =
|
|
|
|
do_QueryInterface(mContent);
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
if (xulCheckboxElement) {
|
2011-09-29 10:19:26 +04:00
|
|
|
bool checked = false;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
xulCheckboxElement->GetChecked(&checked);
|
|
|
|
if (checked) {
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::CHECKED;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t checkState = 0;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
xulCheckboxElement->GetCheckState(&checkState);
|
2007-04-02 19:56:24 +04:00
|
|
|
if (checkState == nsIDOMXULCheckboxElement::CHECKSTATE_MIXED)
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::MIXED;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
}
|
2007-04-02 19:56:24 +04:00
|
|
|
|
2011-04-10 03:38:06 +04:00
|
|
|
return state;
|
2001-10-10 01:52:36 +04:00
|
|
|
}
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULGroupboxAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULGroupboxAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULGroupboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-05-29 05:18:45 +04:00
|
|
|
AccessibleWrap(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULGroupboxAccessible::NativeRole()
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::GROUPING;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
|
2012-10-14 08:18:39 +04:00
|
|
|
ENameValueFlag
|
|
|
|
XULGroupboxAccessible::NativeName(nsString& aName)
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
{
|
2009-02-10 13:03:30 +03:00
|
|
|
// XXX: we use the first related accessible only.
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible* label =
|
2013-10-19 22:19:50 +04:00
|
|
|
RelationByType(RelationType::LABELLED_BY).Next();
|
2011-08-10 05:44:00 +04:00
|
|
|
if (label)
|
2012-10-14 08:18:39 +04:00
|
|
|
return label->Name(aName);
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
|
2012-10-14 08:18:39 +04:00
|
|
|
return eNameOK;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
|
2011-08-10 05:44:00 +04:00
|
|
|
Relation
|
2013-10-19 22:19:50 +04:00
|
|
|
XULGroupboxAccessible::RelationByType(RelationType aType)
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
{
|
2012-05-29 05:18:45 +04:00
|
|
|
Relation rel = AccessibleWrap::RelationByType(aType);
|
2013-10-19 22:19:50 +04:00
|
|
|
if (aType != RelationType::LABELLED_BY)
|
2011-08-10 05:44:00 +04:00
|
|
|
return rel;
|
|
|
|
|
|
|
|
// The label for xul:groupbox is generated from xul:label that is
|
|
|
|
// inside the anonymous content of the xul:caption.
|
|
|
|
// The xul:label has an accessible object but the xul:caption does not
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t childCount = ChildCount();
|
|
|
|
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible* childAcc = GetChildAt(childIdx);
|
2012-01-12 07:07:35 +04:00
|
|
|
if (childAcc->Role() == roles::LABEL) {
|
2011-08-10 05:44:00 +04:00
|
|
|
// Ensure that it's our label
|
2013-10-19 22:19:50 +04:00
|
|
|
Relation reverseRel = childAcc->RelationByType(RelationType::LABEL_FOR);
|
2012-07-30 18:20:58 +04:00
|
|
|
Accessible* testGroupbox = nullptr;
|
2011-08-10 05:44:00 +04:00
|
|
|
while ((testGroupbox = reverseRel.Next()))
|
|
|
|
if (testGroupbox == this) {
|
2007-07-01 00:06:13 +04:00
|
|
|
// The <label> points back to this groupbox
|
2011-08-10 05:44:00 +04:00
|
|
|
rel.AppendTarget(childAcc);
|
2007-07-01 00:06:13 +04:00
|
|
|
}
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
}
|
2007-07-01 00:06:13 +04:00
|
|
|
|
2011-08-10 05:44:00 +04:00
|
|
|
return rel;
|
Bug 109851, bug 108629, bug 109921, bug 109977, bug 109153, bug 109187, bug 109213, bug 109221. Check in latest XUL accessibility support - menus, <colorpicker>, <progressmeter>, <groupbox>, mixed states for checkboxes, buttons that can be 'checked' ie pressed down, fixes extra MSAA events being generated, couldn't see HTML content
2001-11-20 05:05:26 +03:00
|
|
|
}
|
|
|
|
|
2010-01-06 13:36:50 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULRadioButtonAccessible
|
2010-01-06 13:36:50 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2001-12-11 23:49:49 +03:00
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioButtonAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULRadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-04-12 15:11:40 +04:00
|
|
|
RadioButtonAccessible(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2001-12-11 23:49:49 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioButtonAccessible::NativeState()
|
2001-12-11 23:49:49 +03:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t state = LeafAccessible::NativeState();
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::CHECKABLE;
|
2011-09-28 05:46:11 +04:00
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
nsCOMPtr<nsIDOMXULSelectControlItemElement> radioButton =
|
|
|
|
do_QueryInterface(mContent);
|
2004-07-02 00:43:03 +04:00
|
|
|
if (radioButton) {
|
2011-09-29 10:19:26 +04:00
|
|
|
bool selected = false; // Radio buttons can be selected
|
2001-12-11 23:49:49 +03:00
|
|
|
radioButton->GetSelected(&selected);
|
2004-07-02 00:43:03 +04:00
|
|
|
if (selected) {
|
2011-04-10 03:38:06 +04:00
|
|
|
state |= states::CHECKED;
|
2002-06-21 08:54:34 +04:00
|
|
|
}
|
|
|
|
}
|
2001-12-11 23:49:49 +03:00
|
|
|
|
2011-04-10 03:38:06 +04:00
|
|
|
return state;
|
2001-12-11 23:49:49 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-06-04 09:41:06 +04:00
|
|
|
XULRadioButtonAccessible::NativeInteractiveState() const
|
|
|
|
{
|
|
|
|
return NativelyUnavailable() ? states::UNAVAILABLE : states::FOCUSABLE;
|
|
|
|
}
|
|
|
|
|
2011-09-28 05:46:11 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULRadioButtonAccessible: Widgets
|
2011-09-28 05:46:11 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible*
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioButtonAccessible::ContainerWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2007-03-27 16:17:11 +04:00
|
|
|
|
2010-01-06 13:36:50 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULRadioGroupAccessible
|
2010-01-06 13:36:50 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2007-03-27 16:17:11 +04:00
|
|
|
|
2001-12-11 23:49:49 +03:00
|
|
|
/**
|
|
|
|
* XUL Radio Group
|
|
|
|
* The Radio Group proxies for the Radio Buttons themselves. The Group gets
|
|
|
|
* focus whereas the Buttons do not. So we only have an accessible object for
|
|
|
|
* this for the purpose of getting the proper RadioButton. Need this here to
|
|
|
|
* avoid circular reference problems when navigating the accessible tree and
|
|
|
|
* for getting to the radiobuttons.
|
|
|
|
*/
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioGroupAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-02-08 02:38:54 +04:00
|
|
|
XULSelectControlAccessible(aContent, aDoc)
|
2001-12-11 23:49:49 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioGroupAccessible::NativeRole()
|
2002-06-21 08:54:34 +04:00
|
|
|
{
|
2015-03-30 16:37:09 +03:00
|
|
|
return roles::RADIO_GROUP;
|
2002-06-21 08:54:34 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-06-04 09:41:06 +04:00
|
|
|
XULRadioGroupAccessible::NativeInteractiveState() const
|
2002-06-21 08:54:34 +04:00
|
|
|
{
|
2008-11-27 07:04:05 +03:00
|
|
|
// The radio group is not focusable. Sometimes the focus controller will
|
|
|
|
// report that it is focused. That means that the actual selected radio button
|
|
|
|
// should be considered focused.
|
2012-06-04 09:41:06 +04:00
|
|
|
return NativelyUnavailable() ? states::UNAVAILABLE : 0;
|
2002-06-21 08:54:34 +04:00
|
|
|
}
|
2002-01-09 13:02:29 +03:00
|
|
|
|
2011-09-28 05:46:11 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULRadioGroupAccessible: Widgets
|
2011-09-28 05:46:11 +04:00
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioGroupAccessible::IsWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioGroupAccessible::IsActiveWidget() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return FocusMgr()->HasDOMFocus(mContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-04-12 15:11:40 +04:00
|
|
|
XULRadioGroupAccessible::AreItemsOperable() const
|
2011-09-28 05:46:11 +04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULStatusBarAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULStatusBarAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULStatusBarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-05-29 05:18:45 +04:00
|
|
|
AccessibleWrap(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULStatusBarAccessible::NativeRole()
|
2002-01-09 13:02:29 +03:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::STATUSBAR;
|
2002-01-09 13:02:29 +03:00
|
|
|
}
|
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULToolbarButtonAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarButtonAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULToolbarButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-04-12 15:11:40 +04:00
|
|
|
XULButtonAccessible(aContent, aDoc)
|
2007-07-11 11:58:50 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-01-06 13:36:50 +03:00
|
|
|
void
|
2012-08-22 19:56:38 +04:00
|
|
|
XULToolbarButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet,
|
|
|
|
int32_t* aSetSize)
|
2007-07-11 11:58:50 +04:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t setSize = 0;
|
|
|
|
int32_t posInSet = 0;
|
2007-07-11 11:58:50 +04:00
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible* parent = Parent();
|
2011-07-23 12:38:33 +04:00
|
|
|
if (!parent)
|
|
|
|
return;
|
2010-01-11 17:14:06 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t childCount = parent->ChildCount();
|
|
|
|
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible* child = parent->GetChildAt(childIdx);
|
2010-01-11 17:14:06 +03:00
|
|
|
if (IsSeparator(child)) { // end of a group of buttons
|
|
|
|
if (posInSet)
|
|
|
|
break; // we've found our group, so we're done
|
|
|
|
|
|
|
|
setSize = 0; // not our group, so start a new group
|
|
|
|
|
|
|
|
} else {
|
|
|
|
setSize++; // another button in the group
|
|
|
|
|
|
|
|
if (child == this)
|
|
|
|
posInSet = setSize; // we've found our button
|
2007-07-11 11:58:50 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-06 13:36:50 +03:00
|
|
|
*aPosInSet = posInSet;
|
|
|
|
*aSetSize = setSize;
|
2007-07-11 11:58:50 +04:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2012-05-29 05:18:45 +04:00
|
|
|
XULToolbarButtonAccessible::IsSeparator(Accessible* aAccessible)
|
2007-07-11 11:58:50 +04:00
|
|
|
{
|
2012-02-07 17:18:33 +04:00
|
|
|
nsIContent* content = aAccessible->GetContent();
|
2015-03-03 14:08:59 +03:00
|
|
|
return content && content->IsAnyOfXULElements(nsGkAtoms::toolbarseparator,
|
|
|
|
nsGkAtoms::toolbarspacer,
|
|
|
|
nsGkAtoms::toolbarspring);
|
|
|
|
}
|
2007-07-11 11:58:50 +04:00
|
|
|
|
2002-11-06 04:29:58 +03:00
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULToolbarAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULToolbarAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-05-29 05:18:45 +04:00
|
|
|
AccessibleWrap(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2002-11-06 04:29:58 +03:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarAccessible::NativeRole()
|
2002-11-06 04:29:58 +03:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::TOOLBAR;
|
2002-11-06 04:29:58 +03:00
|
|
|
}
|
|
|
|
|
2012-10-14 08:18:39 +04:00
|
|
|
ENameValueFlag
|
|
|
|
XULToolbarAccessible::NativeName(nsString& aName)
|
2010-05-12 11:29:51 +04:00
|
|
|
{
|
2012-10-14 08:18:39 +04:00
|
|
|
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::toolbarname, aName))
|
|
|
|
aName.CompressWhitespace();
|
2010-05-12 11:29:51 +04:00
|
|
|
|
2012-10-14 08:18:39 +04:00
|
|
|
return eNameOK;
|
2010-05-12 11:29:51 +04:00
|
|
|
}
|
|
|
|
|
2002-11-06 04:29:58 +03:00
|
|
|
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-04-12 15:11:40 +04:00
|
|
|
// XULToolbarAccessible
|
2010-06-11 12:23:18 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarSeparatorAccessible::
|
2012-05-27 13:01:40 +04:00
|
|
|
XULToolbarSeparatorAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-06-04 16:32:29 +04:00
|
|
|
LeafAccessible(aContent, aDoc)
|
2010-06-11 12:23:18 +04:00
|
|
|
{
|
2002-11-06 04:29:58 +03:00
|
|
|
}
|
|
|
|
|
2012-01-12 07:07:35 +04:00
|
|
|
role
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarSeparatorAccessible::NativeRole()
|
2002-11-06 04:29:58 +03:00
|
|
|
{
|
2012-01-12 07:07:35 +04:00
|
|
|
return roles::SEPARATOR;
|
2002-11-06 04:29:58 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint64_t
|
2012-04-12 15:11:40 +04:00
|
|
|
XULToolbarSeparatorAccessible::NativeState()
|
2002-11-06 04:29:58 +03:00
|
|
|
{
|
2011-04-12 10:18:42 +04:00
|
|
|
return 0;
|
2002-11-06 04:29:58 +03:00
|
|
|
}
|