mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
Bug 1787692: Partially support ISimpleDOMNode::nodeInfo for cached RemoteAccessibles. r=morgan
JAWS won't expose MathML without this. We can't fully support it; we don't cache info about namespaces, for example. However, this implementation is enough to get MathML working with JAWS. Differential Revision: https://phabricator.services.mozilla.com/D156150
This commit is contained in:
parent
a98fa49a7e
commit
41073adfb6
@ -85,9 +85,38 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
|
||||
*aNodeType = 0;
|
||||
|
||||
if (IsDefunct()) return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
// This is a unique ID for every content node. The 3rd party accessibility
|
||||
// application can compare this to the childID we return for events such as
|
||||
// focus events, to correlate back to data nodes in their internal object
|
||||
// model.
|
||||
MsaaAccessible* accessible = GetMsaa();
|
||||
if (accessible) {
|
||||
*aUniqueID = MsaaAccessible::GetChildIDFor(accessible->Acc());
|
||||
} else {
|
||||
if (mUniqueId.isNothing()) {
|
||||
MsaaAccessible::AssignChildIDTo(WrapNotNull(this));
|
||||
}
|
||||
MOZ_ASSERT(mUniqueId.isSome());
|
||||
*aUniqueID = mUniqueId.value();
|
||||
}
|
||||
|
||||
if (!mNode) {
|
||||
MOZ_ASSERT(mMsaa && mMsaa->Acc()->IsRemote());
|
||||
return E_NOTIMPL;
|
||||
RemoteAccessible* remoteAcc = accessible->Acc()->AsRemote();
|
||||
MOZ_ASSERT(remoteAcc);
|
||||
if (remoteAcc->IsText()) {
|
||||
*aNodeType = nsINode::TEXT_NODE;
|
||||
} else if (remoteAcc->IsDoc()) {
|
||||
*aNodeType = nsINode::DOCUMENT_NODE;
|
||||
} else {
|
||||
*aNodeType = nsINode::ELEMENT_NODE;
|
||||
}
|
||||
if (nsAtom* tag = remoteAcc->TagName()) {
|
||||
nsAutoString nodeName;
|
||||
tag->ToString(nodeName);
|
||||
*aNodeName = ::SysAllocString(nodeName.get());
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
uint16_t nodeType = mNode->NodeType();
|
||||
@ -105,21 +134,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
|
||||
? static_cast<short>(mNode->AsContent()->GetNameSpaceID())
|
||||
: 0;
|
||||
|
||||
// This is a unique ID for every content node. The 3rd party accessibility
|
||||
// application can compare this to the childID we return for events such as
|
||||
// focus events, to correlate back to data nodes in their internal object
|
||||
// model.
|
||||
MsaaAccessible* accessible = GetMsaa();
|
||||
if (accessible) {
|
||||
*aUniqueID = MsaaAccessible::GetChildIDFor(accessible->LocalAcc());
|
||||
} else {
|
||||
if (mUniqueId.isNothing()) {
|
||||
MsaaAccessible::AssignChildIDTo(WrapNotNull(this));
|
||||
}
|
||||
MOZ_ASSERT(mUniqueId.isSome());
|
||||
*aUniqueID = mUniqueId.value();
|
||||
}
|
||||
|
||||
*aNumChildren = mNode->GetChildCount();
|
||||
|
||||
return S_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user