mshtml: Use stored nsdoc in HTMLCurrentStyle_Create.

This commit is contained in:
Jacek Caban 2008-10-08 13:28:34 -05:00 committed by Alexandre Julliard
parent 408024a2d1
commit 502532ee23
1 changed files with 4 additions and 7 deletions

View File

@ -888,19 +888,16 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
nsIDOMDocumentView *nsdocview; nsIDOMDocumentView *nsdocview;
nsIDOMAbstractView *nsview; nsIDOMAbstractView *nsview;
nsIDOMViewCSS *nsviewcss; nsIDOMViewCSS *nsviewcss;
nsIDOMDocument *nsdoc;
nsAString nsempty_str; nsAString nsempty_str;
HTMLCurrentStyle *ret; HTMLCurrentStyle *ret;
nsresult nsres; nsresult nsres;
nsres = nsIWebNavigation_GetDocument(elem->node.doc->nscontainer->navigation, &nsdoc); if(!elem->node.doc->nsdoc) {
if(NS_FAILED(nsres)) { WARN("NULL nsdoc\n");
ERR("GetDocument failed: %08x\n", nsres); return E_UNEXPECTED;
return E_FAIL;
} }
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview); nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
nsIDOMDocument_Release(nsdoc);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMDocumentView: %08x\n", nsres); ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
return E_FAIL; return E_FAIL;