Add pointer test to prevent crashes on frame/iframe elements with no src attribute. b=119939 r=timeless@bemail.org sr=rpotts@netscape.com a=dbaron@fas.harvard.edu

git-svn-id: svn://10.0.0.236/trunk@112385 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2002-01-17 12:15:44 +00:00
parent 0f9a34a1db
commit d04650839e

View File

@@ -1308,15 +1308,18 @@ nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode, PRBool *aAbort)
{
URIData *data = nsnull;
StoreURIAttribute(aNode, "src", PR_FALSE, &data);
data->mIsSubFrame = PR_TRUE;
// TODO how do we get the proper extension (or MIME type) from a DOM document?
data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm"));
// Save the frame content
nsCOMPtr<nsIDOMDocument> content;
nodeAsFrame->GetContentDocument(getter_AddRefs(content));
if (content)
if (data)
{
SaveSubframeContent(content, data);
data->mIsSubFrame = PR_TRUE;
// TODO how do we get the proper extension (or MIME type) from a DOM document?
data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm"));
// Save the frame content
nsCOMPtr<nsIDOMDocument> content;
nodeAsFrame->GetContentDocument(getter_AddRefs(content));
if (content)
{
SaveSubframeContent(content, data);
}
}
return NS_OK;
}
@@ -1326,15 +1329,18 @@ nsWebBrowserPersist::OnWalkDOMNode(nsIDOMNode *aNode, PRBool *aAbort)
{
URIData *data = nsnull;
StoreURIAttribute(aNode, "src", PR_FALSE, &data);
data->mIsSubFrame = PR_TRUE;
// TODO how do we get the proper extension (or MIME type) from a DOM document?
data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm"));
// Save the frame content
nsCOMPtr<nsIDOMDocument> content;
nodeAsIFrame->GetContentDocument(getter_AddRefs(content));
if (content && data)
if (data)
{
SaveSubframeContent(content, data);
data->mIsSubFrame = PR_TRUE;
// TODO how do we get the proper extension (or MIME type) from a DOM document?
data->mSubFrameExt.Assign(NS_LITERAL_STRING(".htm"));
// Save the frame content
nsCOMPtr<nsIDOMDocument> content;
nodeAsIFrame->GetContentDocument(getter_AddRefs(content));
if (content)
{
SaveSubframeContent(content, data);
}
}
return NS_OK;
}