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 02:05:26 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
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 02:05:26 +00:00
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
#include "XULColorPickerAccessible.h"
|
2009-11-10 05:58:52 +00:00
|
|
|
|
2012-04-13 14:17:03 +00:00
|
|
|
#include "Accessible-inl.h"
|
2010-04-27 06:52:03 +00:00
|
|
|
#include "nsAccUtils.h"
|
|
|
|
#include "nsCoreUtils.h"
|
2012-05-27 09:01:40 +00:00
|
|
|
#include "DocAccessible.h"
|
2012-01-12 03:07:35 +00:00
|
|
|
#include "Role.h"
|
|
|
|
#include "States.h"
|
2009-11-10 05:58:52 +00: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 02:05:26 +00:00
|
|
|
#include "nsIDOMElement.h"
|
2011-09-28 01:46:11 +00:00
|
|
|
#include "nsMenuPopupFrame.h"
|
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 02:05:26 +00:00
|
|
|
|
2011-07-27 12:43:01 +00:00
|
|
|
using namespace mozilla::a11y;
|
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 02:05:26 +00:00
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerTileAccessible
|
2009-11-10 05:58:52 +00: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 02:05:26 +00:00
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::
|
|
|
|
XULColorPickerTileAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-05-29 01:18:45 +00:00
|
|
|
AccessibleWrap(aContent, aDoc)
|
2009-11-10 05:58:52 +00: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 02:05:26 +00:00
|
|
|
}
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2014-10-22 00:49:28 +00:00
|
|
|
// XULColorPickerTileAccessible: Accessible
|
2009-11-10 05:58:52 +00:00
|
|
|
|
2012-04-09 09:48:41 +00:00
|
|
|
void
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::Value(nsString& aValue)
|
2009-11-10 05:58:52 +00:00
|
|
|
{
|
|
|
|
aValue.Truncate();
|
|
|
|
|
2011-06-03 21:35:17 +00:00
|
|
|
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::color, aValue);
|
2009-11-10 05:58:52 +00:00
|
|
|
}
|
|
|
|
|
2012-01-12 03:07:35 +00:00
|
|
|
role
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::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 02:05:26 +00:00
|
|
|
{
|
2012-01-12 03:07:35 +00:00
|
|
|
return roles::PUSHBUTTON;
|
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 02:05:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::NativeState()
|
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 02:05:26 +00:00
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t state = AccessibleWrap::NativeState();
|
2011-09-28 01:46:11 +00:00
|
|
|
if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::selected))
|
|
|
|
state |= states::SELECTED;
|
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 02:05:26 +00:00
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
return state;
|
|
|
|
}
|
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 02:05:26 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::NativeInteractiveState() const
|
2012-06-04 05:41:06 +00:00
|
|
|
{
|
|
|
|
return NativelyUnavailable() ?
|
|
|
|
states::UNAVAILABLE : states::FOCUSABLE | states::SELECTABLE;
|
|
|
|
}
|
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerTileAccessible: Widgets
|
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 02:05:26 +00:00
|
|
|
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible*
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerTileAccessible::ContainerWidget() const
|
2011-09-28 01:46:11 +00:00
|
|
|
{
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible* parent = Parent();
|
2011-09-28 01:46:11 +00:00
|
|
|
if (parent) {
|
2012-05-29 01:18:45 +00:00
|
|
|
Accessible* grandParent = parent->Parent();
|
2011-09-28 01:46:11 +00:00
|
|
|
if (grandParent && grandParent->IsMenuButton())
|
|
|
|
return grandParent;
|
|
|
|
}
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
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 02:05:26 +00:00
|
|
|
}
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerAccessible
|
2009-11-10 05:58:52 +00: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 02:05:26 +00:00
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::
|
|
|
|
XULColorPickerAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
|
|
|
XULColorPickerTileAccessible(aContent, aDoc)
|
2010-06-11 08:23:18 +00:00
|
|
|
{
|
2012-12-18 05:22:26 +00:00
|
|
|
mGenericTypes |= eMenuButton;
|
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 02:05:26 +00:00
|
|
|
}
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerAccessible: Accessible
|
2009-11-10 05:58:52 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::NativeState()
|
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 02:05:26 +00:00
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t state = AccessibleWrap::NativeState();
|
2012-06-04 05:41:06 +00:00
|
|
|
return state | states::HASPOPUP;
|
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 02:05:26 +00:00
|
|
|
}
|
|
|
|
|
2012-01-12 03:07:35 +00:00
|
|
|
role
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::NativeRole()
|
2002-06-25 22:54:23 +00:00
|
|
|
{
|
2012-01-12 03:07:35 +00:00
|
|
|
return roles::BUTTONDROPDOWNGRID;
|
2002-06-25 22:54:23 +00:00
|
|
|
}
|
|
|
|
|
2011-09-28 01:46:11 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerAccessible: Widgets
|
2011-09-28 01:46:11 +00:00
|
|
|
|
|
|
|
bool
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::IsWidget() const
|
2011-09-28 01:46:11 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::IsActiveWidget() const
|
2011-09-28 01:46:11 +00:00
|
|
|
{
|
|
|
|
return FocusMgr()->HasDOMFocus(mContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2012-06-10 23:44:50 +00:00
|
|
|
XULColorPickerAccessible::AreItemsOperable() const
|
2011-09-28 01:46:11 +00:00
|
|
|
{
|
2012-07-30 14:20:58 +00:00
|
|
|
Accessible* menuPopup = mChildren.SafeElementAt(0, nullptr);
|
2011-09-28 01:46:11 +00:00
|
|
|
if (menuPopup) {
|
|
|
|
nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(menuPopup->GetFrame());
|
|
|
|
return menuPopupFrame && menuPopupFrame->IsOpen();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-11-10 05:58:52 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2012-06-10 23:44:50 +00:00
|
|
|
// XULColorPickerAccessible: protected Accessible
|
2009-11-10 05:58:52 +00:00
|
|
|
|
2013-09-06 19:27:07 +00:00
|
|
|
bool
|
|
|
|
XULColorPickerAccessible::IsAcceptableChild(Accessible* aPossibleChild) const
|
2009-11-10 05:58:52 +00:00
|
|
|
{
|
2013-09-06 19:27:07 +00:00
|
|
|
return roles::ALERT == aPossibleChild->Role();
|
2009-11-10 05:58:52 +00:00
|
|
|
}
|