mshtml: Added IHTMLDocument2::get_scripts implementation.

This commit is contained in:
Jacek Caban 2013-08-28 14:35:12 +02:00 committed by Alexandre Julliard
parent 8c4e9ba4cf
commit c7417e4528
2 changed files with 35 additions and 2 deletions

View File

@ -406,8 +406,33 @@ static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
{
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsIDOMHTMLCollection *nscoll = NULL;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_INVALIDARG;
*p = NULL;
if(!This->doc_node->nsdoc) {
WARN("NULL nsdoc\n");
return E_UNEXPECTED;
}
nsres = nsIDOMHTMLDocument_GetScripts(This->doc_node->nsdoc, &nscoll);
if(NS_FAILED(nsres)) {
ERR("GetImages failed: %08x\n", nsres);
return E_FAIL;
}
if(nscoll) {
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
nsIDOMHTMLCollection_Release(nscoll);
}
return S_OK;
}
static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)

View File

@ -6075,6 +6075,14 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElementCollection_Release(collection);
}
hres = IHTMLDocument2_get_scripts(doc, &collection);
ok(hres == S_OK, "get_scripts failed: %08x\n", hres);
if(hres == S_OK) {
static const elem_type_t script_types[] = {ET_SCRIPT};
test_elem_collection((IUnknown*)collection, script_types, 1);
IHTMLElementCollection_Release(collection);
}
test_plugins_col(doc);
elem = get_doc_elem(doc);