static HRESULT WINAPI HTMLScriptElement_get_src(IHTMLScriptElement *iface, BSTR *p) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); nsAString src_str; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&src_str, NULL); nsres = nsIDOMHTMLScriptElement_GetSrc(This->nsscript, &src_str); return return_nsstr(nsres, &src_str, p); }
static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); nsAString nstype_str; nsresult nsres; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); nsAString_Init(&nstype_str, v); nsres = nsIDOMHTMLScriptElement_SetType(This->nsscript, &nstype_str); if (NS_FAILED(nsres)) ERR("SetType failed: %08x\n", nsres); nsAString_Finish (&nstype_str); return S_OK; }
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); 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_type(IHTMLScriptElement *iface, BSTR *p) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); const PRUnichar *nstype; nsAString nstype_str; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); nsAString_Init(&nstype_str, NULL); nsres = nsIDOMHTMLScriptElement_GetType(This->nsscript, &nstype_str); if(NS_FAILED(nsres)) ERR("GetType failed: %08x\n", nsres); nsAString_GetData(&nstype_str, &nstype); *p = *nstype ? SysAllocString(nstype) : NULL; nsAString_Finish(&nstype_str); return S_OK; }
static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); 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_put_text(IHTMLScriptElement *iface, BSTR v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); HTMLInnerWindow *window; nsIDOMNode *parent; nsAString text_str; nsresult nsres; TRACE("(%p)->(%s)\n", This, debugstr_w(v)); if(!This->element.node.doc || !This->element.node.doc->window) { WARN("no windoow\n"); return E_UNEXPECTED; } window = This->element.node.doc->window; nsAString_InitDepend(&text_str, v); nsres = nsIDOMHTMLScriptElement_SetText(This->nsscript, &text_str); nsAString_Finish(&text_str); if(NS_FAILED(nsres)) { ERR("SetSrc failed: %08x\n", nsres); return E_FAIL; } nsres = nsIDOMHTMLElement_GetParentNode(This->element.nselem, &parent); if(NS_FAILED(nsres) || !parent) { TRACE("No parent, not executing\n"); This->parse_on_bind = TRUE; return S_OK; } nsIDOMNode_Release(parent); doc_insert_script(window, This); return S_OK; }
static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount(IHTMLScriptElement *iface, UINT *pctinfo) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo); }
static ULONG WINAPI HTMLScriptElement_Release(IHTMLScriptElement *iface) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLScriptElement_get_onerror(IHTMLScriptElement *iface, VARIANT *p) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLScriptElement_put_onerror(IHTMLScriptElement *iface, VARIANT v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); FIXME("(%p)->(v(%d))\n", This, V_VT(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLScriptElement_put_onerror(IHTMLScriptElement *iface, VARIANT v) { HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }