Bug 352093. Update accessibility to handle windowless IFRAMES. r=alexsurkov

This commit is contained in:
Robert O'Callahan 2009-07-22 12:45:04 +12:00
parent d6fc5e3bfb
commit 85dc2d2c9c
3 changed files with 11 additions and 6 deletions

View File

@ -2495,16 +2495,18 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
return nsRelUtils::AddTarget(aRelationType, aRelation, accTarget);
}
// If accessible is in its own Window then we should provide NODE_CHILD_OF relation
// so that MSAA clients can easily get to true parent instead of getting to oleacc's
// ROLE_WINDOW accessible which will prevent us from going up further (because it is
// system generated and has no idea about the hierarchy above it).
// If accessible is in its own Window, or is the root of a document,
// then we should provide NODE_CHILD_OF relation so that MSAA clients
// can easily get to true parent instead of getting to oleacc's
// ROLE_WINDOW accessible which will prevent us from going up further
// (because it is system generated and has no idea about the hierarchy
// above it).
nsIFrame *frame = GetFrame();
if (frame) {
nsIView *view = frame->GetViewExternal();
if (view) {
nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
if (scrollFrame || view->GetWidget()) {
if (scrollFrame || view->GetWidget() || !frame->GetParent()) {
nsCOMPtr<nsIAccessible> accTarget;
GetParent(getter_AddRefs(accTarget));
return nsRelUtils::AddTarget(aRelationType, aRelation, accTarget);

View File

@ -106,7 +106,7 @@ nsDocAccessible::nsDocAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell)
nsIViewManager* vm = shell->GetViewManager();
if (vm) {
nsCOMPtr<nsIWidget> widget;
vm->GetWidget(getter_AddRefs(widget));
vm->GetRootWidget(getter_AddRefs(widget));
if (widget) {
mWnd = widget->GetNativeData(NS_NATIVE_WINDOW);
}

View File

@ -397,6 +397,9 @@ function getNodePrettyName(aNode)
if (aNode.nodeType == nsIDOMNode.ELEMENT_NODE && aNode.hasAttribute("id"))
return " '" + aNode.getAttribute("id") + "' ";
if (aNode.nodeType == nsIDOMNode.DOCUMENT_NODE)
return " 'document node' ";
return " '" + aNode.localName + " node' ";
} catch (e) {
return "no node info";