mshtml: Fix DOCUMENT_NODE handling in nsnode_to_nsstring_rec.

This commit is contained in:
Piotr Caban 2011-08-04 14:05:23 +02:00 committed by Alexandre Julliard
parent f3bd5210b8
commit 0bbc95e4f6
1 changed files with 8 additions and 5 deletions

View File

@ -794,11 +794,13 @@ static HRESULT nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNo
return E_FAIL;
}
if(type != DOCUMENT_NODE) {
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIContent, (void**)&nscontent);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDontent interface: %08x\n", nsres);
ERR("Could not get nsIContent interface: %08x\n", nsres);
return E_FAIL;
}
}
switch(type) {
case ELEMENT_NODE:
@ -849,6 +851,7 @@ static HRESULT nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNo
if(type == ELEMENT_NODE)
nsIContentSerializer_AppendElementEnd(serializer, nscontent, str);
if(type != DOCUMENT_NODE)
nsIContent_Release(nscontent);
return S_OK;
}