зеркало из https://github.com/mozilla/gecko-dev.git
Add a null-check. b=377535 r=aaronleventhal
This commit is contained in:
Родитель
8bd3be05cd
Коммит
7de7b90e2f
|
@ -240,22 +240,24 @@ void nsLinkableAccessible::CacheActionContent()
|
|||
walkUpContent;
|
||||
walkUpContent = walkUpContent->GetParent()) {
|
||||
nsIAtom *tag = walkUpContent->Tag();
|
||||
if ((tag == nsAccessibilityAtoms::a || tag == nsAccessibilityAtoms::area)) {
|
||||
// Currently we do not expose <link> tags, because they are not typically
|
||||
// in <body> and rendered.
|
||||
// We do not yet support xlinks
|
||||
if ((tag == nsAccessibilityAtoms::a || tag == nsAccessibilityAtoms::area) &&
|
||||
walkUpContent->IsNodeOfType(nsINode::eHTML)) {
|
||||
nsCOMPtr<nsILink> link = do_QueryInterface(walkUpContent);
|
||||
NS_ASSERTION(link, "No nsILink for area or a");
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
link->GetHrefURI(getter_AddRefs(uri));
|
||||
if (uri) {
|
||||
mActionContent = walkUpContent;
|
||||
mIsLink = PR_TRUE;
|
||||
break;
|
||||
if (link) {
|
||||
// Currently we do not expose <link> tags, because they are not typically
|
||||
// in <body> and rendered.
|
||||
// We do not yet support xlinks
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
link->GetHrefURI(getter_AddRefs(uri));
|
||||
if (uri) {
|
||||
mActionContent = walkUpContent;
|
||||
mIsLink = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (walkUpContent->HasAttr(kNameSpaceID_None,
|
||||
nsAccessibilityAtoms::onclick)) {
|
||||
nsAccessibilityAtoms::onclick)) {
|
||||
mActionContent = walkUpContent;
|
||||
mIsOnclick = PR_TRUE;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче