зеркало из https://github.com/mozilla/pjs.git
Bug 237954 "nsAccessibleHyperText::GetLink" doesn't return proper link
r = kyle.yuan@sun.com sr = henry.jia@sun.com
This commit is contained in:
Родитель
733524b61b
Коммит
9264864dfc
|
@ -409,9 +409,18 @@ NS_IMETHODIMP nsAccessibleHyperText::GetLink(PRInt32 aIndex, nsIAccessibleHyperL
|
|||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(mTextChildren->ElementAt(index)));
|
||||
nsCOMPtr<nsIDOMNode> parentNode;
|
||||
// text node maybe a child of a link node
|
||||
|
||||
// text node maybe a child (or grandchild, ...) of a link node
|
||||
nsCOMPtr<nsILink> link;
|
||||
domNode->GetParentNode(getter_AddRefs(parentNode));
|
||||
nsCOMPtr<nsILink> link(do_QueryInterface(parentNode));
|
||||
while (parentNode) {
|
||||
link = do_QueryInterface(parentNode);
|
||||
if (link)
|
||||
break;
|
||||
nsCOMPtr<nsIDOMNode> tmpNode = parentNode;
|
||||
tmpNode->GetParentNode(getter_AddRefs(parentNode));
|
||||
}
|
||||
|
||||
if (link) {
|
||||
if (linkCount++ == NS_STATIC_CAST(PRUint32, aIndex)) {
|
||||
nsCOMPtr<nsIWeakReference> weakShell;
|
||||
|
|
Загрузка…
Ссылка в новой задаче