bug 124448 Accessibility Support for Object/Embed tags

r=aaronl
sr=jst
This commit is contained in:
jgaunt%netscape.com 2002-05-10 22:34:53 +00:00
Родитель ed7e3f7fe7
Коммит 6666e38848
34 изменённых файлов: 641 добавлений и 91 удалений

Просмотреть файл

@ -49,7 +49,9 @@ LLIBS=\
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\gkgfx.lib \
$(DIST)\lib\contentshared_s.lib \
$(DIST)\lib\raptorwidget_s.lib \
$(LIBNSPR) \
$(NULL)
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -95,6 +95,16 @@
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:::layout:html:base:src:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>::build:</VALUE></SETTING>
@ -1165,6 +1175,13 @@
<FILEKIND>Library</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsHTMLPluginAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
</FILELIST>
<LINKORDER>
<FILEREF>
@ -1292,6 +1309,11 @@
<PATH>accessible_xul.o</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsHTMLPluginAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
</LINKORDER>
</TARGET>
<TARGET>
@ -1336,6 +1358,16 @@
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>:::layout:html:base:src:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
</SETTING>
<SETTING>
<SETTING><NAME>SearchPath</NAME>
<SETTING><NAME>Path</NAME><VALUE>::build:</VALUE></SETTING>
@ -2406,6 +2438,13 @@
<FILEKIND>Library</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
<FILE>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsHTMLPluginAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
<FILEKIND>Text</FILEKIND>
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
</FILELIST>
<LINKORDER>
<FILEREF>
@ -2533,6 +2572,11 @@
<PATH>accessible_xulDebug.o</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsHTMLPluginAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
</LINKORDER>
</TARGET>
</TARGETLIST>
@ -2603,6 +2647,12 @@
<PATH>nsHTMLLinkAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<TARGETNAME>accessible.shlb</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
<PATH>nsHTMLPluginAccessible.cpp</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
<FILEREF>
<TARGETNAME>accessible.shlb</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>

Просмотреть файл

@ -37,14 +37,14 @@ XPIDLSRCS = \
nsIAccessibleEditableText.idl \
nsIAccessibleEventReceiver.idl \
nsIAccessibleEventListener.idl \
nsIAccessibleSelectable.idl \
nsIAccessibleSelection.idl \
nsIAccessibleHyperLink.idl \
nsIAccessibleHyperText.idl \
nsIAccessibleProvider.idl \
nsIAccessibleSelectable.idl \
nsIAccessibleSelection.idl \
nsIAccessibleTable.idl \
nsIAccessibleText.idl \
nsIAccessibleValue.idl \
nsIAccessibleProvider.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -31,14 +31,15 @@ XPIDLSRCS = \
.\nsIAccessibleEditableText.idl \
.\nsIAccessibleEventReceiver.idl \
.\nsIAccessibleEventListener.idl \
.\nsIAccessibleSelectable.idl \
.\nsIAccessibleSelection.idl \
.\nsIAccessibleHyperLink.idl \
.\nsIAccessibleHyperText.idl \
.\nsIAccessibleProvider.idl \
.\nsIAccessibleSelectable.idl \
.\nsIAccessibleSelection.idl \
.\nsIAccessibleTable.idl \
.\nsIAccessibleText.idl \
.\nsIAccessibleValue.idl \
.\nsIAccessibleProvider.idl \
.\nsIAccessibleWin32Object.idl \
$(NULL)
EXPORTS = \

Просмотреть файл

@ -46,9 +46,8 @@ interface nsIAccessibilityService : nsISupports
nsIAccessible createHTMLGroupboxAccessible(in nsISupports aFrame);
nsIAccessible createHTMLImageAccessible(in nsISupports aFrame);
nsIAccessible createHTMLListboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell);
// new
// nsIAccessible CreateHTMLObjectAccessible(in nsISupports aFrame);
// end new
nsIAccessible createHTMLNativeWindowAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell, in PRInt32 aHWnd);
nsIAccessible createHTMLPluginAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell);
nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame);
nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsISupports aPresShell);
nsIAccessible createHTMLTableAccessible(in nsISupports aFrame);

Просмотреть файл

Просмотреть файл

@ -41,6 +41,7 @@ REQUIRES = \
layout \
locale \
necko \
plugin \
pref \
string \
uriloader \
@ -75,4 +76,5 @@ LOCAL_INCLUDES += \
-I$(srcdir) \
-I$(srcdir)/../html \
-I$(srcdir)/../xul \
-I$(srcdir)/../../../layout/html/base/src \
$(NULL)

Просмотреть файл

@ -32,6 +32,7 @@ REQUIRES = \
layout \
locale \
necko \
plugin \
pref \
string \
uriloader \
@ -41,7 +42,6 @@ REQUIRES = \
xpcom \
$(NULL)
CPP_OBJS = \
.\$(OBJDIR)\nsAccessibilityService.obj \
.\$(OBJDIR)\nsAccessible.obj \
@ -62,6 +62,7 @@ LINCS = \
-I..\..\..\layout\html\forms\public \
-I..\..\..\layout\html\forms\src \
-I..\..\..\layout\html\base\src \
-I..\..\..\widget\src\windows \
$(NULL)

Просмотреть файл

@ -46,7 +46,7 @@
#include "nsHTMLFormControlAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsHTMLLinkAccessible.h"
//#include "nsHTMLObjectAccessible.h" -- this comes with a later checkin DOH! - jgaunt
#include "nsHTMLPluginAccessible.h"
#include "nsHTMLSelectAccessible.h"
#include "nsHTMLTableAccessible.h"
#include "nsHTMLTextAccessible.h"
@ -57,6 +57,7 @@
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLOptGroupElement.h"
#include "nsIDOMHTMLLegendElement.h"
@ -65,10 +66,13 @@
#include "nsIFrame.h"
#include "nsILink.h"
#include "nsINameSpaceManager.h"
#include "nsIObjectFrame.h"
#include "nsIPluginInstance.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsITextContent.h"
#include "nsLayoutAtoms.h"
#include "nsObjectFrame.h"
#include "nsRootAccessible.h"
#include "nsString.h"
#include "nsTextFragment.h"
@ -80,6 +84,11 @@
#include "nsXULTextAccessible.h"
#include "nsIAccessible.h"
// For native window support for object/embed/applet tags
#ifdef XP_WIN
#include "nsHTMLWin32ObjectAccessible.h"
#endif
// IFrame
#include "nsIDocShell.h"
#include "nsHTMLIFrameRootAccessible.h"
@ -278,20 +287,24 @@ nsAccessibilityService::CreateIFrameAccessible(nsIDOMNode* aDOMNode, nsIAccessib
nsCOMPtr<nsIWeakReference> innerWeakShell =
do_GetWeakReference(innerPresShell);
nsCOMPtr<nsIAccessible> innerRootAccessible =
nsHTMLIFrameRootAccessible *innerRootAccessible =
new nsHTMLIFrameRootAccessible(aDOMNode, innerWeakShell);
if (innerRootAccessible) {
nsHTMLIFrameAccessible* outerRootAccessible =
nsHTMLIFrameAccessible *outerRootAccessible =
new nsHTMLIFrameAccessible(aDOMNode, innerRootAccessible,
outerWeakShell, sub_doc);
if (outerRootAccessible) {
innerRootAccessible->Init(outerRootAccessible);
*_retval = outerRootAccessible;
NS_ADDREF(*_retval);
return NS_OK;
if (*_retval) {
NS_ADDREF(*_retval);
return NS_OK;
}
}
else // don't leak the innerRoot
delete innerRootAccessible;
}
}
}
@ -520,25 +533,35 @@ nsAccessibilityService::CreateHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsISup
return NS_OK;
}
/* -- coming in a later patch
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLObjectAccessible(nsISupports *aFrame, nsIAccessible **_retval)
nsAccessibilityService::CreateHTMLPluginAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLPluginAccessible(aDOMNode, aShell);
*_retval = new nsHTMLObjectAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
*/
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLNativeWindowAccessible(nsIDOMNode *aDOMNode, nsIWeakReference *aShell,
PRInt32 aHwnd, nsIAccessible **_retval)
{
#ifdef XP_WIN
*_retval = new nsHTMLWin32ObjectAccessible(aDOMNode, aShell, aHwnd);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
#else
*_retval = nsnull;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
@ -1145,6 +1168,54 @@ NS_IMETHODIMP nsAccessibilityService::CreateXULTabsAccessible(nsIDOMNode *aNode,
return NS_OK;
}
/**
* We can have several cases here.
* 1) a text or html embedded document where the contentDocument
* variable in the object element holds the content
* 2) web content that uses a plugin, which means we will
* have to go to the plugin to get the accessible content
* 3) An image or imagemap, where the image frame points back to
* the object element DOMNode
*/
nsresult
nsAccessibilityService::GetHTMLObjectAccessibleFor(nsIDOMNode *aNode,
nsIPresShell *aShell,
nsObjectFrame *aFrame,
nsIAccessible **_retval)
{
// 1) for object elements containing either HTML or TXT documents
nsCOMPtr<nsIDOMDocument> domDoc;
nsCOMPtr<nsIDOMHTMLObjectElement> obj(do_QueryInterface(aNode));
if (obj)
obj->GetContentDocument(getter_AddRefs(domDoc));
else
domDoc = do_QueryInterface(aNode);
if (domDoc)
return CreateIFrameAccessible(aNode, _retval);
// 2) for plugins
nsCOMPtr<nsIPluginInstance> pluginInstance ;
aFrame->GetPluginInstance(*getter_AddRefs(pluginInstance));
if (pluginInstance) {
nsCOMPtr<nsIWeakReference> weakShell (do_GetWeakReference(aShell));
CreateHTMLPluginAccessible(aNode, weakShell, _retval);
return NS_OK;
}
// 3) for images and imagemaps
nsCOMPtr<nsIPresContext> context;
aShell->GetPresContext(getter_AddRefs(context));
if (!context)
return NS_ERROR_FAILURE;
// we have the object frame, get the image frame
nsIFrame *frame;
aFrame->FirstChild(context, nsnull, &frame);
CreateHTMLImageAccessible(frame, _retval);
if (*_retval)
return NS_OK;
return NS_ERROR_FAILURE;
}
/**
* GetAccessibleFor - get an nsIAccessible from a DOM node
@ -1243,6 +1314,14 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
if (!frame)
return NS_ERROR_FAILURE;
// ---- object/embed/applet tags all use nsObjectFrames ----
nsCOMPtr<nsIAtom> frameType;
frame->GetFrameType(getter_AddRefs(frameType));
if (frameType.get() == nsLayoutAtoms::objectFrame) {
nsObjectFrame* objectFrame = NS_STATIC_CAST(nsObjectFrame*, frame);
return GetHTMLObjectAccessibleFor(aNode, shell, objectFrame, _retval);
}
frame->GetAccessible(getter_AddRefs(newAcc));
// ---- If link, create link accessible ----

Просмотреть файл

@ -43,6 +43,7 @@
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIDocShell.h"
#include "nsObjectFrame.h"
class nsIFrame;
class nsIWeakReference;
@ -60,6 +61,7 @@ public:
NS_DECL_NSIACCESSIBILITYSERVICE
private:
nsresult GetHTMLObjectAccessibleFor(nsIDOMNode *aNode, nsIPresShell *aShell, nsObjectFrame *aFrame, nsIAccessible **_retval);
nsresult GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aContent);
nsresult GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **weakShell);
void GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent);

Просмотреть файл

@ -87,6 +87,7 @@
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLObjectElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
@ -770,7 +771,7 @@ NS_IMETHODIMP nsAccessible::GetAccState(PRUint32 *aAccState)
}
/* readonly attribute boolean accFocused; */
NS_IMETHODIMP nsAccessible::GetAccFocused(nsIAccessible * *aAccFocused)
NS_IMETHODIMP nsAccessible::GetAccFocused(nsIAccessible **aAccFocused)
{
*aAccFocused = nsnull;
@ -1274,11 +1275,15 @@ NS_IMETHODIMP nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent
return NS_OK;
}
nsCOMPtr<nsIDOMHTMLImageElement> imageContent(do_QueryInterface(aContent));
nsCOMPtr<nsIDOMHTMLInputElement> inputContent;
if (!imageContent)
nsCOMPtr<nsIDOMHTMLObjectElement> objectContent;
nsCOMPtr<nsIDOMHTMLImageElement> imageContent(do_QueryInterface(aContent));
if (!imageContent) {
inputContent = do_QueryInterface(aContent);
if (imageContent || inputContent) {
if (!inputContent)
objectContent = do_QueryInterface(aContent);
}
if (imageContent || inputContent || objectContent) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContent));
NS_ASSERTION(elt, "No DOM element for content node!");
elt->GetAttribute(NS_LITERAL_STRING("alt"), textEquivalent);
@ -1288,6 +1293,8 @@ NS_IMETHODIMP nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent
elt->GetAttribute(NS_LITERAL_STRING("name"), textEquivalent);
if (textEquivalent.IsEmpty())
elt->GetAttribute(NS_LITERAL_STRING("src"), textEquivalent);
if (textEquivalent.IsEmpty())
elt->GetAttribute(NS_LITERAL_STRING("data"), textEquivalent); // for <object>s with images
return AppendStringWithSpaces(aFlatString, textEquivalent);
}

Просмотреть файл

@ -209,6 +209,8 @@ nsAccessible(aDOMNode, aShell)
{
}
NS_IMPL_ISUPPORTS_INHERITED1(nsListboxAccessible, nsAccessible, nsIAccessibleSelectable)
/** We are a window, as far as MSAA is concerned */
NS_IMETHODIMP nsListboxAccessible::GetAccRole(PRUint32 *_retval)
{
@ -241,6 +243,15 @@ NS_IMETHODIMP nsListboxAccessible::GetAccState(PRUint32 *_retval)
return NS_OK;
}
/**
* No-op method body. subclasses MUST override this method
*/
NS_IMETHODIMP nsListboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */

Просмотреть файл

@ -98,10 +98,14 @@ protected:
/**
* A class that represents the Listbox widget.
*/
class nsListboxAccessible : public nsAccessible
class nsListboxAccessible : public nsAccessible,
public nsIAccessibleSelectable
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsListboxAccessible (nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsListboxAccessible () {}

Просмотреть файл

@ -31,6 +31,7 @@ LIBRARY_NAME = accessibility_html_s
REQUIRES = \
content \
content_xul \
docshell \
dom \
gfx \
gfx2 \
@ -40,6 +41,7 @@ REQUIRES = \
layout \
locale \
necko \
plugin \
string \
uriloader \
view \
@ -55,6 +57,7 @@ CPPSRCS = \
nsHTMLIFrameRootAccessible.cpp \
nsHTMLImageAccessible.cpp \
nsHTMLLinkAccessible.cpp \
nsHTMLPluginAccessible.cpp \
nsHTMLSelectAccessible.cpp \
nsHTMLTableAccessible.cpp \
nsHTMLTextAccessible.cpp \
@ -67,4 +70,5 @@ include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \
-I$(srcdir)/../base \
-I$(srcdir)/../../../layout/html/base/src \
$(NULL)

Просмотреть файл

@ -24,6 +24,7 @@ MODULE = accessibility
LIBRARY_NAME = accessibility_html_s
REQUIRES = \
content \
docshell \
dom \
gfx \
gfx2 \
@ -33,6 +34,7 @@ REQUIRES = \
layout \
locale \
necko \
plugin \
string \
uriloader \
view \
@ -47,12 +49,15 @@ CPP_OBJS = \
.\$(OBJDIR)\nsHTMLIFrameRootAccessible.obj \
.\$(OBJDIR)\nsHTMLImageAccessible.obj \
.\$(OBJDIR)\nsHTMLLinkAccessible.obj \
.\$(OBJDIR)\nsHTMLPluginAccessible.obj \
.\$(OBJDIR)\nsHTMLSelectAccessible.obj \
.\$(OBJDIR)\nsHTMLTableAccessible.obj \
.\$(OBJDIR)\nsHTMLTextAccessible.obj \
.\$(OBJDIR)\nsHTMLWin32ObjectAccessible.obj \
$(NULL)
EXPORTS = \
.\nsHTMLWin32ObjectAccessible.h \
$(NULL)
LINCS = \
@ -60,6 +65,7 @@ LINCS = \
-I..\..\..\layout\html\forms\public \
-I..\..\..\layout\html\forms\src \
-I..\..\..\layout\html\base\src \
-I..\..\..\widget\src\windows \
$(NULL)

Просмотреть файл

@ -166,40 +166,51 @@ nsHTMLIFrameRootAccessible::~nsHTMLIFrameRootAccessible()
void nsHTMLIFrameRootAccessible::Init()
{
if (!mOuterAccessible) {
nsCOMPtr<nsIDOMDocument> domDoc;
mOuterNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (doc) {
nsCOMPtr<nsIPresShell> parentShell;
doc->GetShellAt(0, getter_AddRefs(parentShell));
if (parentShell) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuterNode));
nsIFrame* frame = nsnull;
parentShell->GetPrimaryFrameFor(content, &frame);
NS_ASSERTION(frame, "No outer frame.");
frame->GetAccessible(getter_AddRefs(mOuterAccessible));
NS_ASSERTION(mOuterAccessible, "Something's wrong - there's no accessible for the outer parent of this frame.");
}
nsCOMPtr<nsIDOMDocument> domDoc;
mOuterNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (doc) {
nsCOMPtr<nsIPresShell> parentShell;
doc->GetShellAt(0, getter_AddRefs(parentShell));
if (parentShell) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuterNode));
nsIFrame* frame = nsnull;
parentShell->GetPrimaryFrameFor(content, &frame);
NS_ASSERTION(frame, "No outer frame.");
if (!frame)
return;
frame->GetAccessible(getter_AddRefs(mOuterAccessible));
NS_ASSERTION(mOuterAccessible, "Something's wrong - there's no accessible for the outer parent of this frame.");
}
}
}
void nsHTMLIFrameRootAccessible::Init(nsIAccessible *aOuterAccessible)
{
if (aOuterAccessible) {
mOuterAccessible = aOuterAccessible;
}
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible * *_retval)
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible **_retval)
{
Init();
if (!mOuterAccessible)
Init();
return mOuterAccessible->GetAccParent(_retval);
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
Init();
if (!mOuterAccessible)
Init();
return mOuterAccessible->GetAccNextSibling(_retval);
}
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
Init();
if (!mOuterAccessible)
Init();
return mOuterAccessible->GetAccPreviousSibling(_retval);
}

Просмотреть файл

@ -89,6 +89,9 @@ class nsHTMLIFrameRootAccessible : public nsRootAccessible
protected:
void Init();
public:
void Init(nsIAccessible *aOuterAccessible);
// In these variable names, "outer" relates to the nsHTMLIFrameAccessible, as opposed to the
// nsHTMLIFrameRootAccessible which is "inner".
// The outer node is a <browser> or <iframe> tag, whereas the inner node corresponds to the inner document root.

Просмотреть файл

@ -0,0 +1,96 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLPluginAccessible.h"
#include "nsIContent.h"
#include "nsObjectFrame.h"
#include "nsplugindefs.h"
#include "nsAccessibilityService.h"
nsHTMLPluginAccessible::nsHTMLPluginAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell), mAccService(do_GetService("@mozilla.org/accessibilityService;1"))
{
}
NS_IMETHODIMP
nsHTMLPluginAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
nsIFrame* frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return NS_ERROR_FAILURE;
nsObjectFrame* objectFrame = NS_STATIC_CAST(nsObjectFrame*, frame);
#ifdef XP_WIN
HWND pluginPort = nsnull;
objectFrame->GetPluginPort(&pluginPort);
if (pluginPort) {
if (mAccService)
mAccService->CreateHTMLNativeWindowAccessible(mDOMNode, mPresShell, (PRInt32)pluginPort, _retval);
}
#else
*_retval = nsnull;
#endif
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLPluginAccessible::GetAccLastChild(nsIAccessible **_retval)
{
return GetAccFirstChild(_retval);
}
NS_IMETHODIMP
nsHTMLPluginAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLPluginAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsAccessible.h"
class nsHTMLPluginAccessible : public nsAccessible
{
public:
nsHTMLPluginAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
protected:
nsCOMPtr<nsIAccessibilityService> mAccService;
};

Просмотреть файл

@ -38,10 +38,13 @@
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsGUIEvent.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDocument.h"
#include "nsIDOMDocumentEvent.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLInputElement.h"
@ -50,10 +53,11 @@
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLOListElement.h"
#include "nsIListControlFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIOptionElement.h"
#include "nsISelectControlFrame.h"
#include "nsIServiceManager.h"
#include "nsIWidget.h"
#include "nsLayoutAtoms.h"
#include "nsIDocument.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
@ -324,7 +328,6 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNumActions(PRUint8 *_retval)
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::AccDoAction(PRUint8 index)
{
if (index == eAction_Select) { // default action
@ -489,9 +492,6 @@ nsListboxAccessible(aDOMNode, aShell)
{
}
/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLListboxAccessible, nsListboxAccessible, nsIAccessibleSelectable)
/**
* Our last (and only) child is an nsHTMLSelectListAccessible object
*/

Просмотреть файл

@ -47,8 +47,7 @@
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
* widgets, some of which are shared between the two. This file contains
* all of the widgets for both of the Selects, for HTML only. Some of them
* widgets, some of which are shared between the two. This file contains * all of the widgets for both of the Selects, for HTML only. Some of them
* extend classes from nsSelectAccessible.cpp, which contains base classes
* that are also extended by the XUL Select Accessibility support.
*
@ -98,12 +97,12 @@ public:
virtual ~nsHTMLSelectOptionAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAString& _retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
static nsresult GetFocusedOptionNode(nsIDOMNode *aListNode, nsCOMPtr<nsIDOMNode>& aFocusedOptionNode);
};
@ -133,14 +132,12 @@ public:
/*
* A class the represents the HTML Listbox widget.
*/
class nsHTMLListboxAccessible : public nsListboxAccessible,
public nsIAccessibleSelectable
class nsHTMLListboxAccessible : public nsListboxAccessible
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLListboxAccessible() {}

Просмотреть файл

@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com) (original author)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLWin32ObjectAccessible.h"
#include "Accessible.h"
nsHTMLWin32ObjectAccessible::nsHTMLWin32ObjectAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, PRInt32 aHwnd):
nsAccessible(aNode, aShell)
{
if (aHwnd) {
// XXX - when we get accessible plugins we may have to check here
// for the proper window handle using Win32 APIs so we check
// the proper IAccessible for the information we need.
mHwnd = aHwnd;
}
}
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLWin32ObjectAccessible, nsAccessible, nsIAccessibleWin32Object)
NS_IMETHODIMP
nsHTMLWin32ObjectAccessible::GetHwnd(PRInt32 *aHwnd) {
*aHwnd = mHwnd;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,79 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape 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/NPL/
*
* 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com) (original author)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLWin32ObjectAccessible_H_
#define _nsHTMLWin32ObjectAccessible_H_
#include "nsAccessible.h"
#include "nsIAccessibleWin32Object.h"
struct IAccessible;
/**
* This class is used only internally, we never! send out an IAccessible linked
* back to this object. This class is used to represent a plugin object when
* referenced as a child or sibling of another nsAccessible node. We need only
* a limited portion of the nsIAccessible interface implemented here. The
* in depth accessible information will be returned by the actual IAccessible
* object returned by us in Accessible::NewAccessible() that gets the IAccessible
* from the windows system from the window handle.
*/
class nsHTMLWin32ObjectAccessible : public nsAccessible,
public nsIAccessibleWin32Object
{
public:
nsHTMLWin32ObjectAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, PRInt32 aHwnd);
virtual ~nsHTMLWin32ObjectAccessible() {}
NS_DECL_ISUPPORTS_INHERITED
// ---- nsIAccessibleWin32Object ----
NS_IMETHOD GetHwnd(PRInt32 *aHwnd);
protected:
// ---- Data Members ----
/**
* A handle to the native plugin window (hopefully), given to
* Accessible::NewAccessible() so the actual IAccessible can be retrieved.
*/
PRInt32 mHwnd;
};
#endif

Просмотреть файл

@ -41,6 +41,7 @@ REQUIRES = \
layout \
locale \
necko \
plugin \
pref \
string \
uriloader \

Просмотреть файл

@ -24,11 +24,13 @@ MODULE = accessibility
LIBRARY_NAME = accessibility_xul_s
REQUIRES = \
content \
docshell \
dom \
gfx \
intl \
layout \
necko \
plugin \
pref \
string \
widget \
@ -50,12 +52,8 @@ EXPORTS = \
LINCS = \
-I..\base \
-I..\html \
-I..\..\..\layout\html\forms\public \
-I..\..\..\layout\html\forms\src \
-I..\..\..\layout\html\base\src \
$(NULL)
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)

Просмотреть файл

@ -64,7 +64,7 @@
// Don't inherit from nsFormControlAccessible - it doesn't allow children and a button can have a dropmarker child
nsXULButtonAccessible::nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell), mAccService(do_GetService("@mozilla.org/accessibilityService;1"))
nsAccessible(aNode, aShell)
{
}

Просмотреть файл

@ -59,10 +59,6 @@ public:
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
private:
nsCOMPtr<nsIAccessibilityService> mAccService;
};
class nsXULCheckboxAccessible : public nsFormControlAccessible

Просмотреть файл

@ -151,9 +151,6 @@ nsListboxAccessible(aDOMNode, aShell)
{
}
/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
NS_IMPL_ISUPPORTS_INHERITED1(nsXULListboxAccessible, nsListboxAccessible, nsIAccessibleSelectable)
/**
* Let Accessible count them up
*/

Просмотреть файл

@ -109,14 +109,12 @@ public:
/*
* A class the represents the XUL Listbox widget.
*/
class nsXULListboxAccessible : public nsListboxAccessible,
public nsIAccessibleSelectable
class nsXULListboxAccessible : public nsListboxAccessible
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsXULListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsXULListboxAccessible() {}

Просмотреть файл

@ -128,6 +128,11 @@
#include "nsObjectFrame.h"
#include "nsIObjectFrame.h"
// accessibility support
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#endif
#include "nsContentCID.h"
static NS_DEFINE_CID(kRangeCID, NS_RANGE_CID);
@ -402,6 +407,29 @@ NS_IMETHODIMP_(nsrefcnt) nsObjectFrame::Release(void)
return 1;
}
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsObjectFrame::GetAccessible(nsIAccessible** aAccessible)
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent);
return accService->CreateIFrameAccessible(node, aAccessible);
}
return NS_ERROR_FAILURE;
}
#ifdef XP_WIN
NS_IMETHODIMP nsObjectFrame::GetPluginPort(HWND *aPort)
{
*aPort = (HWND) mInstanceOwner->GetPluginPort();
return NS_OK;
}
#endif
#endif
static NS_DEFINE_CID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
static NS_DEFINE_CID(kCAppShellCID, NS_APPSHELL_CID);

Просмотреть файл

@ -45,6 +45,10 @@
#include "nsplugin.h"
#include "nsIObjectFrame.h"
#ifdef ACCESSIBILITY
class nsIAccessible;
#endif
class nsPluginInstanceOwner;
#define nsObjectFrameSuper nsHTMLContainerFrame
@ -100,6 +104,14 @@ public:
nsresult MakeAbsoluteURL(nsIURI* *aFullURI,
nsString aSrc,
nsIURI* aBaseURI);
// accessibility support
#ifdef ACCESSIBILITY
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
#ifdef XP_WIN
NS_IMETHOD GetPluginPort(HWND *aPort);
#endif
#endif
//local methods
nsresult CreateWidget(nsIPresContext* aPresContext,
nscoord aWidth,

Просмотреть файл

@ -128,6 +128,11 @@
#include "nsObjectFrame.h"
#include "nsIObjectFrame.h"
// accessibility support
#ifdef ACCESSIBILITY
#include "nsIAccessibilityService.h"
#endif
#include "nsContentCID.h"
static NS_DEFINE_CID(kRangeCID, NS_RANGE_CID);
@ -402,6 +407,29 @@ NS_IMETHODIMP_(nsrefcnt) nsObjectFrame::Release(void)
return 1;
}
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsObjectFrame::GetAccessible(nsIAccessible** aAccessible)
{
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
if (accService) {
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(mContent);
return accService->CreateIFrameAccessible(node, aAccessible);
}
return NS_ERROR_FAILURE;
}
#ifdef XP_WIN
NS_IMETHODIMP nsObjectFrame::GetPluginPort(HWND *aPort)
{
*aPort = (HWND) mInstanceOwner->GetPluginPort();
return NS_OK;
}
#endif
#endif
static NS_DEFINE_CID(kViewCID, NS_VIEW_CID);
static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
static NS_DEFINE_CID(kCAppShellCID, NS_APPSHELL_CID);

Просмотреть файл

@ -45,6 +45,10 @@
#include "nsplugin.h"
#include "nsIObjectFrame.h"
#ifdef ACCESSIBILITY
class nsIAccessible;
#endif
class nsPluginInstanceOwner;
#define nsObjectFrameSuper nsHTMLContainerFrame
@ -100,6 +104,14 @@ public:
nsresult MakeAbsoluteURL(nsIURI* *aFullURI,
nsString aSrc,
nsIURI* aBaseURI);
// accessibility support
#ifdef ACCESSIBILITY
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
#ifdef XP_WIN
NS_IMETHOD GetPluginPort(HWND *aPort);
#endif
#endif
//local methods
nsresult CreateWidget(nsIPresContext* aPresContext,
nscoord aWidth,

Просмотреть файл

@ -34,22 +34,23 @@
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "Accessible.h"
#include "nsCOMPtr.h"
#include "nsIAccessibilityService.h"
#include "nsIAccessible.h"
#include "nsIAccessibleDocument.h"
#include "nsIAccessibleSelectable.h"
#include "nsIAccessibilityService.h"
#include "Accessible.h"
#include "nsIWidget.h"
#include "nsWindow.h"
#include "nsCOMPtr.h"
#include "nsIAccessibleEventReceiver.h"
#include "nsReadableUtils.h"
#include "nsITextContent.h"
#include "nsIAccessibleSelectable.h"
#include "nsIAccessibleWin32Object.h"
#include "nsIDocument.h"
#include "nsIXULDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsINameSpaceManager.h"
#include "nsITextContent.h"
#include "nsIWidget.h"
#include "nsIXULDocument.h"
#include "nsReadableUtils.h"
#include "nsWindow.h"
#include "String.h"
// for the COM IEnumVARIANT solution in get_AccSelection()
@ -747,6 +748,15 @@ IAccessible *Accessible::NewAccessible(nsIAccessible *aNSAcc, nsIDOMNode *aNode,
{
IAccessible *retval = nsnull;
if (aNSAcc) {
nsCOMPtr<nsIAccessibleWin32Object> accObject(do_QueryInterface(aNSAcc));
if (accObject) {
PRInt32 iHwnd;
accObject->GetHwnd(&iHwnd);
if (iHwnd) {
AccessibleObjectFromWindow(NS_REINTERPRET_CAST(HWND, iHwnd), OBJID_CLIENT, IID_IAccessible, (void **) &retval);
return retval;
}
}
nsCOMPtr<nsIAccessibleDocument> accDoc(do_QueryInterface(aNSAcc));
if (accDoc) {
nsCOMPtr<nsIDocument> doc;