From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 555 ++++++++++++++++++++++------------- dlls/mshtml/htmlwindow.c | 4 +- dlls/mshtml/mshtml_private.h | 3 +- 3 files changed, 356 insertions(+), 206 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index af6a1a1a033..cf05323602d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2766,71 +2766,67 @@ static const IHTMLDocument2Vtbl DocObjHTMLDocument2Vtbl = { DocObjHTMLDocument2_createStyleSheet };
-static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IHTMLDocument3(IHTMLDocument3 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument3_iface); }
-static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeHTMLDocument3_QueryInterface(IHTMLDocument3 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) +static ULONG WINAPI DocNodeHTMLDocument3_AddRef(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) +static ULONG WINAPI DocNodeHTMLDocument3_Release(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeHTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI DocNodeHTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI DocNodeHTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI DocNodeHTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
-static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface) +static HRESULT WINAPI DocNodeHTMLDocument3_releaseCapture(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) +static HRESULT WINAPI DocNodeHTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
WARN("(%p)->(%x)\n", This, fForce);
@@ -2838,10 +2834,9 @@ static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL f return S_OK; }
-static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, - IHTMLDOMNode **newTextNode) +static HRESULT WINAPI DocNodeHTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, IHTMLDOMNode **newTextNode) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsIDOMText *nstext; HTMLDOMNode *node; nsAString text_str; @@ -2850,20 +2845,20 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&text_str, text); - nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext); + nsres = nsIDOMHTMLDocument_CreateTextNode(This->nsdoc, &text_str, &nstext); nsAString_Finish(&text_str); if(NS_FAILED(nsres)) { ERR("CreateTextNode failed: %08lx\n", nsres); return E_FAIL; }
- hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node); + hres = HTMLDOMTextNode_Create(This, (nsIDOMNode*)nstext, &node); nsIDOMText_Release(nstext); if(FAILED(hres)) return hres; @@ -2872,9 +2867,9 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t return S_OK; }
-static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsIDOMElement *nselem = NULL; HTMLElement *element; nsresult nsres; @@ -2882,17 +2877,17 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
- if(This->window && This->window->readystate == READYSTATE_UNINITIALIZED) { + if(This->basedoc.window && This->basedoc.window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; return S_OK; }
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem); + nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem); if(NS_FAILED(nsres)) { ERR("GetDocumentElement failed: %08lx\n", nsres); return E_FAIL; @@ -2912,148 +2907,147 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I return hres; }
-static HRESULT WINAPI HTMLDocument3_get_uniqueID(IHTMLDocument3 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_uniqueID(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return elem_unique_id(++This->doc_node->unique_id, p); + return elem_unique_id(++This->unique_id, p); }
-static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch* pDisp, VARIANT_BOOL *pfResult) +static HRESULT WINAPI DocNodeHTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch* pDisp, + VARIANT_BOOL *pfResult) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
- return attach_event(&This->doc_node->node.event_target, event, pDisp, pfResult); + return attach_event(&This->node.event_target, event, pDisp, pfResult); }
-static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch *pDisp) +static HRESULT WINAPI DocNodeHTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch *pDisp) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
- return detach_event(&This->doc_node->node.event_target, event, pDisp); + return detach_event(&This->node.event_target, event, pDisp); }
-static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsAString dir_str; nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&dir_str, v); - nsres = nsIDOMHTMLDocument_SetDir(This->doc_node->nsdoc, &dir_str); + nsres = nsIDOMHTMLDocument_SetDir(This->nsdoc, &dir_str); nsAString_Finish(&dir_str); if(NS_FAILED(nsres)) { ERR("SetDir failed: %08lx\n", nsres); @@ -3063,60 +3057,59 @@ static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) return S_OK; }
-static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsAString dir_str; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_Init(&dir_str, NULL); - nsres = nsIDOMHTMLDocument_GetDir(This->doc_node->nsdoc, &dir_str); + nsres = nsIDOMHTMLDocument_GetDir(This->nsdoc, &dir_str); return return_nsstr(nsres, &dir_str, p); }
-static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->()\n", This);
- return set_doc_event(This, EVENTID_CONTEXTMENU, &v); + return set_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, &v); }
-static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_CONTEXTMENU, p); + return get_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, p); }
-static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, - IHTMLDocument2 **ppNewDoc) +static HRESULT WINAPI DocNodeHTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, IHTMLDocument2 **ppNewDoc) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsIDOMDocumentFragment *doc_frag; HTMLDocumentNode *docnode; nsresult nsres; @@ -3124,18 +3117,18 @@ static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface
TRACE("(%p)->(%p)\n", This, ppNewDoc);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_NOTIMPL; }
- nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag); + nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->nsdoc, &doc_frag); if(NS_FAILED(nsres)) { ERR("CreateDocumentFragment failed: %08lx\n", nsres); return E_FAIL; }
- hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode); + hres = create_document_fragment((nsIDOMNode*)doc_frag, This, &docnode); nsIDOMDocumentFragment_Release(doc_frag); if(FAILED(hres)) return hres; @@ -3144,87 +3137,82 @@ static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface return S_OK; }
-static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, - IHTMLDocument2 **p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, IHTMLDocument2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p); + return IHTMLDOMNode_get_childNodes(&This->node.IHTMLDOMNode_iface, p); }
-static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **ppelColl) +static HRESULT WINAPI DocNodeHTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, + IHTMLElementCollection **ppelColl) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsIDOMNodeList *node_list; nsAString selector_str; WCHAR *selector; @@ -3233,7 +3221,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
- if(!This->doc_node || !This->doc_node->nsdoc) { + if(!This || !This->nsdoc) { /* We should probably return an empty collection. */ FIXME("No nsdoc\n"); return E_NOTIMPL; @@ -3250,7 +3238,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST * types and search should be case insensitive. Those are currently not supported properly. */ nsAString_InitDepend(&selector_str, selector); - nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &selector_str, &node_list); + nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->nsdoc, &selector_str, &node_list); nsAString_Finish(&selector_str); heap_free(selector); if(NS_FAILED(nsres)) { @@ -3258,22 +3246,21 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST return E_FAIL; }
- *ppelColl = create_collection_from_nodelist(node_list, This->doc_node->document_mode); + *ppelColl = create_collection_from_nodelist(node_list, This->document_mode); nsIDOMNodeList_Release(node_list); return S_OK; }
-static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, - IHTMLElement **pel) +static HRESULT WINAPI DocNodeHTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, IHTMLElement **pel) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); HTMLElement *elem; HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
- hres = get_doc_elem_by_id(This->doc_node, v, &elem); + hres = get_doc_elem_by_id(This, v, &elem); if(FAILED(hres) || !elem) { *pel = NULL; return hres; @@ -3284,19 +3271,19 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v }
-static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **pelColl) +static HRESULT WINAPI DocNodeHTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, + IHTMLElementCollection **pelColl) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument3(iface); nsIDOMNodeList *nslist; nsAString id_str; nsresult nsres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
- if(This->doc_node->nsdoc) { + if(This->nsdoc) { nsAString_InitDepend(&id_str, v); - nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist); + nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->nsdoc, &id_str, &nslist); nsAString_Finish(&id_str); if(FAILED(nsres)) { ERR("GetElementByName failed: %08lx\n", nsres); @@ -3316,7 +3303,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, } }
- nsres = nsIDOMNode_QueryInterface(This->doc_node->node.nsnode, &IID_nsIDOMDocumentFragment, (void**)&docfrag); + nsres = nsIDOMNode_QueryInterface(This->node.nsnode, &IID_nsIDOMDocumentFragment, (void**)&docfrag); if(NS_FAILED(nsres)) { ERR("Could not get nsIDOMDocumentFragment iface: %08lx\n", nsres); return E_UNEXPECTED; @@ -3333,61 +3320,220 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, }
- *pelColl = create_collection_from_nodelist(nslist, This->doc_node->document_mode); + *pelColl = create_collection_from_nodelist(nslist, This->document_mode); nsIDOMNodeList_Release(nslist);
return S_OK; }
-static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = { - HTMLDocument3_QueryInterface, - HTMLDocument3_AddRef, - HTMLDocument3_Release, - HTMLDocument3_GetTypeInfoCount, - HTMLDocument3_GetTypeInfo, - HTMLDocument3_GetIDsOfNames, - HTMLDocument3_Invoke, - HTMLDocument3_releaseCapture, - HTMLDocument3_recalc, - HTMLDocument3_createTextNode, - HTMLDocument3_get_documentElement, - HTMLDocument3_get_uniqueID, - HTMLDocument3_attachEvent, - HTMLDocument3_detachEvent, - HTMLDocument3_put_onrowsdelete, - HTMLDocument3_get_onrowsdelete, - HTMLDocument3_put_onrowsinserted, - HTMLDocument3_get_onrowsinserted, - HTMLDocument3_put_oncellchange, - HTMLDocument3_get_oncellchange, - HTMLDocument3_put_ondatasetchanged, - HTMLDocument3_get_ondatasetchanged, - HTMLDocument3_put_ondataavailable, - HTMLDocument3_get_ondataavailable, - HTMLDocument3_put_ondatasetcomplete, - HTMLDocument3_get_ondatasetcomplete, - HTMLDocument3_put_onpropertychange, - HTMLDocument3_get_onpropertychange, - HTMLDocument3_put_dir, - HTMLDocument3_get_dir, - HTMLDocument3_put_oncontextmenu, - HTMLDocument3_get_oncontextmenu, - HTMLDocument3_put_onstop, - HTMLDocument3_get_onstop, - HTMLDocument3_createDocumentFragment, - HTMLDocument3_get_parentDocument, - HTMLDocument3_put_enableDownload, - HTMLDocument3_get_enableDownload, - HTMLDocument3_put_baseUrl, - HTMLDocument3_get_baseUrl, - HTMLDocument3_get_childNodes, - HTMLDocument3_put_inheritStyleSheets, - HTMLDocument3_get_inheritStyleSheets, - HTMLDocument3_put_onbeforeeditfocus, - HTMLDocument3_get_onbeforeeditfocus, - HTMLDocument3_getElementsByName, - HTMLDocument3_getElementById, - HTMLDocument3_getElementsByTagName +static const IHTMLDocument3Vtbl DocNodeHTMLDocument3Vtbl = { + DocNodeHTMLDocument3_QueryInterface, + DocNodeHTMLDocument3_AddRef, + DocNodeHTMLDocument3_Release, + DocNodeHTMLDocument3_GetTypeInfoCount, + DocNodeHTMLDocument3_GetTypeInfo, + DocNodeHTMLDocument3_GetIDsOfNames, + DocNodeHTMLDocument3_Invoke, + DocNodeHTMLDocument3_releaseCapture, + DocNodeHTMLDocument3_recalc, + DocNodeHTMLDocument3_createTextNode, + DocNodeHTMLDocument3_get_documentElement, + DocNodeHTMLDocument3_get_uniqueID, + DocNodeHTMLDocument3_attachEvent, + DocNodeHTMLDocument3_detachEvent, + DocNodeHTMLDocument3_put_onrowsdelete, + DocNodeHTMLDocument3_get_onrowsdelete, + DocNodeHTMLDocument3_put_onrowsinserted, + DocNodeHTMLDocument3_get_onrowsinserted, + DocNodeHTMLDocument3_put_oncellchange, + DocNodeHTMLDocument3_get_oncellchange, + DocNodeHTMLDocument3_put_ondatasetchanged, + DocNodeHTMLDocument3_get_ondatasetchanged, + DocNodeHTMLDocument3_put_ondataavailable, + DocNodeHTMLDocument3_get_ondataavailable, + DocNodeHTMLDocument3_put_ondatasetcomplete, + DocNodeHTMLDocument3_get_ondatasetcomplete, + DocNodeHTMLDocument3_put_onpropertychange, + DocNodeHTMLDocument3_get_onpropertychange, + DocNodeHTMLDocument3_put_dir, + DocNodeHTMLDocument3_get_dir, + DocNodeHTMLDocument3_put_oncontextmenu, + DocNodeHTMLDocument3_get_oncontextmenu, + DocNodeHTMLDocument3_put_onstop, + DocNodeHTMLDocument3_get_onstop, + DocNodeHTMLDocument3_createDocumentFragment, + DocNodeHTMLDocument3_get_parentDocument, + DocNodeHTMLDocument3_put_enableDownload, + DocNodeHTMLDocument3_get_enableDownload, + DocNodeHTMLDocument3_put_baseUrl, + DocNodeHTMLDocument3_get_baseUrl, + DocNodeHTMLDocument3_get_childNodes, + DocNodeHTMLDocument3_put_inheritStyleSheets, + DocNodeHTMLDocument3_get_inheritStyleSheets, + DocNodeHTMLDocument3_put_onbeforeeditfocus, + DocNodeHTMLDocument3_get_onbeforeeditfocus, + DocNodeHTMLDocument3_getElementsByName, + DocNodeHTMLDocument3_getElementById, + DocNodeHTMLDocument3_getElementsByTagName +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IHTMLDocument3(IHTMLDocument3 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument3_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument3) + +static HRESULT WINAPI DocObjHTMLDocument3_releaseCapture(IHTMLDocument3 *iface) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + + WARN("(%p)->(%x)\n", This, fForce); + + /* Doing nothing here should be fine for us. */ + return S_OK; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, createTextNode, BSTR,IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_documentElement, IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_uniqueID, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument3, attachEvent, BSTR,IDispatch*,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, detachEvent, BSTR,IDispatch*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onrowsdelete, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onrowsdelete, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onrowsinserted, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onrowsinserted, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_oncellchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_oncellchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondatasetchanged, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondatasetchanged, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondataavailable, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondataavailable, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondatasetcomplete, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondatasetcomplete, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onpropertychange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onpropertychange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_dir, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_dir, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_oncontextmenu, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_oncontextmenu, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onstop, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onstop, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, createDocumentFragment, IHTMLDocument2**) + +static HRESULT WINAPI DocObjHTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, IHTMLDocument2 **p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_childNodes, IDispatch**) + +static HRESULT WINAPI DocObjHTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onbeforeeditfocus, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onbeforeeditfocus, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementsByName, BSTR,IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementById, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementsByTagName, BSTR,IHTMLElementCollection**) + +static const IHTMLDocument3Vtbl DocObjHTMLDocument3Vtbl = { + DocObjHTMLDocument3_QueryInterface, + DocObjHTMLDocument3_AddRef, + DocObjHTMLDocument3_Release, + DocObjHTMLDocument3_GetTypeInfoCount, + DocObjHTMLDocument3_GetTypeInfo, + DocObjHTMLDocument3_GetIDsOfNames, + DocObjHTMLDocument3_Invoke, + DocObjHTMLDocument3_releaseCapture, + DocObjHTMLDocument3_recalc, + DocObjHTMLDocument3_createTextNode, + DocObjHTMLDocument3_get_documentElement, + DocObjHTMLDocument3_get_uniqueID, + DocObjHTMLDocument3_attachEvent, + DocObjHTMLDocument3_detachEvent, + DocObjHTMLDocument3_put_onrowsdelete, + DocObjHTMLDocument3_get_onrowsdelete, + DocObjHTMLDocument3_put_onrowsinserted, + DocObjHTMLDocument3_get_onrowsinserted, + DocObjHTMLDocument3_put_oncellchange, + DocObjHTMLDocument3_get_oncellchange, + DocObjHTMLDocument3_put_ondatasetchanged, + DocObjHTMLDocument3_get_ondatasetchanged, + DocObjHTMLDocument3_put_ondataavailable, + DocObjHTMLDocument3_get_ondataavailable, + DocObjHTMLDocument3_put_ondatasetcomplete, + DocObjHTMLDocument3_get_ondatasetcomplete, + DocObjHTMLDocument3_put_onpropertychange, + DocObjHTMLDocument3_get_onpropertychange, + DocObjHTMLDocument3_put_dir, + DocObjHTMLDocument3_get_dir, + DocObjHTMLDocument3_put_oncontextmenu, + DocObjHTMLDocument3_get_oncontextmenu, + DocObjHTMLDocument3_put_onstop, + DocObjHTMLDocument3_get_onstop, + DocObjHTMLDocument3_createDocumentFragment, + DocObjHTMLDocument3_get_parentDocument, + DocObjHTMLDocument3_put_enableDownload, + DocObjHTMLDocument3_get_enableDownload, + DocObjHTMLDocument3_put_baseUrl, + DocObjHTMLDocument3_get_baseUrl, + DocObjHTMLDocument3_get_childNodes, + DocObjHTMLDocument3_put_inheritStyleSheets, + DocObjHTMLDocument3_get_inheritStyleSheets, + DocObjHTMLDocument3_put_onbeforeeditfocus, + DocObjHTMLDocument3_get_onbeforeeditfocus, + DocObjHTMLDocument3_getElementsByName, + DocObjHTMLDocument3_getElementById, + DocObjHTMLDocument3_getElementsByTagName };
static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) @@ -6580,8 +6726,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_IHTMLDocument3, riid)) - *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) *ppv = &This->IHTMLDocument4_iface; else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) @@ -6611,7 +6755,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; @@ -6640,6 +6783,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) *ppv = &This->IHTMLDocument2_iface; + else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) + *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -7105,6 +7250,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc->ref = 1; doc->IHTMLDocument2_iface.lpVtbl = &DocNodeHTMLDocument2Vtbl; + doc->IHTMLDocument3_iface.lpVtbl = &DocNodeHTMLDocument3Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocNodeDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocNodeDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocNodeSupportErrorInfoVtbl; @@ -7236,6 +7382,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii return *ppv ? S_OK : E_NOINTERFACE; }else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) { *ppv = &This->IHTMLDocument2_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) { + *ppv = &This->IHTMLDocument3_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -7547,6 +7695,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; + doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 9a4df87b529..ac2ca06bb14 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3607,7 +3607,7 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, global_prop_t *prop; IHTMLElement *elem;
- hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->basedoc.IHTMLDocument3_iface, + hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->IHTMLDocument3_iface, bstrName, &elem); if(SUCCEEDED(hres) && elem) { IHTMLElement_Release(elem); @@ -3813,7 +3813,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD case DISPATCH_PROPERTYGET: { IHTMLElement *elem;
- hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->basedoc.IHTMLDocument3_iface, + hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->IHTMLDocument3_iface, prop->name, &elem); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 9ce987edef0..d2726476d3c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; @@ -677,6 +676,7 @@ struct HTMLDocumentObj { IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; IHTMLDocument2 IHTMLDocument2_iface; + IHTMLDocument3 IHTMLDocument3_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -897,6 +897,7 @@ struct HTMLDocumentNode { HTMLDocument basedoc;
IHTMLDocument2 IHTMLDocument2_iface; + IHTMLDocument3 IHTMLDocument3_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface;