protect recreate frames for content against content with no parent

This commit is contained in:
peterl%netscape.com 1999-03-25 19:27:11 +00:00
Родитель 28b6ec8dbb
Коммит bbe0f2a86e
2 изменённых файлов: 24 добавлений и 36 удалений

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

@ -4548,28 +4548,22 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext,
{
nsresult rv = NS_OK;
// First, remove the frames associated with the content object on which the
// attribute change occurred.
// XXX Right now, ContentRemoved() does not do anything with its aContainer
// and aIndexInContainer in parameters, so I am passing in null and 0, respectively
rv = ContentRemoved(aPresContext, nsnull, aContent, 0);
if (NS_OK == rv) {
// Now, recreate the frames associated with this content object.
nsIContent *container;
rv = aContent->GetParent(container);
nsIContent *container;
rv = aContent->GetParent(container);
if (container) {
PRInt32 indexInContainer;
rv = container->IndexOf(aContent, indexInContainer);
if (NS_OK == rv) {
PRInt32 indexInContainer;
rv = container->IndexOf(aContent, indexInContainer);
// First, remove the frames associated with the content object on which the
// attribute change occurred.
rv = ContentRemoved(aPresContext, container, aContent, indexInContainer);
if (NS_OK == rv) {
// Now, recreate the frames associated with this content object.
rv = ContentInserted(aPresContext, container, aContent, indexInContainer);
}
NS_RELEASE(container);
}
}
NS_RELEASE(container);
}
return rv;

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

@ -4548,28 +4548,22 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext,
{
nsresult rv = NS_OK;
// First, remove the frames associated with the content object on which the
// attribute change occurred.
// XXX Right now, ContentRemoved() does not do anything with its aContainer
// and aIndexInContainer in parameters, so I am passing in null and 0, respectively
rv = ContentRemoved(aPresContext, nsnull, aContent, 0);
if (NS_OK == rv) {
// Now, recreate the frames associated with this content object.
nsIContent *container;
rv = aContent->GetParent(container);
nsIContent *container;
rv = aContent->GetParent(container);
if (container) {
PRInt32 indexInContainer;
rv = container->IndexOf(aContent, indexInContainer);
if (NS_OK == rv) {
PRInt32 indexInContainer;
rv = container->IndexOf(aContent, indexInContainer);
// First, remove the frames associated with the content object on which the
// attribute change occurred.
rv = ContentRemoved(aPresContext, container, aContent, indexInContainer);
if (NS_OK == rv) {
// Now, recreate the frames associated with this content object.
rv = ContentInserted(aPresContext, container, aContent, indexInContainer);
}
NS_RELEASE(container);
}
}
NS_RELEASE(container);
}
return rv;