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