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

This commit is contained in:
Jacek Caban 2012-10-16 17:09:52 +02:00 committed by Alexandre Julliard
parent ccbee09f7e
commit b882b18402
3 changed files with 23 additions and 2 deletions

View file

@ -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);

View file

@ -23,6 +23,7 @@ typedef struct {
nsIDOMHTMLScriptElement *nsscript;
BOOL parsed;
BOOL parse_on_bind;
} HTMLScriptElement;
typedef struct {

View file

@ -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,