GetFrameForNodeOffset: if aNode has no children and the offset is 0, return the frame corresponding to aNode rather than failing. patch by Nian Liu <nian.liu@sun.com>. bug=363198 r=uriber sr=roc.

This commit is contained in:
uriber%gmail.com 2007-01-30 19:29:55 +00:00
Родитель 26a36cc8f0
Коммит 1f1b745917
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -2586,12 +2586,14 @@ nsFrameSelection::GetFrameForNodeOffset(nsIContent *aNode,
childIndex = aOffset;
}
nsCOMPtr<nsIContent> childNode = theNode->GetChildAt(childIndex);
if (aOffset != 0 || numChildren != 0) {
nsCOMPtr<nsIContent> childNode = theNode->GetChildAt(childIndex);
if (!childNode)
return nsnull;
if (!childNode)
return nsnull;
theNode = childNode;
theNode = childNode;
}
#ifdef DONT_DO_THIS_YET
// XXX: We can't use this code yet because the hinting