Bug 561094 - export nsAccessible.h, r=davidb

--HG--
rename : accessible/src/base/nsCoreUtils.h => accessible/src/base/a11yGeneric.h
This commit is contained in:
Alexander Surkov 2010-04-27 15:52:03 +09:00
parent e732815453
commit e89e38045d
59 changed files with 513 additions and 360 deletions

View File

@ -40,6 +40,8 @@
* ***** END LICENSE BLOCK ***** */
#include "nsAccessibleWrap.h"
#include "nsAccUtils.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsRootAccessible.h"
#include "nsDocAccessibleWrap.h"
@ -48,6 +50,7 @@
#include "nsAutoPtr.h"
#include "prprf.h"
#include "nsRoleMap.h"
#include "nsRelUtils.h"
#include "nsStateMap.h"
#include "nsMaiInterfaceComponent.h"
@ -1155,7 +1158,7 @@ nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent)
if (rootAccWrap && rootAccWrap->mActivated) {
atk_focus_tracker_notify(atkObj);
// Fire state change event for focus
nsCOMPtr<nsIAccessibleEvent> stateChangeEvent =
nsRefPtr<nsAccEvent> stateChangeEvent =
new nsAccStateChangeEvent(accessible,
nsIAccessibleStates::STATE_FOCUSED,
PR_FALSE, PR_TRUE);
@ -1383,7 +1386,7 @@ nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent)
}
nsresult
nsAccessibleWrap::FireAtkStateChangeEvent(nsIAccessibleEvent *aEvent,
nsAccessibleWrap::FireAtkStateChangeEvent(nsAccEvent *aEvent,
AtkObject *aObject)
{
MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n"));
@ -1425,7 +1428,7 @@ nsAccessibleWrap::FireAtkStateChangeEvent(nsIAccessibleEvent *aEvent,
}
nsresult
nsAccessibleWrap::FireAtkTextChangedEvent(nsIAccessibleEvent *aEvent,
nsAccessibleWrap::FireAtkTextChangedEvent(nsAccEvent *aEvent,
AtkObject *aObject)
{
MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_REMOVED/INSERTED\n"));
@ -1443,8 +1446,7 @@ nsAccessibleWrap::FireAtkTextChangedEvent(nsIAccessibleEvent *aEvent,
PRBool isInserted;
event->IsInserted(&isInserted);
PRBool isFromUserInput;
aEvent->GetIsFromUserInput(&isFromUserInput);
PRBool isFromUserInput = aEvent->IsFromUserInput();
char *signal_name = g_strconcat(isInserted ? "text_changed::insert" : "text_changed::delete",
isFromUserInput ? "" : kNonUserInputEvent, NULL);
@ -1455,7 +1457,7 @@ nsAccessibleWrap::FireAtkTextChangedEvent(nsIAccessibleEvent *aEvent,
}
nsresult
nsAccessibleWrap::FireAtkShowHideEvent(nsIAccessibleEvent *aEvent,
nsAccessibleWrap::FireAtkShowHideEvent(nsAccEvent *aEvent,
AtkObject *aObject, PRBool aIsAdded)
{
if (aIsAdded)
@ -1467,8 +1469,7 @@ nsAccessibleWrap::FireAtkShowHideEvent(nsIAccessibleEvent *aEvent,
AtkObject *parentObject = getParentCB(aObject);
NS_ENSURE_STATE(parentObject);
PRBool isFromUserInput;
aEvent->GetIsFromUserInput(&isFromUserInput);
PRBool isFromUserInput = aEvent->IsFromUserInput();
char *signal_name = g_strconcat(aIsAdded ? "children_changed::add" : "children_changed::remove",
isFromUserInput ? "" : kNonUserInputEvent, NULL);
g_signal_emit_by_name(parentObject, signal_name, indexInParent, aObject, NULL);

View File

@ -120,14 +120,10 @@ public:
protected:
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent);
nsresult FireAtkStateChangeEvent(nsIAccessibleEvent *aEvent,
AtkObject *aObject);
nsresult FireAtkTextChangedEvent(nsIAccessibleEvent *aEvent,
AtkObject *aObject);
nsresult FireAtkPropChangedEvent(nsIAccessibleEvent *aEvent,
AtkObject *aObject);
nsresult FireAtkShowHideEvent(nsIAccessibleEvent *aEvent,
AtkObject *aObject, PRBool aIsAdded);
nsresult FireAtkStateChangeEvent(nsAccEvent *aEvent, AtkObject *aObject);
nsresult FireAtkTextChangedEvent(nsAccEvent *aEvent, AtkObject *aObject);
nsresult FireAtkShowHideEvent(nsAccEvent *aEvent, AtkObject *aObject,
PRBool aIsAdded);
AtkObject *mAtkObject;

View File

@ -40,9 +40,12 @@
#include "nsMaiInterfaceAction.h"
#include "nsAccUtils.h"
#include "nsRoleMap.h"
#include "nsString.h"
#include "nsIDOMDOMStringList.h"
void
actionInterfaceInitCB(AtkActionIface *aIface)
{

View File

@ -39,7 +39,11 @@
* ***** END LICENSE BLOCK ***** */
#include "nsMaiInterfaceComponent.h"
#include "nsAccessibleWrap.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"

View File

@ -40,6 +40,8 @@
#include "nsMaiInterfaceTable.h"
#include "nsAccUtils.h"
#include "nsArrayUtils.h"
void

View File

@ -74,7 +74,8 @@ CPPSRCS = \
$(NULL)
EXPORTS = \
nsRootAccessible.h \
a11yGeneric.h \
nsAccessible.h \
nsAccessNode.h \
$(NULL)

View File

@ -0,0 +1,198 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _a11yGeneric_H_
#define _a11yGeneric_H_
#include "nsThreadUtils.h"
// What we want is: NS_INTERFACE_MAP_ENTRY(self) for static IID accessors,
// but some of our classes have an ambiguous base class of nsISupports which
// prevents this from working (the default macro converts it to nsISupports,
// then addrefs it, then returns it). Therefore, we expand the macro here and
// change it so that it works. Yuck.
#define NS_INTERFACE_MAP_STATIC_AMBIGUOUS(_class) \
if (aIID.Equals(NS_GET_IID(_class))) { \
NS_ADDREF(this); \
*aInstancePtr = this; \
return NS_OK; \
} else
#define NS_OK_DEFUNCT_OBJECT \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x22)
#define NS_ENSURE_A11Y_SUCCESS(res, ret) \
PR_BEGIN_MACRO \
nsresult __rv = res; /* Don't evaluate |res| more than once */ \
if (NS_FAILED(__rv)) { \
NS_ENSURE_SUCCESS_BODY(res, ret) \
return ret; \
} \
if (__rv == NS_OK_DEFUNCT_OBJECT) \
return ret; \
PR_END_MACRO
////////////////////////////////////////////////////////////////////////////////
// nsRunnable helpers
////////////////////////////////////////////////////////////////////////////////
/**
* Use NS_DECL_RUNNABLEMETHOD_ macros to declare a runnable class for the given
* method of the given class. There are three macros:
* NS_DECL_RUNNABLEMETHOD(Class, Method)
* NS_DECL_RUNNABLEMETHOD_ARG1(Class, Method, Arg1Type)
* NS_DECL_RUNNABLEMETHOD_ARG2(Class, Method, Arg1Type, Arg2Type)
* Note Arg1Type and Arg2Type must be types which keeps the objects alive.
*
* Use NS_DISPATCH_RUNNABLEMETHOD_ macros to create an instance of declared
* runnable class and dispatch it to main thread. Availabe macros are:
* NS_DISPATCH_RUNNABLEMETHOD(Method, Object)
* NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Object, Arg1)
* NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Object, Arg1, Arg2)
*/
#define NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
void Revoke() \
{ \
NS_IF_RELEASE(mObj); \
} \
\
protected: \
virtual ~nsRunnableMethod_##Method() \
{ \
NS_IF_RELEASE(mObj); \
} \
\
private: \
ClassType *mObj; \
#define NS_DECL_RUNNABLEMETHOD(ClassType, Method) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj) : mObj(aObj) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
\
};
#define NS_DECL_RUNNABLEMETHOD_ARG1(ClassType, Method, Arg1Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj, Arg1Type aArg1) : \
mObj(aObj), mArg1(aArg1) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(mArg1); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
Arg1Type mArg1; \
};
#define NS_DECL_RUNNABLEMETHOD_ARG2(ClassType, Method, Arg1Type, Arg2Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
\
nsRunnableMethod_##Method(ClassType *aObj, \
Arg1Type aArg1, Arg2Type aArg2) : \
mObj(aObj), mArg1(aArg1), mArg2(aArg2) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(mArg1, mArg2); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
Arg1Type mArg1; \
Arg2Type mArg2; \
};
#define NS_DISPATCH_RUNNABLEMETHOD(Method, Obj) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Obj, Arg1) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj, Arg1); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Obj, Arg1, Arg2) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj, Arg1, Arg2); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#endif

View File

@ -38,6 +38,9 @@
#include "nsARIAGridAccessible.h"
#include "nsAccUtils.h"
#include "nsIMutableArray.h"
#include "nsComponentManagerUtils.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -42,15 +42,11 @@
#include "nsRefPtrHashtable.h"
#include "nsCycleCollectionParticipant.h"
class nsAccessNode;
class nsAccessible;
class nsIAccessNode;
typedef nsRefPtrHashtable<nsVoidPtrHashKey, nsAccessNode>
nsAccessNodeHashtable;
typedef nsRefPtrHashtable<nsVoidPtrHashKey, nsAccessible>
nsAccessibleHashtable;
////////////////////////////////////////////////////////////////////////////////
// Accessible cache utils
////////////////////////////////////////////////////////////////////////////////
/**
* Shutdown and removes the accessible from cache.

View File

@ -38,8 +38,14 @@
#include "nsAccEvent.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsDocAccessible.h"
#include "nsIAccessibleText.h"
#ifdef MOZ_XUL
#include "nsXULTreeAccessible.h"
#endif
#include "nsIDOMDocument.h"
#include "nsIEventStateManager.h"
@ -47,9 +53,7 @@
#include "nsIServiceManager.h"
#ifdef MOZ_XUL
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "nsXULTreeAccessible.h"
#endif
#include "nsIAccessibleText.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
@ -193,15 +197,10 @@ nsAccEvent::GetAccessibleByNode()
if (!mNode)
return nsnull;
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
if (!accService)
return nsnull;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mNode));
nsCOMPtr<nsIAccessible> accessible;
accService->GetAccessibleFor(DOMNode, getter_AddRefs(accessible));
GetAccService()->GetAccessibleFor(DOMNode, getter_AddRefs(accessible));
#ifdef MOZ_XUL
// hack for xul tree table. We need a better way for firing delayed event

View File

@ -42,13 +42,14 @@
#include "nsIAccessibleStates.h"
#include "nsIAccessibleTypes.h"
#include "nsAccessibilityService.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccessible.h"
#include "nsAccTreeWalker.h"
#include "nsARIAMap.h"
#include "nsDocAccessible.h"
#include "nsHyperTextAccessible.h"
#include "nsHTMLTableAccessible.h"
#include "nsDocAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccTreeWalker.h"
#include "nsAccessible.h"
#include "nsARIAMap.h"
#include "nsXULTreeGridAccessible.h"
#include "nsIDOMXULContainerElement.h"

View File

@ -37,8 +37,14 @@
* ***** END LICENSE BLOCK ***** */
#include "nsDocAccessible.h"
#include "nsIAccessible.h"
#include "nsAccCache.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsHashtable.h"
#include "nsAccessibilityService.h"
#include "nsApplicationAccessibleWrap.h"
@ -46,7 +52,6 @@
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocument.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSSPrimitiveValue.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"

View File

@ -43,58 +43,35 @@
#ifndef _nsAccessNode_H_
#define _nsAccessNode_H_
#include "nsAccCache.h"
#include "nsAccessibilityAtoms.h"
#include "nsCoreUtils.h"
#include "nsAccUtils.h"
#include "nsIAccessibleTypes.h"
#include "nsIAccessNode.h"
#include "nsIAccessibleTypes.h"
#include "a11yGeneric.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsINameSpaceManager.h"
#include "nsIStringBundle.h"
#include "nsRefPtrHashtable.h"
#include "nsWeakReference.h"
#include "nsAccessibilityService.h"
class nsAccessNode;
class nsApplicationAccessible;
class nsDocAccessible;
class nsIAccessibleDocument;
class nsRootAccessible;
class nsIPresShell;
class nsPresContext;
class nsIAccessibleDocument;
class nsIFrame;
class nsIDOMNodeList;
class nsRootAccessible;
class nsApplicationAccessible;
class nsIDocShellTreeItem;
typedef nsRefPtrHashtable<nsVoidPtrHashKey, nsAccessNode>
nsAccessNodeHashtable;
#define ACCESSIBLE_BUNDLE_URL "chrome://global-platform/locale/accessible.properties"
#define PLATFORM_KEYS_BUNDLE_URL "chrome://global-platform/locale/platformKeys.properties"
// What we want is: NS_INTERFACE_MAP_ENTRY(self) for static IID accessors,
// but some of our classes have an ambiguous base class of nsISupports which
// prevents this from working (the default macro converts it to nsISupports,
// then addrefs it, then returns it). Therefore, we expand the macro here and
// change it so that it works. Yuck.
#define NS_INTERFACE_MAP_STATIC_AMBIGUOUS(_class) \
if (aIID.Equals(NS_GET_IID(_class))) { \
NS_ADDREF(this); \
*aInstancePtr = this; \
return NS_OK; \
} else
#define NS_OK_DEFUNCT_OBJECT \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x22)
#define NS_ENSURE_A11Y_SUCCESS(res, ret) \
PR_BEGIN_MACRO \
nsresult __rv = res; /* Don't evaluate |res| more than once */ \
if (NS_FAILED(__rv)) { \
NS_ENSURE_SUCCESS_BODY(res, ret) \
return ret; \
} \
if (__rv == NS_OK_DEFUNCT_OBJECT) \
return ret; \
PR_END_MACRO
#define NS_ACCESSNODE_IMPL_CID \
{ /* 2b07e3d7-00b3-4379-aa0b-ea22e2c8ffda */ \
0x2b07e3d7, \

View File

@ -41,6 +41,7 @@
#include "nsIAccessibilityService.h"
#include "a11yGeneric.h"
#include "nsCoreUtils.h"
#include "nsCOMArray.h"

View File

@ -41,9 +41,15 @@
#include "nsIXBLAccessible.h"
#include "nsAccTreeWalker.h"
#include "nsAccessibleRelation.h"
#include "nsAccUtils.h"
#include "nsARIAMap.h"
#include "nsDocAccessible.h"
#include "nsEventShell.h"
#include "nsAccessibilityService.h"
#include "nsAccTreeWalker.h"
#include "nsRelUtils.h"
#include "nsTextEquivUtils.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
@ -95,50 +101,6 @@
#include "nsIDOMCharacterData.h"
#endif
/**
* nsAccessibleDOMStringList implementation
*/
nsAccessibleDOMStringList::nsAccessibleDOMStringList()
{
}
nsAccessibleDOMStringList::~nsAccessibleDOMStringList()
{
}
NS_IMPL_ISUPPORTS1(nsAccessibleDOMStringList, nsIDOMDOMStringList)
NS_IMETHODIMP
nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
{
if (aIndex >= mNames.Length()) {
SetDOMStringToNull(aResult);
} else {
aResult = mNames.ElementAt(aIndex);
}
return NS_OK;
}
NS_IMETHODIMP
nsAccessibleDOMStringList::GetLength(PRUint32 *aLength)
{
*aLength = mNames.Length();
return NS_OK;
}
NS_IMETHODIMP
nsAccessibleDOMStringList::Contains(const nsAString& aString, PRBool *aResult)
{
*aResult = mNames.Contains(aString);
return NS_OK;
}
/*
* Class nsAccessible
*/
////////////////////////////////////////////////////////////////////////////////
// nsAccessible. nsISupports
@ -824,12 +786,8 @@ NS_IMETHODIMP nsAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
focusedChild = this;
}
else if (gLastFocusedNode) {
nsCOMPtr<nsIAccessibilityService> accService =
do_GetService("@mozilla.org/accessibilityService;1");
NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
accService->GetAccessibleFor(gLastFocusedNode,
getter_AddRefs(focusedChild));
GetAccService()->GetAccessibleFor(gLastFocusedNode,
getter_AddRefs(focusedChild));
if (focusedChild) {
nsCOMPtr<nsIAccessible> focusedParentAccessible;
focusedChild->GetParent(getter_AddRefs(focusedParentAccessible));
@ -891,17 +849,17 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
}
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
nsCOMPtr<nsIDOMNode> relevantNode;
accService->GetRelevantContentNodeFor(node, getter_AddRefs(relevantNode));
GetAccService()->GetRelevantContentNodeFor(node,
getter_AddRefs(relevantNode));
if (!relevantNode) {
NS_IF_ADDREF(*aChild = fallbackAnswer);
return NS_OK;
}
nsCOMPtr<nsIAccessible> accessible;
accService->GetAccessibleFor(relevantNode, getter_AddRefs(accessible));
GetAccService()->GetAccessibleFor(relevantNode, getter_AddRefs(accessible));
if (!accessible) {
// No accessible for the node with the point, so find the first
// accessible in the DOM parent chain

View File

@ -41,33 +41,29 @@
#include "nsAccessNodeWrap.h"
#include "nsARIAMap.h"
#include "nsEventShell.h"
#include "nsRelUtils.h"
#include "nsTextEquivUtils.h"
#include "nsIAccessible.h"
#include "nsIAccessibleHyperLink.h"
#include "nsIAccessibleSelectable.h"
#include "nsIAccessibleValue.h"
#include "nsIAccessibleRole.h"
#include "nsIAccessibleStates.h"
#include "nsIAccessibleEvent.h"
#include "nsIDOMNodeList.h"
#include "nsINameSpaceManager.h"
#include "nsWeakReference.h"
#include "nsString.h"
#include "nsStringGlue.h"
#include "nsTArray.h"
#include "nsIDOMDOMStringList.h"
class nsAccessible;
class nsAccEvent;
struct nsRoleMapEntry;
struct nsRect;
class nsIContent;
class nsIFrame;
class nsIDOMNode;
class nsIAtom;
class nsIView;
typedef nsRefPtrHashtable<nsVoidPtrHashKey, nsAccessible>
nsAccessibleHashtable;
// see nsAccessible::GetAttrValue
#define NS_OK_NO_ARIA_VALUE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x21)
@ -80,29 +76,8 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x23)
#define NS_OK_NAME_FROM_TOOLTIP \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x25)
// Saves a data member -- if child count equals this value we haven't
// cached children or child count yet
enum { eChildCountUninitialized = -1 };
class nsAccessibleDOMStringList : public nsIDOMDOMStringList
{
public:
nsAccessibleDOMStringList();
virtual ~nsAccessibleDOMStringList();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMDOMSTRINGLIST
PRBool Add(const nsAString& aName) {
return mNames.AppendElement(aName) != nsnull;
}
private:
nsTArray<nsString> mNames;
};
#define NS_ACCESSIBLE_IMPL_CID \
#define NS_ACCESSIBLE_IMPL_IID \
{ /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \
0x133c8bf4, \
0x4913, \
@ -127,7 +102,7 @@ public:
NS_DECL_NSIACCESSIBLEHYPERLINK
NS_DECL_NSIACCESSIBLESELECTABLE
NS_DECL_NSIACCESSIBLEVALUE
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_CID)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID)
//////////////////////////////////////////////////////////////////////////////
// nsAccessNode
@ -441,7 +416,7 @@ protected:
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessible,
NS_ACCESSIBLE_IMPL_CID)
NS_ACCESSIBLE_IMPL_IID)
#endif

View File

@ -43,6 +43,7 @@
#include "nsApplicationAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsIComponentManager.h"
#include "nsIDOMDocument.h"

View File

@ -38,18 +38,18 @@
* ***** END LICENSE BLOCK ***** */
#include "nsBaseWidgetAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsIAccessibilityService.h"
#include "nsIAccessibleDocument.h"
#include "nsAccessibleWrap.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsHyperTextAccessibleWrap.h"
#include "nsIDOMNSHTMLElement.h"
#include "nsGUIEvent.h"
#include "nsHyperTextAccessibleWrap.h"
#include "nsILink.h"
#include "nsIFrame.h"
#include "nsINameSpaceManager.h"
#include "nsIServiceManager.h"
#include "nsIURI.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -35,10 +35,13 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsAccessibilityService.h"
#include "nsCaretAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsIAccessibleEvent.h"
#include "nsCaret.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLAnchorElement.h"

View File

@ -74,6 +74,10 @@
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
////////////////////////////////////////////////////////////////////////////////
// nsCoreUtils
////////////////////////////////////////////////////////////////////////////////
PRBool
nsCoreUtils::HasClickListener(nsIContent *aContent)
{
@ -1150,3 +1154,37 @@ nsCoreUtils::GeneratePopupTree(nsIDOMNode *aNode, PRBool aIsAnon)
}
}
}
////////////////////////////////////////////////////////////////////////////////
// nsAccessibleDOMStringList
////////////////////////////////////////////////////////////////////////////////
NS_IMPL_ISUPPORTS1(nsAccessibleDOMStringList, nsIDOMDOMStringList)
NS_IMETHODIMP
nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
{
if (aIndex >= mNames.Length())
SetDOMStringToNull(aResult);
else
aResult = mNames.ElementAt(aIndex);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibleDOMStringList::GetLength(PRUint32 *aLength)
{
*aLength = mNames.Length();
return NS_OK;
}
NS_IMETHODIMP
nsAccessibleDOMStringList::Contains(const nsAString& aString, PRBool *aResult)
{
*aResult = mNames.Contains(aString);
return NS_OK;
}

View File

@ -49,10 +49,15 @@
#include "nsIFrame.h"
#include "nsIDocShellTreeItem.h"
#include "nsIArray.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMDOMStringList.h"
#include "nsIMutableArray.h"
#include "nsPoint.h"
#include "nsTArray.h"
/**
* Core utils.
*/
class nsCoreUtils
{
public:
@ -468,132 +473,26 @@ public:
static void GeneratePopupTree(nsIDOMNode *aNode, PRBool aIsAnon = PR_FALSE);
};
////////////////////////////////////////////////////////////////////////////////
// nsRunnable helpers
////////////////////////////////////////////////////////////////////////////////
/**
* Use NS_DECL_RUNNABLEMETHOD_ macros to declare a runnable class for the given
* method of the given class. There are three macros:
* NS_DECL_RUNNABLEMETHOD(Class, Method)
* NS_DECL_RUNNABLEMETHOD_ARG1(Class, Method, Arg1Type)
* NS_DECL_RUNNABLEMETHOD_ARG2(Class, Method, Arg1Type, Arg2Type)
* Note Arg1Type and Arg2Type must be types which keeps the objects alive.
*
* Use NS_DISPATCH_RUNNABLEMETHOD_ macros to create an instance of declared
* runnable class and dispatch it to main thread. Availabe macros are:
* NS_DISPATCH_RUNNABLEMETHOD(Method, Object)
* NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Object, Arg1)
* NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Object, Arg1, Arg2)
* nsIDOMDOMStringList implementation.
*/
class nsAccessibleDOMStringList : public nsIDOMDOMStringList
{
public:
nsAccessibleDOMStringList() {};
virtual ~nsAccessibleDOMStringList() {};
#define NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
void Revoke() \
{ \
NS_IF_RELEASE(mObj); \
} \
\
protected: \
virtual ~nsRunnableMethod_##Method() \
{ \
NS_IF_RELEASE(mObj); \
} \
\
private: \
ClassType *mObj; \
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMDOMSTRINGLIST
PRBool Add(const nsAString& aName) {
return mNames.AppendElement(aName) != nsnull;
}
#define NS_DECL_RUNNABLEMETHOD(ClassType, Method) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj) : mObj(aObj) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
\
private:
nsTArray<nsString> mNames;
};
#define NS_DECL_RUNNABLEMETHOD_ARG1(ClassType, Method, Arg1Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj, Arg1Type aArg1) : \
mObj(aObj), mArg1(aArg1) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(mArg1); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
Arg1Type mArg1; \
};
#define NS_DECL_RUNNABLEMETHOD_ARG2(ClassType, Method, Arg1Type, Arg2Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
\
nsRunnableMethod_##Method(ClassType *aObj, \
Arg1Type aArg1, Arg2Type aArg2) : \
mObj(aObj), mArg1(aArg1), mArg2(aArg2) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(mArg1, mArg2); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
Arg1Type mArg1; \
Arg2Type mArg2; \
};
#define NS_DISPATCH_RUNNABLEMETHOD(Method, Obj) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Obj, Arg1) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj, Arg1); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Obj, Arg1, Arg2) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj, Arg1, Arg2); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#endif

View File

@ -36,9 +36,14 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsRootAccessible.h"
#include "nsAccCache.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsRootAccessible.h"
#include "nsTextEquivUtils.h"
#include "nsIMutableArray.h"
#include "nsICommandManager.h"
#include "nsIDocShell.h"

View File

@ -40,7 +40,9 @@
#define _nsDocAccessible_H_
#include "nsHyperTextAccessibleWrap.h"
#include "nsEventShell.h"
#include "nsIAccessibleDocument.h"
#include "nsIDocument.h"
#include "nsIDocumentObserver.h"
#include "nsIEditor.h"

View File

@ -38,6 +38,8 @@
#include "nsEventShell.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsDocAccessible.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -41,8 +41,9 @@
#include "nsAccEvent.h"
#include "a11yGeneric.h"
#include "nsAutoPtr.h"
#include "nsCoreUtils.h"
class nsIPersistentProperties;

View File

@ -37,8 +37,10 @@
* ***** END LICENSE BLOCK ***** */
#include "nsOuterDocAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIAccessibleDocument.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsIDocument.h"
#include "nsIServiceManager.h"
#include "nsIContent.h"

View File

@ -38,6 +38,7 @@
#include "nsRelUtils.h"
#include "nsAccessibilityService.h"
#include "nsAccessNode.h"
#include "nsIDOMDocument.h"

View File

@ -35,9 +35,11 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsAccessibilityService.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsRelUtils.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIDocShell.h"

View File

@ -38,7 +38,8 @@
#include "nsTextAttrs.h"
#include "nsAccessNode.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsHyperTextAccessibleWrap.h"
#include "gfxFont.h"

View File

@ -45,7 +45,6 @@ class nsHyperTextAccessible;
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIContent.h"
#include "nsIFrame.h"

View File

@ -39,7 +39,9 @@
#include "nsTextEquivUtils.h"
#include "nsAccessibilityService.h"
#include "nsAccessible.h"
#include "nsAccUtils.h"
#include "nsIDOMXULLabeledControlEl.h"

View File

@ -36,9 +36,13 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsAccessibilityAtoms.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccUtils.h"
#include "nsRelUtils.h"
#include "nsTextEquivUtils.h"
#include "nsIDOMDocument.h"
#include "nsIDOMNSHTMLInputElement.h"
#include "nsIDOMHTMLInputElement.h"

View File

@ -36,12 +36,13 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLImageAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccUtils.h"
#include "imgIContainer.h"
#include "imgIRequest.h"
#include "nsHTMLImageAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsIDocument.h"
#include "nsIImageLoadingContent.h"
#include "nsILink.h"

View File

@ -39,6 +39,8 @@
#include "nsHTMLImageMapAccessible.h"
#include "nsAccUtils.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIServiceManager.h"
#include "nsIDOMElement.h"

View File

@ -39,6 +39,8 @@
#include "nsHTMLLinkAccessible.h"
#include "nsCoreUtils.h"
#include "nsILink.h"
////////////////////////////////////////////////////////////////////////////////

View File

@ -36,10 +36,15 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsEventShell.h"
#include "nsIAccessibleEvent.h"
#include "nsTextEquivUtils.h"
#include "nsCOMPtr.h"
#include "nsIFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDocument.h"

View File

@ -39,7 +39,11 @@
#include "nsHTMLTableAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsRelUtils.h"
#include "nsTextEquivUtils.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
@ -48,8 +52,6 @@
#include "nsISelection2.h"
#include "nsISelectionPrivate.h"
#include "nsINameSpaceManager.h"
#include "nsIAccessibilityService.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLTableCellElement.h"
#include "nsIDOMHTMLTableElement.h"
@ -57,7 +59,6 @@
#include "nsIDOMHTMLTableSectionElem.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsITableLayout.h"
#include "nsITableCellLayout.h"
#include "nsFrameSelection.h"

View File

@ -40,6 +40,7 @@
#include "nsHTMLTextAccessible.h"
#include "nsDocAccessible.h"
#include "nsTextEquivUtils.h"
#include "nsIFrame.h"
#include "nsPresContext.h"

View File

@ -38,8 +38,10 @@
* ***** END LICENSE BLOCK ***** */
#include "nsHyperTextAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsTextAttrs.h"
#include "nsIClipboard.h"

View File

@ -43,14 +43,15 @@
#ifndef _nsAccessibleWrap_H_
#define _nsAccessibleWrap_H_
#include "nsAccessible.h"
#include "nsAccUtils.h"
#include "nsCOMPtr.h"
#include "nsRect.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsAccessible.h"
struct AccessibleWrapper;
struct objc_class;
@ -99,23 +100,10 @@ class nsAccessibleWrap : public nsAccessible
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent);
PRBool AncestorIsFlat() {
// we don't create a native object if we're child of a "flat" accessible; for example, on OS X buttons
// shouldn't have any children, because that makes the OS confused.
//
// to maintain a scripting environment where the XPCOM accessible hierarchy look the same
// on all platforms, we still let the C++ objects be created though.
nsAccessible* parent(GetParent());
while (parent) {
if (nsAccUtils::MustPrune(parent))
return PR_TRUE;
parent = parent->GetParent();
}
// no parent was flat
return PR_FALSE;
}
/**
* Return true if the parent doesn't have children to expose to AT.
*/
PRBool AncestorIsFlat();
// Wrapper around our native object.
AccessibleWrapper *mNativeWrapper;

View File

@ -309,3 +309,28 @@ nsAccessibleWrap::GetUnignoredParent()
return outValue;
}
////////////////////////////////////////////////////////////////////////////////
// nsAccessibleWrap protected
PRBool
nsAccessibleWrap::AncestorIsFlat()
{
// We don't create a native object if we're child of a "flat" accessible;
// for example, on OS X buttons shouldn't have any children, because that
// makes the OS confused.
//
// To maintain a scripting environment where the XPCOM accessible hierarchy
// look the same on all platforms, we still let the C++ objects be created
// though.
nsAccessible* parent(GetParent());
while (parent) {
if (nsAccUtils::MustPrune(parent))
return PR_TRUE;
parent = parent->GetParent();
}
// no parent was flat
return PR_FALSE;
}

View File

@ -51,6 +51,7 @@
#include "nsAccessibleWrap.h"
#include "nsCOMPtr.h"
#include "nsIPersistentProperties2.h"
#include "nsString.h"
#define GET_NSIACCESSIBLETEXT \

View File

@ -37,12 +37,18 @@
* ***** END LICENSE BLOCK ***** */
#include "nsAccessNodeWrap.h"
#include "AccessibleApplication.h"
#include "ISimpleDOMNode_i.c"
#include "nsAccessibilityAtoms.h"
#include "nsIAccessible.h"
#include "nsAccessibilityService.h"
#include "nsApplicationAccessibleWrap.h"
#include "nsCoreUtils.h"
#include "nsRootAccessible.h"
#include "nsAttrName.h"
#include "nsIDocument.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMNSHTMLElement.h"
#include "nsIDOMViewCSS.h"
@ -51,10 +57,7 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsPIDOMWindow.h"
#include "nsRootAccessible.h"
#include "nsIServiceManager.h"
#include "AccessibleApplication.h"
#include "nsApplicationAccessibleWrap.h"
/// the accessible library and cached methods
HINSTANCE nsAccessNodeWrap::gmAccLib = nsnull;

View File

@ -37,7 +37,11 @@
* ***** END LICENSE BLOCK ***** */
#include "nsAccessibleWrap.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsRelUtils.h"
#include "nsIAccessibleDocument.h"
#include "nsIAccessibleSelectable.h"

View File

@ -44,6 +44,8 @@
#define _nsDocAccessibleWrap_H_
#include "ISimpleDOMDocument.h"
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsIDocShellTreeItem.h"

View File

@ -40,6 +40,8 @@
#include "nsHyperTextAccessibleWrap.h"
#include "nsEventShell.h"
NS_IMPL_ISUPPORTS_INHERITED0(nsHyperTextAccessibleWrap,
nsHyperTextAccessible)

View File

@ -40,6 +40,7 @@
#include "nsTextAccessibleWrap.h"
#include "ISimpleDOMText_i.c"
#include "nsCoreUtils.h"
#include "nsDocAccessible.h"
#include "nsIFontMetrics.h"

View File

@ -38,6 +38,10 @@
#include "nsXFormsAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsTextEquivUtils.h"
#include "nscore.h"
#include "nsServiceManagerUtils.h"
#include "nsIDOMElement.h"
@ -105,10 +109,6 @@ nsXFormsAccessible::GetBoundChildElementValue(const nsAString& aTagName,
void
nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
{
nsIAccessibilityService *accService = GetAccService();
if (!accService)
return;
nsCOMPtr<nsIDOMNode> container(aContainerNode);
if (!container)
container = mDOMNode;
@ -131,7 +131,8 @@ nsXFormsAccessible::CacheSelectChildren(nsIDOMNode *aContainerNode)
if (!child)
continue;
accService->GetAttachedAccessibleFor(child, getter_AddRefs(accessible));
GetAccService()->GetAttachedAccessibleFor(child,
getter_AddRefs(accessible));
if (!accessible)
continue;
@ -337,9 +338,6 @@ nsXFormsSelectableAccessible::GetSelectedChildren(nsIArray **aAccessibles)
do_CreateInstance(NS_ARRAY_CONTRACTID);
NS_ENSURE_TRUE(accessibles, NS_ERROR_OUT_OF_MEMORY);
nsIAccessibilityService* accService = GetAccService();
NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
nsresult rv;
if (mIsSelect1Element) {
@ -352,7 +350,7 @@ nsXFormsSelectableAccessible::GetSelectedChildren(nsIArray **aAccessibles)
return NS_OK;
nsCOMPtr<nsIAccessible> accessible;
accService->GetAccessibleFor(item, getter_AddRefs(accessible));
GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
accessibles->AppendElement(accessible, PR_FALSE);
@ -379,7 +377,7 @@ nsXFormsSelectableAccessible::GetSelectedChildren(nsIArray **aAccessibles)
NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
nsCOMPtr<nsIAccessible> accessible;
accService->GetAccessibleFor(item, getter_AddRefs(accessible));
GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
accessibles->AppendElement(accessible, PR_FALSE);
@ -467,9 +465,6 @@ nsXFormsSelectableAccessible::RefSelection(PRInt32 aIndex,
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
nsIAccessibilityService* accService = GetAccService();
NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
nsresult rv;
if (mIsSelect1Element) {
if (aIndex != 0)
@ -481,7 +476,7 @@ nsXFormsSelectableAccessible::RefSelection(PRInt32 aIndex,
NS_ENSURE_SUCCESS(rv, rv);
if (item)
return accService->GetAccessibleFor(item, aAccessible);
return GetAccService()->GetAccessibleFor(item, aAccessible);
return NS_OK;
}
@ -502,7 +497,7 @@ nsXFormsSelectableAccessible::RefSelection(PRInt32 aIndex,
items->Item(aIndex, getter_AddRefs(item));
nsCOMPtr<nsIAccessible> accessible;
return accService->GetAccessibleFor(item, getter_AddRefs(accessible));
return GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
}
NS_IMETHODIMP

View File

@ -38,6 +38,8 @@
#include "nsXFormsFormControlsAccessible.h"
#include "nsTextEquivUtils.h"
// nsXFormsLabelAccessible
nsXFormsLabelAccessible::

View File

@ -38,7 +38,9 @@
#include "nsXULColorPickerAccessible.h"
#include "nsAccUtils.h"
#include "nsAccTreeWalker.h"
#include "nsCoreUtils.h"
#include "nsIDOMElement.h"

View File

@ -40,9 +40,10 @@
#include "nsXULComboboxAccessible.h"
#include "nsAccessibilityService.h"
#include "nsIDOMXULMenuListElement.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsServiceManagerUtils.h"
////////////////////////////////////////////////////////////////////////////////
// nsXULComboboxAccessible

View File

@ -37,11 +37,16 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsXULFormControlAccessible.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsAccUtils.h"
#include "nsAccTreeWalker.h"
#include "nsCoreUtils.h"
#include "nsRelUtils.h"
// NOTE: alphabetically ordered
#include "nsHTMLFormControlAccessible.h"
#include "nsXULMenuAccessible.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNSEditableElement.h"

View File

@ -40,10 +40,12 @@
#include "nsXULListboxAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsIDOMXULPopupElement.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsServiceManagerUtils.h"
////////////////////////////////////////////////////////////////////////////////
// nsXULColumnsAccessible

View File

@ -37,6 +37,11 @@
* ***** END LICENSE BLOCK ***** */
#include "nsXULMenuAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsXULFormControlAccessible.h"
#include "nsIDOMElement.h"
#include "nsIDOMXULElement.h"
#include "nsIMutableArray.h"
@ -50,7 +55,6 @@
#include "nsIPresShell.h"
#include "nsIContent.h"
#include "nsGUIEvent.h"
#include "nsXULFormControlAccessible.h"
#include "nsILookAndFeel.h"
#include "nsWidgetsCID.h"

View File

@ -38,8 +38,11 @@
#include "nsXULSliderAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIFrame.h"
// nsXULSliderAccessible

View File

@ -36,8 +36,12 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsXULTabAccessible.h"
#include "nsAccUtils.h"
#include "nsRelUtils.h"
// NOTE: alphabetically ordered
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "nsIDOMDocument.h"

View File

@ -37,14 +37,19 @@
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
// NOTE: groups are alphabetically ordered
#include "nsXULTextAccessible.h"
#include "nsAccessibilityAtoms.h"
#include "nsCoreUtils.h"
#include "nsAccUtils.h"
#include "nsBaseWidgetAccessible.h"
#include "nsCoreUtils.h"
#include "nsRelUtils.h"
#include "nsTextEquivUtils.h"
#include "nsIDOMXULDescriptionElement.h"
#include "nsINameSpaceManager.h"
#include "nsString.h"
#include "nsXULTextAccessible.h"
#include "nsNetUtil.h"
/**

View File

@ -38,7 +38,11 @@
#include "nsXULTreeAccessible.h"
#include "nsAccCache.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsDocAccessible.h"
#include "nsRelUtils.h"
#include "nsIDOMXULElement.h"
#include "nsIDOMXULMultSelectCntrlEl.h"

View File

@ -38,8 +38,12 @@
#include "nsXULTreeGridAccessibleWrap.h"
#include "nsAccCache.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsEventShell.h"
#include "nsITreeSelection.h"
#include "nsServiceManagerUtils.h"
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridAccessible