зеркало из https://github.com/mozilla/pjs.git
Bug 249421 - Remote getDOMNode from nsIAccessible (it is already available in nsIAccessNode).
r=aaronleventhal@moonset.net, sr=darin@meer.net
This commit is contained in:
Родитель
06e7427174
Коммит
c611c6232c
|
@ -39,8 +39,6 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIDOMNode.idl"
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* A cross-platform interface that supports platform-specific
|
||||
|
@ -54,7 +52,7 @@
|
|||
*
|
||||
* @status UNDER_REVIEW
|
||||
*/
|
||||
[scriptable, uuid(A84FCE8C-B127-4528-84F1-A022F5B040DA)]
|
||||
[scriptable, uuid(EF7E14F3-64D2-4389-8F8B-DD899C544374)]
|
||||
interface nsIAccessible : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -230,11 +228,6 @@ interface nsIAccessible : nsISupports
|
|||
*/
|
||||
void doAction(in PRUint8 index);
|
||||
|
||||
/**
|
||||
* Get the DOM node described by this accessible node
|
||||
*/
|
||||
nsIDOMNode getDOMNode();
|
||||
|
||||
/**
|
||||
* Get a pointer to accessibility interface for this node, which is specific
|
||||
* to the OS/accessibility toolkit we're running on.
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIAccessible.idl"
|
||||
#include "nsIDOMNode.idl"
|
||||
|
||||
[scriptable, uuid(9124c666-6133-4be6-b3ed-dd0ec35f1e64)]
|
||||
interface nsIAccessibleCaret : nsISupports
|
||||
|
|
|
@ -112,8 +112,10 @@ nsHTMLTableAccessibleWrap::SetCaption(nsIAccessible *aCaption)
|
|||
nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mDOMNode));
|
||||
NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aCaption));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
nsCOMPtr<nsIDOMNode> domNode;
|
||||
rv = aCaption->GetDOMNode(getter_AddRefs(domNode));
|
||||
rv = accessNode->GetDOMNode(getter_AddRefs(domNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMNode> newDOMNode;
|
||||
|
|
|
@ -210,8 +210,10 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::CellRefAt(PRInt32 aRow, PRInt32 aColumn,
|
|||
rv = header->CellRefAt(0, aColumn, getter_AddRefs(column));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(column));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
nsCOMPtr<nsIDOMNode> columnNode;
|
||||
rv = column->GetDOMNode(getter_AddRefs(columnNode));
|
||||
rv = accessNode->GetDOMNode(getter_AddRefs(columnNode));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> columnElement(do_QueryInterface(columnNode, &rv));
|
||||
|
|
|
@ -636,13 +636,6 @@ NS_IMETHODIMP nsAccessible::GetChildAtPoint(PRInt32 tx, PRInt32 ty, nsIAccessibl
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccessible::GetDOMNode(nsIDOMNode **_retval)
|
||||
{
|
||||
*_retval = mDOMNode;
|
||||
NS_IF_ADDREF(*_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsAccessible::GetScreenOrigin(nsIPresContext *aPresContext, nsIFrame *aFrame, nsRect *aRect)
|
||||
{
|
||||
aRect->x = aRect->y = 0;
|
||||
|
|
|
@ -475,8 +475,10 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
|
|||
else if (eventType.LowerCaseEqualsLiteral("dommenubarinactive")) {
|
||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENUEND, accessible, nsnull);
|
||||
GetFocusedChild(getter_AddRefs(accessible));
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(accessible));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
if (accessible) {
|
||||
accessible->GetDOMNode(getter_AddRefs(targetNode));
|
||||
accessNode->GetDOMNode(getter_AddRefs(targetNode));
|
||||
FireAccessibleFocusEvent(accessible, targetNode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -499,8 +499,10 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetNextSibling(nsIAccessible **aNext
|
|||
currentNode->GetParentNode(getter_AddRefs(parent));
|
||||
|
||||
next = nsnull;
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(mParent));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
nsCOMPtr<nsIDOMNode> selectNode;
|
||||
mParent->GetDOMNode(getter_AddRefs(selectNode));
|
||||
accessNode->GetDOMNode(getter_AddRefs(selectNode));
|
||||
if (parent && parent != selectNode) { // End search for options at subtree's start
|
||||
parent->GetNextSibling(getter_AddRefs(next));
|
||||
if (next) {
|
||||
|
@ -582,7 +584,9 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetPreviousSibling(nsIAccessible **_
|
|||
*_retval = nsnull;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nextSiblingAcc->GetDOMNode(getter_AddRefs(siblingDOMNode));
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(nextSiblingAcc));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
accessNode->GetDOMNode(getter_AddRefs(siblingDOMNode));
|
||||
if (siblingDOMNode == mDOMNode) {
|
||||
break; // we found ourselves!
|
||||
}
|
||||
|
@ -663,7 +667,9 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
|
|||
return NS_ERROR_FAILURE;
|
||||
// Clear old selection
|
||||
nsCOMPtr<nsIDOMNode> oldHTMLOptionNode, selectNode;
|
||||
mParent->GetDOMNode(getter_AddRefs(selectNode));
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(mParent));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
accessNode->GetDOMNode(getter_AddRefs(selectNode));
|
||||
GetFocusedOptionNode(selectNode, getter_AddRefs(oldHTMLOptionNode));
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> oldHTMLOption(do_QueryInterface(oldHTMLOptionNode));
|
||||
if (oldHTMLOption)
|
||||
|
|
|
@ -576,8 +576,10 @@ STDMETHODIMP nsAccessibleWrap::accHitTest(
|
|||
} else { // its not create an Accessible for it.
|
||||
pvarChild->vt = VT_DISPATCH;
|
||||
pvarChild->pdispVal = NativeAccessible(xpAccessible);
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(xpAccessible));
|
||||
NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
|
||||
nsCOMPtr<nsIDOMNode> domNode;
|
||||
xpAccessible->GetDOMNode(getter_AddRefs(domNode));
|
||||
accessNode->GetDOMNode(getter_AddRefs(domNode));
|
||||
if (!domNode) {
|
||||
// Has already been shut down
|
||||
pvarChild->vt = VT_EMPTY;
|
||||
|
@ -786,8 +788,6 @@ IDispatch *nsAccessibleWrap::NativeAccessible(nsIAccessible *aXPAccessible)
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aXPAccessible));
|
||||
|
||||
IAccessible *msaaAccessible;
|
||||
aXPAccessible->GetNativeInterface((void**)&msaaAccessible);
|
||||
|
||||
|
|
|
@ -317,8 +317,9 @@ NS_IMETHODIMP nsXULMenupopupAccessible::GetState(PRUint32 *_retval)
|
|||
nsCOMPtr<nsIAccessible> parentAccessible;
|
||||
nsCOMPtr<nsIDOMNode> parentNode;
|
||||
GetParent(getter_AddRefs(parentAccessible));
|
||||
if (parentAccessible)
|
||||
parentAccessible->GetDOMNode(getter_AddRefs(parentNode));
|
||||
nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(parentAccessible));
|
||||
if (accessNode)
|
||||
accessNode->GetDOMNode(getter_AddRefs(parentNode));
|
||||
element = do_QueryInterface(parentNode);
|
||||
if (element)
|
||||
element->HasAttribute(NS_LITERAL_STRING("open"), &isActive);
|
||||
|
|
Загрузка…
Ссылка в новой задаче