Commit b882b184 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added support for IHTMLScriptElement::put_src on detached elements.

parent ccbee09f
......@@ -138,8 +138,9 @@ static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR
nsres = nsIDOMHTMLScriptElement_GetParentNode(This->nsscript, &parent);
if(NS_FAILED(nsres) || !parent) {
FIXME("No parent, not supported detached elements\n");
return E_NOTIMPL;
TRACE("No parent, not executing\n");
This->parse_on_bind = TRUE;
return S_OK;
}
nsIDOMNode_Release(parent);
......
......@@ -23,6 +23,7 @@ typedef struct {
nsIDOMHTMLScriptElement *nsscript;
BOOL parsed;
BOOL parse_on_bind;
} HTMLScriptElement;
typedef struct {
......
......@@ -629,6 +629,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
HTMLDocumentNode *This = impl_from_nsIDocumentObserver(iface);
nsIDOMHTMLIFrameElement *nsiframe;
nsIDOMHTMLFrameElement *nsframe;
nsIDOMHTMLScriptElement *nsscript;
nsIDOMComment *nscomment;
nsIDOMElement *nselem;
nsresult nsres;
......@@ -667,6 +668,24 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
nsIDOMHTMLFrameElement_Release(nsframe);
return;
}
nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
if(NS_SUCCEEDED(nsres)) {
HTMLScriptElement *script_elem;
HRESULT hres;
TRACE("script element\n");
hres = script_elem_from_nsscript(This, nsscript, &script_elem);
nsIDOMHTMLScriptElement_Release(nsscript);
if(FAILED(hres))
return;
if(script_elem->parse_on_bind)
add_script_runner(This, run_insert_script, (nsISupports*)nsscript, NULL);
IHTMLScriptElement_Release(&script_elem->IHTMLScriptElement_iface);
}
}
static void NSAPI nsDocumentObserver_AttemptToExecuteScript(nsIDocumentObserver *iface, nsIContent *aContent,
......
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