Bug 717371 - Don't use nsINode::GetChildAt in PresShell::GoToAnchor; r=bz

This commit is contained in:
Ms2ger 2012-01-15 09:13:12 +01:00
parent cee1d31b2e
commit 0db2e640d3

View File

@ -3154,8 +3154,8 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll)
// caret there. That way tabbing will start from the new
// location
nsRefPtr<nsIDOMRange> jumpToRange = new nsRange();
while (content && content->GetChildCount() > 0) {
content = content->GetChildAt(0);
while (content && content->GetFirstChild()) {
content = content->GetFirstChild();
}
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
NS_ASSERTION(node, "No nsIDOMNode for descendant of anchor");