Commit de5bbbc2 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

mshtml: Implement IHTMLScriptElement get/put Defer.

parent 8e984bcc
......@@ -154,15 +154,40 @@ static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v)
{
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
HRESULT hr = S_OK;
nsresult nsres;
TRACE("(%p)->(%x)\n", This, v);
nsres = nsIDOMHTMLScriptElement_SetDefer(This->nsscript, v != VARIANT_FALSE);
if(NS_FAILED(nsres))
{
hr = E_FAIL;
}
return hr;
}
static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p)
{
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
PRBool defer = FALSE;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
if(!p)
return E_INVALIDARG;
nsres = nsIDOMHTMLScriptElement_GetDefer(This->nsscript, &defer);
if(NS_FAILED(nsres)) {
ERR("GetSrc failed: %08x\n", nsres);
}
*p = defer ? VARIANT_TRUE : VARIANT_FALSE;
TRACE("*p = %d\n", *p);
return S_OK;
}
static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p)
......
......@@ -3433,10 +3433,26 @@ static void test_elems(IHTMLDocument2 *doc)
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLScriptElement, (void**)&script);
ok(hres == S_OK, "Could not get IHTMLScriptElement interface: %08x\n", hres);
hres = IHTMLScriptElement_get_type(script, &type);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
ok(!lstrcmpW(type, text_javascriptW), "Unexpected type %s\n", dbgstr_w(type));
SysFreeString(type);
if(hres == S_OK)
{
VARIANT_BOOL vb;
hres = IHTMLScriptElement_get_type(script, &type);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
ok(!lstrcmpW(type, text_javascriptW), "Unexpected type %s\n", dbgstr_w(type));
SysFreeString(type);
/* test defer */
hres = IHTMLScriptElement_put_defer(script, VARIANT_TRUE);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
hres = IHTMLScriptElement_get_defer(script, &vb);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
ok(vb == VARIANT_TRUE, "get_type failed: %08x\n", hres);
hres = IHTMLScriptElement_put_defer(script, VARIANT_FALSE);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
}
IHTMLScriptElement_Release(script);
}
......
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