diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp
index 27686f0b05a3..dbdabbf683e9 100644
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -1185,7 +1185,9 @@ NS_IMETHODIMP nsHyperTextAccessible::DidInsertNode(nsIDOMNode *aNode, nsIDOMNode
}
}
- if (NS_FAILED(DOMPointToOffset(aNode, aPosition, &start)))
+ nsCOMPtr parentNode;
+ aNode->GetParentNode(getter_AddRefs(parentNode));
+ if (NS_FAILED(DOMPointToOffset(parentNode, aPosition, &start)))
return NS_OK;
nsCOMPtr event =