Bug 395923. The whole page's contents are repeated inside an anchor with no href. r=evan.yan, a=dsicore

This commit is contained in:
aaronleventhal@moonset.net 2007-09-26 10:32:33 -07:00
Родитель 4f8174f700
Коммит 7b769473fb
1 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -226,6 +226,11 @@ void nsLinkableAccessible::CacheActionContent()
for (nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
walkUpContent;
walkUpContent = walkUpContent->GetParent()) {
if (nsAccUtils::HasListener(walkUpContent, NS_LITERAL_STRING("click"))) {
mActionContent = walkUpContent;
mIsOnclick = PR_TRUE;
break;
}
nsIAtom *tag = walkUpContent->Tag();
if ((tag == nsAccessibilityAtoms::a || tag == nsAccessibilityAtoms::area) &&
walkUpContent->IsNodeOfType(nsINode::eHTML)) {
@ -242,11 +247,13 @@ void nsLinkableAccessible::CacheActionContent()
break;
}
}
}
if (nsAccUtils::HasListener(walkUpContent, NS_LITERAL_STRING("click"))) {
mActionContent = walkUpContent;
mIsOnclick = PR_TRUE;
break;
if (SameCOMIdentity(mDOMNode, walkUpContent)) {
// This is the element that caused the creation of a linkable accessible
// Don't let it keep walking up, otherwise we may report the wrong container
// as the action node
mActionContent = walkUpContent;
break;
}
}
}
}