Add a comment and assertion to the fix for bug 370174. r+sr=roc on the original patch. blocking1.9=dbaron

This commit is contained in:
uriber@gmail.com 2008-02-23 02:54:29 -08:00
Родитель a670c24635
Коммит e97bd96b3a
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -4519,6 +4519,7 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection)
{
nsContentAndOffset result;
result.mContent = nsnull;
result.mOffset = 0;
if (aFrame->IsGeneratedContentFrame())
return result;
@ -4540,6 +4541,10 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection)
aFrame->GetType() == nsGkAtoms::brFrame) {
nsIContent* content = aFrame->GetContent();
result.mContent = content->GetParent();
// In some cases (bug 310589, bug 370174) we end up here with a null content.
// This probably shouldn't ever happen, but since it sometimes does, we want
// to avoid crashing here.
NS_ASSERTION(result.mContent, "Unexpected orphan content");
if (result.mContent)
result.mOffset = result.mContent->IndexOf(content) +
(aDirection == eDirPrevious ? 1 : 0);