From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 1169 ++++++++++++++++++++++++---------- dlls/mshtml/mshtml_private.h | 24 +- 2 files changed, 852 insertions(+), 341 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 57e922834d6..957d98d5ed6 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -39,6 +39,59 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
+#define HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(iface) \ +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); \ +} \ +static ULONG WINAPI DocObj##iface##_AddRef(I##iface *_0) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return htmldoc_addref(&This->basedoc); \ +} \ +static ULONG WINAPI DocObj##iface##_Release(I##iface *_0) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return htmldoc_release(&This->basedoc); \ +} + +#define HTMLDOCUMENTOBJ_IDISPATCH_METHODS(iface) HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(iface) \ +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); \ +} \ +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); \ +} \ +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); \ +} \ +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); \ +} + +#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; \ +} + +#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; \ +} + static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *doc_node, HTMLDocumentNode **ret);
HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret) @@ -4579,61 +4632,61 @@ static const IHTMLDocument7Vtbl HTMLDocument7Vtbl = { HTMLDocument7_get_head };
-static inline HTMLDocument *impl_from_IDocumentSelector(IDocumentSelector *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IDocumentSelector(IDocumentSelector *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentSelector_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentSelector_iface); }
-static HRESULT WINAPI DocumentSelector_QueryInterface(IDocumentSelector *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeDocumentSelector_QueryInterface(IDocumentSelector *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI DocumentSelector_AddRef(IDocumentSelector *iface) +static ULONG WINAPI DocNodeDocumentSelector_AddRef(IDocumentSelector *iface) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI DocumentSelector_Release(IDocumentSelector *iface) +static ULONG WINAPI DocNodeDocumentSelector_Release(IDocumentSelector *iface) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI DocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeDocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI DocumentSelector_GetTypeInfo(IDocumentSelector *iface, UINT iTInfo, +static HRESULT WINAPI DocNodeDocumentSelector_GetTypeInfo(IDocumentSelector *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI DocumentSelector_GetIDsOfNames(IDocumentSelector *iface, REFIID riid, +static HRESULT WINAPI DocNodeDocumentSelector_GetIDsOfNames(IDocumentSelector *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI DocumentSelector_Invoke(IDocumentSelector *iface, DISPID dispIdMember, REFIID riid, +static HRESULT WINAPI DocNodeDocumentSelector_Invoke(IDocumentSelector *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
-static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, BSTR v, IHTMLElement **pel) +static HRESULT WINAPI DocNodeDocumentSelector_querySelector(IDocumentSelector *iface, BSTR v, IHTMLElement **pel) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); nsIDOMElement *nselem; HTMLElement *elem; nsAString nsstr; @@ -4643,7 +4696,7 @@ static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, B TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMHTMLDocument_QuerySelector(This->doc_node->nsdoc, &nsstr, &nselem); + nsres = nsIDOMHTMLDocument_QuerySelector(This->nsdoc, &nsstr, &nselem); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { ERR("QuerySelector failed: %08lx\n", nsres); @@ -4664,9 +4717,9 @@ static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, B return S_OK; }
-static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface, BSTR v, IHTMLDOMChildrenCollection **pel) +static HRESULT WINAPI DocNodeDocumentSelector_querySelectorAll(IDocumentSelector *iface, BSTR v, IHTMLDOMChildrenCollection **pel) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentSelector(iface); nsIDOMNodeList *node_list; nsAString nsstr; HRESULT hres; @@ -4674,100 +4727,116 @@ static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
nsAString_InitDepend(&nsstr, v); - hres = map_nsresult(nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &nsstr, &node_list)); + hres = map_nsresult(nsIDOMHTMLDocument_QuerySelectorAll(This->nsdoc, &nsstr, &node_list)); nsAString_Finish(&nsstr); if(FAILED(hres)) { ERR("QuerySelectorAll failed: %08lx\n", hres); return hres; }
- hres = create_child_collection(node_list, dispex_compat_mode(&This->doc_node->node.event_target.dispex), pel); + hres = create_child_collection(node_list, dispex_compat_mode(&This->node.event_target.dispex), pel); nsIDOMNodeList_Release(node_list); return hres; }
-static const IDocumentSelectorVtbl DocumentSelectorVtbl = { - DocumentSelector_QueryInterface, - DocumentSelector_AddRef, - DocumentSelector_Release, - DocumentSelector_GetTypeInfoCount, - DocumentSelector_GetTypeInfo, - DocumentSelector_GetIDsOfNames, - DocumentSelector_Invoke, - DocumentSelector_querySelector, - DocumentSelector_querySelectorAll +static const IDocumentSelectorVtbl DocNodeDocumentSelectorVtbl = { + DocNodeDocumentSelector_QueryInterface, + DocNodeDocumentSelector_AddRef, + DocNodeDocumentSelector_Release, + DocNodeDocumentSelector_GetTypeInfoCount, + DocNodeDocumentSelector_GetTypeInfo, + DocNodeDocumentSelector_GetIDsOfNames, + DocNodeDocumentSelector_Invoke, + DocNodeDocumentSelector_querySelector, + DocNodeDocumentSelector_querySelectorAll };
-static inline HTMLDocument *impl_from_IDocumentEvent(IDocumentEvent *iface) +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentSelector) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentSelector, querySelector, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentSelector, querySelectorAll, BSTR,IHTMLDOMChildrenCollection**) + +static const IDocumentSelectorVtbl DocObjDocumentSelectorVtbl = { + DocObjDocumentSelector_QueryInterface, + DocObjDocumentSelector_AddRef, + DocObjDocumentSelector_Release, + DocObjDocumentSelector_GetTypeInfoCount, + DocObjDocumentSelector_GetTypeInfo, + DocObjDocumentSelector_GetIDsOfNames, + DocObjDocumentSelector_Invoke, + DocObjDocumentSelector_querySelector, + DocObjDocumentSelector_querySelectorAll +}; + +static inline HTMLDocumentNode *HTMLDocumentNode_from_IDocumentEvent(IDocumentEvent *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentEvent_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentEvent_iface); }
-static HRESULT WINAPI DocumentEvent_QueryInterface(IDocumentEvent *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeDocumentEvent_QueryInterface(IDocumentEvent *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI DocumentEvent_AddRef(IDocumentEvent *iface) +static ULONG WINAPI DocNodeDocumentEvent_AddRef(IDocumentEvent *iface) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI DocumentEvent_Release(IDocumentEvent *iface) +static ULONG WINAPI DocNodeDocumentEvent_Release(IDocumentEvent *iface) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI DocumentEvent_GetTypeInfoCount(IDocumentEvent *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeDocumentEvent_GetTypeInfoCount(IDocumentEvent *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI DocumentEvent_GetTypeInfo(IDocumentEvent *iface, UINT iTInfo, +static HRESULT WINAPI DocNodeDocumentEvent_GetTypeInfo(IDocumentEvent *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI DocumentEvent_GetIDsOfNames(IDocumentEvent *iface, REFIID riid, +static HRESULT WINAPI DocNodeDocumentEvent_GetIDsOfNames(IDocumentEvent *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI DocumentEvent_Invoke(IDocumentEvent *iface, DISPID dispIdMember, REFIID riid, +static HRESULT WINAPI DocNodeDocumentEvent_Invoke(IDocumentEvent *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
-static HRESULT WINAPI DocumentEvent_createEvent(IDocumentEvent *iface, BSTR eventType, IDOMEvent **p) +static HRESULT WINAPI DocNodeDocumentEvent_createEvent(IDocumentEvent *iface, BSTR eventType, IDOMEvent **p) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentEvent(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eventType), p);
- return create_document_event_str(This->doc_node, eventType, p); + return create_document_event_str(This, eventType, p); }
-static const IDocumentEventVtbl DocumentEventVtbl = { - DocumentEvent_QueryInterface, - DocumentEvent_AddRef, - DocumentEvent_Release, - DocumentEvent_GetTypeInfoCount, - DocumentEvent_GetTypeInfo, - DocumentEvent_GetIDsOfNames, - DocumentEvent_Invoke, - DocumentEvent_createEvent +static const IDocumentEventVtbl DocNodeDocumentEventVtbl = { + DocNodeDocumentEvent_QueryInterface, + DocNodeDocumentEvent_AddRef, + DocNodeDocumentEvent_Release, + DocNodeDocumentEvent_GetTypeInfoCount, + DocNodeDocumentEvent_GetTypeInfo, + DocNodeDocumentEvent_GetIDsOfNames, + DocNodeDocumentEvent_Invoke, + DocNodeDocumentEvent_createEvent };
static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) @@ -4778,40 +4847,69 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) update_doc_cp_events(This, cp); }
-static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentEvent) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentEvent, createEvent, BSTR,IDOMEvent**) + +static const IDocumentEventVtbl DocObjDocumentEventVtbl = { + DocObjDocumentEvent_QueryInterface, + DocObjDocumentEvent_AddRef, + DocObjDocumentEvent_Release, + DocObjDocumentEvent_GetTypeInfoCount, + DocObjDocumentEvent_GetTypeInfo, + DocObjDocumentEvent_GetIDsOfNames, + DocObjDocumentEvent_Invoke, + DocObjDocumentEvent_createEvent +}; + +static inline HTMLDocumentNode *HTMLDocumentNode_from_ISupportErrorInfo(ISupportErrorInfo *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentNode, ISupportErrorInfo_iface); +} + +static HRESULT WINAPI DocNodeSupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) { - return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_ISupportErrorInfo(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) +static ULONG WINAPI DocNodeSupportErrorInfo_AddRef(ISupportErrorInfo *iface) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_ISupportErrorInfo(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface) +static ULONG WINAPI DocNodeSupportErrorInfo_Release(ISupportErrorInfo *iface) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_ISupportErrorInfo(iface); + return htmldoc_release(&This->basedoc); }
-static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface) +static HRESULT WINAPI DocNodeSupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_release(This); + FIXME("(%p)->(%s)\n", iface, debugstr_mshtml_guid(riid)); + return S_FALSE; }
-static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) +static const ISupportErrorInfoVtbl DocNodeSupportErrorInfoVtbl = { + DocNodeSupportErrorInfo_QueryInterface, + DocNodeSupportErrorInfo_AddRef, + DocNodeSupportErrorInfo_Release, + DocNodeSupportErrorInfo_InterfaceSupportsErrorInfo +}; + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(SupportErrorInfo) + +static HRESULT WINAPI DocObjSupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) { FIXME("(%p)->(%s)\n", iface, debugstr_mshtml_guid(riid)); return S_FALSE; }
-static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { - SupportErrorInfo_QueryInterface, - SupportErrorInfo_AddRef, - SupportErrorInfo_Release, - SupportErrorInfo_InterfaceSupportsErrorInfo +static const ISupportErrorInfoVtbl DocObjSupportErrorInfoVtbl = { + DocObjSupportErrorInfo_QueryInterface, + DocObjSupportErrorInfo_AddRef, + DocObjSupportErrorInfo_Release, + DocObjSupportErrorInfo_InterfaceSupportsErrorInfo };
static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface) @@ -5081,508 +5179,859 @@ static const IDispatchExVtbl DocDispatchExVtbl = { DocDispatchEx_GetNameSpaceParent };
-static inline HTMLDocument *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IProvideMultipleClassInfo_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface); }
-static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo *iface, +static HRESULT WINAPI DocNodeProvideClassInfo_QueryInterface(IProvideMultipleClassInfo *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI ProvideClassInfo_AddRef(IProvideMultipleClassInfo *iface) +static ULONG WINAPI DocNodeProvideClassInfo_AddRef(IProvideMultipleClassInfo *iface) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI ProvideClassInfo_Release(IProvideMultipleClassInfo *iface) +static ULONG WINAPI DocNodeProvideClassInfo_Release(IProvideMultipleClassInfo *iface) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) +static HRESULT WINAPI DocNodeProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); TRACE("(%p)->(%p)\n", This, ppTI); return get_class_typeinfo(&CLSID_HTMLDocument, ppTI); }
-static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID) +static HRESULT WINAPI DocNodeProvideClassInfo2_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%lu %p)\n", This, dwGuidKind, pGUID); return E_NOTIMPL; }
-static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti) +static HRESULT WINAPI DocNodeProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%p)\n", This, pcti); *pcti = 1; return S_OK; }
-static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti, +static HRESULT WINAPI DocNodeProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti, DWORD dwFlags, ITypeInfo **pptiCoClass, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%lu %lx %p %p %p %p %p)\n", This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); return E_NOTIMPL; }
-static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = { - ProvideClassInfo_QueryInterface, - ProvideClassInfo_AddRef, - ProvideClassInfo_Release, - ProvideClassInfo_GetClassInfo, - ProvideClassInfo2_GetGUID, - ProvideMultipleClassInfo_GetMultiTypeInfoCount, - ProvideMultipleClassInfo_GetInfoOfIndex +static const IProvideMultipleClassInfoVtbl DocNodeProvideMultipleClassInfoVtbl = { + DocNodeProvideClassInfo_QueryInterface, + DocNodeProvideClassInfo_AddRef, + DocNodeProvideClassInfo_Release, + DocNodeProvideClassInfo_GetClassInfo, + DocNodeProvideClassInfo2_GetGUID, + DocNodeProvideMultipleClassInfo_GetMultiTypeInfoCount, + DocNodeProvideMultipleClassInfo_GetInfoOfIndex +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IProvideMultipleClassInfo_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(ProvideMultipleClassInfo) + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IProvideMultipleClassInfo(iface); + TRACE("(%p)->(%p)\n", This, ppTI); + return get_class_typeinfo(&CLSID_HTMLDocument, ppTI); +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%lu %p)\n", This, dwGuidKind, pGUID); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%p)\n", This, pcti); + *pcti = 1; + return S_OK; +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti, + DWORD dwFlags, ITypeInfo **pptiCoClass, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%lu %lx %p %p %p %p %p)\n", This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); + return E_NOTIMPL; +} + +static const IProvideMultipleClassInfoVtbl DocObjProvideMultipleClassInfoVtbl = { + DocObjProvideMultipleClassInfo_QueryInterface, + DocObjProvideMultipleClassInfo_AddRef, + DocObjProvideMultipleClassInfo_Release, + DocObjProvideMultipleClassInfo_GetClassInfo, + DocObjProvideMultipleClassInfo_GetGUID, + DocObjProvideMultipleClassInfo_GetMultiTypeInfoCount, + DocObjProvideMultipleClassInfo_GetInfoOfIndex };
/********************************************************** * IMarkupServices implementation */ -static inline HTMLDocument *impl_from_IMarkupServices(IMarkupServices *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IMarkupServices(IMarkupServices *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IMarkupServices_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IMarkupServices_iface); }
-static HRESULT WINAPI MarkupServices_QueryInterface(IMarkupServices *iface, REFIID riid, void **ppvObject) +static HRESULT WINAPI DocNodeMarkupServices_QueryInterface(IMarkupServices *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
-static ULONG WINAPI MarkupServices_AddRef(IMarkupServices *iface) +static ULONG WINAPI DocNodeMarkupServices_AddRef(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI MarkupServices_Release(IMarkupServices *iface) +static ULONG WINAPI DocNodeMarkupServices_Release(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI DocNodeMarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + + TRACE("(%p)->(%p)\n", This, ppPointer); + + return create_markup_pointer(ppPointer); +} + +static HRESULT WINAPI DocNodeMarkupServices_CreateMarkupContainer(IMarkupServices *iface, IMarkupContainer **ppMarkupContainer) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p)\n", This, ppMarkupContainer); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_CreateElement(IMarkupServices *iface, + ELEMENT_TAG_ID tagID, OLECHAR *pchAttributes, IHTMLElement **ppElement) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%d,%s,%p)\n", This, tagID, debugstr_w(pchAttributes), ppElement); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_CloneElement(IMarkupServices *iface, + IHTMLElement *pElemCloneThis, IHTMLElement **ppElementTheClone) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pElemCloneThis, ppElementTheClone); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_InsertElement(IMarkupServices *iface, + IHTMLElement *pElementInsert, IMarkupPointer *pPointerStart, + IMarkupPointer *pPointerFinish) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p,%p)\n", This, pElementInsert, pPointerStart, pPointerFinish); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_RemoveElement(IMarkupServices *iface, IHTMLElement *pElementRemove) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p)\n", This, pElementRemove); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_Remove(IMarkupServices *iface, + IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pPointerStart, pPointerFinish); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_Copy(IMarkupServices *iface, + IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, + IMarkupPointer *pPointerTarget) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_Move(IMarkupServices *iface, + IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, + IMarkupPointer *pPointerTarget) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_InsertText(IMarkupServices *iface, + OLECHAR *pchText, LONG cch, IMarkupPointer *pPointerTarget) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%s,%lx,%p)\n", This, debugstr_w(pchText), cch, pPointerTarget); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_ParseString(IMarkupServices *iface, + OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, + IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_ParseGlobal(IMarkupServices *iface, + HGLOBAL hglobalHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, + IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(hglobalHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_IsScopedElement(IMarkupServices *iface, + IHTMLElement *pElement, BOOL *pfScoped) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pElement, pfScoped); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_GetElementTagId(IMarkupServices *iface, + IHTMLElement *pElement, ELEMENT_TAG_ID *ptagId) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pElement, ptagId); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_GetTagIDForName(IMarkupServices *iface, + BSTR bstrName, ELEMENT_TAG_ID *ptagId) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), ptagId); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_GetNameForTagID(IMarkupServices *iface, + ELEMENT_TAG_ID tagId, BSTR *pbstrName) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%d,%p)\n", This, tagId, pbstrName); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_MovePointersToRange(IMarkupServices *iface, + IHTMLTxtRange *pIRange, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p,%p)\n", This, pIRange, pPointerStart, pPointerFinish); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_MoveRangeToPointers(IMarkupServices *iface, + IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish, IHTMLTxtRange *pIRange) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%p,%p,%p)\n", This, pPointerStart, pPointerFinish, pIRange); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_BeginUndoUnit(IMarkupServices *iface, OLECHAR *pchTitle) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(pchTitle)); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocNodeMarkupServices_EndUndoUnit(IMarkupServices *iface) +{ + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupServices(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) +static const IMarkupServicesVtbl DocNodeMarkupServicesVtbl = { + DocNodeMarkupServices_QueryInterface, + DocNodeMarkupServices_AddRef, + DocNodeMarkupServices_Release, + DocNodeMarkupServices_CreateMarkupPointer, + DocNodeMarkupServices_CreateMarkupContainer, + DocNodeMarkupServices_CreateElement, + DocNodeMarkupServices_CloneElement, + DocNodeMarkupServices_InsertElement, + DocNodeMarkupServices_RemoveElement, + DocNodeMarkupServices_Remove, + DocNodeMarkupServices_Copy, + DocNodeMarkupServices_Move, + DocNodeMarkupServices_InsertText, + DocNodeMarkupServices_ParseString, + DocNodeMarkupServices_ParseGlobal, + DocNodeMarkupServices_IsScopedElement, + DocNodeMarkupServices_GetElementTagId, + DocNodeMarkupServices_GetTagIDForName, + DocNodeMarkupServices_GetNameForTagID, + DocNodeMarkupServices_MovePointersToRange, + DocNodeMarkupServices_MoveRangeToPointers, + DocNodeMarkupServices_BeginUndoUnit, + DocNodeMarkupServices_EndUndoUnit +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IMarkupServices(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IMarkupServices_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(MarkupServices) + +static HRESULT WINAPI DocObjMarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface);
TRACE("(%p)->(%p)\n", This, ppPointer);
return create_markup_pointer(ppPointer); }
-static HRESULT WINAPI MarkupServices_CreateMarkupContainer(IMarkupServices *iface, IMarkupContainer **ppMarkupContainer) +static HRESULT WINAPI DocObjMarkupServices_CreateMarkupContainer(IMarkupServices *iface, IMarkupContainer **ppMarkupContainer) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p)\n", This, ppMarkupContainer); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_CreateElement(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_CreateElement(IMarkupServices *iface, ELEMENT_TAG_ID tagID, OLECHAR *pchAttributes, IHTMLElement **ppElement) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%d,%s,%p)\n", This, tagID, debugstr_w(pchAttributes), ppElement); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_CloneElement(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_CloneElement(IMarkupServices *iface, IHTMLElement *pElemCloneThis, IHTMLElement **ppElementTheClone) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElemCloneThis, ppElementTheClone); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_InsertElement(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_InsertElement(IMarkupServices *iface, IHTMLElement *pElementInsert, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pElementInsert, pPointerStart, pPointerFinish); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_RemoveElement(IMarkupServices *iface, IHTMLElement *pElementRemove) +static HRESULT WINAPI DocObjMarkupServices_RemoveElement(IMarkupServices *iface, IHTMLElement *pElementRemove) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p)\n", This, pElementRemove); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_Remove(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_Remove(IMarkupServices *iface, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pPointerStart, pPointerFinish); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_Copy(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_Copy(IMarkupServices *iface, IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_Move(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_Move(IMarkupServices *iface, IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_InsertText(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_InsertText(IMarkupServices *iface, OLECHAR *pchText, LONG cch, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p)\n", This, debugstr_w(pchText), cch, pPointerTarget); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_ParseString(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_ParseString(IMarkupServices *iface, OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_ParseGlobal(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_ParseGlobal(IMarkupServices *iface, HGLOBAL hglobalHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(hglobalHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_IsScopedElement(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_IsScopedElement(IMarkupServices *iface, IHTMLElement *pElement, BOOL *pfScoped) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElement, pfScoped); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_GetElementTagId(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_GetElementTagId(IMarkupServices *iface, IHTMLElement *pElement, ELEMENT_TAG_ID *ptagId) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElement, ptagId); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_GetTagIDForName(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_GetTagIDForName(IMarkupServices *iface, BSTR bstrName, ELEMENT_TAG_ID *ptagId) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), ptagId); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_GetNameForTagID(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_GetNameForTagID(IMarkupServices *iface, ELEMENT_TAG_ID tagId, BSTR *pbstrName) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%d,%p)\n", This, tagId, pbstrName); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_MovePointersToRange(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_MovePointersToRange(IMarkupServices *iface, IHTMLTxtRange *pIRange, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pIRange, pPointerStart, pPointerFinish); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_MoveRangeToPointers(IMarkupServices *iface, +static HRESULT WINAPI DocObjMarkupServices_MoveRangeToPointers(IMarkupServices *iface, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish, IHTMLTxtRange *pIRange) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerStart, pPointerFinish, pIRange); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_BeginUndoUnit(IMarkupServices *iface, OLECHAR *pchTitle) +static HRESULT WINAPI DocObjMarkupServices_BeginUndoUnit(IMarkupServices *iface, OLECHAR *pchTitle) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(pchTitle)); return E_NOTIMPL; }
-static HRESULT WINAPI MarkupServices_EndUndoUnit(IMarkupServices *iface) +static HRESULT WINAPI DocObjMarkupServices_EndUndoUnit(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupServices(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static const IMarkupServicesVtbl MarkupServicesVtbl = { - MarkupServices_QueryInterface, - MarkupServices_AddRef, - MarkupServices_Release, - MarkupServices_CreateMarkupPointer, - MarkupServices_CreateMarkupContainer, - MarkupServices_CreateElement, - MarkupServices_CloneElement, - MarkupServices_InsertElement, - MarkupServices_RemoveElement, - MarkupServices_Remove, - MarkupServices_Copy, - MarkupServices_Move, - MarkupServices_InsertText, - MarkupServices_ParseString, - MarkupServices_ParseGlobal, - MarkupServices_IsScopedElement, - MarkupServices_GetElementTagId, - MarkupServices_GetTagIDForName, - MarkupServices_GetNameForTagID, - MarkupServices_MovePointersToRange, - MarkupServices_MoveRangeToPointers, - MarkupServices_BeginUndoUnit, - MarkupServices_EndUndoUnit +static const IMarkupServicesVtbl DocObjMarkupServicesVtbl = { + DocObjMarkupServices_QueryInterface, + DocObjMarkupServices_AddRef, + DocObjMarkupServices_Release, + DocObjMarkupServices_CreateMarkupPointer, + DocObjMarkupServices_CreateMarkupContainer, + DocObjMarkupServices_CreateElement, + DocObjMarkupServices_CloneElement, + DocObjMarkupServices_InsertElement, + DocObjMarkupServices_RemoveElement, + DocObjMarkupServices_Remove, + DocObjMarkupServices_Copy, + DocObjMarkupServices_Move, + DocObjMarkupServices_InsertText, + DocObjMarkupServices_ParseString, + DocObjMarkupServices_ParseGlobal, + DocObjMarkupServices_IsScopedElement, + DocObjMarkupServices_GetElementTagId, + DocObjMarkupServices_GetTagIDForName, + DocObjMarkupServices_GetNameForTagID, + DocObjMarkupServices_MovePointersToRange, + DocObjMarkupServices_MoveRangeToPointers, + DocObjMarkupServices_BeginUndoUnit, + DocObjMarkupServices_EndUndoUnit };
/********************************************************** * IMarkupContainer implementation */ -static inline HTMLDocument *impl_from_IMarkupContainer(IMarkupContainer *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IMarkupContainer(IMarkupContainer *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IMarkupContainer_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IMarkupContainer_iface); }
-static HRESULT WINAPI MarkupContainer_QueryInterface(IMarkupContainer *iface, REFIID riid, void **ppvObject) +static HRESULT WINAPI DocNodeMarkupContainer_QueryInterface(IMarkupContainer *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupContainer(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
-static ULONG WINAPI MarkupContainer_AddRef(IMarkupContainer *iface) +static ULONG WINAPI DocNodeMarkupContainer_AddRef(IMarkupContainer *iface) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupContainer(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI MarkupContainer_Release(IMarkupContainer *iface) +static ULONG WINAPI DocNodeMarkupContainer_Release(IMarkupContainer *iface) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupContainer(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI MarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) +static HRESULT WINAPI DocNodeMarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IMarkupContainer(iface); FIXME("(%p)->(%p)\n", This, ppDoc); return E_NOTIMPL; }
-static const IMarkupContainerVtbl MarkupContainerVtbl = { - MarkupContainer_QueryInterface, - MarkupContainer_AddRef, - MarkupContainer_Release, - MarkupContainer_OwningDoc +static const IMarkupContainerVtbl DocNodeMarkupContainerVtbl = { + DocNodeMarkupContainer_QueryInterface, + DocNodeMarkupContainer_AddRef, + DocNodeMarkupContainer_Release, + DocNodeMarkupContainer_OwningDoc +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IMarkupContainer(IMarkupContainer *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IMarkupContainer_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(MarkupContainer) + +static HRESULT WINAPI DocObjMarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IMarkupContainer(iface); + FIXME("(%p)->(%p)\n", This, ppDoc); + return E_NOTIMPL; +} + +static const IMarkupContainerVtbl DocObjMarkupContainerVtbl = { + DocObjMarkupContainer_QueryInterface, + DocObjMarkupContainer_AddRef, + DocObjMarkupContainer_Release, + DocObjMarkupContainer_OwningDoc };
/********************************************************** * IDisplayServices implementation */ -static inline HTMLDocument *impl_from_IDisplayServices(IDisplayServices *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IDisplayServices(IDisplayServices *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDisplayServices_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDisplayServices_iface); }
-static HRESULT WINAPI DisplayServices_QueryInterface(IDisplayServices *iface, REFIID riid, void **ppvObject) +static HRESULT WINAPI DocNodeDisplayServices_QueryInterface(IDisplayServices *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
-static ULONG WINAPI DisplayServices_AddRef(IDisplayServices *iface) +static ULONG WINAPI DocNodeDisplayServices_AddRef(IDisplayServices *iface) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI DisplayServices_Release(IDisplayServices *iface) +static ULONG WINAPI DocNodeDisplayServices_Release(IDisplayServices *iface) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI DisplayServices_CreateDisplayPointer(IDisplayServices *iface, IDisplayPointer **ppDispPointer) +static HRESULT WINAPI DocNodeDisplayServices_CreateDisplayPointer(IDisplayServices *iface, IDisplayPointer **ppDispPointer) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%p)\n", This, ppDispPointer); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_TransformRect(IDisplayServices *iface, +static HRESULT WINAPI DocNodeDisplayServices_TransformRect(IDisplayServices *iface, RECT *pRect, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_rect(pRect), eSource, eDestination, pIElement); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_TransformPoint(IDisplayServices *iface, +static HRESULT WINAPI DocNodeDisplayServices_TransformPoint(IDisplayServices *iface, POINT *pPoint, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_point(pPoint), eSource, eDestination, pIElement); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_GetCaret(IDisplayServices *iface, IHTMLCaret **ppCaret) +static HRESULT WINAPI DocNodeDisplayServices_GetCaret(IDisplayServices *iface, IHTMLCaret **ppCaret) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%p)\n", This, ppCaret); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_GetComputedStyle(IDisplayServices *iface, +static HRESULT WINAPI DocNodeDisplayServices_GetComputedStyle(IDisplayServices *iface, IMarkupPointer *pPointer, IHTMLComputedStyle **ppComputedStyle) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%p,%p)\n", This, pPointer, ppComputedStyle); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_ScrollRectIntoView(IDisplayServices *iface, +static HRESULT WINAPI DocNodeDisplayServices_ScrollRectIntoView(IDisplayServices *iface, IHTMLElement *pIElement, RECT rect) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%p,%s)\n", This, pIElement, wine_dbgstr_rect(&rect)); return E_NOTIMPL; }
-static HRESULT WINAPI DisplayServices_HasFlowLayout(IDisplayServices *iface, +static HRESULT WINAPI DocNodeDisplayServices_HasFlowLayout(IDisplayServices *iface, IHTMLElement *pIElement, BOOL *pfHasFlowLayout) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDisplayServices(iface); FIXME("(%p)->(%p,%p)\n", This, pIElement, pfHasFlowLayout); return E_NOTIMPL; }
-static const IDisplayServicesVtbl DisplayServicesVtbl = { - DisplayServices_QueryInterface, - DisplayServices_AddRef, - DisplayServices_Release, - DisplayServices_CreateDisplayPointer, - DisplayServices_TransformRect, - DisplayServices_TransformPoint, - DisplayServices_GetCaret, - DisplayServices_GetComputedStyle, - DisplayServices_ScrollRectIntoView, - DisplayServices_HasFlowLayout +static const IDisplayServicesVtbl DocNodeDisplayServicesVtbl = { + DocNodeDisplayServices_QueryInterface, + DocNodeDisplayServices_AddRef, + DocNodeDisplayServices_Release, + DocNodeDisplayServices_CreateDisplayPointer, + DocNodeDisplayServices_TransformRect, + DocNodeDisplayServices_TransformPoint, + DocNodeDisplayServices_GetCaret, + DocNodeDisplayServices_GetComputedStyle, + DocNodeDisplayServices_ScrollRectIntoView, + DocNodeDisplayServices_HasFlowLayout +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IDisplayServices(IDisplayServices *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IDisplayServices_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DisplayServices) + +static HRESULT WINAPI DocObjDisplayServices_CreateDisplayPointer(IDisplayServices *iface, IDisplayPointer **ppDispPointer) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%p)\n", This, ppDispPointer); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_TransformRect(IDisplayServices *iface, + RECT *pRect, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_rect(pRect), eSource, eDestination, pIElement); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_TransformPoint(IDisplayServices *iface, + POINT *pPoint, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_point(pPoint), eSource, eDestination, pIElement); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_GetCaret(IDisplayServices *iface, IHTMLCaret **ppCaret) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%p)\n", This, ppCaret); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_GetComputedStyle(IDisplayServices *iface, + IMarkupPointer *pPointer, IHTMLComputedStyle **ppComputedStyle) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pPointer, ppComputedStyle); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_ScrollRectIntoView(IDisplayServices *iface, + IHTMLElement *pIElement, RECT rect) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%p,%s)\n", This, pIElement, wine_dbgstr_rect(&rect)); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjDisplayServices_HasFlowLayout(IDisplayServices *iface, + IHTMLElement *pIElement, BOOL *pfHasFlowLayout) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IDisplayServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pIElement, pfHasFlowLayout); + return E_NOTIMPL; +} + +static const IDisplayServicesVtbl DocObjDisplayServicesVtbl = { + DocObjDisplayServices_QueryInterface, + DocObjDisplayServices_AddRef, + DocObjDisplayServices_Release, + DocObjDisplayServices_CreateDisplayPointer, + DocObjDisplayServices_TransformRect, + DocObjDisplayServices_TransformPoint, + DocObjDisplayServices_GetCaret, + DocObjDisplayServices_GetComputedStyle, + DocObjDisplayServices_ScrollRectIntoView, + DocObjDisplayServices_HasFlowLayout };
/********************************************************** * IDocumentRange implementation */ -static inline HTMLDocument *impl_from_IDocumentRange(IDocumentRange *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IDocumentRange(IDocumentRange *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentRange_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentRange_iface); }
-static HRESULT WINAPI DocumentRange_QueryInterface(IDocumentRange *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeDocumentRange_QueryInterface(IDocumentRange *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return htmldoc_query_interface(This, riid, ppv); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI DocumentRange_AddRef(IDocumentRange *iface) +static ULONG WINAPI DocNodeDocumentRange_AddRef(IDocumentRange *iface) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return htmldoc_addref(This); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI DocumentRange_Release(IDocumentRange *iface) +static ULONG WINAPI DocNodeDocumentRange_Release(IDocumentRange *iface) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return htmldoc_release(This); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI DocumentRange_GetTypeInfoCount(IDocumentRange *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeDocumentRange_GetTypeInfoCount(IDocumentRange *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI DocumentRange_GetTypeInfo(IDocumentRange *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI DocNodeDocumentRange_GetTypeInfo(IDocumentRange *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI DocumentRange_GetIDsOfNames(IDocumentRange *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, +static HRESULT WINAPI DocNodeDocumentRange_GetIDsOfNames(IDocumentRange *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI DocumentRange_Invoke(IDocumentRange *iface, DISPID dispIdMember, REFIID riid, LCID lcid, +static HRESULT WINAPI DocNodeDocumentRange_Invoke(IDocumentRange *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface);
- return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
-static HRESULT WINAPI DocumentRange_createRange(IDocumentRange *iface, IHTMLDOMRange **p) +static HRESULT WINAPI DocNodeDocumentRange_createRange(IDocumentRange *iface, IHTMLDOMRange **p) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IDocumentRange(iface); nsIDOMRange *nsrange; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- if(NS_FAILED(nsIDOMHTMLDocument_CreateRange(This->doc_node->nsdoc, &nsrange))) + if(NS_FAILED(nsIDOMHTMLDocument_CreateRange(This->nsdoc, &nsrange))) return E_FAIL;
- hres = create_dom_range(nsrange, dispex_compat_mode(&This->doc_node->node.event_target.dispex), p); + hres = create_dom_range(nsrange, dispex_compat_mode(&This->node.event_target.dispex), p); nsIDOMRange_Release(nsrange); return hres; }
-static const IDocumentRangeVtbl DocumentRangeVtbl = { - DocumentRange_QueryInterface, - DocumentRange_AddRef, - DocumentRange_Release, - DocumentRange_GetTypeInfoCount, - DocumentRange_GetTypeInfo, - DocumentRange_GetIDsOfNames, - DocumentRange_Invoke, - DocumentRange_createRange, +static const IDocumentRangeVtbl DocNodeDocumentRangeVtbl = { + DocNodeDocumentRange_QueryInterface, + DocNodeDocumentRange_AddRef, + DocNodeDocumentRange_Release, + DocNodeDocumentRange_GetTypeInfoCount, + DocNodeDocumentRange_GetTypeInfo, + DocNodeDocumentRange_GetIDsOfNames, + DocNodeDocumentRange_Invoke, + DocNodeDocumentRange_createRange +}; + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentRange) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DocumentRange, createRange, IHTMLDOMRange**) + +static const IDocumentRangeVtbl DocObjDocumentRangeVtbl = { + DocObjDocumentRange_QueryInterface, + DocObjDocumentRange_AddRef, + DocObjDocumentRange_Release, + DocObjDocumentRange_GetTypeInfoCount, + DocObjDocumentRange_GetTypeInfo, + DocObjDocumentRange_GetIDsOfNames, + DocObjDocumentRange_Invoke, + DocObjDocumentRange_createRange };
static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) @@ -5609,46 +6058,10 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) *ppv = &This->IHTMLDocument7_iface; - else if(IsEqualGUID(&IID_IDocumentSelector, riid)) - *ppv = &This->IDocumentSelector_iface; - else if(IsEqualGUID(&IID_IDocumentEvent, riid)) - *ppv = &This->IDocumentEvent_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; - else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) - *ppv = &This->ISupportErrorInfo_iface; - else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IMarkupServices, riid)) - *ppv = &This->IMarkupServices_iface; - else if(IsEqualGUID(&IID_IMarkupContainer, riid)) - *ppv = &This->IMarkupContainer_iface; - else if(IsEqualGUID(&IID_IDisplayServices, riid)) - *ppv = &This->IDisplayServices_iface; - else if(IsEqualGUID(&IID_IDocumentRange, riid)) - *ppv = &This->IDocumentRange_iface; - else if(IsEqualGUID(&CLSID_CMarkup, riid)) { - FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { - TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { - TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { - TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { - TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else { + else return FALSE; - }
if(*ppv) IUnknown_AddRef((IUnknown*)*ppv); @@ -5675,14 +6088,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; - doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; - doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; - doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; - doc->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; - doc->IMarkupServices_iface.lpVtbl = &MarkupServicesVtbl; - doc->IMarkupContainer_iface.lpVtbl = &MarkupContainerVtbl; - doc->IDisplayServices_iface.lpVtbl = &DisplayServicesVtbl; - doc->IDocumentRange_iface.lpVtbl = &DocumentRangeVtbl;
doc->outer_unk = outer; doc->dispex = dispex; @@ -5702,8 +6107,26 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) if(htmldoc_qi(&This->basedoc, riid, ppv)) return *ppv ? S_OK : E_NOINTERFACE;
- if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) - *ppv = &This->IInternetHostSecurityManager_iface; + if(IsEqualGUID(&IID_IDocumentSelector, riid)) + *ppv = &This->IDocumentSelector_iface; + else if(IsEqualGUID(&IID_IDocumentEvent, riid)) + *ppv = &This->IDocumentEvent_iface; + else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) + *ppv = &This->ISupportErrorInfo_iface; + else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IMarkupServices, riid)) + *ppv = &This->IMarkupServices_iface; + else if(IsEqualGUID(&IID_IMarkupContainer, riid)) + *ppv = &This->IMarkupContainer_iface; + else if(IsEqualGUID(&IID_IDisplayServices, riid)) + *ppv = &This->IDisplayServices_iface; + else if(IsEqualGUID(&IID_IDocumentRange, riid)) + *ppv = &This->IDocumentRange_iface; else if(IsEqualGUID(&IID_IPersist, riid)) *ppv = &This->IPersistFile_iface; else if(IsEqualGUID(&IID_IPersistMoniker, riid)) @@ -5742,10 +6165,33 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IObjectSafety_iface; else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; + else if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) + *ppv = &This->IInternetHostSecurityManager_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) *ppv = &This->cp_container.IConnectionPointContainer_iface; - else + else if(IsEqualGUID(&CLSID_CMarkup, riid)) { + FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { + TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { + TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { + TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { + TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else { return HTMLDOMNode_QI(&This->node, riid, ppv); + }
IUnknown_AddRef((IUnknown*)*ppv); return S_OK; @@ -6123,6 +6569,15 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo return NULL;
doc->ref = 1; + doc->IDocumentSelector_iface.lpVtbl = &DocNodeDocumentSelectorVtbl; + doc->IDocumentEvent_iface.lpVtbl = &DocNodeDocumentEventVtbl; + doc->ISupportErrorInfo_iface.lpVtbl = &DocNodeSupportErrorInfoVtbl; + doc->IProvideMultipleClassInfo_iface.lpVtbl = &DocNodeProvideMultipleClassInfoVtbl; + doc->IMarkupServices_iface.lpVtbl = &DocNodeMarkupServicesVtbl; + doc->IMarkupContainer_iface.lpVtbl = &DocNodeMarkupContainerVtbl; + doc->IDisplayServices_iface.lpVtbl = &DocNodeDisplayServicesVtbl; + doc->IDocumentRange_iface.lpVtbl = &DocNodeDocumentRangeVtbl; + doc->basedoc.doc_node = doc; doc->basedoc.doc_obj = doc_obj; doc->basedoc.window = window ? window->base.outer_window : NULL; @@ -6245,6 +6700,26 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii return *ppv ? S_OK : E_NOINTERFACE; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; + }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { + *ppv = &This->IDocumentSelector_iface; + }else if(IsEqualGUID(&IID_IDocumentEvent, riid)) { + *ppv = &This->IDocumentEvent_iface; + }else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) { + *ppv = &This->ISupportErrorInfo_iface; + }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IMarkupServices, riid)) { + *ppv = &This->IMarkupServices_iface; + }else if(IsEqualGUID(&IID_IMarkupContainer, riid)) { + *ppv = &This->IMarkupContainer_iface; + }else if(IsEqualGUID(&IID_IDisplayServices, riid)) { + *ppv = &This->IDisplayServices_iface; + }else if(IsEqualGUID(&IID_IDocumentRange, riid)) { + *ppv = &This->IDocumentRange_iface; }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) { *ppv = &This->IOleDocumentView_iface; }else if(IsEqualGUID(&IID_IViewObject, riid)) { @@ -6295,6 +6770,26 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->ITargetContainer_iface; }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { *ppv = &This->cp_container.IConnectionPointContainer_iface; + }else if(IsEqualGUID(&CLSID_CMarkup, riid)) { + FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { + TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { + TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { + TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { + TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; }else { @@ -6511,6 +7006,14 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->ref = 1; doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; + doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; + doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; + doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; + doc->IProvideMultipleClassInfo_iface.lpVtbl = &DocObjProvideMultipleClassInfoVtbl; + doc->IMarkupServices_iface.lpVtbl = &DocObjMarkupServicesVtbl; + doc->IMarkupContainer_iface.lpVtbl = &DocObjMarkupContainerVtbl; + doc->IDisplayServices_iface.lpVtbl = &DocObjDisplayServicesVtbl; + doc->IDocumentRange_iface.lpVtbl = &DocObjDocumentRangeVtbl;
doc->basedoc.doc_obj = doc;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6b3310e55ab..cfbb1a2bfbc 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -646,15 +646,7 @@ struct HTMLDocument { IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; - IDocumentSelector IDocumentSelector_iface; - IDocumentEvent IDocumentEvent_iface; IDispatchEx IDispatchEx_iface; - ISupportErrorInfo ISupportErrorInfo_iface; - IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; - IMarkupServices IMarkupServices_iface; - IMarkupContainer IMarkupContainer_iface; - IDisplayServices IDisplayServices_iface; - IDocumentRange IDocumentRange_iface;
IUnknown *outer_unk; IDispatchEx *dispex; @@ -685,6 +677,14 @@ struct HTMLDocumentObj { DispatchEx dispex; IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; + IDocumentSelector IDocumentSelector_iface; + IDocumentEvent IDocumentEvent_iface; + ISupportErrorInfo ISupportErrorInfo_iface; + IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IMarkupServices IMarkupServices_iface; + IMarkupContainer IMarkupContainer_iface; + IDisplayServices IDisplayServices_iface; + IDocumentRange IDocumentRange_iface; IOleDocumentView IOleDocumentView_iface; IViewObjectEx IViewObjectEx_iface; IPersistMoniker IPersistMoniker_iface; @@ -896,6 +896,14 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IDocumentSelector IDocumentSelector_iface; + IDocumentEvent IDocumentEvent_iface; + ISupportErrorInfo ISupportErrorInfo_iface; + IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IMarkupServices IMarkupServices_iface; + IMarkupContainer IMarkupContainer_iface; + IDisplayServices IDisplayServices_iface; + IDocumentRange IDocumentRange_iface; IPersistMoniker IPersistMoniker_iface; IPersistFile IPersistFile_iface; IMonikerProp IMonikerProp_iface;