From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 299 +++++++++++++++++++++-------------- dlls/mshtml/mshtml_private.h | 3 +- 2 files changed, 184 insertions(+), 118 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 47433af2ed1..25fea413c73 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -3863,82 +3863,78 @@ static const IHTMLDocument4Vtbl DocObjHTMLDocument4Vtbl = { DocObjHTMLDocument4_get_URLUnencoded };
-static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IHTMLDocument5(IHTMLDocument5 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument5_iface); }
-static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeHTMLDocument5_QueryInterface(IHTMLDocument5 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface) +static ULONG WINAPI DocNodeHTMLDocument5_AddRef(IHTMLDocument5 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) +static ULONG WINAPI DocNodeHTMLDocument5_Release(IHTMLDocument5 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeHTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI DocNodeHTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI DocNodeHTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.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) +static HRESULT WINAPI DocNodeHTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
-static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEWHEEL, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, &v); }
-static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEWHEEL, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, p); }
-static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - HTMLDocumentNode *doc_node = This->doc_node; + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); nsIDOMDocumentType *nsdoctype; HTMLDOMNode *doctype_node; nsresult nsres; @@ -3946,12 +3942,12 @@ static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMN
TRACE("(%p)->(%p)\n", This, p);
- if(dispex_compat_mode(&doc_node->node.event_target.dispex) < COMPAT_MODE_IE9) { + if(dispex_compat_mode(&This->node.event_target.dispex) < COMPAT_MODE_IE9) { *p = NULL; return S_OK; }
- nsres = nsIDOMHTMLDocument_GetDoctype(doc_node->nsdoc, &nsdoctype); + nsres = nsIDOMHTMLDocument_GetDoctype(This->nsdoc, &nsdoctype); if(NS_FAILED(nsres)) return map_nsresult(nsres); if(!nsdoctype) { @@ -3967,36 +3963,35 @@ static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMN return hres; }
-static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - HTMLDocumentNode *doc_node = This->doc_node; + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- if(!doc_node->dom_implementation) { + if(!This->dom_implementation) { HRESULT hres;
- hres = create_dom_implementation(doc_node, &doc_node->dom_implementation); + hres = create_dom_implementation(This, &This->dom_implementation); if(FAILED(hres)) return hres; }
- IHTMLDOMImplementation_AddRef(doc_node->dom_implementation); - *p = doc_node->dom_implementation; + IHTMLDOMImplementation_AddRef(This->dom_implementation); + *p = This->dom_implementation; return S_OK; }
-static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName, +static HRESULT WINAPI DocNodeHTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName, IHTMLDOMAttribute **ppattribute) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); HTMLDOMAttribute *attr; HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
- hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->doc_node->node.event_target.dispex), &attr); + hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->node.event_target.dispex), &attr); if(FAILED(hres)) return hres;
@@ -4004,10 +3999,10 @@ static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR return S_OK; }
-static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata, +static HRESULT WINAPI DocNodeHTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata, IHTMLDOMNode **ppRetNode) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); nsIDOMComment *nscomment; HTMLElement *elem; nsAString str; @@ -4016,20 +4011,20 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&str, bstrdata); - nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment); + nsres = nsIDOMHTMLDocument_CreateComment(This->nsdoc, &str, &nscomment); nsAString_Finish(&str); if(NS_FAILED(nsres)) { ERR("CreateTextNode failed: %08lx\n", nsres); return E_FAIL; }
- hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem); + hres = HTMLCommentElement_Create(This, (nsIDOMNode*)nscomment, &elem); nsIDOMComment_Release(nscomment); if(FAILED(hres)) return hres; @@ -4038,135 +4033,202 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs return S_OK; }
-static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_FOCUSIN, &v); + return set_doc_event(&This->basedoc, EVENTID_FOCUSIN, &v); }
-static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_FOCUSIN, p); + return get_doc_event(&This->basedoc, EVENTID_FOCUSIN, p); }
-static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_FOCUSOUT, &v); + return set_doc_event(&This->basedoc, EVENTID_FOCUSOUT, &v); }
-static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_FOCUSOUT, p); + return get_doc_event(&This->basedoc, EVENTID_FOCUSOUT, p); }
-static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat"); + *p = SysAllocString(This->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat"); return *p ? S_OK : E_OUTOFMEMORY; }
-static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = { - HTMLDocument5_QueryInterface, - HTMLDocument5_AddRef, - HTMLDocument5_Release, - HTMLDocument5_GetTypeInfoCount, - HTMLDocument5_GetTypeInfo, - HTMLDocument5_GetIDsOfNames, - HTMLDocument5_Invoke, - HTMLDocument5_put_onmousewheel, - HTMLDocument5_get_onmousewheel, - HTMLDocument5_get_doctype, - HTMLDocument5_get_implementation, - HTMLDocument5_createAttribute, - HTMLDocument5_createComment, - HTMLDocument5_put_onfocusin, - HTMLDocument5_get_onfocusin, - HTMLDocument5_put_onfocusout, - HTMLDocument5_get_onfocusout, - HTMLDocument5_put_onactivate, - HTMLDocument5_get_onactivate, - HTMLDocument5_put_ondeactivate, - HTMLDocument5_get_ondeactivate, - HTMLDocument5_put_onbeforeactivate, - HTMLDocument5_get_onbeforeactivate, - HTMLDocument5_put_onbeforedeactivate, - HTMLDocument5_get_onbeforedeactivate, - HTMLDocument5_get_compatMode +static const IHTMLDocument5Vtbl DocNodeHTMLDocument5Vtbl = { + DocNodeHTMLDocument5_QueryInterface, + DocNodeHTMLDocument5_AddRef, + DocNodeHTMLDocument5_Release, + DocNodeHTMLDocument5_GetTypeInfoCount, + DocNodeHTMLDocument5_GetTypeInfo, + DocNodeHTMLDocument5_GetIDsOfNames, + DocNodeHTMLDocument5_Invoke, + DocNodeHTMLDocument5_put_onmousewheel, + DocNodeHTMLDocument5_get_onmousewheel, + DocNodeHTMLDocument5_get_doctype, + DocNodeHTMLDocument5_get_implementation, + DocNodeHTMLDocument5_createAttribute, + DocNodeHTMLDocument5_createComment, + DocNodeHTMLDocument5_put_onfocusin, + DocNodeHTMLDocument5_get_onfocusin, + DocNodeHTMLDocument5_put_onfocusout, + DocNodeHTMLDocument5_get_onfocusout, + DocNodeHTMLDocument5_put_onactivate, + DocNodeHTMLDocument5_get_onactivate, + DocNodeHTMLDocument5_put_ondeactivate, + DocNodeHTMLDocument5_get_ondeactivate, + DocNodeHTMLDocument5_put_onbeforeactivate, + DocNodeHTMLDocument5_get_onbeforeactivate, + DocNodeHTMLDocument5_put_onbeforedeactivate, + DocNodeHTMLDocument5_get_onbeforedeactivate, + DocNodeHTMLDocument5_get_compatMode +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IHTMLDocument5(IHTMLDocument5 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument5_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument5) + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onmousewheel, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onmousewheel, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_doctype, IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_implementation, IHTMLDOMImplementation**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument5, createAttribute, BSTR,IHTMLDOMAttribute**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument5, createComment, BSTR,IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onfocusin, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onfocusin, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onfocusout, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onfocusout, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_ondeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_ondeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforedeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforedeactivate, VARIANT*) + +static HRESULT WINAPI DocObjHTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument5(iface); + + if(This->basedoc.doc_node) + return IHTMLDocument5_get_compatMode(&This->basedoc.doc_node->IHTMLDocument5_iface, p); + + TRACE("(%p)->(%p)\n", This, p); + + return (*p = SysAllocString(L"BackCompat")) ? S_OK : E_OUTOFMEMORY; +} + +static const IHTMLDocument5Vtbl DocObjHTMLDocument5Vtbl = { + DocObjHTMLDocument5_QueryInterface, + DocObjHTMLDocument5_AddRef, + DocObjHTMLDocument5_Release, + DocObjHTMLDocument5_GetTypeInfoCount, + DocObjHTMLDocument5_GetTypeInfo, + DocObjHTMLDocument5_GetIDsOfNames, + DocObjHTMLDocument5_Invoke, + DocObjHTMLDocument5_put_onmousewheel, + DocObjHTMLDocument5_get_onmousewheel, + DocObjHTMLDocument5_get_doctype, + DocObjHTMLDocument5_get_implementation, + DocObjHTMLDocument5_createAttribute, + DocObjHTMLDocument5_createComment, + DocObjHTMLDocument5_put_onfocusin, + DocObjHTMLDocument5_get_onfocusin, + DocObjHTMLDocument5_put_onfocusout, + DocObjHTMLDocument5_get_onfocusout, + DocObjHTMLDocument5_put_onactivate, + DocObjHTMLDocument5_get_onactivate, + DocObjHTMLDocument5_put_ondeactivate, + DocObjHTMLDocument5_get_ondeactivate, + DocObjHTMLDocument5_put_onbeforeactivate, + DocObjHTMLDocument5_get_onbeforeactivate, + DocObjHTMLDocument5_put_onbeforedeactivate, + DocObjHTMLDocument5_get_onbeforedeactivate, + DocObjHTMLDocument5_get_compatMode };
static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) @@ -4539,7 +4601,7 @@ static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
- return IHTMLDocument5_createAttribute(&This->IHTMLDocument5_iface, bstrAttrName, ppAttribute); + return IHTMLDocument5_createAttribute(&This->doc_node->IHTMLDocument5_iface, bstrAttrName, ppAttribute); }
static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel) @@ -6816,8 +6878,6 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) - *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) @@ -6843,7 +6903,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; @@ -6874,6 +6933,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) *ppv = &This->IHTMLDocument4_iface; + else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) + *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -7341,6 +7402,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->IHTMLDocument2_iface.lpVtbl = &DocNodeHTMLDocument2Vtbl; doc->IHTMLDocument3_iface.lpVtbl = &DocNodeHTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &DocNodeHTMLDocument4Vtbl; + doc->IHTMLDocument5_iface.lpVtbl = &DocNodeHTMLDocument5Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocNodeDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocNodeDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocNodeSupportErrorInfoVtbl; @@ -7476,6 +7538,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHTMLDocument3_iface; }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) { *ppv = &This->IHTMLDocument4_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) { + *ppv = &This->IHTMLDocument5_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -7789,6 +7853,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &DocObjHTMLDocument4Vtbl; + doc->IHTMLDocument5_iface.lpVtbl = &DocObjHTMLDocument5Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c3b5f135fb6..a6a0159f4ac 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; IDispatchEx IDispatchEx_iface; @@ -677,6 +676,7 @@ struct HTMLDocumentObj { IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; + IHTMLDocument5 IHTMLDocument5_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -899,6 +899,7 @@ struct HTMLDocumentNode { IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; + IHTMLDocument5 IHTMLDocument5_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface;