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

mshtml: Store external script text in HTMLScriptElement object.

parent 718a415a
......@@ -391,6 +391,13 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return HTMLElement_QI(&This->element.node, riid, ppv);
}
static void HTMLScriptElement_destructor(HTMLDOMNode *iface)
{
HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
heap_free(This->src_text);
HTMLElement_destructor(&This->element.node);
}
static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
......@@ -439,7 +446,7 @@ static void HTMLScriptElement_unlink(HTMLDOMNode *iface)
static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_QI,
HTMLElement_destructor,
HTMLScriptElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
......
......@@ -26,6 +26,7 @@ typedef struct {
BOOL parse_on_bind;
BOOL pending_readystatechange_event;
READYSTATE readystate;
WCHAR *src_text; /* sctipt text downloaded from src */
} HTMLScriptElement;
typedef struct {
......
......@@ -866,22 +866,20 @@ static void script_file_available(ScriptBSC *bsc)
HTMLScriptElement *script_elem = bsc->script_elem;
HTMLInnerWindow *window = bsc->bsc.window;
ScriptHost *script_host;
WCHAR *text;
HRESULT hres;
hres = get_binding_text(bsc, &text);
assert(window != NULL);
hres = get_binding_text(bsc, &script_elem->src_text);
if(FAILED(hres))
return;
script_host = get_elem_script_host(window, script_elem);
if(!script_host) {
heap_free(text);
if(!script_host)
return;
}
script_elem->parsed = TRUE;
parse_elem_text(script_host, script_elem, text);
heap_free(text);
parse_elem_text(script_host, script_elem, script_elem->src_text);
}
static inline ScriptBSC *impl_from_BSCallback(BSCallback *iface)
......
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