This moves the last interface out (IDispatchEx) and gets rid of the remaining fields and the HTMLDocument structure.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/dispex.c | 5 +- dlls/mshtml/htmldoc.c | 177 +++++++++++++++-------------------- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 10 +- dlls/mshtml/oleobj.c | 153 ++++++++++++++++++++++++++++-- 5 files changed, 229 insertions(+), 118 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 3d3d854936e..ebb1a675d91 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -709,7 +709,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA return S_OK; }
-HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id) +HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, BOOL hidden, DISPID *id) { dynamic_prop_t *prop; HRESULT hres; @@ -718,7 +718,8 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id) if(FAILED(hres)) return hres;
- prop->flags |= DYNPROP_HIDDEN; + if(hidden) + prop->flags |= DYNPROP_HIDDEN; *id = DISPID_DYNPROP_0 + (prop - This->dynamic_data->props); return S_OK; } diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e89671d2ad6..338662d0daa 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -441,7 +441,7 @@ static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo, LCID lcid, @@ -449,7 +449,7 @@ static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInf { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid, LPOLESTR *rgszNames, @@ -457,7 +457,7 @@ static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID r { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
@@ -466,7 +466,7 @@ static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMe { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -2187,28 +2187,28 @@ static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -2798,28 +2798,28 @@ static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface) static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -3031,28 +3031,28 @@ static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -3332,28 +3332,28 @@ static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface) static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -3509,28 +3509,28 @@ static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface) static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -4559,21 +4559,21 @@ static ULONG WINAPI DocumentSelector_Release(IDocumentSelector *iface) static HRESULT WINAPI DocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentSelector_GetTypeInfo(IDocumentSelector *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentSelector_GetIDsOfNames(IDocumentSelector *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
@@ -4581,7 +4581,7 @@ static HRESULT WINAPI DocumentSelector_Invoke(IDocumentSelector *iface, DISPID d LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -4678,21 +4678,21 @@ static ULONG WINAPI DocumentEvent_Release(IDocumentEvent *iface) static HRESULT WINAPI DocumentEvent_GetTypeInfoCount(IDocumentEvent *iface, UINT *pctinfo) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentEvent_GetTypeInfo(IDocumentEvent *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentEvent_GetIDsOfNames(IDocumentEvent *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
@@ -4700,7 +4700,7 @@ static HRESULT WINAPI DocumentEvent_Invoke(IDocumentEvent *iface, DISPID dispIdM LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -4768,9 +4768,9 @@ static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { SupportErrorInfo_InterfaceSupportsErrorInfo };
-static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface) +static inline HTMLDocumentNode *impl_from_IDispatchEx(IDispatchEx *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDispatchEx_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDispatchEx_iface); }
static HRESULT has_elem_name(nsIDOMHTMLDocument *nsdoc, const WCHAR *name) @@ -4875,54 +4875,54 @@ static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, const WCHAR *name,
static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_query_interface(This, riid, ppv); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_addref(This); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_release(This); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetTypeInfoCount(This->dispex, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->node.event_target.dispex.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetTypeInfo(This->dispex, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetIDsOfNames(This->dispex, riid, rgszNames, cNames, lcid, rgDispId); + return IDispatchEx_GetIDsOfNames(&This->node.event_target.dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
TRACE("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); @@ -4933,28 +4933,28 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb
static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface); HRESULT hres;
- hres = IDispatchEx_GetDispID(This->dispex, bstrName, grfdex & ~fdexNameEnsure, pid); + hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex & ~fdexNameEnsure, pid); if(hres != DISP_E_UNKNOWNNAME) return hres;
- if(This->doc_node->nsdoc) { - hres = get_elem_by_name_or_id(This->doc_node->nsdoc, bstrName, NULL); + if(This->nsdoc) { + hres = get_elem_by_name_or_id(This->nsdoc, bstrName, NULL); if(SUCCEEDED(hres)) - hres = dispid_from_elem_name(This->doc_node, bstrName, pid); + hres = dispid_from_elem_name(This, bstrName, pid); }
if(hres == DISP_E_UNKNOWNNAME && (grfdex & fdexNameEnsure)) - hres = IDispatchEx_GetDispID(This->dispex, bstrName, grfdex, pid); + hres = dispex_get_dynid(&This->node.event_target.dispex, bstrName, FALSE, pid); return hres; }
static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
if(This->window) { switch(id) { @@ -4965,56 +4965,56 @@ static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID return E_INVALIDARG;
V_VT(pvarRes) = VT_I4; - V_I4(pvarRes) = This->window->readystate; + V_I4(pvarRes) = This->window->base.outer_window->readystate; return S_OK; default: break; } }
- return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); }
static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_DeleteMemberByName(This->dispex, bstrName, grfdex); + return IDispatchEx_DeleteMemberByName(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex); }
static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_DeleteMemberByDispID(This->dispex, id); + return IDispatchEx_DeleteMemberByDispID(&This->node.event_target.dispex.IDispatchEx_iface, id); }
static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetMemberProperties(This->dispex, id, grfdexFetch, pgrfdex); + return IDispatchEx_GetMemberProperties(&This->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, pgrfdex); }
static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetMemberName(This->dispex, id, pbstrName); + return IDispatchEx_GetMemberName(&This->node.event_target.dispex.IDispatchEx_iface, id, pbstrName); }
static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetNextDispID(This->dispex, grfdex, id, pid); + return IDispatchEx_GetNextDispID(&This->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid); }
static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_GetNameSpaceParent(This->dispex, ppunk); + return IDispatchEx_GetNameSpaceParent(&This->node.event_target.dispex.IDispatchEx_iface, ppunk); }
static const IDispatchExVtbl DocDispatchExVtbl = { @@ -5479,14 +5479,14 @@ static HRESULT WINAPI DocumentRange_GetTypeInfoCount(IDocumentRange *iface, UINT { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentRange_GetTypeInfo(IDocumentRange *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentRange_GetIDsOfNames(IDocumentRange *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, @@ -5494,7 +5494,7 @@ static HRESULT WINAPI DocumentRange_GetIDsOfNames(IDocumentRange *iface, REFIID { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
@@ -5503,7 +5503,7 @@ static HRESULT WINAPI DocumentRange_Invoke(IDocumentRange *iface, DISPID dispIdM { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
@@ -5539,22 +5539,6 @@ static const IDocumentRangeVtbl DocumentRangeVtbl = { DocumentRange_createRange };
-BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) -{ - *ppv = NULL; - - if(IsEqualGUID(&IID_IDispatch, riid)) - *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IDispatchEx, riid)) - *ppv = &This->IDispatchEx_iface; - else - return FALSE; - - if(*ppv) - IUnknown_AddRef((IUnknown*)*ppv); - return TRUE; -} - static cp_static_data_t HTMLDocumentNodeEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentNode_on_advise }; static cp_static_data_t HTMLDocumentNodeEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocumentNode_on_advise, TRUE };
@@ -5566,14 +5550,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = { {NULL} };
-void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) -{ - doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; - - doc->outer_unk = outer; - doc->dispex = dispex; -} - static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface) { return CONTAINING_RECORD(iface, HTMLDocumentNode, node); @@ -5585,11 +5561,10 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
- if(htmldoc_qi(&This->basedoc, riid, ppv)) - return *ppv ? S_OK : E_NOINTERFACE; - if(IsEqualGUID(&IID_IUnknown, riid)) *ppv = &This->IHTMLDocument2_iface; + else if(IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) + *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) @@ -6072,6 +6047,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo return NULL;
doc->ref = 1; + doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; @@ -6092,8 +6068,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->basedoc.window = window ? window->base.outer_window : NULL; doc->window = window;
- init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface, - &doc->node.event_target.dispex.IDispatchEx_iface); + doc->basedoc.outer_unk = (IUnknown*)&doc->node.IHTMLDOMNode_iface; ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ac2ca06bb14..83b216fa7e6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3828,7 +3828,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD case DISPATCH_PROPERTYPUT: { DISPID dispex_id;
- hres = dispex_get_dynid(&This->event_target.dispex, prop->name, &dispex_id); + hres = dispex_get_dynid(&This->event_target.dispex, prop->name, TRUE, &dispex_id); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 50d756309fe..964d01043bd 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -406,7 +406,7 @@ HRESULT change_type(VARIANT*,VARIANT*,VARTYPE,IServiceProvider*) DECLSPEC_HIDDEN HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**) DECLSPEC_HIDDEN; HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN; HRESULT remove_attribute(DispatchEx*,DISPID,VARIANT_BOOL*) DECLSPEC_HIDDEN; -HRESULT dispex_get_dynid(DispatchEx*,const WCHAR*,DISPID*) DECLSPEC_HIDDEN; +HRESULT dispex_get_dynid(DispatchEx*,const WCHAR*,BOOL,DISPID*) DECLSPEC_HIDDEN; void dispex_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*) DECLSPEC_HIDDEN; void dispex_unlink(DispatchEx*) DECLSPEC_HIDDEN; void release_typelib(void) DECLSPEC_HIDDEN; @@ -640,10 +640,7 @@ struct ConnectionPoint { };
struct HTMLDocument { - IDispatchEx IDispatchEx_iface; - IUnknown *outer_unk; - IDispatchEx *dispex;
HTMLDocumentObj *doc_obj; HTMLDocumentNode *doc_node; @@ -666,13 +663,11 @@ static inline ULONG htmldoc_release(HTMLDocument *This) return IUnknown_Release(This->outer_unk); }
-BOOL htmldoc_qi(HTMLDocument*,REFIID,void**) DECLSPEC_HIDDEN; -void init_doc(HTMLDocument*,IUnknown*,IDispatchEx*) DECLSPEC_HIDDEN; - struct HTMLDocumentObj { HTMLDocument basedoc; DispatchEx dispex; IUnknown IUnknown_inner; + IDispatchEx IDispatchEx_iface; ICustomDoc ICustomDoc_iface; IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; @@ -899,6 +894,7 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IDispatchEx IDispatchEx_iface; IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index a1281759f38..3218317a63d 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2145,24 +2145,24 @@ static ULONG WINAPI DocObj##iface##_Release(I##iface *_0) \ static HRESULT WINAPI DocObj##iface##_GetTypeInfoCount(I##iface *_0, UINT *pctinfo) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); \ + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); \ } \ static HRESULT WINAPI DocObj##iface##_GetTypeInfo(I##iface *_0, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); \ + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); \ } \ static HRESULT WINAPI DocObj##iface##_GetIDsOfNames(I##iface *_0, REFIID riid, LPOLESTR *rgszNames, UINT cNames, \ LCID lcid, DISPID *rgDispId) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); \ + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); \ } \ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, REFIID riid, LCID lcid, \ WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \ + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \ @@ -3251,8 +3251,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
if(IsEqualGUID(&IID_IUnknown, riid)) { *ppv = &This->IUnknown_inner; - }else if(htmldoc_qi(&This->basedoc, riid, ppv)) { - return *ppv ? S_OK : E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) { + *ppv = &This->IDispatchEx_iface; }else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) { *ppv = &This->IHTMLDocument2_iface; }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) { @@ -3437,6 +3437,144 @@ static const IUnknownVtbl HTMLDocumentObjVtbl = { HTMLDocumentObj_Release };
+/********************************************************** + * IDispatchEx implementation + */ +static inline HTMLDocumentObj *impl_from_IDispatchEx(IDispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IDispatchEx_iface); +} + +static HRESULT WINAPI DocObjDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI DocObjDispatchEx_AddRef(IDispatchEx *iface) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI DocObjDispatchEx_Release(IDispatchEx *iface) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocObjDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI DocObjDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI DocObjDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); +} + +static HRESULT WINAPI DocObjDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, + pVarResult, pExcepInfo, NULL); +} + +static HRESULT WINAPI DocObjDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetDispID(&This->dispex.IDispatchEx_iface, bstrName, grfdex, pid); +} + +static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + if(This->basedoc.window) { + switch(id) { + case DISPID_READYSTATE: + TRACE("DISPID_READYSTATE\n"); + + if(!(wFlags & DISPATCH_PROPERTYGET)) + return E_INVALIDARG; + + V_VT(pvarRes) = VT_I4; + V_I4(pvarRes) = This->basedoc.window->readystate; + return S_OK; + default: + break; + } + } + + return IDispatchEx_InvokeEx(&This->dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_DeleteMemberByName(&This->dispex.IDispatchEx_iface, bstrName, grfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_DeleteMemberByDispID(&This->dispex.IDispatchEx_iface, id); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetMemberProperties(&This->dispex.IDispatchEx_iface, id, grfdexFetch, pgrfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetMemberName(&This->dispex.IDispatchEx_iface, id, pbstrName); +} + +static HRESULT WINAPI DocObjDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetNextDispID(&This->dispex.IDispatchEx_iface, grfdex, id, pid); +} + +static HRESULT WINAPI DocObjDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + return IDispatchEx_GetNameSpaceParent(&This->dispex.IDispatchEx_iface, ppunk); +} + +static const IDispatchExVtbl DocObjDispatchExVtbl = { + DocObjDispatchEx_QueryInterface, + DocObjDispatchEx_AddRef, + DocObjDispatchEx_Release, + DocObjDispatchEx_GetTypeInfoCount, + DocObjDispatchEx_GetTypeInfo, + DocObjDispatchEx_GetIDsOfNames, + DocObjDispatchEx_Invoke, + DocObjDispatchEx_GetDispID, + DocObjDispatchEx_InvokeEx, + DocObjDispatchEx_DeleteMemberByName, + DocObjDispatchEx_DeleteMemberByDispID, + DocObjDispatchEx_GetMemberProperties, + DocObjDispatchEx_GetMemberName, + DocObjDispatchEx_GetNextDispID, + DocObjDispatchEx_GetNameSpaceParent +}; + /********************************************************** * ICustomDoc implementation */ @@ -3580,6 +3718,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc->ref = 1; doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; + doc->IDispatchEx_iface.lpVtbl = &DocObjDispatchExVtbl; doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; @@ -3596,10 +3735,10 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IDisplayServices_iface.lpVtbl = &DocObjDisplayServicesVtbl; doc->IDocumentRange_iface.lpVtbl = &DocObjDocumentRangeVtbl;
+ doc->basedoc.outer_unk = outer ? outer : &doc->IUnknown_inner; doc->basedoc.doc_obj = doc;
init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); - init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); HTMLDocumentObj_Persist_Init(doc); HTMLDocumentObj_Service_Init(doc);
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 91 +++++++++++++------------ dlls/mshtml/htmlnode.c | 8 +-- dlls/mshtml/htmlwindow.c | 6 +- dlls/mshtml/mshtml_private.h | 18 +---- dlls/mshtml/mutation.c | 10 +-- dlls/mshtml/nsevents.c | 4 +- dlls/mshtml/olecmd.c | 12 ++-- dlls/mshtml/oleobj.c | 126 +++++++++++++++++------------------ dlls/mshtml/persist.c | 72 ++++++++++---------- dlls/mshtml/script.c | 2 +- dlls/mshtml/service.c | 12 ++-- dlls/mshtml/view.c | 16 ++--- 12 files changed, 180 insertions(+), 197 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 338662d0daa..027f27f222d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -420,21 +420,21 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo) @@ -2169,19 +2169,19 @@ static inline HTMLDocumentNode *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) @@ -2780,19 +2780,19 @@ static inline HTMLDocumentNode *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo) @@ -3013,19 +3013,19 @@ static inline HTMLDocumentNode *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) @@ -3314,19 +3314,19 @@ static inline HTMLDocumentNode *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo) @@ -3491,19 +3491,19 @@ static inline HTMLDocumentNode *impl_from_IHTMLDocument7(IHTMLDocument7 *iface) static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface) { HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo) @@ -4541,19 +4541,19 @@ static inline HTMLDocumentNode *impl_from_IDocumentSelector(IDocumentSelector *i static HRESULT WINAPI DocumentSelector_QueryInterface(IDocumentSelector *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocumentSelector_AddRef(IDocumentSelector *iface) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocumentSelector_Release(IDocumentSelector *iface) { HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo) @@ -4660,19 +4660,19 @@ static inline HTMLDocumentNode *impl_from_IDocumentEvent(IDocumentEvent *iface) static HRESULT WINAPI DocumentEvent_QueryInterface(IDocumentEvent *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocumentEvent_AddRef(IDocumentEvent *iface) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocumentEvent_Release(IDocumentEvent *iface) { HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocumentEvent_GetTypeInfoCount(IDocumentEvent *iface, UINT *pctinfo) @@ -4740,19 +4740,19 @@ static inline HTMLDocumentNode *impl_from_ISupportErrorInfo(ISupportErrorInfo *i static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface) { HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface) { HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) @@ -4877,21 +4877,21 @@ static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID ri { HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface) { HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface) { HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
- return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) @@ -5044,19 +5044,19 @@ static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo REFIID riid, void **ppv) { HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideMultipleClassInfo *iface) { HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI ProvideClassInfo_Release(IProvideMultipleClassInfo *iface) { HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) @@ -5110,19 +5110,19 @@ static inline HTMLDocumentNode *impl_from_IMarkupServices(IMarkupServices *iface static HRESULT WINAPI MarkupServices_QueryInterface(IMarkupServices *iface, REFIID riid, void **ppvObject) { HTMLDocumentNode *This = impl_from_IMarkupServices(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppvObject); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppvObject); }
static ULONG WINAPI MarkupServices_AddRef(IMarkupServices *iface) { HTMLDocumentNode *This = impl_from_IMarkupServices(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI MarkupServices_Release(IMarkupServices *iface) { HTMLDocumentNode *This = impl_from_IMarkupServices(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI MarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) @@ -5324,19 +5324,19 @@ static inline HTMLDocumentNode *impl_from_IMarkupContainer(IMarkupContainer *ifa static HRESULT WINAPI MarkupContainer_QueryInterface(IMarkupContainer *iface, REFIID riid, void **ppvObject) { HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppvObject); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppvObject); }
static ULONG WINAPI MarkupContainer_AddRef(IMarkupContainer *iface) { HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI MarkupContainer_Release(IMarkupContainer *iface) { HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI MarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) @@ -5364,19 +5364,19 @@ static inline HTMLDocumentNode *impl_from_IDisplayServices(IDisplayServices *ifa static HRESULT WINAPI DisplayServices_QueryInterface(IDisplayServices *iface, REFIID riid, void **ppvObject) { HTMLDocumentNode *This = impl_from_IDisplayServices(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppvObject); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppvObject); }
static ULONG WINAPI DisplayServices_AddRef(IDisplayServices *iface) { HTMLDocumentNode *This = impl_from_IDisplayServices(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DisplayServices_Release(IDisplayServices *iface) { HTMLDocumentNode *This = impl_from_IDisplayServices(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DisplayServices_CreateDisplayPointer(IDisplayServices *iface, IDisplayPointer **ppDispPointer) @@ -5458,21 +5458,21 @@ static HRESULT WINAPI DocumentRange_QueryInterface(IDocumentRange *iface, REFIID { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocumentRange_AddRef(IDocumentRange *iface) { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocumentRange_Release(IDocumentRange *iface) { HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocumentRange_GetTypeInfoCount(IDocumentRange *iface, UINT *pctinfo) @@ -6068,7 +6068,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->basedoc.window = window ? window->base.outer_window : NULL; doc->window = window;
- doc->basedoc.outer_unk = (IUnknown*)&doc->node.IHTMLDOMNode_iface; ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 2e04c2fa94a..42ac37a7736 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1441,7 +1441,7 @@ void HTMLDOMNode_destructor(HTMLDOMNode *This) if(This->nsnode) nsIDOMNode_Release(This->nsnode); if(This->doc && &This->doc->node != This) - htmldoc_release(&This->doc->basedoc); + IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface); }
static HRESULT HTMLDOMNode_clone(HTMLDOMNode *This, nsIDOMNode *nsnode, HTMLDOMNode **ret) @@ -1479,7 +1479,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno EventTarget_Init(&node->event_target, (IUnknown*)&node->IHTMLDOMNode_iface, dispex_data, doc->document_mode);
if(&doc->node != node) - htmldoc_addref(&doc->basedoc); + IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface); node->doc = doc;
nsIDOMNode_AddRef(nsnode); @@ -1601,7 +1601,7 @@ static nsresult NSAPI HTMLDOMNode_unlink(void *p) if(This->doc && &This->doc->node != This) { HTMLDocumentNode *doc = This->doc; This->doc = NULL; - htmldoc_release(&doc->basedoc); + IHTMLDOMNode_Release(&doc->node.IHTMLDOMNode_iface); }else { This->doc = NULL; } @@ -1667,6 +1667,6 @@ HRESULT get_node(nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret) return E_FAIL;
hres = create_node(document, nsnode, ret); - htmldoc_release(&document->basedoc); + IHTMLDOMNode_Release(&document->node.IHTMLDOMNode_iface); return hres; } diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 83b216fa7e6..1098be05b9b 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -259,7 +259,7 @@ static void release_inner_window(HTMLInnerWindow *This)
if(This->doc) { This->doc->window = NULL; - htmldoc_release(&This->doc->basedoc); + IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface); }
release_event_target(&This->event_target); @@ -4187,9 +4187,9 @@ HRESULT update_window_doc(HTMLInnerWindow *window) if(is_main_content_window(outer_window) || !outer_window->browser->content_window) { HTMLDocumentObj *doc_obj = outer_window->browser->doc; if(doc_obj->basedoc.doc_node) - htmldoc_release(&doc_obj->basedoc.doc_node->basedoc); + IHTMLDOMNode_Release(&doc_obj->basedoc.doc_node->node.IHTMLDOMNode_iface); doc_obj->basedoc.doc_node = window->doc; - htmldoc_addref(&window->doc->basedoc); + IHTMLDOMNode_AddRef(&window->doc->node.IHTMLDOMNode_iface); }
return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 964d01043bd..738cd770318 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,29 +640,12 @@ struct ConnectionPoint { };
struct HTMLDocument { - IUnknown *outer_unk; - HTMLDocumentObj *doc_obj; HTMLDocumentNode *doc_node;
HTMLOuterWindow *window; };
-static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv) -{ - return IUnknown_QueryInterface(This->outer_unk, riid, ppv); -} - -static inline ULONG htmldoc_addref(HTMLDocument *This) -{ - return IUnknown_AddRef(This->outer_unk); -} - -static inline ULONG htmldoc_release(HTMLDocument *This) -{ - return IUnknown_Release(This->outer_unk); -} - struct HTMLDocumentObj { HTMLDocument basedoc; DispatchEx dispex; @@ -707,6 +690,7 @@ struct HTMLDocumentObj {
LONG ref;
+ IUnknown *outer_unk; GeckoBrowser *nscontainer;
IOleClientSite *client; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 0f1a083e616..2b000ad8e55 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -605,7 +605,7 @@ static nsrefcnt NSAPI nsRunnable_Release(nsIRunnable *iface) TRACE("(%p) ref=%ld\n", This, ref);
if(!ref) { - htmldoc_release(&This->doc->basedoc); + IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface); if(This->arg1) nsISupports_Release(This->arg1); if(This->arg2) @@ -641,7 +641,7 @@ static void add_script_runner(HTMLDocumentNode *This, runnable_proc_t proc, nsIS runnable->nsIRunnable_iface.lpVtbl = &nsRunnableVtbl; runnable->ref = 1;
- htmldoc_addref(&This->basedoc); + IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); runnable->doc = This; runnable->proc = proc;
@@ -683,20 +683,20 @@ static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *ifa return NS_NOINTERFACE; }
- htmldoc_addref(&This->basedoc); + IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); return NS_OK; }
static nsrefcnt NSAPI nsDocumentObserver_AddRef(nsIDocumentObserver *iface) { HTMLDocumentNode *This = impl_from_nsIDocumentObserver(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static nsrefcnt NSAPI nsDocumentObserver_Release(nsIDocumentObserver *iface) { HTMLDocumentNode *This = impl_from_nsIDocumentObserver(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface);; }
static void NSAPI nsDocumentObserver_CharacterDataWillChange(nsIDocumentObserver *iface, diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index e7d99151669..d4bd35090c1 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -237,7 +237,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
connect_scripts(doc->window);
- htmldoc_addref(&doc->basedoc); + IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface);
if(doc_obj) handle_docobj_load(doc_obj); @@ -278,7 +278,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event WARN("no window\n"); }
- htmldoc_release(&doc->basedoc); + IHTMLDOMNode_Release(&doc->node.IHTMLDOMNode_iface); return NS_OK; }
diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 364a26ed769..b5dbf3bdbeb 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -801,19 +801,19 @@ static const cmdtable_t base_cmds[] = { static HRESULT WINAPI DocNodeOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleCommandTarget_AddRef(IOleCommandTarget *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleCommandTarget_Release(IOleCommandTarget *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT query_from_table(HTMLDocumentNode *doc, const cmdtable_t *cmdtable, OLECMD *cmd) @@ -965,19 +965,19 @@ static const IOleCommandTargetVtbl DocNodeOleCommandTargetVtbl = { static HRESULT WINAPI DocObjOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleCommandTarget_AddRef(IOleCommandTarget *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleCommandTarget_Release(IOleCommandTarget *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup, diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 3218317a63d..d5df7378df7 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -147,19 +147,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleObject(IOleObject *ifa static HRESULT WINAPI DocNodeOleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleObject_AddRef(IOleObject *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleObject_Release(IOleObject *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite) @@ -336,19 +336,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleObject(IOleObject *iface static HRESULT WINAPI DocObjOleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleObject_AddRef(IOleObject *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleObject_Release(IOleObject *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleObject(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static void update_hostinfo(HTMLDocumentObj *This, DOCHOSTUIINFO *hostinfo) @@ -909,19 +909,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleDocument(IOleDocument static HRESULT WINAPI DocNodeOleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleDocument_AddRef(IOleDocument *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleDocument_Release(IOleDocument *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm, @@ -963,19 +963,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleDocument(IOleDocument *i static HRESULT WINAPI DocObjOleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleDocument_AddRef(IOleDocument *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleDocument_Release(IOleDocument *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleDocument(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm, @@ -1046,19 +1046,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleControl(IOleControl *i static HRESULT WINAPI DocNodeOleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleControl_AddRef(IOleControl *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleControl_Release(IOleControl *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) @@ -1106,19 +1106,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleControl(IOleControl *ifa static HRESULT WINAPI DocObjOleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleControl_AddRef(IOleControl *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleControl_Release(IOleControl *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleControl(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI) @@ -1286,19 +1286,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleInPlaceActiveObject(IO static HRESULT WINAPI DocNodeOleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) @@ -1371,19 +1371,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleInPlaceActiveObject(IOle static HRESULT WINAPI DocObjOleInPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleInPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleInPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceActiveObject(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) @@ -1479,19 +1479,19 @@ static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_QueryInterface(IOleInPla REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, @@ -1574,19 +1574,19 @@ static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_QueryInterface(IOleInPlac REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleInPlaceObjectWindowless(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface, @@ -1717,19 +1717,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IObjectWithSite(IObjectWit static HRESULT WINAPI DocNodeObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeObjectWithSite_AddRef(IObjectWithSite *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeObjectWithSite_Release(IObjectWithSite *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectWithSite(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) @@ -1762,19 +1762,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IObjectWithSite(IObjectWithS static HRESULT WINAPI DocObjObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjObjectWithSite_AddRef(IObjectWithSite *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjObjectWithSite_Release(IObjectWithSite *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectWithSite(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) @@ -1811,19 +1811,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IOleContainer(IOleContaine static HRESULT WINAPI DocNodeOleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeOleContainer_AddRef(IOleContainer *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeOleContainer_Release(IOleContainer *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeOleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, @@ -1864,19 +1864,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IOleContainer(IOleContainer static HRESULT WINAPI DocObjOleContainer_QueryInterface(IOleContainer *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjOleContainer_AddRef(IOleContainer *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjOleContainer_Release(IOleContainer *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleContainer(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjOleContainer_ParseDisplayName(IOleContainer *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, @@ -1988,19 +1988,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IObjectSafety(IObjectSafet static HRESULT WINAPI DocNodeObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeObjectSafety_AddRef(IObjectSafety *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeObjectSafety_Release(IObjectSafety *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, @@ -2035,19 +2035,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IObjectSafety(IObjectSafety static HRESULT WINAPI DocObjObjectSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjObjectSafety_AddRef(IObjectSafety *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjObjectSafety_Release(IObjectSafety *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IObjectSafety(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjObjectSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, @@ -2128,17 +2128,17 @@ static void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) static HRESULT WINAPI DocObj##iface##_QueryInterface(I##iface *_0, REFIID riid, void **ppv) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return htmldoc_query_interface(&This->basedoc, riid, ppv); \ + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); \ } \ static ULONG WINAPI DocObj##iface##_AddRef(I##iface *_0) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return htmldoc_addref(&This->basedoc); \ + return IUnknown_AddRef(This->outer_unk); \ } \ static ULONG WINAPI DocObj##iface##_Release(I##iface *_0) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return htmldoc_release(&This->basedoc); \ + return IUnknown_Release(This->outer_unk); \ }
#define HTMLDOCUMENTOBJ_IDISPATCH_METHODS(iface) HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(iface) \ @@ -3391,7 +3391,7 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) if(!ref) { if(This->basedoc.doc_node) { This->basedoc.doc_node->basedoc.doc_obj = NULL; - htmldoc_release(&This->basedoc.doc_node->basedoc); + IHTMLDOMNode_Release(&This->basedoc.doc_node->node.IHTMLDOMNode_iface); } if(This->basedoc.window) IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface); @@ -3448,19 +3448,19 @@ static inline HTMLDocumentObj *impl_from_IDispatchEx(IDispatchEx *iface) static HRESULT WINAPI DocObjDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjDispatchEx_AddRef(IDispatchEx *iface) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjDispatchEx_Release(IDispatchEx *iface) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) @@ -3588,21 +3588,21 @@ static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, v { HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
- return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) { HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
- return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) { HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
- return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler) @@ -3735,7 +3735,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IDisplayServices_iface.lpVtbl = &DocObjDisplayServicesVtbl; doc->IDocumentRange_iface.lpVtbl = &DocObjDocumentRangeVtbl;
- doc->basedoc.outer_unk = outer ? outer : &doc->IUnknown_inner; + doc->outer_unk = outer ? outer : &doc->IUnknown_inner; doc->basedoc.doc_obj = doc;
init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); @@ -3754,15 +3754,15 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii hres = create_gecko_browser(doc, &doc->nscontainer); if(FAILED(hres)) { ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n"); - htmldoc_release(&doc->basedoc); + IUnknown_Release(&doc->IUnknown_inner); return hres; }
if(IsEqualGUID(&IID_IUnknown, riid)) { *ppv = &doc->IUnknown_inner; }else { - hres = htmldoc_query_interface(&doc->basedoc, riid, ppv); - htmldoc_release(&doc->basedoc); + hres = IUnknown_QueryInterface(doc->outer_unk, riid, ppv); + IUnknown_Release(doc->outer_unk); if(FAILED(hres)) return hres; } @@ -3772,7 +3772,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) { doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc; - htmldoc_addref(&doc->basedoc.doc_node->basedoc); + IHTMLDOMNode_AddRef(&doc->basedoc.doc_node->node.IHTMLDOMNode_iface); }
get_thread_hwnd(); diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 1f8e47b936f..283e3703440 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -547,19 +547,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistMoniker(IPersistMo static HRESULT WINAPI DocNodePersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodePersistMoniker_AddRef(IPersistMoniker *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodePersistMoniker_Release(IPersistMoniker *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodePersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) @@ -625,19 +625,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistMoniker(IPersistMoni static HRESULT WINAPI DocObjPersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjPersistMoniker_AddRef(IPersistMoniker *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjPersistMoniker_Release(IPersistMoniker *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistMoniker(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjPersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID) @@ -768,19 +768,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IMonikerProp(IMonikerProp static HRESULT WINAPI DocNodeMonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeMonikerProp_AddRef(IMonikerProp *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeMonikerProp_Release(IMonikerProp *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeMonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) @@ -804,19 +804,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IMonikerProp(IMonikerProp *i static HRESULT WINAPI DocObjMonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjMonikerProp_AddRef(IMonikerProp *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjMonikerProp_Release(IMonikerProp *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IMonikerProp(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjMonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) @@ -861,19 +861,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistFile(IPersistFile static HRESULT WINAPI DocNodePersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodePersistFile_AddRef(IPersistFile *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodePersistFile_Release(IPersistFile *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodePersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) @@ -957,19 +957,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistFile(IPersistFile *i static HRESULT WINAPI DocObjPersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjPersistFile_AddRef(IPersistFile *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjPersistFile_Release(IPersistFile *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjPersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) @@ -1047,19 +1047,19 @@ static HRESULT WINAPI DocNodePersistStreamInit_QueryInterface(IPersistStreamInit REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodePersistStreamInit_AddRef(IPersistStreamInit *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodePersistStreamInit_Release(IPersistStreamInit *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodePersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) @@ -1141,19 +1141,19 @@ static HRESULT WINAPI DocObjPersistStreamInit_QueryInterface(IPersistStreamInit REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjPersistStreamInit_AddRef(IPersistStreamInit *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjPersistStreamInit_Release(IPersistStreamInit *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjPersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID) @@ -1261,19 +1261,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IPersistHistory(IPersistHi static HRESULT WINAPI DocNodePersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodePersistHistory_AddRef(IPersistHistory *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodePersistHistory_Release(IPersistHistory *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodePersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) @@ -1327,19 +1327,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IPersistHistory(IPersistHist static HRESULT WINAPI DocObjPersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjPersistHistory_AddRef(IPersistHistory *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjPersistHistory_Release(IPersistHistory *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistHistory(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjPersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID) @@ -1467,19 +1467,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IHlinkTarget(IHlinkTarget static HRESULT WINAPI DocNodeHlinkTarget_QueryInterface(IHlinkTarget *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeHlinkTarget_AddRef(IHlinkTarget *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeHlinkTarget_Release(IHlinkTarget *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IHlinkTarget(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeHlinkTarget_SetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext *pihlbc) @@ -1548,19 +1548,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IHlinkTarget(IHlinkTarget *i static HRESULT WINAPI DocObjHlinkTarget_QueryInterface(IHlinkTarget *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjHlinkTarget_AddRef(IHlinkTarget *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjHlinkTarget_Release(IHlinkTarget *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IHlinkTarget(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjHlinkTarget_SetBrowseContext(IHlinkTarget *iface, IHlinkBrowseContext *pihlbc) diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 6f0ca73a778..1d555706e6a 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -1473,7 +1473,7 @@ static EventTarget *find_event_target(HTMLDocumentNode *doc, HTMLScriptElement * FIXME("Empty for attribute\n"); }else if(!wcscmp(target_id, L"document")) { event_target = &doc->node.event_target; - htmldoc_addref(&doc->basedoc); + IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface); }else if(!wcscmp(target_id, L"window")) { if(doc->window) { event_target = &doc->window->event_target; diff --git a/dlls/mshtml/service.c b/dlls/mshtml/service.c index d909217fb4e..865c35172e8 100644 --- a/dlls/mshtml/service.c +++ b/dlls/mshtml/service.c @@ -340,19 +340,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IServiceProvider(IServiceP static HRESULT WINAPI DocNodeServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) { HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv); }
static ULONG WINAPI DocNodeServiceProvider_AddRef(IServiceProvider *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); - return htmldoc_addref(&This->basedoc); + return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface); }
static ULONG WINAPI DocNodeServiceProvider_Release(IServiceProvider *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface); - return htmldoc_release(&This->basedoc); + return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface); }
static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, @@ -383,19 +383,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IServiceProvider(IServicePro static HRESULT WINAPI DocObjServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI DocObjServiceProvider_AddRef(IServiceProvider *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI DocObjServiceProvider_Release(IServiceProvider *iface) { HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI DocObjServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 96d3372174e..04b35e43039 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -419,19 +419,19 @@ static inline HTMLDocumentObj *impl_from_IOleDocumentView(IOleDocumentView *ifac static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject) { HTMLDocumentObj *This = impl_from_IOleDocumentView(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppvObject); + return IUnknown_QueryInterface(This->outer_unk, riid, ppvObject); }
static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface) { HTMLDocumentObj *This = impl_from_IOleDocumentView(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface) { HTMLDocumentObj *This = impl_from_IOleDocumentView(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite) @@ -727,19 +727,19 @@ static inline HTMLDocumentObj *impl_from_IViewObjectEx(IViewObjectEx *iface) static HRESULT WINAPI ViewObject_QueryInterface(IViewObjectEx *iface, REFIID riid, void **ppv) { HTMLDocumentObj *This = impl_from_IViewObjectEx(iface); - return htmldoc_query_interface(&This->basedoc, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); }
static ULONG WINAPI ViewObject_AddRef(IViewObjectEx *iface) { HTMLDocumentObj *This = impl_from_IViewObjectEx(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI ViewObject_Release(IViewObjectEx *iface) { HTMLDocumentObj *This = impl_from_IViewObjectEx(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI ViewObject_Draw(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, @@ -894,13 +894,13 @@ static HRESULT WINAPI WindowForBindingUI_QueryInterface(IWindowForBindingUI *ifa static ULONG WINAPI WindowForBindingUI_AddRef(IWindowForBindingUI *iface) { HTMLDocumentObj *This = impl_from_IWindowForBindingUI(iface); - return htmldoc_addref(&This->basedoc); + return IUnknown_AddRef(This->outer_unk); }
static ULONG WINAPI WindowForBindingUI_Release(IWindowForBindingUI *iface) { HTMLDocumentObj *This = impl_from_IWindowForBindingUI(iface); - return htmldoc_release(&This->basedoc); + return IUnknown_Release(This->outer_unk); }
static HRESULT WINAPI WindowForBindingUI_GetWindow(IWindowForBindingUI *iface, REFGUID rguidReason, HWND *phwnd)
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/editor.c | 20 ++++++++-------- dlls/mshtml/htmlanchor.c | 6 ++--- dlls/mshtml/htmldoc.c | 44 ++++++++++++++++++------------------ dlls/mshtml/htmlframe.c | 6 ++--- dlls/mshtml/mshtml_private.h | 4 ++-- dlls/mshtml/mutation.c | 6 ++--- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsevents.c | 10 ++++---- dlls/mshtml/olecmd.c | 10 ++++---- dlls/mshtml/oleobj.c | 32 +++++++++++++------------- dlls/mshtml/persist.c | 34 ++++++++++++++-------------- dlls/mshtml/pluginhost.c | 4 ++-- dlls/mshtml/range.c | 2 +- dlls/mshtml/secmgr.c | 8 +++---- 14 files changed, 94 insertions(+), 94 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index d70129ae533..b176eb8763b 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -133,7 +133,7 @@ static nsresult get_ns_command_state(GeckoBrowser *This, const char *cmd, nsICom return nsres; }
- nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->basedoc.window->window_proxy, nsparam); + nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->window->window_proxy, nsparam); if(NS_FAILED(nsres)) ERR("GetCommandState(%s) failed: %08lx\n", debugstr_a(cmd), nsres);
@@ -146,7 +146,7 @@ static DWORD query_ns_edit_status(HTMLDocumentNode *doc, const char *nscmd) nsICommandParams *nsparam; cpp_bool b = FALSE;
- if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED;
if(nscmd) { @@ -180,7 +180,7 @@ static DWORD query_align_status(HTMLDocumentNode *doc, const WCHAR *align) cpp_bool b; nsresult nsres;
- if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED;
nsAString_Init(&justify_str, align); @@ -198,7 +198,7 @@ static nsISelection *get_ns_selection(HTMLDocumentNode *doc) nsISelection *nsselection = NULL; nsresult nsres;
- nsres = nsIDOMWindow_GetSelection(doc->basedoc.window->nswindow, &nsselection); + nsres = nsIDOMWindow_GetSelection(doc->outer_window->nswindow, &nsselection); if(NS_FAILED(nsres)) ERR("GetSelection failed %08lx\n", nsres);
@@ -661,7 +661,7 @@ static HRESULT query_justify(HTMLDocumentNode *doc, OLECMD *cmd) case IDM_JUSTIFYLEFT: TRACE("(%p) IDM_JUSTIFYLEFT\n", doc); /* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */ - if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) cmd->cmdf = OLECMDF_SUPPORTED; else cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED; @@ -1191,9 +1191,9 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
doc->nscontainer->usermode = EDITMODE;
- if(doc->basedoc.window->mon) { + if(doc->window->mon) { CLSID clsid = IID_NULL; - hres = IMoniker_GetClassID(doc->basedoc.window->mon, &clsid); + hres = IMoniker_GetClassID(doc->window->mon, &clsid); if(SUCCEEDED(hres)) { /* We should use IMoniker::Save here */ FIXME("Use CLSID %s\n", debugstr_guid(&clsid)); @@ -1203,7 +1203,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc) if(doc->frame) IOleInPlaceFrame_SetStatusText(doc->frame, NULL);
- doc->basedoc.window->readystate = READYSTATE_UNINITIALIZED; + doc->window->readystate = READYSTATE_UNINITIALIZED;
if(doc->client) { IOleCommandTarget *cmdtrg; @@ -1235,11 +1235,11 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
update_doc(doc, UPDATE_UI);
- if(doc->basedoc.window->mon) { + if(doc->window->mon) { /* FIXME: We should find nicer way to do this */ remove_target_tasks(doc->task_magic);
- mon = doc->basedoc.window->mon; + mon = doc->window->mon; IMoniker_AddRef(mon); }else { hres = CreateURLMoniker(NULL, L"about:blank", &mon); diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 7b4ee80778f..633bb88e9df 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -49,11 +49,11 @@ static HRESULT navigate_href_new_window(HTMLElement *element, nsAString *href_st HRESULT hres;
nsAString_GetData(href_str, &href); - hres = create_relative_uri(element->node.doc->basedoc.window, href, &uri); + hres = create_relative_uri(element->node.doc->outer_window, href, &uri); if(FAILED(hres)) return hres;
- hres = navigate_new_window(element->node.doc->basedoc.window, uri, target, NULL, NULL); + hres = navigate_new_window(element->node.doc->outer_window, uri, target, NULL, NULL); IUri_Release(uri); return hres; } @@ -110,7 +110,7 @@ static HRESULT navigate_href(HTMLElement *element, nsAString *href_str, nsAStrin const PRUnichar *href; HRESULT hres;
- window = get_target_window(element->node.doc->basedoc.window, target_str, &use_new_window); + window = get_target_window(element->node.doc->outer_window, target_str, &use_new_window); if(!window) { if(use_new_window) { const PRUnichar *target; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 027f27f222d..eef6a2d91f1 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -893,7 +893,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p if(!p) return E_POINTER;
- return get_readystate_string(This->basedoc.window ? This->basedoc.window->readystate : 0, p); + return get_readystate_string(This->outer_window ? This->outer_window->readystate : 0, p); }
static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) @@ -902,11 +902,11 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->outer_window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); + return IHTMLWindow2_get_frames(&This->outer_window->base.IHTMLWindow2_iface, p); }
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p) @@ -1074,12 +1074,12 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->basedoc.window) { + if(!This->outer_window) { FIXME("No window available\n"); return E_FAIL; }
- return navigate_url(This->basedoc.window, v, This->basedoc.window->uri, BINDING_NAVIGATED); + return navigate_url(This->outer_window, v, This->outer_window->uri, BINDING_NAVIGATED); }
static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) @@ -1088,7 +1088,7 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", iface, p);
- *p = SysAllocString(This->basedoc.window && This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"); + *p = SysAllocString(This->outer_window && This->outer_window->url ? This->outer_window->url : L"about:blank"); return *p ? S_OK : E_OUTOFMEMORY; }
@@ -1121,7 +1121,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
nsAString_Init(&nsstr, NULL); nsres = nsIDOMHTMLDocument_GetDomain(This->nsdoc, &nsstr); - if(NS_SUCCEEDED(nsres) && This->basedoc.window && This->basedoc.window->uri) { + if(NS_SUCCEEDED(nsres) && This->outer_window && This->outer_window->uri) { const PRUnichar *str; HRESULT hres;
@@ -1129,7 +1129,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) if(!*str) { TRACE("Gecko returned empty string, fallback to loaded URL.\n"); nsAString_Finish(&nsstr); - hres = IUri_GetHost(This->basedoc.window->uri, p); + hres = IUri_GetHost(This->outer_window->uri, p); return FAILED(hres) ? hres : S_OK; } } @@ -1144,10 +1144,10 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->basedoc.window) + if(!This->outer_window) return S_OK;
- bret = InternetSetCookieExW(This->basedoc.window->url, NULL, v, 0, 0); + bret = InternetSetCookieExW(This->outer_window->url, NULL, v, 0, 0); if(!bret) { FIXME("InternetSetCookieExW failed: %lu\n", GetLastError()); return HRESULT_FROM_WIN32(GetLastError()); @@ -1164,13 +1164,13 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->outer_window) { *p = NULL; return S_OK; }
size = 0; - bret = InternetGetCookieExW(This->basedoc.window->url, NULL, NULL, &size, 0, NULL); + bret = InternetGetCookieExW(This->outer_window->url, NULL, NULL, &size, 0, NULL); if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { WARN("InternetGetCookieExW failed: %lu\n", GetLastError()); *p = NULL; @@ -1186,7 +1186,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) if(!*p) return E_OUTOFMEMORY;
- bret = InternetGetCookieExW(This->basedoc.window->url, NULL, *p, &size, 0, NULL); + bret = InternetGetCookieExW(This->outer_window->url, NULL, *p, &size, 0, NULL); if(!bret) { ERR("InternetGetCookieExW failed: %lu\n", GetLastError()); return E_FAIL; @@ -1391,7 +1391,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
*pomWindowResult = NULL;
- if(!This->basedoc.window) + if(!This->outer_window) return E_FAIL;
if(!This->nsdoc) { @@ -1413,8 +1413,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT if(tmp) nsISupports_Release(tmp);
- *pomWindowResult = (IDispatch*)&This->basedoc.window->base.IHTMLWindow2_iface; - IHTMLWindow2_AddRef(&This->basedoc.window->base.IHTMLWindow2_iface); + *pomWindowResult = (IDispatch*)&This->outer_window->base.IHTMLWindow2_iface; + IHTMLWindow2_AddRef(&This->outer_window->base.IHTMLWindow2_iface); return S_OK; }
@@ -2272,7 +2272,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
- if(This->basedoc.window && This->basedoc.window->readystate == READYSTATE_UNINITIALIZED) { + if(This->outer_window && This->outer_window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; return S_OK; } @@ -4728,7 +4728,7 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, IHTMLDocument2_iface);
- if(This->basedoc.window) + if(This->outer_window) update_doc_cp_events(This, cp); }
@@ -5956,10 +5956,10 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI { HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
- if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + if(!(flags & DISPATCH_PROPERTYPUT) || !This->outer_window) return S_FALSE;
- return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + return IDispatchEx_InvokeEx(&This->outer_window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, 0, flags, dp, res, ei, caller); }
@@ -6065,7 +6065,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc->basedoc.doc_node = doc; doc->basedoc.doc_obj = doc_obj; - doc->basedoc.window = window ? window->base.outer_window : NULL; + doc->outer_window = window ? window->base.outer_window : NULL; doc->window = window;
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); @@ -6098,7 +6098,7 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H lock_document_mode(doc); }
- if(!doc_obj->basedoc.window || (window && is_main_content_window(window->base.outer_window))) + if(!doc_obj->window || (window && is_main_content_window(window->base.outer_window))) doc->cp_container.forward_container = &doc_obj->cp_container;
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc, &HTMLDocumentNode_dispex); diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 707de8eebaa..a93460829fd 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -50,7 +50,7 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) window = mozwindow_to_window(mozwindow); if(!window && frame->element.node.doc->browser) hres = create_outer_window(frame->element.node.doc->browser, mozwindow, - frame->element.node.doc->basedoc.window, &window); + frame->element.node.doc->outer_window, &window); mozIDOMWindowProxy_Release(mozwindow); if(FAILED(hres)) return hres; @@ -127,7 +127,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->content_window || !This->element.node.doc || !This->element.node.doc->basedoc.window) { + if(!This->content_window || !This->element.node.doc || !This->element.node.doc->outer_window) { nsAString nsstr; nsresult nsres;
@@ -145,7 +145,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v) return S_OK; }
- return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->uri, BINDING_NAVIGATED); + return navigate_url(This->content_window, v, This->element.node.doc->outer_window->uri, BINDING_NAVIGATED); }
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 738cd770318..3e53a301129 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -642,8 +642,6 @@ struct ConnectionPoint { struct HTMLDocument { HTMLDocumentObj *doc_obj; HTMLDocumentNode *doc_node; - - HTMLOuterWindow *window; };
struct HTMLDocumentObj { @@ -691,6 +689,7 @@ struct HTMLDocumentObj { LONG ref;
IUnknown *outer_unk; + HTMLOuterWindow *window; GeckoBrowser *nscontainer;
IOleClientSite *client; @@ -916,6 +915,7 @@ struct HTMLDocumentNode { LONG ref;
ConnectionPointContainer cp_container; + HTMLOuterWindow *outer_window; HTMLInnerWindow *window;
GeckoBrowser *browser; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 2b000ad8e55..61ed745c588 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -283,8 +283,8 @@ static void parse_complete(HTMLDocumentObj *doc) call_property_onchanged(&doc->cp_container, 1005); call_explorer_69(doc);
- if(doc->webbrowser && doc->nscontainer->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH)) - IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0); + if(doc->webbrowser && doc->nscontainer->usermode != EDITMODE && !(doc->window->load_flags & BINDING_REFRESH)) + IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->window->base.IHTMLWindow2_iface, 0);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */ } @@ -305,7 +305,7 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo }
bind_event_scripts(This); - set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE); + set_ready_state(This->outer_window, READYSTATE_INTERACTIVE); return NS_OK; }
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index c7683a6d06d..744e567e56e 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -1228,7 +1228,7 @@ void setup_editor_controller(GeckoBrowser *This) }
nsres = nsIEditingSession_GetEditorForWindow(editing_session, - This->doc->basedoc.window->window_proxy, &This->editor); + This->doc->window->window_proxy, &This->editor); nsIEditingSession_Release(editing_session); if(NS_FAILED(nsres)) { ERR("Could not get editor: %08lx\n", nsres); diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index d4bd35090c1..00f4ffe526b 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -230,7 +230,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE("(%p)\n", doc);
- if(!doc || !doc->basedoc.window) + if(!doc || !doc->outer_window) return NS_ERROR_FAILURE; if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc) doc_obj = doc->basedoc.doc_obj; @@ -242,7 +242,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event if(doc_obj) handle_docobj_load(doc_obj);
- set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE); + set_ready_state(doc->outer_window, READYSTATE_COMPLETE);
if(doc_obj) { if(doc_obj->view_sink) @@ -254,9 +254,9 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event }
if(doc_obj && doc_obj->nscontainer->usermode != EDITMODE && doc_obj->doc_object_service - && !(doc->basedoc.window->load_flags & BINDING_REFRESH)) + && !(doc->outer_window->load_flags & BINDING_REFRESH)) IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service, - &doc->basedoc.window->base.IHTMLWindow2_iface, 0); + &doc->outer_window->base.IHTMLWindow2_iface, 0);
if(doc->nsdoc) { hres = create_document_event(doc, EVENTID_LOAD, &load_event); @@ -383,7 +383,7 @@ static nsIDOMEventTarget *get_default_document_target(HTMLDocumentNode *doc) nsISupports *target_iface; nsresult nsres;
- target_iface = doc->window ? (nsISupports*)doc->basedoc.window->nswindow : (nsISupports*)doc->nsdoc; + target_iface = doc->window ? (nsISupports*)doc->outer_window->nswindow : (nsISupports*)doc->nsdoc; nsres = nsISupports_QueryInterface(target_iface, &IID_nsIDOMEventTarget, (void**)&target); return NS_SUCCEEDED(nsres) ? target : NULL; } diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index b5dbf3bdbeb..2b12c2bf84b 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -69,7 +69,7 @@ static nsIClipboardCommands *get_clipboard_commands(HTMLDocumentNode *doc) nsIDocShell *doc_shell; nsresult nsres;
- nsres = get_nsinterface((nsISupports*)doc->basedoc.window->nswindow, &IID_nsIDocShell, (void**)&doc_shell); + nsres = get_nsinterface((nsISupports*)doc->outer_window->nswindow, &IID_nsIDocShell, (void**)&doc_shell); if(NS_FAILED(nsres)) { ERR("Could not get nsIDocShell interface\n"); return NULL; @@ -475,17 +475,17 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p } }
- if(!doc->basedoc.window) + if(!doc->outer_window) return E_UNEXPECTED;
task = heap_alloc(sizeof(*task)); if(!task) return E_OUTOFMEMORY;
- IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); - task->window = doc->basedoc.window; + IHTMLWindow2_AddRef(&doc->outer_window->base.IHTMLWindow2_iface); + task->window = doc->outer_window;
- return push_task(&task->header, refresh_proc, refresh_destr, doc->basedoc.window->task_magic); + return push_task(&task->header, refresh_proc, refresh_destr, doc->outer_window->task_magic); }
static HRESULT exec_stop(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index d5df7378df7..4de2efa690f 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -407,7 +407,7 @@ void set_document_navigation(HTMLDocumentObj *doc, BOOL doc_can_navigate)
if(doc_can_navigate) { V_VT(&var) = VT_UNKNOWN; - V_UNKNOWN(&var) = (IUnknown*)&doc->basedoc.window->base.IHTMLWindow2_iface; + V_UNKNOWN(&var) = (IUnknown*)&doc->window->base.IHTMLWindow2_iface; }
IOleCommandTarget_Exec(doc->client_cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, @@ -2276,11 +2276,11 @@ static HRESULT WINAPI DocObjHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTM
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); + return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p); }
HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_embeds, IHTMLElementCollection**) @@ -2767,8 +2767,8 @@ static HRESULT WINAPI DocObjHTMLDocument7_get_defaultView(IHTMLDocument7 *iface,
TRACE("(%p)->(%p)\n", This, p);
- if(This->basedoc.window) { - *p = &This->basedoc.window->base.IHTMLWindow2_iface; + if(This->window) { + *p = &This->window->base.IHTMLWindow2_iface; IHTMLWindow2_AddRef(*p); }else { *p = NULL; @@ -3393,8 +3393,8 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) This->basedoc.doc_node->basedoc.doc_obj = NULL; IHTMLDOMNode_Release(&This->basedoc.doc_node->node.IHTMLDOMNode_iface); } - if(This->basedoc.window) - IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface); + if(This->window) + IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface); if(This->advise_holder) IOleAdviseHolder_Release(This->advise_holder);
@@ -3502,7 +3502,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L { HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
- if(This->basedoc.window) { + if(This->window) { switch(id) { case DISPID_READYSTATE: TRACE("DISPID_READYSTATE\n"); @@ -3511,7 +3511,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L return E_INVALIDARG;
V_VT(pvarRes) = VT_I4; - V_I4(pvarRes) = This->basedoc.window->readystate; + V_I4(pvarRes) = This->window->readystate; return S_OK; default: break; @@ -3646,7 +3646,7 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentObj *This = impl_from_IUnknown(iface);
- if(This->basedoc.window && This->basedoc.doc_node) + if(This->window && This->basedoc.doc_node) update_doc_cp_events(This->basedoc.doc_node, cp); }
@@ -3666,10 +3666,10 @@ static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DIS { HTMLDocumentObj *This = CONTAINING_RECORD(dispex, HTMLDocumentObj, dispex);
- if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + if(!(flags & DISPATCH_PROPERTYPUT) || !This->window) return S_FALSE;
- return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, 0, flags, dp, res, ei, caller); }
@@ -3767,11 +3767,11 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii return hres; }
- doc->basedoc.window = doc->nscontainer->content_window; - IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); + doc->window = doc->nscontainer->content_window; + IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface);
- if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) { - doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc; + if(!doc->basedoc.doc_node && doc->window->base.inner_window->doc) { + doc->basedoc.doc_node = doc->window->base.inner_window->doc; IHTMLDOMNode_AddRef(&doc->basedoc.doc_node->node.IHTMLDOMNode_iface); }
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 283e3703440..337271a4e3a 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -302,11 +302,11 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags) } }
- if(This->basedoc.window->mon) { + if(This->window->mon) { update_doc(This, UPDATE_TITLE|UPDATE_UI); }else { update_doc(This, UPDATE_TITLE); - set_current_mon(This->basedoc.window, mon, flags); + set_current_mon(This->window, mon, flags); }
if(This->client) { @@ -318,7 +318,7 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags)
if(flags & BINDING_NAVIGATED) { V_VT(&var) = VT_UNKNOWN; - V_UNKNOWN(&var) = (IUnknown*)&This->basedoc.window->base.IHTMLWindow2_iface; + V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface; V_VT(&out) = VT_EMPTY; hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out); if(SUCCEEDED(hres)) @@ -707,12 +707,12 @@ static HRESULT WINAPI DocObjPersistMoniker_Load(IPersistMoniker *iface, BOOL fFu
prepare_for_binding(This, mon, FALSE); call_docview_84(This); - hres = set_moniker(This->basedoc.window, mon, NULL, pibc, NULL, TRUE); + hres = set_moniker(This->window, mon, NULL, pibc, NULL, TRUE); IMoniker_Release(mon); if(FAILED(hres)) return hres;
- return start_binding(This->basedoc.window->pending_window, (BSCallback*)This->basedoc.window->pending_window->bscallback, pibc); + return start_binding(This->window->pending_window, (BSCallback*)This->window->pending_window->bscallback, pibc); }
static HRESULT WINAPI DocObjPersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, @@ -736,11 +736,11 @@ static HRESULT WINAPI DocObjPersistMoniker_GetCurMoniker(IPersistMoniker *iface,
TRACE("(%p)->(%p)\n", This, ppimkName);
- if(!This->basedoc.window || !This->basedoc.window->mon) + if(!This->window || !This->window->mon) return E_UNEXPECTED;
- IMoniker_AddRef(This->basedoc.window->mon); - *ppimkName = This->basedoc.window->mon; + IMoniker_AddRef(This->window->mon); + *ppimkName = This->window->mon; return S_OK; }
@@ -1186,9 +1186,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_Load(IPersistStreamInit *iface, IS }
prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, TRUE); + hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE); if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, pStm); + hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
IMoniker_Release(mon); return hres; @@ -1229,9 +1229,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_InitNew(IPersistStreamInit *iface) }
prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, FALSE); + hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE); if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, NULL); + hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
IMoniker_Release(mon); return hres; @@ -1358,7 +1358,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I
TRACE("(%p)->(%p %p)\n", This, pStream, pbc);
- if(!This->basedoc.window) { + if(!This->window) { FIXME("No current window\n"); return E_UNEXPECTED; } @@ -1397,7 +1397,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I if(FAILED(hres)) return hres;
- hres = load_uri(This->basedoc.window, uri, BINDING_FROMHIST); + hres = load_uri(This->window, uri, BINDING_FROMHIST); IUri_Release(uri); return hres; } @@ -1411,14 +1411,14 @@ static HRESULT WINAPI DocObjPersistHistory_SaveHistory(IPersistHistory *iface, I
TRACE("(%p)->(%p)\n", This, pStream);
- if(!This->basedoc.window || !This->basedoc.window->uri) { + if(!This->window || !This->window->uri) { FIXME("No current URI\n"); return E_FAIL; }
/* NOTE: The format we store is *not* compatible with native MSHTML. We currently * store only URI of the page (as a length followed by a string) */ - hres = IUri_GetDisplayUri(This->basedoc.window->uri, &display_uri); + hres = IUri_GetDisplayUri(This->window->uri, &display_uri); if(FAILED(hres)) return hres;
@@ -1592,7 +1592,7 @@ static HRESULT WINAPI DocObjHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfH HRESULT hres; BSTR uri;
- hres = IUri_GetAbsoluteUri(This->basedoc.window->uri, &uri); + hres = IUri_GetAbsoluteUri(This->window->uri, &uri); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index 444834043d4..f5a0afc517e 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -2238,12 +2238,12 @@ static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, RE
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
- if(!This->doc || !This->doc->basedoc.window) { + if(!This->doc || !This->doc->outer_window) { *ppv = NULL; return E_NOINTERFACE; }
- return IServiceProvider_QueryService(&This->doc->basedoc.window->base.IServiceProvider_iface, + return IServiceProvider_QueryService(&This->doc->outer_window->base.IServiceProvider_iface, guidService, riid, ppv); }
diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 59d1a59b0b0..c98ba331b12 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1318,7 +1318,7 @@ static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface)
TRACE("(%p)\n", This);
- nsres = nsIDOMWindow_GetSelection(This->doc->basedoc.window->nswindow, &nsselection); + nsres = nsIDOMWindow_GetSelection(This->doc->outer_window->nswindow, &nsselection); if(NS_FAILED(nsres)) { ERR("GetSelection failed: %08lx\n", nsres); return E_FAIL; diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index 02bdc41c369..cee2313b083 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -76,10 +76,10 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
TRACE("(%p)->(%ld %p %ld %p %ld %lx %lx)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
- if(!This->basedoc.window) + if(!This->outer_window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"; + url = This->outer_window->url ? This->outer_window->url : L"about:blank";
return IInternetSecurityManager_ProcessUrlAction(get_security_manager(), url, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved); @@ -181,10 +181,10 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
TRACE("(%p)->(%s %p %p %p %ld %lx)\n", This, debugstr_guid(guidKey), ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
- if(!This->basedoc.window) + if(!This->outer_window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"; + url = This->outer_window->url ? This->outer_window->url : L"about:blank";
hres = IInternetSecurityManager_QueryCustomPolicy(get_security_manager(), url, guidKey, ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/binding.h | 2 +- dlls/mshtml/htmlbody.c | 2 +- dlls/mshtml/htmldoc.c | 11 +++--- dlls/mshtml/htmlelem.c | 3 +- dlls/mshtml/htmlwindow.c | 6 ++-- dlls/mshtml/mshtml_private.h | 9 ++--- dlls/mshtml/mutation.c | 8 ++--- dlls/mshtml/navigate.c | 6 ++-- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsevents.c | 10 +++--- dlls/mshtml/nsio.c | 2 +- dlls/mshtml/olecmd.c | 14 ++++---- dlls/mshtml/oleobj.c | 69 ++++++++++++++++++------------------ dlls/mshtml/persist.c | 32 ++++++++--------- dlls/mshtml/pluginhost.c | 4 +-- dlls/mshtml/service.c | 2 +- 16 files changed, 87 insertions(+), 95 deletions(-)
diff --git a/dlls/mshtml/binding.h b/dlls/mshtml/binding.h index 2034d12d816..479cb71cf15 100644 --- a/dlls/mshtml/binding.h +++ b/dlls/mshtml/binding.h @@ -140,7 +140,7 @@ typedef struct { HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN; HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
-HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN; +HRESULT hlink_frame_navigate(HTMLDocumentObj*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN; HRESULT create_doc_uri(IUri*,nsWineURI**) DECLSPEC_HIDDEN; HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsIInputStream*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN; HRESULT set_moniker(HTMLOuterWindow*,IMoniker*,IUri*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index c431551e489..163099114c5 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -683,7 +683,7 @@ static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, I ERR("CreateRange failed: %08lx\n", nsres); }
- hres = HTMLTxtRange_Create(This->element.node.doc->basedoc.doc_node, nsrange, range); + hres = HTMLTxtRange_Create(This->element.node.doc, nsrange, range);
nsIDOMRange_Release(nsrange); return hres; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index eef6a2d91f1..e3ef57ecfee 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -846,7 +846,7 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) return E_NOTIMPL; }
- hres = setup_edit_mode(This->basedoc.doc_obj); + hres = setup_edit_mode(This->doc_obj); if(FAILED(hres)) return hres;
@@ -5939,8 +5939,8 @@ static EventTarget *HTMLDocumentNode_get_parent_event_target(DispatchEx *dispex) static ConnectionPointContainer *HTMLDocumentNode_get_cp_container(DispatchEx *dispex) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); - ConnectionPointContainer *container = This->basedoc.doc_obj - ? &This->basedoc.doc_obj->cp_container : &This->cp_container; + ConnectionPointContainer *container = This->doc_obj + ? &This->doc_obj->cp_container : &This->cp_container; IConnectionPointContainer_AddRef(&container->IConnectionPointContainer_iface); return container; } @@ -6063,8 +6063,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->IDisplayServices_iface.lpVtbl = &DisplayServicesVtbl; doc->IDocumentRange_iface.lpVtbl = &DocumentRangeVtbl;
- doc->basedoc.doc_node = doc; - doc->basedoc.doc_obj = doc_obj; + doc->doc_obj = doc_obj; doc->outer_window = window ? window->base.outer_window : NULL; doc->window = window;
@@ -6133,7 +6132,7 @@ static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *do { HTMLDocumentNode *doc_frag;
- doc_frag = alloc_doc_node(doc_node->basedoc.doc_obj, doc_node->window); + doc_frag = alloc_doc_node(doc_node->doc_obj, doc_node->window); if(!doc_frag) return E_OUTOFMEMORY;
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 4a8ba9cc855..8a45a354a04 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -2939,8 +2939,7 @@ static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT compon
TRACE("(%p)->(%s)\n", This, debugstr_variant(&component));
- if(!This->node.doc->content_ready - || !This->node.doc->basedoc.doc_obj->in_place_active) + if(!This->node.doc->content_ready || !This->node.doc->doc_obj->in_place_active) return E_PENDING;
WARN("stub\n"); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 1098be05b9b..14fa17ace1b 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -4186,9 +4186,9 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
if(is_main_content_window(outer_window) || !outer_window->browser->content_window) { HTMLDocumentObj *doc_obj = outer_window->browser->doc; - if(doc_obj->basedoc.doc_node) - IHTMLDOMNode_Release(&doc_obj->basedoc.doc_node->node.IHTMLDOMNode_iface); - doc_obj->basedoc.doc_node = window->doc; + if(doc_obj->doc_node) + IHTMLDOMNode_Release(&doc_obj->doc_node->node.IHTMLDOMNode_iface); + doc_obj->doc_node = window->doc; IHTMLDOMNode_AddRef(&window->doc->node.IHTMLDOMNode_iface); }
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 3e53a301129..49393c977cc 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -639,13 +639,7 @@ struct ConnectionPoint { cp_static_data_t *data; };
-struct HTMLDocument { - HTMLDocumentObj *doc_obj; - HTMLDocumentNode *doc_node; -}; - struct HTMLDocumentObj { - HTMLDocument basedoc; DispatchEx dispex; IUnknown IUnknown_inner; IDispatchEx IDispatchEx_iface; @@ -691,6 +685,7 @@ struct HTMLDocumentObj { IUnknown *outer_unk; HTMLOuterWindow *window; GeckoBrowser *nscontainer; + HTMLDocumentNode *doc_node;
IOleClientSite *client; IDocHostUIHandler *hostui; @@ -875,7 +870,6 @@ typedef struct nsDocumentEventListener nsDocumentEventListener;
struct HTMLDocumentNode { HTMLDOMNode node; - HTMLDocument basedoc;
IDispatchEx IDispatchEx_iface; IHTMLDocument2 IHTMLDocument2_iface; @@ -917,6 +911,7 @@ struct HTMLDocumentNode { ConnectionPointContainer cp_container; HTMLOuterWindow *outer_window; HTMLInnerWindow *window; + HTMLDocumentObj *doc_obj;
GeckoBrowser *browser; struct list browser_entry; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 61ed745c588..9be1d304c14 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -275,7 +275,7 @@ static void parse_complete(HTMLDocumentObj *doc) TRACE("(%p)\n", doc);
if(doc->nscontainer->usermode == EDITMODE) - init_editor(doc->basedoc.doc_node); + init_editor(doc->doc_node);
call_explorer_69(doc); if(doc->view_sink) @@ -293,15 +293,15 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo { TRACE("(%p)\n", This);
- if(!This->basedoc.doc_obj) + if(!This->doc_obj) return NS_OK;
- if(This == This->basedoc.doc_obj->basedoc.doc_node) { + if(This == This->doc_obj->doc_node) { /* * This should be done in the worker thread that parses HTML, * but we don't have such thread (Gecko parses HTML for us). */ - parse_complete(This->basedoc.doc_obj); + parse_complete(This->doc_obj); }
bind_event_scripts(This); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 5d7e4d38b77..3594cfe0a6c 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -2390,7 +2390,7 @@ HRESULT navigate_new_window(HTMLOuterWindow *window, IUri *uri, const WCHAR *nam return S_OK; }
-HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschannel, DWORD hlnf, BOOL *cancel) +HRESULT hlink_frame_navigate(HTMLDocumentObj *doc, LPCWSTR url, nsChannel *nschannel, DWORD hlnf, BOOL *cancel) { IHlinkFrame *hlink_frame; nsChannelBSC *callback; @@ -2401,7 +2401,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
*cancel = FALSE;
- hres = do_query_service((IUnknown*)doc->doc_obj->client, &IID_IHlinkFrame, &IID_IHlinkFrame, + hres = do_query_service((IUnknown*)doc->client, &IID_IHlinkFrame, &IID_IHlinkFrame, (void**)&hlink_frame); if(FAILED(hres)) return S_OK; @@ -2486,7 +2486,7 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis if(is_main_content_window(window)) { BOOL cancel;
- hres = hlink_frame_navigate(&window->base.inner_window->doc->basedoc, display_uri, NULL, 0, &cancel); + hres = hlink_frame_navigate(window->base.inner_window->doc->doc_obj, display_uri, NULL, 0, &cancel); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 744e567e56e..67d40ca0085 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -1681,7 +1681,7 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList case CONTEXT_TEXT: { nsISelection *selection;
- nsres = nsIDOMHTMLDocument_GetSelection(This->doc->basedoc.doc_node->nsdoc, &selection); + nsres = nsIDOMHTMLDocument_GetSelection(This->doc->doc_node->nsdoc, &selection); if(NS_SUCCEEDED(nsres) && selection) { cpp_bool is_collapsed;
diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 00f4ffe526b..83653b46e35 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -129,9 +129,9 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE("(%p)\n", doc);
- if(!doc || !doc->basedoc.doc_obj) + if(!doc || !doc->doc_obj) return NS_ERROR_FAILURE; - doc_obj = doc->basedoc.doc_obj; + doc_obj = doc->doc_obj;
if(doc_obj->focus && !is_doc_child_focus(doc_obj->nscontainer)) { doc_obj->focus = FALSE; @@ -151,7 +151,7 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
if(!doc) return NS_ERROR_FAILURE; - doc_obj = doc->basedoc.doc_obj; + doc_obj = doc->doc_obj;
if(!doc_obj->focus) { doc_obj->focus = TRUE; @@ -232,8 +232,8 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if(!doc || !doc->outer_window) return NS_ERROR_FAILURE; - if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc) - doc_obj = doc->basedoc.doc_obj; + if(doc->doc_obj && doc->doc_obj->doc_node == doc) + doc_obj = doc->doc_obj;
connect_scripts(doc->window);
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 1a48925ff77..72f40979ace 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -273,7 +273,7 @@ static nsresult before_async_open(nsChannel *channel, GeckoBrowser *container, B return NS_OK; }
- hres = hlink_frame_navigate(&doc->basedoc, display_uri, channel, 0, cancel); + hres = hlink_frame_navigate(doc, display_uri, channel, 0, cancel); SysFreeString(display_uri); if(FAILED(hres)) *cancel = TRUE; diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 2b12c2bf84b..68cb4491f06 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -457,7 +457,7 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p
TRACE("(%p)->(%ld %s %p)\n", doc, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
- if(doc != doc->browser->doc->basedoc.doc_node) { + if(doc != doc->browser->doc->doc_node) { FIXME("Unsupported on frame documents\n"); return E_NOTIMPL; } @@ -859,8 +859,8 @@ static HRESULT WINAPI DocNodeOleCommandTarget_QueryStatus(IOleCommandTarget *ifa OLECMD olecmd;
prgCmds[i].cmdf = OLECMDF_SUPPORTED; - if(This->basedoc.doc_obj->client) { - hres = IOleClientSite_QueryInterface(This->basedoc.doc_obj->client, &IID_IOleCommandTarget, + if(This->doc_obj->client) { + hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, (void**)&cmdtrg); if(SUCCEEDED(hres)) { olecmd.cmdID = prgCmds[i].cmdID; @@ -985,9 +985,9 @@ static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *ifac { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
- if(!This->basedoc.doc_node) + if(!This->doc_node) return E_UNEXPECTED; - return IOleCommandTarget_QueryStatus(&This->basedoc.doc_node->IOleCommandTarget_iface, + return IOleCommandTarget_QueryStatus(&This->doc_node->IOleCommandTarget_iface, pguidCmdGroup, cCmds, prgCmds, pCmdText); }
@@ -996,9 +996,9 @@ static HRESULT WINAPI DocObjOleCommandTarget_Exec(IOleCommandTarget *iface, cons { HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
- if(!This->basedoc.doc_node) + if(!This->doc_node) return E_UNEXPECTED; - return IOleCommandTarget_Exec(&This->basedoc.doc_node->IOleCommandTarget_iface, + return IOleCommandTarget_Exec(&This->doc_node->IOleCommandTarget_iface, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); }
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 4de2efa690f..de6fd028218 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -165,13 +165,13 @@ static ULONG WINAPI DocNodeOleObject_Release(IOleObject *iface) static HRESULT WINAPI DocNodeOleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_SetClientSite(&This->basedoc.doc_obj->IOleObject_iface, pClientSite); + return IOleObject_SetClientSite(&This->doc_obj->IOleObject_iface, pClientSite); }
static HRESULT WINAPI DocNodeOleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_GetClientSite(&This->basedoc.doc_obj->IOleObject_iface, ppClientSite); + return IOleObject_GetClientSite(&This->doc_obj->IOleObject_iface, ppClientSite); }
static HRESULT WINAPI DocNodeOleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) @@ -184,7 +184,7 @@ static HRESULT WINAPI DocNodeOleObject_SetHostNames(IOleObject *iface, LPCOLESTR static HRESULT WINAPI DocNodeOleObject_Close(IOleObject *iface, DWORD dwSaveOption) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_Close(&This->basedoc.doc_obj->IOleObject_iface, dwSaveOption); + return IOleObject_Close(&This->doc_obj->IOleObject_iface, dwSaveOption); }
static HRESULT WINAPI DocNodeOleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk) @@ -220,7 +220,7 @@ static HRESULT WINAPI DocNodeOleObject_DoVerb(IOleObject *iface, LONG iVerb, LPM LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_DoVerb(&This->basedoc.doc_obj->IOleObject_iface, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); + return IOleObject_DoVerb(&This->doc_obj->IOleObject_iface, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); }
static HRESULT WINAPI DocNodeOleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb) @@ -247,7 +247,7 @@ static HRESULT WINAPI DocNodeOleObject_IsUpToDate(IOleObject *iface) static HRESULT WINAPI DocNodeOleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_GetUserClassID(&This->basedoc.doc_obj->IOleObject_iface, pClsid); + return IOleObject_GetUserClassID(&This->doc_obj->IOleObject_iface, pClsid); }
static HRESULT WINAPI DocNodeOleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType) @@ -260,31 +260,31 @@ static HRESULT WINAPI DocNodeOleObject_GetUserType(IOleObject *iface, DWORD dwFo static HRESULT WINAPI DocNodeOleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_SetExtent(&This->basedoc.doc_obj->IOleObject_iface, dwDrawAspect, psizel); + return IOleObject_SetExtent(&This->doc_obj->IOleObject_iface, dwDrawAspect, psizel); }
static HRESULT WINAPI DocNodeOleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_GetExtent(&This->basedoc.doc_obj->IOleObject_iface, dwDrawAspect, psizel); + return IOleObject_GetExtent(&This->doc_obj->IOleObject_iface, dwDrawAspect, psizel); }
static HRESULT WINAPI DocNodeOleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_Advise(&This->basedoc.doc_obj->IOleObject_iface, pAdvSink, pdwConnection); + return IOleObject_Advise(&This->doc_obj->IOleObject_iface, pAdvSink, pdwConnection); }
static HRESULT WINAPI DocNodeOleObject_Unadvise(IOleObject *iface, DWORD dwConnection) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_Unadvise(&This->basedoc.doc_obj->IOleObject_iface, dwConnection); + return IOleObject_Unadvise(&This->doc_obj->IOleObject_iface, dwConnection); }
static HRESULT WINAPI DocNodeOleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleObject(iface); - return IOleObject_EnumAdvise(&This->basedoc.doc_obj->IOleObject_iface, ppenumAdvise); + return IOleObject_EnumAdvise(&This->doc_obj->IOleObject_iface, ppenumAdvise); }
static HRESULT WINAPI DocNodeOleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) @@ -928,7 +928,7 @@ static HRESULT WINAPI DocNodeOleDocument_CreateView(IOleDocument *iface, IOleInP DWORD dwReserved, IOleDocumentView **ppView) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleDocument(iface); - return IOleDocument_CreateView(&This->basedoc.doc_obj->IOleDocument_iface, pIPSite, pstm, dwReserved, ppView); + return IOleDocument_CreateView(&This->doc_obj->IOleDocument_iface, pIPSite, pstm, dwReserved, ppView); }
static HRESULT WINAPI DocNodeOleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus) @@ -1078,7 +1078,7 @@ static HRESULT WINAPI DocNodeOleControl_OnMnemonic(IOleControl *iface, MSG *pMsg static HRESULT WINAPI DocNodeOleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleControl(iface); - return IOleControl_OnAmbientPropertyChange(&This->basedoc.doc_obj->IOleControl_iface, dispID); + return IOleControl_OnAmbientPropertyChange(&This->doc_obj->IOleControl_iface, dispID); }
static HRESULT WINAPI DocNodeOleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) @@ -1304,7 +1304,7 @@ static ULONG WINAPI DocNodeOleInPlaceActiveObject_Release(IOleInPlaceActiveObjec static HRESULT WINAPI DocNodeOleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, HWND *phwnd) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); - return IOleInPlaceActiveObject_GetWindow(&This->basedoc.doc_obj->IOleInPlaceActiveObject_iface, phwnd); + return IOleInPlaceActiveObject_GetWindow(&This->doc_obj->IOleInPlaceActiveObject_iface, phwnd); }
static HRESULT WINAPI DocNodeOleInPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, BOOL fEnterMode) @@ -1325,7 +1325,7 @@ static HRESULT WINAPI DocNodeOleInPlaceActiveObject_OnFrameWindowActivate(IOleIn BOOL fActivate) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceActiveObject(iface); - return IOleInPlaceActiveObject_OnFrameWindowActivate(&This->basedoc.doc_obj->IOleInPlaceActiveObject_iface, fActivate); + return IOleInPlaceActiveObject_OnFrameWindowActivate(&This->doc_obj->IOleInPlaceActiveObject_iface, fActivate); }
static HRESULT WINAPI DocNodeOleInPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, BOOL fActivate) @@ -1511,7 +1511,7 @@ static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_ContextSensitiveHelp(IOl static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); - return IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.doc_obj->IOleInPlaceObjectWindowless_iface); + return IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->doc_obj->IOleInPlaceObjectWindowless_iface); }
static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface) @@ -1525,7 +1525,7 @@ static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_SetObjectRects(IOleInPla const RECT *pos, const RECT *clip) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleInPlaceObjectWindowless(iface); - return IOleInPlaceObjectWindowless_SetObjectRects(&This->basedoc.doc_obj->IOleInPlaceObjectWindowless_iface, pos, clip); + return IOleInPlaceObjectWindowless_SetObjectRects(&This->doc_obj->IOleInPlaceObjectWindowless_iface, pos, clip); }
static HRESULT WINAPI DocNodeOleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface) @@ -1837,7 +1837,7 @@ static HRESULT WINAPI DocNodeOleContainer_ParseDisplayName(IOleContainer *iface, static HRESULT WINAPI DocNodeOleContainer_EnumObjects(IOleContainer *iface, DWORD grfFlags, IEnumUnknown **ppenum) { HTMLDocumentNode *This = HTMLDocumentNode_from_IOleContainer(iface); - return IOleContainer_EnumObjects(&This->basedoc.doc_obj->IOleContainer_iface, grfFlags, ppenum); + return IOleContainer_EnumObjects(&This->doc_obj->IOleContainer_iface, grfFlags, ppenum); }
static HRESULT WINAPI DocNodeOleContainer_LockContainer(IOleContainer *iface, BOOL fLock) @@ -2015,7 +2015,7 @@ static HRESULT WINAPI DocNodeObjectSafety_SetInterfaceSafetyOptions(IObjectSafet REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) { HTMLDocumentNode *This = HTMLDocumentNode_from_IObjectSafety(iface); - return IObjectSafety_SetInterfaceSafetyOptions(&This->basedoc.doc_obj->IObjectSafety_iface, + return IObjectSafety_SetInterfaceSafetyOptions(&This->doc_obj->IObjectSafety_iface, riid, dwOptionSetMask, dwEnabledOptions); }
@@ -2106,8 +2106,8 @@ void HTMLDocumentNode_OleObj_Init(HTMLDocumentNode *This) This->IObjectWithSite_iface.lpVtbl = &DocNodeObjectWithSiteVtbl; This->IOleContainer_iface.lpVtbl = &DocNodeOleContainerVtbl; This->IObjectSafety_iface.lpVtbl = &DocNodeObjectSafetyVtbl; - This->basedoc.doc_obj->extent.cx = 1; - This->basedoc.doc_obj->extent.cy = 1; + This->doc_obj->extent.cx = 1; + This->doc_obj->extent.cy = 1; }
static void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) @@ -2168,37 +2168,37 @@ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, #define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface) : E_UNEXPECTED; \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_1(iface, method, a) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1) : E_UNEXPECTED; \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_2(iface, method, a,b) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2) : E_UNEXPECTED; \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_3(iface, method, a,b,c) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3) : E_UNEXPECTED; \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_4(iface, method, a,b,c,d) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3, _4) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4) : E_UNEXPECTED; \ }
#define HTMLDOCUMENTOBJ_FWD_TO_NODE_5(iface, method, a,b,c,d,e) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4, e _5) \ { \ HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ - return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3, _4, _5) : E_UNEXPECTED; \ + return This->doc_node ? This->doc_node->I##iface##_iface.lpVtbl->method(&This->doc_node->I##iface##_iface, _1, _2, _3, _4, _5) : E_UNEXPECTED; \ }
/********************************************************** @@ -3389,9 +3389,9 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) TRACE("(%p) ref = %lu\n", This, ref);
if(!ref) { - if(This->basedoc.doc_node) { - This->basedoc.doc_node->basedoc.doc_obj = NULL; - IHTMLDOMNode_Release(&This->basedoc.doc_node->node.IHTMLDOMNode_iface); + if(This->doc_node) { + This->doc_node->doc_obj = NULL; + IHTMLDOMNode_Release(&This->doc_node->node.IHTMLDOMNode_iface); } if(This->window) IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface); @@ -3646,8 +3646,8 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentObj *This = impl_from_IUnknown(iface);
- if(This->window && This->basedoc.doc_node) - update_doc_cp_events(This->basedoc.doc_node, cp); + if(This->window && This->doc_node) + update_doc_cp_events(This->doc_node, cp); }
static cp_static_data_t HTMLDocumentObjEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentObj_on_advise }; @@ -3736,7 +3736,6 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IDocumentRange_iface.lpVtbl = &DocObjDocumentRangeVtbl;
doc->outer_unk = outer ? outer : &doc->IUnknown_inner; - doc->basedoc.doc_obj = doc;
init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); @@ -3770,9 +3769,9 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->window = doc->nscontainer->content_window; IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface);
- if(!doc->basedoc.doc_node && doc->window->base.inner_window->doc) { - doc->basedoc.doc_node = doc->window->base.inner_window->doc; - IHTMLDOMNode_AddRef(&doc->basedoc.doc_node->node.IHTMLDOMNode_iface); + if(!doc->doc_node && doc->window->base.inner_window->doc) { + doc->doc_node = doc->window->base.inner_window->doc; + IHTMLDOMNode_AddRef(&doc->doc_node->node.IHTMLDOMNode_iface); }
get_thread_hwnd(); diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 337271a4e3a..12a74393739 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -581,7 +581,7 @@ static HRESULT WINAPI DocNodePersistMoniker_Load(IPersistMoniker *iface, BOOL fF IMoniker *pimkName, LPBC pibc, DWORD grfMode) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); - return IPersistMoniker_Load(&This->basedoc.doc_obj->IPersistMoniker_iface, fFullyAvailable, pimkName, pibc, grfMode); + return IPersistMoniker_Load(&This->doc_obj->IPersistMoniker_iface, fFullyAvailable, pimkName, pibc, grfMode); }
static HRESULT WINAPI DocNodePersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, @@ -602,7 +602,7 @@ static HRESULT WINAPI DocNodePersistMoniker_SaveCompleted(IPersistMoniker *iface static HRESULT WINAPI DocNodePersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistMoniker(iface); - return IPersistMoniker_GetCurMoniker(&This->basedoc.doc_obj->IPersistMoniker_iface, ppimkName); + return IPersistMoniker_GetCurMoniker(&This->doc_obj->IPersistMoniker_iface, ppimkName); }
static const IPersistMonikerVtbl DocNodePersistMonikerVtbl = { @@ -786,7 +786,7 @@ static ULONG WINAPI DocNodeMonikerProp_Release(IMonikerProp *iface) static HRESULT WINAPI DocNodeMonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val) { HTMLDocumentNode *This = HTMLDocumentNode_from_IMonikerProp(iface); - return IMonikerProp_PutProperty(&This->basedoc.doc_obj->IMonikerProp_iface, mkp, val); + return IMonikerProp_PutProperty(&This->doc_obj->IMonikerProp_iface, mkp, val); }
static const IMonikerPropVtbl DocNodeMonikerPropVtbl = { @@ -879,7 +879,7 @@ static ULONG WINAPI DocNodePersistFile_Release(IPersistFile *iface) static HRESULT WINAPI DocNodePersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistFile(iface); - return IPersistFile_GetClassID(&This->basedoc.doc_obj->IPersistFile_iface, pClassID); + return IPersistFile_GetClassID(&This->doc_obj->IPersistFile_iface, pClassID); }
static HRESULT WINAPI DocNodePersistFile_IsDirty(IPersistFile *iface) @@ -1005,11 +1005,11 @@ static HRESULT WINAPI DocObjPersistFile_Save(IPersistFile *iface, LPCOLESTR pszF { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistFile(iface);
- if(!This->basedoc.doc_node) { + if(!This->doc_node) { FIXME("No doc_node\n"); return E_UNEXPECTED; } - return IPersistFile_Save(&This->basedoc.doc_node->IPersistFile_iface, pszFileName, fRemember); + return IPersistFile_Save(&This->doc_node->IPersistFile_iface, pszFileName, fRemember); }
static HRESULT WINAPI DocObjPersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName) @@ -1071,13 +1071,13 @@ static HRESULT WINAPI DocNodePersistStreamInit_GetClassID(IPersistStreamInit *if static HRESULT WINAPI DocNodePersistStreamInit_IsDirty(IPersistStreamInit *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return IPersistStreamInit_IsDirty(&This->basedoc.doc_obj->IPersistStreamInit_iface); + return IPersistStreamInit_IsDirty(&This->doc_obj->IPersistStreamInit_iface); }
static HRESULT WINAPI DocNodePersistStreamInit_Load(IPersistStreamInit *iface, IStream *pStm) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return IPersistStreamInit_Load(&This->basedoc.doc_obj->IPersistStreamInit_iface, pStm); + return IPersistStreamInit_Load(&This->doc_obj->IPersistStreamInit_iface, pStm); }
static HRESULT WINAPI DocNodePersistStreamInit_Save(IPersistStreamInit *iface, IStream *pStm, @@ -1101,7 +1101,7 @@ static HRESULT WINAPI DocNodePersistStreamInit_Save(IPersistStreamInit *iface, I heap_free(str);
if(fClearDirty) - set_dirty(This->basedoc.doc_obj->nscontainer, VARIANT_FALSE); + set_dirty(This->doc_obj->nscontainer, VARIANT_FALSE);
return S_OK; } @@ -1117,7 +1117,7 @@ static HRESULT WINAPI DocNodePersistStreamInit_GetSizeMax(IPersistStreamInit *if static HRESULT WINAPI DocNodePersistStreamInit_InitNew(IPersistStreamInit *iface) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistStreamInit(iface); - return IPersistStreamInit_InitNew(&This->basedoc.doc_obj->IPersistStreamInit_iface); + return IPersistStreamInit_InitNew(&This->doc_obj->IPersistStreamInit_iface); }
static const IPersistStreamInitVtbl DocNodePersistStreamInitVtbl = { @@ -1199,11 +1199,11 @@ static HRESULT WINAPI DocObjPersistStreamInit_Save(IPersistStreamInit *iface, IS { HTMLDocumentObj *This = HTMLDocumentObj_from_IPersistStreamInit(iface);
- if(!This->basedoc.doc_node) { + if(!This->doc_node) { FIXME("No doc_node\n"); return E_UNEXPECTED; } - return IPersistStreamInit_Save(&This->basedoc.doc_node->IPersistStreamInit_iface, pStm, fClearDirty); + return IPersistStreamInit_Save(&This->doc_node->IPersistStreamInit_iface, pStm, fClearDirty); }
static HRESULT WINAPI DocObjPersistStreamInit_GetSizeMax(IPersistStreamInit *iface, @@ -1285,13 +1285,13 @@ static HRESULT WINAPI DocNodePersistHistory_GetClassID(IPersistHistory *iface, C static HRESULT WINAPI DocNodePersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); - return IPersistHistory_LoadHistory(&This->basedoc.doc_obj->IPersistHistory_iface, pStream, pbc); + return IPersistHistory_LoadHistory(&This->doc_obj->IPersistHistory_iface, pStream, pbc); }
static HRESULT WINAPI DocNodePersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) { HTMLDocumentNode *This = HTMLDocumentNode_from_IPersistHistory(iface); - return IPersistHistory_SaveHistory(&This->basedoc.doc_obj->IPersistHistory_iface, pStream); + return IPersistHistory_SaveHistory(&This->doc_obj->IPersistHistory_iface, pStream); }
static HRESULT WINAPI DocNodePersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie) @@ -1507,10 +1507,10 @@ static HRESULT WINAPI DocNodeHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grf if(pwzJumpLocation) FIXME("JumpLocation not supported\n");
- if(This->basedoc.doc_obj->client) + if(This->doc_obj->client) return IOleObject_DoVerb(&This->IOleObject_iface, OLEIVERB_SHOW, NULL, NULL, -1, NULL, NULL);
- return IHlinkTarget_Navigate(&This->basedoc.doc_obj->IHlinkTarget_iface, grfHLNF, pwzJumpLocation); + return IHlinkTarget_Navigate(&This->doc_obj->IHlinkTarget_iface, grfHLNF, pwzJumpLocation); }
static HRESULT WINAPI DocNodeHlinkTarget_GetMoniker(IHlinkTarget *iface, LPCWSTR pwzLocation, DWORD dwAssign, diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index f5a0afc517e..4c64c394b6d 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -1918,12 +1918,12 @@ static HRESULT WINAPI PHInPlaceSite_GetWindowContext(IOleInPlaceSiteEx *iface,
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, frame_info);
- if(!This->doc || !This->doc->basedoc.doc_obj || !This->doc->basedoc.doc_obj->ipsite) { + if(!This->doc || !This->doc->doc_obj || !This->doc->doc_obj->ipsite) { FIXME("No ipsite\n"); return E_UNEXPECTED; }
- hres = IOleInPlaceSite_GetWindowContext(This->doc->basedoc.doc_obj->ipsite, &ip_frame, &ip_window, &pr, &cr, frame_info); + hres = IOleInPlaceSite_GetWindowContext(This->doc->doc_obj->ipsite, &ip_frame, &ip_window, &pr, &cr, frame_info); if(FAILED(hres)) { WARN("GetWindowContext failed: %08lx\n", hres); return hres; diff --git a/dlls/mshtml/service.c b/dlls/mshtml/service.c index 865c35172e8..6b162e235ec 100644 --- a/dlls/mshtml/service.c +++ b/dlls/mshtml/service.c @@ -365,7 +365,7 @@ static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *ifac return IHTMLDocument2_QueryInterface(&This->IHTMLDocument2_iface, riid, ppv); }
- return IServiceProvider_QueryService(&This->basedoc.doc_obj->IServiceProvider_iface, guidService, riid, ppv); + return IServiceProvider_QueryService(&This->doc_obj->IServiceProvider_iface, guidService, riid, ppv); }
static const IServiceProviderVtbl DocNodeServiceProviderVtbl = {
This merge request was approved by Jacek Caban.