mshtml: Moved readystate changes to separated function.

This commit is contained in:
Jacek Caban 2009-11-01 19:24:19 +01:00 committed by Alexandre Julliard
parent dca249833b
commit 67c8d4b405
3 changed files with 11 additions and 6 deletions

View File

@ -684,6 +684,7 @@ void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISuppo
IMoniker *get_channelbsc_mon(nsChannelBSC*);
void parse_complete(HTMLDocumentObj*);
void set_ready_state(HTMLWindow*,READYSTATE);
HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**);
HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**);

View File

@ -190,8 +190,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
}
}
This->doc_obj->readystate = READYSTATE_LOADING;
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
set_ready_state(This->window, READYSTATE_LOADING);
update_doc(This, UPDATE_TITLE);
HTMLDocument_LockContainer(This->doc_obj, TRUE);
@ -274,6 +273,13 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
return S_OK;
}
void set_ready_state(HTMLWindow *window, READYSTATE readystate)
{
window->doc_obj->readystate = readystate;
if(window->doc_obj->basedoc.window == window)
call_property_onchanged(&window->doc_obj->basedoc.cp_propnotif, DISPID_READYSTATE);
}
static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
{
nsIDOMNode *nsnode;

View File

@ -237,8 +237,7 @@ void parse_complete(HTMLDocumentObj *doc)
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
doc->readystate = READYSTATE_INTERACTIVE;
call_property_onchanged(&doc->basedoc.cp_propnotif, DISPID_READYSTATE);
set_ready_state(doc->basedoc.window, READYSTATE_INTERACTIVE);
if(doc->client)
IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
@ -263,8 +262,7 @@ void parse_complete(HTMLDocumentObj *doc)
IOleCommandTarget_Release(olecmd);
}
doc->readystate = READYSTATE_COMPLETE;
call_property_onchanged(&doc->basedoc.cp_propnotif, DISPID_READYSTATE);
set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE);
if(doc->frame) {
static const WCHAR wszDone[] = {'D','o','n','e',0};