Commit 9f1d3b21 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use stored nsdoc in IHTMLDocument2::get_styleSheets.

parent 9fbc40f8
......@@ -1188,30 +1188,24 @@ static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
HTMLDocument *This = HTMLDOC_THIS(iface);
nsIDOMStyleSheetList *nsstylelist;
nsIDOMDocumentStyle *nsdocstyle;
nsIDOMDocument *nsdoc;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
*p = NULL;
if(!This->nscontainer)
return S_OK;
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
if(NS_FAILED(nsres)) {
ERR("GetDocument failed: %08x\n", nsres);
return S_OK;
if(!This->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
if(NS_FAILED(nsres) || !nsdoc)
return S_OK;
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
nsIDOMDocument_Release(nsdoc);
nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
nsres = nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
nsIDOMDocumentStyle_Release(nsdocstyle);
if(NS_FAILED(nsres)) {
ERR("GetStyleSheets failed: %08x\n", nsres);
return E_FAIL;
}
*p = HTMLStyleSheetsCollection_Create(nsstylelist);
nsIDOMDocumentStyle_Release(nsstylelist);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment