Commit 05d19947 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Move readystate to HTMLDocumentObj.

parent 56b69dff
...@@ -150,7 +150,7 @@ static DWORD query_ns_edit_status(HTMLDocument *This, const char *nscmd) ...@@ -150,7 +150,7 @@ static DWORD query_ns_edit_status(HTMLDocument *This, const char *nscmd)
nsICommandParams *nsparam; nsICommandParams *nsparam;
PRBool b = FALSE; PRBool b = FALSE;
if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE)
return OLECMDF_SUPPORTED; return OLECMDF_SUPPORTED;
if(This->doc_obj->nscontainer && nscmd) { if(This->doc_obj->nscontainer && nscmd) {
...@@ -185,7 +185,7 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str) ...@@ -185,7 +185,7 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str)
nsICommandParams *nsparam; nsICommandParams *nsparam;
char *align = NULL; char *align = NULL;
if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE)
return OLECMDF_SUPPORTED; return OLECMDF_SUPPORTED;
if(This->doc_obj->nscontainer) { if(This->doc_obj->nscontainer) {
...@@ -715,7 +715,7 @@ static HRESULT query_justify(HTMLDocument *This, OLECMD *cmd) ...@@ -715,7 +715,7 @@ static HRESULT query_justify(HTMLDocument *This, OLECMD *cmd)
case IDM_JUSTIFYLEFT: case IDM_JUSTIFYLEFT:
TRACE("(%p) IDM_JUSTIFYLEFT\n", This); TRACE("(%p) IDM_JUSTIFYLEFT\n", This);
/* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */ /* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */
if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE)
cmd->cmdf = OLECMDF_SUPPORTED; cmd->cmdf = OLECMDF_SUPPORTED;
else else
cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED; cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED;
......
...@@ -454,7 +454,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p ...@@ -454,7 +454,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p
if(!p) if(!p)
return E_POINTER; return E_POINTER;
*p = SysAllocString(readystate_str[This->readystate]); *p = SysAllocString(readystate_str[This->doc_obj->readystate]);
return S_OK; return S_OK;
} }
...@@ -1512,7 +1512,7 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb ...@@ -1512,7 +1512,7 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb
return E_INVALIDARG; return E_INVALIDARG;
V_VT(pVarResult) = VT_I4; V_VT(pVarResult) = VT_I4;
V_I4(pVarResult) = This->readystate; V_I4(pVarResult) = This->doc_obj->readystate;
return S_OK; return S_OK;
} }
...@@ -1737,7 +1737,6 @@ static void init_doc(HTMLDocument *doc, const htmldoc_vtbl_t *vtbl) ...@@ -1737,7 +1737,6 @@ static void init_doc(HTMLDocument *doc, const htmldoc_vtbl_t *vtbl)
doc->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl; doc->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
doc->lpIDispatchExVtbl = &DocDispatchExVtbl; doc->lpIDispatchExVtbl = &DocDispatchExVtbl;
doc->lpSupportErrorInfoVtbl = &SupportErrorInfoVtbl; doc->lpSupportErrorInfoVtbl = &SupportErrorInfoVtbl;
doc->readystate = READYSTATE_UNINITIALIZED;
HTMLDocument_HTMLDocument3_Init(doc); HTMLDocument_HTMLDocument3_Init(doc);
HTMLDocument_HTMLDocument5_Init(doc); HTMLDocument_HTMLDocument5_Init(doc);
...@@ -1941,6 +1940,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ...@@ -1941,6 +1940,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
doc->nscontainer = NSContainer_Create(doc, NULL); doc->nscontainer = NSContainer_Create(doc, NULL);
list_init(&doc->bindings); list_init(&doc->bindings);
doc->usermode = UNKNOWN_USERMODE; doc->usermode = UNKNOWN_USERMODE;
doc->readystate = READYSTATE_UNINITIALIZED;
if(doc->nscontainer) { if(doc->nscontainer) {
nsresult nsres; nsresult nsres;
......
...@@ -284,7 +284,6 @@ struct HTMLDocument { ...@@ -284,7 +284,6 @@ struct HTMLDocument {
HTMLWindow *window; HTMLWindow *window;
nsIDOMHTMLDocument *nsdoc; nsIDOMHTMLDocument *nsdoc;
READYSTATE readystate;
LPWSTR mime; LPWSTR mime;
DWORD update; DWORD update;
...@@ -350,6 +349,7 @@ struct HTMLDocumentObj { ...@@ -350,6 +349,7 @@ struct HTMLDocumentObj {
BOOL focus; BOOL focus;
USERMODE usermode; USERMODE usermode;
READYSTATE readystate;
/* FIXME: probably should be in document node object */ /* FIXME: probably should be in document node object */
nsChannelBSC *bscallback; nsChannelBSC *bscallback;
......
...@@ -555,7 +555,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, ...@@ -555,7 +555,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(This->doc_obj->frame) if(This->doc_obj->frame)
IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL); IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL);
This->readystate = READYSTATE_UNINITIALIZED; This->doc_obj->readystate = READYSTATE_UNINITIALIZED;
if(This->doc_obj->client) { if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg; IOleCommandTarget *cmdtrg;
......
...@@ -113,7 +113,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO ...@@ -113,7 +113,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
} }
} }
This->readystate = READYSTATE_LOADING; This->doc_obj->readystate = READYSTATE_LOADING;
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE); call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
update_doc(This, UPDATE_TITLE); update_doc(This, UPDATE_TITLE);
......
...@@ -263,7 +263,7 @@ static void set_parsecomplete(HTMLDocument *doc) ...@@ -263,7 +263,7 @@ static void set_parsecomplete(HTMLDocument *doc)
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */ /* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
doc->readystate = READYSTATE_INTERACTIVE; doc->doc_obj->readystate = READYSTATE_INTERACTIVE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
if(doc->doc_obj->client) if(doc->doc_obj->client)
...@@ -289,7 +289,7 @@ static void set_parsecomplete(HTMLDocument *doc) ...@@ -289,7 +289,7 @@ static void set_parsecomplete(HTMLDocument *doc)
IOleCommandTarget_Release(olecmd); IOleCommandTarget_Release(olecmd);
} }
doc->readystate = READYSTATE_COMPLETE; doc->doc_obj->readystate = READYSTATE_COMPLETE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
if(doc->doc_obj->frame) { if(doc->doc_obj->frame) {
......
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