r=karnaze and r=kin
under the hood, we've opened up leaf elements to generated content.  GeneratedContentIterators assumed the real element was a container, not a leaf.  The fix was just to add a null check on a request for the element's child.
This commit is contained in:
buster%netscape.com 2000-09-14 05:40:48 +00:00
Родитель aa961f07d3
Коммит ea39a92693
2 изменённых файлов: 18 добавлений и 8 удалений

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

@ -3306,10 +3306,15 @@ PresShell::GetGeneratedContentIterator(nsIContent* aContent,
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
nsIFrame* lastChildFrame = GetLastChildFrame(mPresContext, primaryFrame, aContent);
NS_ASSERTION(lastChildFrame && IsGeneratedContentFrame(lastChildFrame),
"can't find generated content frame");
// Create an iterator
rv = NS_NewGeneratedContentIterator(mPresContext, lastChildFrame, aIterator);
if (lastChildFrame)
{ // it is now legal for GetLastChildFrame to return null. see bug 52307 (a regression from bug 18754)
// in the case of a null child frame, we treat the frame as having no "after" style
// the "before" handler above already does this check
NS_ASSERTION(IsGeneratedContentFrame(lastChildFrame),
"can't find generated content frame");
// Create an iterator
rv = NS_NewGeneratedContentIterator(mPresContext, lastChildFrame, aIterator);
}
}
}
}

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

@ -3306,10 +3306,15 @@ PresShell::GetGeneratedContentIterator(nsIContent* aContent,
getter_AddRefs(pseudoStyleContext));
if (pseudoStyleContext) {
nsIFrame* lastChildFrame = GetLastChildFrame(mPresContext, primaryFrame, aContent);
NS_ASSERTION(lastChildFrame && IsGeneratedContentFrame(lastChildFrame),
"can't find generated content frame");
// Create an iterator
rv = NS_NewGeneratedContentIterator(mPresContext, lastChildFrame, aIterator);
if (lastChildFrame)
{ // it is now legal for GetLastChildFrame to return null. see bug 52307 (a regression from bug 18754)
// in the case of a null child frame, we treat the frame as having no "after" style
// the "before" handler above already does this check
NS_ASSERTION(IsGeneratedContentFrame(lastChildFrame),
"can't find generated content frame");
// Create an iterator
rv = NS_NewGeneratedContentIterator(mPresContext, lastChildFrame, aIterator);
}
}
}
}