Test for null parent content, rather than null parent frame, to avoid possible crash in FindBlockFrameOrBR(). bug=370174 r=sharparrow1 sr=roc

This commit is contained in:
uriber@gmail.com 2007-04-14 09:34:12 -07:00
Родитель fe6118acae
Коммит 6953c2f40a
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -4675,7 +4675,8 @@ nsIFrame::PeekOffsetParagraph(nsPeekOffsetStruct *aPos)
if (aPos->mDirection == eDirPrevious) {
while (!reachedBlockAncestor) {
nsIFrame* parent = frame->GetParent();
if (!parent) { // Treat the root frame as if it were a block frame.
// Treat a frame associated with the root content as if it were a block frame.
if (!frame->mContent || !frame->mContent->GetParent()) {
reachedBlockAncestor = PR_TRUE;
break;
}
@ -4700,7 +4701,8 @@ nsIFrame::PeekOffsetParagraph(nsPeekOffsetStruct *aPos)
} else { // eDirNext
while (!reachedBlockAncestor) {
nsIFrame* parent = frame->GetParent();
if (!parent) { // Treat the root frame as if it were a block frame.
// Treat a frame associated with the root content as if it were a block frame.
if (!frame->mContent || !frame->mContent->GetParent()) {
reachedBlockAncestor = PR_TRUE;
break;
}