From e89e38045d86151fe923407080cac07f3bb5c0d1 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Tue, 27 Apr 2010 15:52:03 +0900 Subject: [PATCH] Bug 561094 - export nsAccessible.h, r=davidb --HG-- rename : accessible/src/base/nsCoreUtils.h => accessible/src/base/a11yGeneric.h --- accessible/src/atk/nsAccessibleWrap.cpp | 17 +- accessible/src/atk/nsAccessibleWrap.h | 12 +- accessible/src/atk/nsMaiInterfaceAction.cpp | 3 + .../src/atk/nsMaiInterfaceComponent.cpp | 4 + accessible/src/atk/nsMaiInterfaceTable.cpp | 2 + accessible/src/base/Makefile.in | 3 +- accessible/src/base/a11yGeneric.h | 198 ++++++++++++++++++ accessible/src/base/nsARIAGridAccessible.cpp | 3 + accessible/src/base/nsAccCache.h | 10 +- accessible/src/base/nsAccEvent.cpp | 15 +- accessible/src/base/nsAccUtils.cpp | 11 +- accessible/src/base/nsAccessNode.cpp | 7 +- accessible/src/base/nsAccessNode.h | 51 ++--- accessible/src/base/nsAccessibilityService.h | 1 + accessible/src/base/nsAccessible.cpp | 68 ++---- accessible/src/base/nsAccessible.h | 47 +---- .../src/base/nsApplicationAccessible.cpp | 1 + .../src/base/nsBaseWidgetAccessible.cpp | 10 +- accessible/src/base/nsCaretAccessible.cpp | 7 +- accessible/src/base/nsCoreUtils.cpp | 38 ++++ accessible/src/base/nsCoreUtils.h | 139 ++---------- accessible/src/base/nsDocAccessible.cpp | 7 +- accessible/src/base/nsDocAccessible.h | 2 + accessible/src/base/nsEventShell.cpp | 2 + accessible/src/base/nsEventShell.h | 3 +- accessible/src/base/nsOuterDocAccessible.cpp | 6 +- accessible/src/base/nsRelUtils.cpp | 1 + accessible/src/base/nsRootAccessible.cpp | 4 +- accessible/src/base/nsTextAttrs.cpp | 3 +- accessible/src/base/nsTextAttrs.h | 1 - accessible/src/base/nsTextEquivUtils.cpp | 2 + .../src/html/nsHTMLFormControlAccessible.cpp | 8 +- accessible/src/html/nsHTMLImageAccessible.cpp | 9 +- .../src/html/nsHTMLImageMapAccessible.cpp | 2 + accessible/src/html/nsHTMLLinkAccessible.cpp | 2 + .../src/html/nsHTMLSelectAccessible.cpp | 9 +- accessible/src/html/nsHTMLTableAccessible.cpp | 7 +- accessible/src/html/nsHTMLTextAccessible.cpp | 1 + accessible/src/html/nsHyperTextAccessible.cpp | 2 + accessible/src/mac/nsAccessibleWrap.h | 26 +-- accessible/src/mac/nsAccessibleWrap.mm | 25 +++ accessible/src/msaa/CAccessibleText.cpp | 1 + accessible/src/msaa/nsAccessNodeWrap.cpp | 13 +- accessible/src/msaa/nsAccessibleWrap.cpp | 4 + accessible/src/msaa/nsDocAccessibleWrap.h | 2 + .../src/msaa/nsHyperTextAccessibleWrap.cpp | 2 + accessible/src/msaa/nsTextAccessibleWrap.cpp | 1 + accessible/src/xforms/nsXFormsAccessible.cpp | 25 +-- .../xforms/nsXFormsFormControlsAccessible.cpp | 2 + .../src/xul/nsXULColorPickerAccessible.cpp | 2 + .../src/xul/nsXULComboboxAccessible.cpp | 3 +- .../src/xul/nsXULFormControlAccessible.cpp | 9 +- accessible/src/xul/nsXULListboxAccessible.cpp | 4 +- accessible/src/xul/nsXULMenuAccessible.cpp | 6 +- accessible/src/xul/nsXULSliderAccessible.cpp | 3 + accessible/src/xul/nsXULTabAccessible.cpp | 6 +- accessible/src/xul/nsXULTextAccessible.cpp | 11 +- accessible/src/xul/nsXULTreeAccessible.cpp | 4 + .../src/xul/nsXULTreeGridAccessible.cpp | 6 +- 59 files changed, 513 insertions(+), 360 deletions(-) create mode 100644 accessible/src/base/a11yGeneric.h diff --git a/accessible/src/atk/nsAccessibleWrap.cpp b/accessible/src/atk/nsAccessibleWrap.cpp index 90b1ca496a7..6a6def00ace 100644 --- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/nsAccessibleWrap.cpp @@ -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 stateChangeEvent = + nsRefPtr 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); diff --git a/accessible/src/atk/nsAccessibleWrap.h b/accessible/src/atk/nsAccessibleWrap.h index 6ab94f5d4ce..5c64970d141 100644 --- a/accessible/src/atk/nsAccessibleWrap.h +++ b/accessible/src/atk/nsAccessibleWrap.h @@ -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; diff --git a/accessible/src/atk/nsMaiInterfaceAction.cpp b/accessible/src/atk/nsMaiInterfaceAction.cpp index d69ec918619..9d682e4a9a8 100644 --- a/accessible/src/atk/nsMaiInterfaceAction.cpp +++ b/accessible/src/atk/nsMaiInterfaceAction.cpp @@ -40,9 +40,12 @@ #include "nsMaiInterfaceAction.h" +#include "nsAccUtils.h" #include "nsRoleMap.h" #include "nsString.h" +#include "nsIDOMDOMStringList.h" + void actionInterfaceInitCB(AtkActionIface *aIface) { diff --git a/accessible/src/atk/nsMaiInterfaceComponent.cpp b/accessible/src/atk/nsMaiInterfaceComponent.cpp index e198009a802..c5309697fed 100644 --- a/accessible/src/atk/nsMaiInterfaceComponent.cpp +++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp @@ -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" diff --git a/accessible/src/atk/nsMaiInterfaceTable.cpp b/accessible/src/atk/nsMaiInterfaceTable.cpp index 466b4eed967..455d6995b74 100644 --- a/accessible/src/atk/nsMaiInterfaceTable.cpp +++ b/accessible/src/atk/nsMaiInterfaceTable.cpp @@ -40,6 +40,8 @@ #include "nsMaiInterfaceTable.h" +#include "nsAccUtils.h" + #include "nsArrayUtils.h" void diff --git a/accessible/src/base/Makefile.in b/accessible/src/base/Makefile.in index a50c1f0d7c8..b01789e4aa8 100644 --- a/accessible/src/base/Makefile.in +++ b/accessible/src/base/Makefile.in @@ -74,7 +74,8 @@ CPPSRCS = \ $(NULL) EXPORTS = \ - nsRootAccessible.h \ + a11yGeneric.h \ + nsAccessible.h \ nsAccessNode.h \ $(NULL) diff --git a/accessible/src/base/a11yGeneric.h b/accessible/src/base/a11yGeneric.h new file mode 100644 index 00000000000..270c62f50e7 --- /dev/null +++ b/accessible/src/base/a11yGeneric.h @@ -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 (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 runnable = \ + new nsRunnableMethod_##Method(Obj); \ + if (runnable) \ + NS_DispatchToMainThread(runnable); \ +} + +#define NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Obj, Arg1) \ +{ \ + nsCOMPtr runnable = \ + new nsRunnableMethod_##Method(Obj, Arg1); \ + if (runnable) \ + NS_DispatchToMainThread(runnable); \ +} + +#define NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Obj, Arg1, Arg2) \ +{ \ + nsCOMPtr runnable = \ + new nsRunnableMethod_##Method(Obj, Arg1, Arg2); \ + if (runnable) \ + NS_DispatchToMainThread(runnable); \ +} + +#endif diff --git a/accessible/src/base/nsARIAGridAccessible.cpp b/accessible/src/base/nsARIAGridAccessible.cpp index 98715e5f435..be6ccde69a3 100644 --- a/accessible/src/base/nsARIAGridAccessible.cpp +++ b/accessible/src/base/nsARIAGridAccessible.cpp @@ -38,6 +38,9 @@ #include "nsARIAGridAccessible.h" +#include "nsAccUtils.h" + +#include "nsIMutableArray.h" #include "nsComponentManagerUtils.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/base/nsAccCache.h b/accessible/src/base/nsAccCache.h index 5c7d3d70c19..fe41fa4cbe5 100644 --- a/accessible/src/base/nsAccCache.h +++ b/accessible/src/base/nsAccCache.h @@ -42,15 +42,11 @@ #include "nsRefPtrHashtable.h" #include "nsCycleCollectionParticipant.h" -class nsAccessNode; -class nsAccessible; class nsIAccessNode; -typedef nsRefPtrHashtable - nsAccessNodeHashtable; - -typedef nsRefPtrHashtable - nsAccessibleHashtable; +//////////////////////////////////////////////////////////////////////////////// +// Accessible cache utils +//////////////////////////////////////////////////////////////////////////////// /** * Shutdown and removes the accessible from cache. diff --git a/accessible/src/base/nsAccEvent.cpp b/accessible/src/base/nsAccEvent.cpp index 49f9e447a24..8174290384c 100644 --- a/accessible/src/base/nsAccEvent.cpp +++ b/accessible/src/base/nsAccEvent.cpp @@ -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 accService = - do_GetService("@mozilla.org/accessibilityService;1"); - if (!accService) - return nsnull; - nsCOMPtr DOMNode(do_QueryInterface(mNode)); nsCOMPtr 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 diff --git a/accessible/src/base/nsAccUtils.cpp b/accessible/src/base/nsAccUtils.cpp index f07e65b93f7..5b379176de6 100644 --- a/accessible/src/base/nsAccUtils.cpp +++ b/accessible/src/base/nsAccUtils.cpp @@ -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" diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 868d147d1ab..9e9f0abcf30 100644 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -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" diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index e40a0ded945..05ba2e015c7 100644 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -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 + 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, \ diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h index d6eb787911f..98f54604f37 100644 --- a/accessible/src/base/nsAccessibilityService.h +++ b/accessible/src/base/nsAccessibilityService.h @@ -41,6 +41,7 @@ #include "nsIAccessibilityService.h" +#include "a11yGeneric.h" #include "nsCoreUtils.h" #include "nsCOMArray.h" diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index 55382b3fe42..3aa0ff71d0b 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -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 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 focusedParentAccessible; focusedChild->GetParent(getter_AddRefs(focusedParentAccessible)); @@ -891,17 +849,17 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild, } nsCOMPtr node(do_QueryInterface(content)); - nsCOMPtr accService = GetAccService(); nsCOMPtr relevantNode; - accService->GetRelevantContentNodeFor(node, getter_AddRefs(relevantNode)); + GetAccService()->GetRelevantContentNodeFor(node, + getter_AddRefs(relevantNode)); if (!relevantNode) { NS_IF_ADDREF(*aChild = fallbackAnswer); return NS_OK; } nsCOMPtr 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 diff --git a/accessible/src/base/nsAccessible.h b/accessible/src/base/nsAccessible.h index c9e13063c2a..303a6fac24a 100644 --- a/accessible/src/base/nsAccessible.h +++ b/accessible/src/base/nsAccessible.h @@ -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 + 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 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 diff --git a/accessible/src/base/nsApplicationAccessible.cpp b/accessible/src/base/nsApplicationAccessible.cpp index 74ba19cb84a..4f0982649c6 100644 --- a/accessible/src/base/nsApplicationAccessible.cpp +++ b/accessible/src/base/nsApplicationAccessible.cpp @@ -43,6 +43,7 @@ #include "nsApplicationAccessible.h" #include "nsAccessibilityService.h" +#include "nsAccUtils.h" #include "nsIComponentManager.h" #include "nsIDOMDocument.h" diff --git a/accessible/src/base/nsBaseWidgetAccessible.cpp b/accessible/src/base/nsBaseWidgetAccessible.cpp index 28f91e053f4..316788769bc 100644 --- a/accessible/src/base/nsBaseWidgetAccessible.cpp +++ b/accessible/src/base/nsBaseWidgetAccessible.cpp @@ -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" //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/base/nsCaretAccessible.cpp b/accessible/src/base/nsCaretAccessible.cpp index 45dc72415d2..030b474291b 100644 --- a/accessible/src/base/nsCaretAccessible.cpp +++ b/accessible/src/base/nsCaretAccessible.cpp @@ -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" diff --git a/accessible/src/base/nsCoreUtils.cpp b/accessible/src/base/nsCoreUtils.cpp index 368ba997dd3..bfb42ff164d 100644 --- a/accessible/src/base/nsCoreUtils.cpp +++ b/accessible/src/base/nsCoreUtils.cpp @@ -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; +} diff --git a/accessible/src/base/nsCoreUtils.h b/accessible/src/base/nsCoreUtils.h index 63cb9dc3402..298e3df477a 100644 --- a/accessible/src/base/nsCoreUtils.h +++ b/accessible/src/base/nsCoreUtils.h @@ -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 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 runnable = \ - new nsRunnableMethod_##Method(Obj); \ - if (runnable) \ - NS_DispatchToMainThread(runnable); \ -} - -#define NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Obj, Arg1) \ -{ \ - nsCOMPtr runnable = \ - new nsRunnableMethod_##Method(Obj, Arg1); \ - if (runnable) \ - NS_DispatchToMainThread(runnable); \ -} - -#define NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Obj, Arg1, Arg2) \ -{ \ - nsCOMPtr runnable = \ - new nsRunnableMethod_##Method(Obj, Arg1, Arg2); \ - if (runnable) \ - NS_DispatchToMainThread(runnable); \ -} - #endif diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index 77981486004..e32238d032d 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -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" diff --git a/accessible/src/base/nsDocAccessible.h b/accessible/src/base/nsDocAccessible.h index b1c310b9519..bc1d80ad654 100644 --- a/accessible/src/base/nsDocAccessible.h +++ b/accessible/src/base/nsDocAccessible.h @@ -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" diff --git a/accessible/src/base/nsEventShell.cpp b/accessible/src/base/nsEventShell.cpp index a983ea3d165..356e89eacd4 100644 --- a/accessible/src/base/nsEventShell.cpp +++ b/accessible/src/base/nsEventShell.cpp @@ -38,6 +38,8 @@ #include "nsEventShell.h" +#include "nsAccUtils.h" +#include "nsCoreUtils.h" #include "nsDocAccessible.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/base/nsEventShell.h b/accessible/src/base/nsEventShell.h index 90385a338e3..51298d5d072 100644 --- a/accessible/src/base/nsEventShell.h +++ b/accessible/src/base/nsEventShell.h @@ -41,8 +41,9 @@ #include "nsAccEvent.h" +#include "a11yGeneric.h" + #include "nsAutoPtr.h" -#include "nsCoreUtils.h" class nsIPersistentProperties; diff --git a/accessible/src/base/nsOuterDocAccessible.cpp b/accessible/src/base/nsOuterDocAccessible.cpp index fd1f065a391..496ca472c20 100644 --- a/accessible/src/base/nsOuterDocAccessible.cpp +++ b/accessible/src/base/nsOuterDocAccessible.cpp @@ -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" diff --git a/accessible/src/base/nsRelUtils.cpp b/accessible/src/base/nsRelUtils.cpp index da8c4fdd215..153ac45e724 100644 --- a/accessible/src/base/nsRelUtils.cpp +++ b/accessible/src/base/nsRelUtils.cpp @@ -38,6 +38,7 @@ #include "nsRelUtils.h" +#include "nsAccessibilityService.h" #include "nsAccessNode.h" #include "nsIDOMDocument.h" diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index cf2851460a6..bc3fb1f89eb 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -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" diff --git a/accessible/src/base/nsTextAttrs.cpp b/accessible/src/base/nsTextAttrs.cpp index f01f999b2a4..dcd361207f6 100644 --- a/accessible/src/base/nsTextAttrs.cpp +++ b/accessible/src/base/nsTextAttrs.cpp @@ -38,7 +38,8 @@ #include "nsTextAttrs.h" -#include "nsAccessNode.h" +#include "nsAccUtils.h" +#include "nsCoreUtils.h" #include "nsHyperTextAccessibleWrap.h" #include "gfxFont.h" diff --git a/accessible/src/base/nsTextAttrs.h b/accessible/src/base/nsTextAttrs.h index d11b7e00e3e..b47b25e2dc7 100644 --- a/accessible/src/base/nsTextAttrs.h +++ b/accessible/src/base/nsTextAttrs.h @@ -45,7 +45,6 @@ class nsHyperTextAccessible; #include "nsIDOMNode.h" #include "nsIDOMElement.h" -#include "nsIDOMCSSStyleDeclaration.h" #include "nsIContent.h" #include "nsIFrame.h" diff --git a/accessible/src/base/nsTextEquivUtils.cpp b/accessible/src/base/nsTextEquivUtils.cpp index d011cb69de2..2082b7fd4dc 100644 --- a/accessible/src/base/nsTextEquivUtils.cpp +++ b/accessible/src/base/nsTextEquivUtils.cpp @@ -39,7 +39,9 @@ #include "nsTextEquivUtils.h" +#include "nsAccessibilityService.h" #include "nsAccessible.h" +#include "nsAccUtils.h" #include "nsIDOMXULLabeledControlEl.h" diff --git a/accessible/src/html/nsHTMLFormControlAccessible.cpp b/accessible/src/html/nsHTMLFormControlAccessible.cpp index 982cb197880..959cbdd8038 100644 --- a/accessible/src/html/nsHTMLFormControlAccessible.cpp +++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp @@ -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" diff --git a/accessible/src/html/nsHTMLImageAccessible.cpp b/accessible/src/html/nsHTMLImageAccessible.cpp index f5702651ce6..1cbb07610d5 100644 --- a/accessible/src/html/nsHTMLImageAccessible.cpp +++ b/accessible/src/html/nsHTMLImageAccessible.cpp @@ -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" diff --git a/accessible/src/html/nsHTMLImageMapAccessible.cpp b/accessible/src/html/nsHTMLImageMapAccessible.cpp index c41a5f0f61e..35df102b47d 100644 --- a/accessible/src/html/nsHTMLImageMapAccessible.cpp +++ b/accessible/src/html/nsHTMLImageMapAccessible.cpp @@ -39,6 +39,8 @@ #include "nsHTMLImageMapAccessible.h" +#include "nsAccUtils.h" + #include "nsIDOMHTMLCollection.h" #include "nsIServiceManager.h" #include "nsIDOMElement.h" diff --git a/accessible/src/html/nsHTMLLinkAccessible.cpp b/accessible/src/html/nsHTMLLinkAccessible.cpp index a692aa56cb9..94502e968bc 100644 --- a/accessible/src/html/nsHTMLLinkAccessible.cpp +++ b/accessible/src/html/nsHTMLLinkAccessible.cpp @@ -39,6 +39,8 @@ #include "nsHTMLLinkAccessible.h" +#include "nsCoreUtils.h" + #include "nsILink.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/html/nsHTMLSelectAccessible.cpp b/accessible/src/html/nsHTMLSelectAccessible.cpp index 9594405fba8..c51a09f40d2 100644 --- a/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -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" diff --git a/accessible/src/html/nsHTMLTableAccessible.cpp b/accessible/src/html/nsHTMLTableAccessible.cpp index 52a36674623..42d1bfe0ef1 100644 --- a/accessible/src/html/nsHTMLTableAccessible.cpp +++ b/accessible/src/html/nsHTMLTableAccessible.cpp @@ -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" diff --git a/accessible/src/html/nsHTMLTextAccessible.cpp b/accessible/src/html/nsHTMLTextAccessible.cpp index 5ca9de25e7f..21c023a055f 100644 --- a/accessible/src/html/nsHTMLTextAccessible.cpp +++ b/accessible/src/html/nsHTMLTextAccessible.cpp @@ -40,6 +40,7 @@ #include "nsHTMLTextAccessible.h" #include "nsDocAccessible.h" +#include "nsTextEquivUtils.h" #include "nsIFrame.h" #include "nsPresContext.h" diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp index 11c1c52d5ab..e7585b89d9a 100644 --- a/accessible/src/html/nsHyperTextAccessible.cpp +++ b/accessible/src/html/nsHyperTextAccessible.cpp @@ -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" diff --git a/accessible/src/mac/nsAccessibleWrap.h b/accessible/src/mac/nsAccessibleWrap.h index 838df786ee4..db3ca0ab370 100644 --- a/accessible/src/mac/nsAccessibleWrap.h +++ b/accessible/src/mac/nsAccessibleWrap.h @@ -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; diff --git a/accessible/src/mac/nsAccessibleWrap.mm b/accessible/src/mac/nsAccessibleWrap.mm index 9092d189ed7..9401989ef41 100644 --- a/accessible/src/mac/nsAccessibleWrap.mm +++ b/accessible/src/mac/nsAccessibleWrap.mm @@ -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; +} diff --git a/accessible/src/msaa/CAccessibleText.cpp b/accessible/src/msaa/CAccessibleText.cpp index 03adc923c29..fe6d4e72f2d 100644 --- a/accessible/src/msaa/CAccessibleText.cpp +++ b/accessible/src/msaa/CAccessibleText.cpp @@ -51,6 +51,7 @@ #include "nsAccessibleWrap.h" #include "nsCOMPtr.h" +#include "nsIPersistentProperties2.h" #include "nsString.h" #define GET_NSIACCESSIBLETEXT \ diff --git a/accessible/src/msaa/nsAccessNodeWrap.cpp b/accessible/src/msaa/nsAccessNodeWrap.cpp index 7cead23d72a..a9f10ab61be 100644 --- a/accessible/src/msaa/nsAccessNodeWrap.cpp +++ b/accessible/src/msaa/nsAccessNodeWrap.cpp @@ -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; diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index 91b3ad99703..a93d5739199 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -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" diff --git a/accessible/src/msaa/nsDocAccessibleWrap.h b/accessible/src/msaa/nsDocAccessibleWrap.h index ab9e66325ec..ac250e311cf 100644 --- a/accessible/src/msaa/nsDocAccessibleWrap.h +++ b/accessible/src/msaa/nsDocAccessibleWrap.h @@ -44,6 +44,8 @@ #define _nsDocAccessibleWrap_H_ #include "ISimpleDOMDocument.h" + +#include "nsAccUtils.h" #include "nsDocAccessible.h" #include "nsIDocShellTreeItem.h" diff --git a/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp b/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp index 24e256432e2..27f95feb263 100644 --- a/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp +++ b/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp @@ -40,6 +40,8 @@ #include "nsHyperTextAccessibleWrap.h" +#include "nsEventShell.h" + NS_IMPL_ISUPPORTS_INHERITED0(nsHyperTextAccessibleWrap, nsHyperTextAccessible) diff --git a/accessible/src/msaa/nsTextAccessibleWrap.cpp b/accessible/src/msaa/nsTextAccessibleWrap.cpp index a7087dedb71..a4bf6bf7efa 100644 --- a/accessible/src/msaa/nsTextAccessibleWrap.cpp +++ b/accessible/src/msaa/nsTextAccessibleWrap.cpp @@ -40,6 +40,7 @@ #include "nsTextAccessibleWrap.h" #include "ISimpleDOMText_i.c" +#include "nsCoreUtils.h" #include "nsDocAccessible.h" #include "nsIFontMetrics.h" diff --git a/accessible/src/xforms/nsXFormsAccessible.cpp b/accessible/src/xforms/nsXFormsAccessible.cpp index 70e1a1a3a4d..618565c1d7d 100644 --- a/accessible/src/xforms/nsXFormsAccessible.cpp +++ b/accessible/src/xforms/nsXFormsAccessible.cpp @@ -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 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 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 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 accessible; - return accService->GetAccessibleFor(item, getter_AddRefs(accessible)); + return GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible)); } NS_IMETHODIMP diff --git a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp index daab0e75390..d0f41e88f59 100644 --- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp +++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp @@ -38,6 +38,8 @@ #include "nsXFormsFormControlsAccessible.h" +#include "nsTextEquivUtils.h" + // nsXFormsLabelAccessible nsXFormsLabelAccessible:: diff --git a/accessible/src/xul/nsXULColorPickerAccessible.cpp b/accessible/src/xul/nsXULColorPickerAccessible.cpp index 48e2a514815..c6920b2a1c4 100644 --- a/accessible/src/xul/nsXULColorPickerAccessible.cpp +++ b/accessible/src/xul/nsXULColorPickerAccessible.cpp @@ -38,7 +38,9 @@ #include "nsXULColorPickerAccessible.h" +#include "nsAccUtils.h" #include "nsAccTreeWalker.h" +#include "nsCoreUtils.h" #include "nsIDOMElement.h" diff --git a/accessible/src/xul/nsXULComboboxAccessible.cpp b/accessible/src/xul/nsXULComboboxAccessible.cpp index d86a638795e..68fd80c99ff 100644 --- a/accessible/src/xul/nsXULComboboxAccessible.cpp +++ b/accessible/src/xul/nsXULComboboxAccessible.cpp @@ -40,9 +40,10 @@ #include "nsXULComboboxAccessible.h" +#include "nsAccessibilityService.h" + #include "nsIDOMXULMenuListElement.h" #include "nsIDOMXULSelectCntrlItemEl.h" -#include "nsServiceManagerUtils.h" //////////////////////////////////////////////////////////////////////////////// // nsXULComboboxAccessible diff --git a/accessible/src/xul/nsXULFormControlAccessible.cpp b/accessible/src/xul/nsXULFormControlAccessible.cpp index a8de7b21f52..86dc3a45795 100644 --- a/accessible/src/xul/nsXULFormControlAccessible.cpp +++ b/accessible/src/xul/nsXULFormControlAccessible.cpp @@ -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" diff --git a/accessible/src/xul/nsXULListboxAccessible.cpp b/accessible/src/xul/nsXULListboxAccessible.cpp index 5b08a279956..117814ecaf4 100644 --- a/accessible/src/xul/nsXULListboxAccessible.cpp +++ b/accessible/src/xul/nsXULListboxAccessible.cpp @@ -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 diff --git a/accessible/src/xul/nsXULMenuAccessible.cpp b/accessible/src/xul/nsXULMenuAccessible.cpp index e870347da5f..adb16ba3d4c 100644 --- a/accessible/src/xul/nsXULMenuAccessible.cpp +++ b/accessible/src/xul/nsXULMenuAccessible.cpp @@ -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" diff --git a/accessible/src/xul/nsXULSliderAccessible.cpp b/accessible/src/xul/nsXULSliderAccessible.cpp index ea47153f509..c6c12e73d64 100644 --- a/accessible/src/xul/nsXULSliderAccessible.cpp +++ b/accessible/src/xul/nsXULSliderAccessible.cpp @@ -38,8 +38,11 @@ #include "nsXULSliderAccessible.h" +#include "nsAccessibilityAtoms.h" + #include "nsIDOMDocument.h" #include "nsIDOMDocumentXBL.h" +#include "nsIFrame.h" // nsXULSliderAccessible diff --git a/accessible/src/xul/nsXULTabAccessible.cpp b/accessible/src/xul/nsXULTabAccessible.cpp index b2697f0bb37..046f2f4376b 100644 --- a/accessible/src/xul/nsXULTabAccessible.cpp +++ b/accessible/src/xul/nsXULTabAccessible.cpp @@ -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" diff --git a/accessible/src/xul/nsXULTextAccessible.cpp b/accessible/src/xul/nsXULTextAccessible.cpp index 7fbf545955e..1273d95e6c7 100644 --- a/accessible/src/xul/nsXULTextAccessible.cpp +++ b/accessible/src/xul/nsXULTextAccessible.cpp @@ -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" /** diff --git a/accessible/src/xul/nsXULTreeAccessible.cpp b/accessible/src/xul/nsXULTreeAccessible.cpp index 50f8ae77b76..27f0fc401f9 100644 --- a/accessible/src/xul/nsXULTreeAccessible.cpp +++ b/accessible/src/xul/nsXULTreeAccessible.cpp @@ -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" diff --git a/accessible/src/xul/nsXULTreeGridAccessible.cpp b/accessible/src/xul/nsXULTreeGridAccessible.cpp index fb4c0c8b70c..02eae030f7e 100644 --- a/accessible/src/xul/nsXULTreeGridAccessible.cpp +++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp @@ -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