diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 098f7fc3fd9..6f95ccf45f8 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -3154,8 +3154,8 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll) // caret there. That way tabbing will start from the new // location nsRefPtr jumpToRange = new nsRange(); - while (content && content->GetChildCount() > 0) { - content = content->GetChildAt(0); + while (content && content->GetFirstChild()) { + content = content->GetFirstChild(); } nsCOMPtr node(do_QueryInterface(content)); NS_ASSERTION(node, "No nsIDOMNode for descendant of anchor");