mshtml: Set interactive script ready state change in the right places.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-07-19 18:41:06 +02:00 committed by Alexandre Julliard
parent 3a85711a98
commit 8ccc38cb55
4 changed files with 10 additions and 8 deletions

View File

@ -203,7 +203,7 @@ static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR
}
nsIDOMNode_Release(parent);
doc_insert_script(window, This);
doc_insert_script(window, This, FALSE);
return S_OK;
}
@ -400,7 +400,7 @@ static HRESULT HTMLScriptElement_bind_to_tree(HTMLDOMNode *iface)
}
This->parse_on_bind = FALSE;
doc_insert_script(This->element.node.doc->window, This);
doc_insert_script(This->element.node.doc->window, This, FALSE);
return S_OK;
}

View File

@ -40,7 +40,7 @@ HRESULT load_script(HTMLScriptElement*,const WCHAR*) DECLSPEC_HIDDEN;
void release_script_hosts(HTMLInnerWindow*) DECLSPEC_HIDDEN;
void connect_scripts(HTMLInnerWindow*) DECLSPEC_HIDDEN;
void doc_insert_script(HTMLInnerWindow*,HTMLScriptElement*) DECLSPEC_HIDDEN;
void doc_insert_script(HTMLInnerWindow*,HTMLScriptElement*,BOOL) DECLSPEC_HIDDEN;
IDispatch *script_parse_event(HTMLInnerWindow*,LPCWSTR) DECLSPEC_HIDDEN;
HRESULT exec_script(HTMLInnerWindow*,const WCHAR*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN;
void set_script_mode(HTMLOuterWindow*,SCRIPTMODE) DECLSPEC_HIDDEN;

View File

@ -337,13 +337,13 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
doc_insert_script(window, script_elem);
doc_insert_script(window, script_elem, TRUE);
while(!list_empty(&window->script_queue)) {
iter = LIST_ENTRY(list_head(&window->script_queue), script_queue_entry_t, entry);
list_remove(&iter->entry);
if(!iter->script->parsed)
doc_insert_script(window, iter->script);
doc_insert_script(window, iter->script, TRUE);
IHTMLScriptElement_Release(&iter->script->IHTMLScriptElement_iface);
heap_free(iter);
}

View File

@ -786,8 +786,6 @@ static void parse_elem_text(ScriptHost *script_host, HTMLScriptElement *script_e
TRACE("%s\n", debugstr_w(text));
set_script_elem_readystate(script_elem, READYSTATE_INTERACTIVE);
VariantInit(&var);
memset(&excepinfo, 0, sizeof(excepinfo));
TRACE(">>>\n");
@ -1089,6 +1087,8 @@ static void parse_inline_script(ScriptHost *script_host, HTMLScriptElement *scri
nsres = nsIDOMHTMLScriptElement_GetText(script_elem->nsscript, &text_str);
nsAString_GetData(&text_str, &text);
set_script_elem_readystate(script_elem, READYSTATE_INTERACTIVE);
if(NS_FAILED(nsres)) {
ERR("GetText failed: %08x\n", nsres);
}else if(*text) {
@ -1257,7 +1257,7 @@ static ScriptHost *get_elem_script_host(HTMLInnerWindow *window, HTMLScriptEleme
return get_script_host(window, &guid);
}
void doc_insert_script(HTMLInnerWindow *window, HTMLScriptElement *script_elem)
void doc_insert_script(HTMLInnerWindow *window, HTMLScriptElement *script_elem, BOOL from_parser)
{
ScriptHost *script_host;
BOOL is_complete = FALSE;
@ -1268,6 +1268,8 @@ void doc_insert_script(HTMLInnerWindow *window, HTMLScriptElement *script_elem)
if(script_host->parse) {
if(script_elem->src_text) {
if(from_parser)
set_script_elem_readystate(script_elem, READYSTATE_INTERACTIVE);
script_elem->parsed = TRUE;
parse_elem_text(script_host, script_elem, script_elem->src_text);
is_complete = TRUE;