Fix for bug #14157. Changed ConstructAlternateImageFrame() to set the document

pointer and the parent content pointer for the text frame
This commit is contained in:
troy%netscape.com 1999-09-17 20:57:06 +00:00
parent e1f3907c3c
commit cbf2204bfc
2 changed files with 18 additions and 4 deletions

View File

@ -6817,9 +6817,16 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
// Create a text content element for the alternate text
nsCOMPtr<nsIContent> altTextContent;
nsIDOMCharacterData* domData;
NS_NewTextNode(getter_AddRefs(altTextContent));
// Set aContent as the parent content and set the document object
nsCOMPtr<nsIDocument> document;
aContent->GetDocument(*getter_AddRefs(document));
altTextContent->SetParent(aContent);
altTextContent->SetDocument(document, PR_TRUE);
// Set the content's text
nsIDOMCharacterData* domData;
altTextContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
domData->SetData(altText);
NS_RELEASE(domData);

View File

@ -6817,9 +6817,16 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex
// Create a text content element for the alternate text
nsCOMPtr<nsIContent> altTextContent;
nsIDOMCharacterData* domData;
NS_NewTextNode(getter_AddRefs(altTextContent));
// Set aContent as the parent content and set the document object
nsCOMPtr<nsIDocument> document;
aContent->GetDocument(*getter_AddRefs(document));
altTextContent->SetParent(aContent);
altTextContent->SetDocument(document, PR_TRUE);
// Set the content's text
nsIDOMCharacterData* domData;
altTextContent->QueryInterface(kIDOMCharacterDataIID, (void**)&domData);
domData->SetData(altText);
NS_RELEASE(domData);