зеркало из https://github.com/mozilla/pjs.git
Bug 212104 Browser just exits when find finds a link while running with gtk 2.2 and atk libraries on AIX, r=kyle, sr=henry. GTK2 bug, not included in default build.
This commit is contained in:
Родитель
cbdbc13d8b
Коммит
a493925bc5
|
@ -444,11 +444,17 @@ NS_IMETHODIMP nsAccessibleHyperText::GetSelectedLinkIndex(PRInt32 *aSelectedLink
|
|||
{
|
||||
*aSelectedLinkIndex = -1;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
NS_REINTERPRET_CAST(nsAccessible*, this)->GetFocusedNode(getter_AddRefs(focusedNode));
|
||||
|
||||
PRUint32 index, count, linkCount = 0;
|
||||
PRUint32 count;
|
||||
mTextChildren->Count(&count);
|
||||
if (count <= 0)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMNode> curNode(do_QueryInterface(mTextChildren->ElementAt(0)));
|
||||
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
nsAccessible::GetFocusedNode(curNode, getter_AddRefs(focusedNode));
|
||||
|
||||
PRUint32 index, linkCount = 0;
|
||||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mTextChildren->ElementAt(index)));
|
||||
nsCOMPtr<nsIDOMNode> parentNode;
|
||||
|
|
|
@ -337,6 +337,13 @@ NS_IMETHODIMP nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent,
|
|||
rv = NS_OK;
|
||||
break;
|
||||
|
||||
case nsIAccessibleEventReceiver::EVENT_ATK_LINK_SELECTED:
|
||||
MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_LINK_SELECTED\n"));
|
||||
g_signal_emit_by_name(accWrap->GetAtkObject(),
|
||||
"link_selected");
|
||||
rv = NS_OK;
|
||||
break;
|
||||
|
||||
// Is a superclass of ATK event children_changed
|
||||
case nsIAccessibleEventReceiver::EVENT_REORDER:
|
||||
AtkChildrenChange *pAtkChildrenChange;
|
||||
|
|
|
@ -117,7 +117,7 @@ NS_IMETHODIMP nsHTMLLinkAccessibleWrap::IsValid(PRBool *aIsValid)
|
|||
NS_IMETHODIMP nsHTMLLinkAccessibleWrap::IsSelected(PRBool *aIsSelected)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
GetFocusedNode(getter_AddRefs(focusedNode));
|
||||
GetFocusedNode(mDOMNode, getter_AddRefs(focusedNode));
|
||||
*aIsSelected = (focusedNode == mDOMNode);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -499,16 +499,16 @@ PRBool nsAccessible::IsPartiallyVisible(PRBool *aIsOffscreen)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccessible::GetFocusedNode(nsIDOMNode **aFocusedNode)
|
||||
nsresult nsAccessible::GetFocusedNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aFocusedNode)
|
||||
{
|
||||
nsCOMPtr<nsIFocusController> focusController;
|
||||
nsCOMPtr<nsIDocument> document;
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aCurrentNode));
|
||||
if (content)
|
||||
content->GetDocument(getter_AddRefs(document));
|
||||
|
||||
if (!document)
|
||||
document = do_QueryInterface(mDOMNode);
|
||||
document = do_QueryInterface(aCurrentNode);
|
||||
if (document) {
|
||||
nsCOMPtr<nsIScriptGlobalObject> ourGlobal;
|
||||
document->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
|
||||
|
@ -561,7 +561,7 @@ NS_IMETHODIMP nsAccessible::GetAccState(PRUint32 *aAccState)
|
|||
else {
|
||||
*aAccState |= STATE_FOCUSABLE;
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
if (NS_SUCCEEDED(GetFocusedNode(getter_AddRefs(focusedNode))) && focusedNode == mDOMNode)
|
||||
if (NS_SUCCEEDED(GetFocusedNode(mDOMNode, getter_AddRefs(focusedNode))) && focusedNode == mDOMNode)
|
||||
*aAccState |= STATE_FOCUSED;
|
||||
}
|
||||
}
|
||||
|
@ -585,7 +585,8 @@ NS_IMETHODIMP nsAccessible::GetAccFocused(nsIAccessible **aAccFocused)
|
|||
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
|
||||
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
if (accService && NS_SUCCEEDED(GetFocusedNode(getter_AddRefs(focusedNode)))) {
|
||||
if (accService &&
|
||||
NS_SUCCEEDED(GetFocusedNode(mDOMNode, getter_AddRefs(focusedNode)))) {
|
||||
nsCOMPtr<nsIAccessible> accessible;
|
||||
if (NS_SUCCEEDED(accService->GetAccessibleInWeakShell(focusedNode,
|
||||
mWeakShell,
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
NS_DECL_NSIACCESSIBLE
|
||||
NS_DECL_NSPIACCESSIBLE
|
||||
|
||||
NS_IMETHOD GetFocusedNode(nsIDOMNode **aFocusedNode);
|
||||
static nsresult GetFocusedNode(nsIDOMNode *aCurrentNode, nsIDOMNode **aFocusedNode);
|
||||
|
||||
// nsIAccessNode
|
||||
NS_IMETHOD Shutdown();
|
||||
|
|
|
@ -499,7 +499,7 @@ NS_IMETHODIMP nsXULRadioButtonAccessible::GetAccState(PRUint32 *_retval)
|
|||
mDOMNode->GetParentNode(getter_AddRefs(parentNode));
|
||||
if (parentNode) {
|
||||
nsCOMPtr<nsIDOMNode> focusedNode;
|
||||
GetFocusedNode(getter_AddRefs(focusedNode));
|
||||
GetFocusedNode(mDOMNode, getter_AddRefs(focusedNode));
|
||||
if (focusedNode == parentNode)
|
||||
*_retval |= STATE_FOCUSED;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче