From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 1565 +++++++++++++++++++++++----------- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/htmlframe.c | 6 +- dlls/mshtml/htmlnode.c | 2 +- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/script.c | 2 +- dlls/mshtml/service.c | 4 +- dlls/mshtml/view.c | 2 +- 9 files changed, 1065 insertions(+), 523 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 957d98d5ed6..af6a1a1a033 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -80,6 +80,12 @@ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \ }
+#define HTMLDOCUMENTOBJ_FWD_TO_NODE_0(iface, method) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface) : E_UNEXPECTED; \ +} + #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); \ @@ -92,6 +98,24 @@ static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, 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; \ }
+#define HTMLDOCUMENTOBJ_FWD_TO_NODE_3(iface, method, a,b,c) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3) : E_UNEXPECTED; \ +} + +#define HTMLDOCUMENTOBJ_FWD_TO_NODE_4(iface, method, a,b,c,d) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3, _4) : E_UNEXPECTED; \ +} + +#define HTMLDOCUMENTOBJ_FWD_TO_NODE_5(iface, method, a,b,c,d,e) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2, c _3, d _4, e _5) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2, _3, _4, _5) : E_UNEXPECTED; \ +} + 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) @@ -464,81 +488,79 @@ HRESULT create_doctype_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNo return S_OK; }
-static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface) +static inline HTMLDocumentNode *HTMLDocumentNode_from_IHTMLDocument2(IHTMLDocument2 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument2_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument2_iface); }
-static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppv) +static HRESULT WINAPI DocNodeHTMLDocument2_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
- return htmldoc_query_interface(This, riid, ppv); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
-static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface) +static ULONG WINAPI DocNodeHTMLDocument2_AddRef(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
- return htmldoc_addref(This); + return htmldoc_addref(&This->basedoc); }
-static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) +static ULONG WINAPI DocNodeHTMLDocument2_Release(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
- return htmldoc_release(This); + return htmldoc_release(&This->basedoc); }
-static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo) +static HRESULT WINAPI DocNodeHTMLDocument2_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
- return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI DocNodeHTMLDocument2_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
- return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI DocNodeHTMLDocument2_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(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 HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI DocNodeHTMLDocument2_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(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 HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_Script(IHTMLDocument2 *iface, IDispatch **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_parentWindow(&This->IHTMLDocument7_iface, (IHTMLWindow2**)p); + hres = IHTMLDocument7_get_parentWindow(&This->basedoc.IHTMLDocument7_iface, (IHTMLWindow2**)p); return hres == S_OK && !*p ? E_PENDING : hres; }
-static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMElement *nselem = NULL; HTMLDOMNode *node; nsresult nsres; @@ -546,12 +568,12 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
TRACE("(%p)->(%p)\n", This, p);
- 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; @@ -572,19 +594,19 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo return hres; }
-static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_body(IHTMLDocument2 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLElement *nsbody = NULL; HTMLElement *element; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(This->doc_node->nsdoc) { + if(This->nsdoc) { nsresult nsres;
- nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody); + nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody); if(NS_FAILED(nsres)) { TRACE("Could not get body: %08lx\n", nsres); return E_UNEXPECTED; @@ -605,9 +627,9 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMElement *nselem; HTMLElement *elem; nsresult nsres; @@ -615,7 +637,7 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { *p = NULL; return S_OK; } @@ -624,7 +646,7 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM * NOTE: Gecko may return an active element even if the document is not visible. * IE returns NULL in this case. */ - nsres = nsIDOMHTMLDocument_GetActiveElement(This->doc_node->nsdoc, &nselem); + nsres = nsIDOMHTMLDocument_GetActiveElement(This->nsdoc, &nselem); if(NS_FAILED(nsres)) { ERR("GetActiveElement failed: %08lx\n", nsres); return E_FAIL; @@ -644,9 +666,9 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -657,28 +679,28 @@ static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElemen
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetImages(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetImages(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetImages failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -689,28 +711,28 @@ static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLEleme
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetApplets(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetApplets(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetApplets failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -721,28 +743,28 @@ static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElement
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetLinks(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetLinks(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetLinks failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -753,28 +775,28 @@ static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElement
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetForms(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetForms(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetForms failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -785,40 +807,40 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetAnchors(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetAnchors(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetAnchors failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_title(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsAString nsstr; nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMHTMLDocument_SetTitle(This->doc_node->nsdoc, &nsstr); + nsres = nsIDOMHTMLDocument_SetTitle(This->nsdoc, &nsstr); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) ERR("SetTitle failed: %08lx\n", nsres); @@ -826,23 +848,23 @@ static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v) return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_title(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); const PRUnichar *ret; nsAString nsstr; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_Init(&nsstr, NULL); - nsres = nsIDOMHTMLDocument_GetTitle(This->doc_node->nsdoc, &nsstr); + nsres = nsIDOMHTMLDocument_GetTitle(This->nsdoc, &nsstr); if (NS_SUCCEEDED(nsres)) { nsAString_GetData(&nsstr, &ret); *p = SysAllocString(ret); @@ -857,9 +879,9 @@ static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p) return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -870,28 +892,28 @@ static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLEleme
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetScripts(This->doc_node->nsdoc, &nscoll); + nsres = nsIDOMHTMLDocument_GetScripts(This->nsdoc, &nscoll); if(NS_FAILED(nsres)) { ERR("GetImages failed: %08lx\n", nsres); return E_FAIL; }
if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, This->doc_node->document_mode); + *p = create_collection_from_htmlcol(nscoll, This->document_mode); nsIDOMHTMLCollection_Release(nscoll); }
return S_OK; }
-static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_designMode(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v)); @@ -901,102 +923,93 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) return E_NOTIMPL; }
- hres = setup_edit_mode(This->doc_obj); + hres = setup_edit_mode(This->basedoc.doc_obj); if(FAILED(hres)) return hres;
- call_property_onchanged(This == &This->doc_obj->basedoc ? &This->doc_obj->cp_container : &This->doc_node->cp_container, - DISPID_IHTMLDOCUMENT2_DESIGNMODE); + call_property_onchanged(&This->cp_container, DISPID_IHTMLDOCUMENT2_DESIGNMODE); return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_designMode(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); - FIXME("(%p)->(%p) always returning Off\n", This, p); - - if(!p) - return E_INVALIDARG; - - *p = SysAllocString(L"Off"); - - return S_OK; + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); + return IHTMLDocument2_get_designMode(&This->basedoc.doc_obj->IHTMLDocument2_iface, p); }
-static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsISelection *nsselection; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMHTMLDocument_GetSelection(This->doc_node->nsdoc, &nsselection); + nsres = nsIDOMHTMLDocument_GetSelection(This->nsdoc, &nsselection); if(NS_FAILED(nsres)) { ERR("GetSelection failed: %08lx\n", nsres); return E_FAIL; }
- return HTMLSelectionObject_Create(This->doc_node, nsselection, p); + return HTMLSelectionObject_Create(This, nsselection, p); }
-static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_readyState(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); - + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", iface, p);
if(!p) return E_POINTER;
- return get_readystate_string(This->window ? This->window->readystate : 0, p); + return get_readystate_string(This->basedoc.window ? This->basedoc.window->readystate : 0, p); }
-static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- if(!This->window) { + if(!This->basedoc.window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p); + return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); }
-static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_alinkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_bgColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); IHTMLElement *element = NULL; IHTMLBodyElement *body; HRESULT hr; @@ -1027,22 +1040,22 @@ static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v) return hr; }
-static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_bgColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsAString nsstr; nsresult nsres; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_Init(&nsstr, NULL); - nsres = nsIDOMHTMLDocument_GetBgColor(This->doc_node->nsdoc, &nsstr); + nsres = nsIDOMHTMLDocument_GetBgColor(This->nsdoc, &nsstr); hres = return_nsstr_variant(nsres, &nsstr, NSSTR_COLOR, p); if(hres == S_OK && V_VT(p) == VT_BSTR && !V_BSTR(p)) { TRACE("default #ffffff\n"); @@ -1052,61 +1065,57 @@ static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p return hres; }
-static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_fgColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_fgColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_linkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_linkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_referrer(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); - - FIXME("(%p)->(%p)\n", This, p); - - *p = NULL; - return S_OK; - } + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); + return IHTMLDocument2_get_referrer(&This->basedoc.doc_obj->IHTMLDocument2_iface, p); +}
-static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_location(IHTMLDocument2 *iface, IHTMLLocation **p) { - HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface)->doc_node; + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -1128,47 +1137,47 @@ static HRESULT IHTMLDocument2_location_hook(HTMLDocument *doc, WORD flags, DISPP 0, flags, dp, res, ei, caller); }
-static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_lastModified(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_URL(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->window) { + if(!This->basedoc.window) { FIXME("No window available\n"); return E_FAIL; }
- return navigate_url(This->window, v, This->window->uri, BINDING_NAVIGATED); + return navigate_url(This->basedoc.window, v, This->basedoc.window->uri, BINDING_NAVIGATED); }
-static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_URL(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", iface, p);
- *p = SysAllocString(This->window && This->window->url ? This->window->url : L"about:blank"); + *p = SysAllocString(This->basedoc.window && This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"); return *p ? S_OK : E_OUTOFMEMORY; }
-static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_domain(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsAString nsstr; nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMHTMLDocument_SetDomain(This->doc_node->nsdoc, &nsstr); + nsres = nsIDOMHTMLDocument_SetDomain(This->nsdoc, &nsstr); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { ERR("SetDomain failed: %08lx\n", nsres); @@ -1178,17 +1187,17 @@ static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v) return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_domain(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsAString nsstr; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&nsstr, NULL); - nsres = nsIDOMHTMLDocument_GetDomain(This->doc_node->nsdoc, &nsstr); - if(NS_SUCCEEDED(nsres) && This->window && This->window->uri) { + nsres = nsIDOMHTMLDocument_GetDomain(This->nsdoc, &nsstr); + if(NS_SUCCEEDED(nsres) && This->basedoc.window && This->basedoc.window->uri) { const PRUnichar *str; HRESULT hres;
@@ -1196,7 +1205,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) if(!*str) { TRACE("Gecko returned empty string, fallback to loaded URL.\n"); nsAString_Finish(&nsstr); - hres = IUri_GetHost(This->window->uri, p); + hres = IUri_GetHost(This->basedoc.window->uri, p); return FAILED(hres) ? hres : S_OK; } } @@ -1204,17 +1213,17 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) return return_nsstr(nsres, &nsstr, p); }
-static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_cookie(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); BOOL bret;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->window) + if(!This->basedoc.window) return S_OK;
- bret = InternetSetCookieExW(This->window->url, NULL, v, 0, 0); + bret = InternetSetCookieExW(This->basedoc.window->url, NULL, v, 0, 0); if(!bret) { FIXME("InternetSetCookieExW failed: %lu\n", GetLastError()); return HRESULT_FROM_WIN32(GetLastError()); @@ -1223,21 +1232,21 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v) return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_cookie(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); DWORD size; BOOL bret;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->window) { + if(!This->basedoc.window) { *p = NULL; return S_OK; }
size = 0; - bret = InternetGetCookieExW(This->window->url, NULL, NULL, &size, 0, NULL); + bret = InternetGetCookieExW(This->basedoc.window->url, NULL, NULL, &size, 0, NULL); if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { WARN("InternetGetCookieExW failed: %lu\n", GetLastError()); *p = NULL; @@ -1253,7 +1262,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) if(!*p) return E_OUTOFMEMORY;
- bret = InternetGetCookieExW(This->window->url, NULL, *p, &size, 0, NULL); + bret = InternetGetCookieExW(This->basedoc.window->url, NULL, *p, &size, 0, NULL); if(!bret) { ERR("InternetGetCookieExW failed: %lu\n", GetLastError()); return E_FAIL; @@ -1262,46 +1271,46 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) return S_OK; }
-static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_charset(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s) returning S_OK\n", This, debugstr_w(v)); return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_charset(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument7_get_characterSet(&This->IHTMLDocument7_iface, p); + return IHTMLDocument7_get_characterSet(&This->basedoc.IHTMLDocument7_iface, p); }
-static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_defaultCharset(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -1309,63 +1318,63 @@ static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BST return *p ? S_OK : E_OUTOFMEMORY; }
-static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_mimeType(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_fileSize(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_security(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_protocol(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_nameProp(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln) +static HRESULT document_write(HTMLDocumentNode *This, SAFEARRAY *psarray, BOOL ln) { VARIANT *var, tmp; JSContext *jsctx; @@ -1374,7 +1383,7 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln) nsresult nsres; HRESULT hres;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; } @@ -1395,7 +1404,7 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
V_VT(&tmp) = VT_EMPTY;
- jsctx = get_context_from_document(This->doc_node->nsdoc); + jsctx = get_context_from_document(This->nsdoc); argc = psarray->rgsabound[0].cElements; for(i=0; i < argc; i++) { if(V_VT(var+i) == VT_BSTR) { @@ -1410,9 +1419,9 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln) }
if(!ln || i != argc-1) - nsres = nsIDOMHTMLDocument_Write(This->doc_node->nsdoc, &nsstr, jsctx); + nsres = nsIDOMHTMLDocument_Write(This->nsdoc, &nsstr, jsctx); else - nsres = nsIDOMHTMLDocument_Writeln(This->doc_node->nsdoc, &nsstr, jsctx); + nsres = nsIDOMHTMLDocument_Writeln(This->nsdoc, &nsstr, jsctx); nsAString_Finish(&nsstr); if(V_VT(var+i) != VT_BSTR) VariantClear(&tmp); @@ -1428,28 +1437,28 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln) return hres; }
-static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray) +static HRESULT WINAPI DocNodeHTMLDocument2_write(IHTMLDocument2 *iface, SAFEARRAY *psarray) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", iface, psarray);
return document_write(This, psarray, FALSE); }
-static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray) +static HRESULT WINAPI DocNodeHTMLDocument2_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, psarray);
return document_write(This, psarray, TRUE); }
-static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name, - VARIANT features, VARIANT replace, IDispatch **pomWindowResult) +static HRESULT WINAPI DocNodeHTMLDocument2_open(IHTMLDocument2 *iface, BSTR url, VARIANT name, + VARIANT features, VARIANT replace, IDispatch **pomWindowResult) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsISupports *tmp; nsresult nsres;
@@ -1458,10 +1467,10 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
*pomWindowResult = NULL;
- if(!This->window) + if(!This->basedoc.window) return E_FAIL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { ERR("!nsdoc\n"); return E_NOTIMPL; } @@ -1470,8 +1479,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT || V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR) FIXME("unsupported args\n");
- nsres = nsIDOMHTMLDocument_Open(This->doc_node->nsdoc, NULL, NULL, NULL, - get_context_from_document(This->doc_node->nsdoc), 0, &tmp); + nsres = nsIDOMHTMLDocument_Open(This->nsdoc, NULL, NULL, NULL, + get_context_from_document(This->nsdoc), 0, &tmp); if(NS_FAILED(nsres)) { ERR("Open failed: %08lx\n", nsres); return E_FAIL; @@ -1480,24 +1489,24 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT if(tmp) nsISupports_Release(tmp);
- *pomWindowResult = (IDispatch*)&This->window->base.IHTMLWindow2_iface; - IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface); + *pomWindowResult = (IDispatch*)&This->basedoc.window->base.IHTMLWindow2_iface; + IHTMLWindow2_AddRef(&This->basedoc.window->base.IHTMLWindow2_iface); return S_OK; }
-static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface) +static HRESULT WINAPI DocNodeHTMLDocument2_close(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsresult nsres;
TRACE("(%p)\n", This);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { ERR("!nsdoc\n"); return E_NOTIMPL; }
- nsres = nsIDOMHTMLDocument_Close(This->doc_node->nsdoc); + nsres = nsIDOMHTMLDocument_Close(This->nsdoc); if(NS_FAILED(nsres)) { ERR("Close failed: %08lx\n", nsres); return E_FAIL; @@ -1506,14 +1515,14 @@ static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface) return S_OK; }
-static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface) +static HRESULT WINAPI DocNodeHTMLDocument2_clear(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsresult nsres;
TRACE("(%p)\n", This);
- nsres = nsIDOMHTMLDocument_Clear(This->doc_node->nsdoc); + nsres = nsIDOMHTMLDocument_Clear(This->nsdoc); if(NS_FAILED(nsres)) { ERR("Clear failed: %08lx\n", nsres); return E_FAIL; @@ -1553,58 +1562,58 @@ static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid) return FALSE; }
-static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID, - BSTR *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID, + BSTR *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_execCommand(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); OLECMDID cmdid; VARIANT ret; HRESULT hres; @@ -1615,7 +1624,7 @@ static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID return OLECMDERR_E_NOTSUPPORTED;
V_VT(&ret) = VT_EMPTY; - hres = IOleCommandTarget_Exec(&This->doc_node->IOleCommandTarget_iface, &CGID_MSHTML, cmdid, + hres = IOleCommandTarget_Exec(&This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid, showUI ? 0 : OLECMDEXECOPT_DONTPROMPTUSER, &value, &ret); if(FAILED(hres)) return hres; @@ -1629,24 +1638,24 @@ static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID return S_OK; }
-static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) +static HRESULT WINAPI DocNodeHTMLDocument2_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID, + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag, - IHTMLElement **newElem) +static HRESULT WINAPI DocNodeHTMLDocument2_createElement(IHTMLDocument2 *iface, BSTR eTag, + IHTMLElement **newElem) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); HTMLElement *elem; HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
- hres = create_element(This->doc_node, eTag, &elem); + hres = create_element(This, eTag, &elem); if(FAILED(hres)) return hres;
@@ -1654,300 +1663,300 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa return S_OK; }
-static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onhelp(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onhelp(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onclick(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_CLICK, &v); + return set_doc_event(&This->basedoc, EVENTID_CLICK, &v); }
-static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onclick(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_CLICK, p); + return get_doc_event(&This->basedoc, EVENTID_CLICK, p); }
-static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_ondblclick(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_DBLCLICK, &v); + return set_doc_event(&This->basedoc, EVENTID_DBLCLICK, &v); }
-static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_DBLCLICK, p); + return get_doc_event(&This->basedoc, EVENTID_DBLCLICK, p); }
-static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onkeyup(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_KEYUP, &v); + return set_doc_event(&This->basedoc, EVENTID_KEYUP, &v); }
-static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_KEYUP, p); + return get_doc_event(&This->basedoc, EVENTID_KEYUP, p); }
-static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onkeydown(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_KEYDOWN, &v); + return set_doc_event(&This->basedoc, EVENTID_KEYDOWN, &v); }
-static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_KEYDOWN, p); + return get_doc_event(&This->basedoc, EVENTID_KEYDOWN, p); }
-static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onkeypress(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_KEYPRESS, &v); + return set_doc_event(&This->basedoc, EVENTID_KEYPRESS, &v); }
-static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_KEYPRESS, p); + return get_doc_event(&This->basedoc, EVENTID_KEYPRESS, p); }
-static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onmouseup(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEUP, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEUP, &v); }
-static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEUP, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEUP, p); }
-static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onmousedown(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEDOWN, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEDOWN, &v); }
-static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEDOWN, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEDOWN, p); }
-static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onmousemove(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEMOVE, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEMOVE, &v); }
-static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEMOVE, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEMOVE, p); }
-static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onmouseout(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEOUT, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEOUT, &v); }
-static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEOUT, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEOUT, p); }
-static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onmouseover(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEOVER, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEOVER, &v); }
-static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEOVER, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEOVER, p); }
-static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_READYSTATECHANGE, &v); + return set_doc_event(&This->basedoc, EVENTID_READYSTATECHANGE, &v); }
-static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_READYSTATECHANGE, p); + return get_doc_event(&This->basedoc, EVENTID_READYSTATECHANGE, p); }
-static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onrowexit(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onrowenter(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_ondragstart(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_DRAGSTART, &v); + return set_doc_event(&This->basedoc, EVENTID_DRAGSTART, &v); }
-static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_DRAGSTART, p); + return get_doc_event(&This->basedoc, EVENTID_DRAGSTART, p); }
-static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onselectstart(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_SELECTSTART, &v); + return set_doc_event(&This->basedoc, EVENTID_SELECTSTART, &v); }
-static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_SELECTSTART, p); + return get_doc_event(&This->basedoc, EVENTID_SELECTSTART, p); }
-static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y, - IHTMLElement **elementHit) +static HRESULT WINAPI DocNodeHTMLDocument2_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y, + IHTMLElement **elementHit) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMElement *nselem; HTMLElement *element; nsresult nsres; @@ -1955,7 +1964,7 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG
TRACE("(%p)->(%ld %ld %p)\n", This, x, y, elementHit);
- nsres = nsIDOMHTMLDocument_ElementFromPoint(This->doc_node->nsdoc, x, y, &nselem); + nsres = nsIDOMHTMLDocument_ElementFromPoint(This->nsdoc, x, y, &nselem); if(NS_FAILED(nsres)) { ERR("ElementFromPoint failed: %08lx\n", nsres); return E_FAIL; @@ -1975,21 +1984,21 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG return S_OK; }
-static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_defaultView(&This->IHTMLDocument7_iface, p); + hres = IHTMLDocument7_get_defaultView(&This->basedoc.IHTMLDocument7_iface, p); return hres == S_OK && !*p ? E_FAIL : hres; }
-static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface, - IHTMLStyleSheetsCollection **p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_styleSheets(IHTMLDocument2 *iface, + IHTMLStyleSheetsCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMStyleSheetList *nsstylelist; nsresult nsres; HRESULT hres; @@ -1998,64 +2007,64 @@ static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
*p = NULL;
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetStyleSheets(This->doc_node->nsdoc, &nsstylelist); + nsres = nsIDOMHTMLDocument_GetStyleSheets(This->nsdoc, &nsstylelist); if(NS_FAILED(nsres)) { ERR("GetStyleSheets failed: %08lx\n", nsres); return map_nsresult(nsres); }
hres = create_style_sheet_collection(nsstylelist, - dispex_compat_mode(&This->doc_node->node.event_target.dispex), p); + dispex_compat_mode(&This->node.event_target.dispex), p); nsIDOMStyleSheetList_Release(nsstylelist); return hres; }
-static HRESULT WINAPI HTMLDocument_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v) +static HRESULT WINAPI DocNodeHTMLDocument2_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p) +static HRESULT WINAPI DocNodeHTMLDocument2_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String) +static HRESULT WINAPI DocNodeHTMLDocument2_toString(IHTMLDocument2 *iface, BSTR *String) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, String);
- return dispex_to_string(&This->doc_node->node.event_target.dispex, String); + return dispex_to_string(&This->node.event_target.dispex, String); }
-static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref, - LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet) +static HRESULT WINAPI DocNodeHTMLDocument2_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref, + LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = HTMLDocumentNode_from_IHTMLDocument2(iface); nsIDOMHTMLHeadElement *head_elem; IHTMLStyleElement *style_elem; HTMLElement *elem; @@ -2064,7 +2073,7 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR
TRACE("(%p)->(%s %ld %p)\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("not a real doc object\n"); return E_NOTIMPL; } @@ -2074,15 +2083,15 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR
if(bstrHref && *bstrHref) { FIXME("semi-stub for href %s\n", debugstr_w(bstrHref)); - return create_style_sheet(NULL, dispex_compat_mode(&This->doc_node->node.event_target.dispex), + return create_style_sheet(NULL, dispex_compat_mode(&This->node.event_target.dispex), ppnewStyleSheet); }
- hres = create_element(This->doc_node, L"style", &elem); + hres = create_element(This, L"style", &elem); if(FAILED(hres)) return hres;
- nsres = nsIDOMHTMLDocument_GetHead(This->doc_node->nsdoc, &head_elem); + nsres = nsIDOMHTMLDocument_GetHead(This->nsdoc, &head_elem); if(NS_SUCCEEDED(nsres)) { nsIDOMNode *head_node, *tmp_node;
@@ -2109,123 +2118,652 @@ static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR return hres; }
-static const IHTMLDocument2Vtbl HTMLDocumentVtbl = { - HTMLDocument_QueryInterface, - HTMLDocument_AddRef, - HTMLDocument_Release, - HTMLDocument_GetTypeInfoCount, - HTMLDocument_GetTypeInfo, - HTMLDocument_GetIDsOfNames, - HTMLDocument_Invoke, - HTMLDocument_get_Script, - HTMLDocument_get_all, - HTMLDocument_get_body, - HTMLDocument_get_activeElement, - HTMLDocument_get_images, - HTMLDocument_get_applets, - HTMLDocument_get_links, - HTMLDocument_get_forms, - HTMLDocument_get_anchors, - HTMLDocument_put_title, - HTMLDocument_get_title, - HTMLDocument_get_scripts, - HTMLDocument_put_designMode, - HTMLDocument_get_designMode, - HTMLDocument_get_selection, - HTMLDocument_get_readyState, - HTMLDocument_get_frames, - HTMLDocument_get_embeds, - HTMLDocument_get_plugins, - HTMLDocument_put_alinkColor, - HTMLDocument_get_alinkColor, - HTMLDocument_put_bgColor, - HTMLDocument_get_bgColor, - HTMLDocument_put_fgColor, - HTMLDocument_get_fgColor, - HTMLDocument_put_linkColor, - HTMLDocument_get_linkColor, - HTMLDocument_put_vlinkColor, - HTMLDocument_get_vlinkColor, - HTMLDocument_get_referrer, - HTMLDocument_get_location, - HTMLDocument_get_lastModified, - HTMLDocument_put_URL, - HTMLDocument_get_URL, - HTMLDocument_put_domain, - HTMLDocument_get_domain, - HTMLDocument_put_cookie, - HTMLDocument_get_cookie, - HTMLDocument_put_expando, - HTMLDocument_get_expando, - HTMLDocument_put_charset, - HTMLDocument_get_charset, - HTMLDocument_put_defaultCharset, - HTMLDocument_get_defaultCharset, - HTMLDocument_get_mimeType, - HTMLDocument_get_fileSize, - HTMLDocument_get_fileCreatedDate, - HTMLDocument_get_fileModifiedDate, - HTMLDocument_get_fileUpdatedDate, - HTMLDocument_get_security, - HTMLDocument_get_protocol, - HTMLDocument_get_nameProp, - HTMLDocument_write, - HTMLDocument_writeln, - HTMLDocument_open, - HTMLDocument_close, - HTMLDocument_clear, - HTMLDocument_queryCommandSupported, - HTMLDocument_queryCommandEnabled, - HTMLDocument_queryCommandState, - HTMLDocument_queryCommandIndeterm, - HTMLDocument_queryCommandText, - HTMLDocument_queryCommandValue, - HTMLDocument_execCommand, - HTMLDocument_execCommandShowHelp, - HTMLDocument_createElement, - HTMLDocument_put_onhelp, - HTMLDocument_get_onhelp, - HTMLDocument_put_onclick, - HTMLDocument_get_onclick, - HTMLDocument_put_ondblclick, - HTMLDocument_get_ondblclick, - HTMLDocument_put_onkeyup, - HTMLDocument_get_onkeyup, - HTMLDocument_put_onkeydown, - HTMLDocument_get_onkeydown, - HTMLDocument_put_onkeypress, - HTMLDocument_get_onkeypress, - HTMLDocument_put_onmouseup, - HTMLDocument_get_onmouseup, - HTMLDocument_put_onmousedown, - HTMLDocument_get_onmousedown, - HTMLDocument_put_onmousemove, - HTMLDocument_get_onmousemove, - HTMLDocument_put_onmouseout, - HTMLDocument_get_onmouseout, - HTMLDocument_put_onmouseover, - HTMLDocument_get_onmouseover, - HTMLDocument_put_onreadystatechange, - HTMLDocument_get_onreadystatechange, - HTMLDocument_put_onafterupdate, - HTMLDocument_get_onafterupdate, - HTMLDocument_put_onrowexit, - HTMLDocument_get_onrowexit, - HTMLDocument_put_onrowenter, - HTMLDocument_get_onrowenter, - HTMLDocument_put_ondragstart, - HTMLDocument_get_ondragstart, - HTMLDocument_put_onselectstart, - HTMLDocument_get_onselectstart, - HTMLDocument_elementFromPoint, - HTMLDocument_get_parentWindow, - HTMLDocument_get_styleSheets, - HTMLDocument_put_onbeforeupdate, - HTMLDocument_get_onbeforeupdate, - HTMLDocument_put_onerrorupdate, - HTMLDocument_get_onerrorupdate, - HTMLDocument_toString, - HTMLDocument_createStyleSheet +static const IHTMLDocument2Vtbl DocNodeHTMLDocument2Vtbl = { + DocNodeHTMLDocument2_QueryInterface, + DocNodeHTMLDocument2_AddRef, + DocNodeHTMLDocument2_Release, + DocNodeHTMLDocument2_GetTypeInfoCount, + DocNodeHTMLDocument2_GetTypeInfo, + DocNodeHTMLDocument2_GetIDsOfNames, + DocNodeHTMLDocument2_Invoke, + DocNodeHTMLDocument2_get_Script, + DocNodeHTMLDocument2_get_all, + DocNodeHTMLDocument2_get_body, + DocNodeHTMLDocument2_get_activeElement, + DocNodeHTMLDocument2_get_images, + DocNodeHTMLDocument2_get_applets, + DocNodeHTMLDocument2_get_links, + DocNodeHTMLDocument2_get_forms, + DocNodeHTMLDocument2_get_anchors, + DocNodeHTMLDocument2_put_title, + DocNodeHTMLDocument2_get_title, + DocNodeHTMLDocument2_get_scripts, + DocNodeHTMLDocument2_put_designMode, + DocNodeHTMLDocument2_get_designMode, + DocNodeHTMLDocument2_get_selection, + DocNodeHTMLDocument2_get_readyState, + DocNodeHTMLDocument2_get_frames, + DocNodeHTMLDocument2_get_embeds, + DocNodeHTMLDocument2_get_plugins, + DocNodeHTMLDocument2_put_alinkColor, + DocNodeHTMLDocument2_get_alinkColor, + DocNodeHTMLDocument2_put_bgColor, + DocNodeHTMLDocument2_get_bgColor, + DocNodeHTMLDocument2_put_fgColor, + DocNodeHTMLDocument2_get_fgColor, + DocNodeHTMLDocument2_put_linkColor, + DocNodeHTMLDocument2_get_linkColor, + DocNodeHTMLDocument2_put_vlinkColor, + DocNodeHTMLDocument2_get_vlinkColor, + DocNodeHTMLDocument2_get_referrer, + DocNodeHTMLDocument2_get_location, + DocNodeHTMLDocument2_get_lastModified, + DocNodeHTMLDocument2_put_URL, + DocNodeHTMLDocument2_get_URL, + DocNodeHTMLDocument2_put_domain, + DocNodeHTMLDocument2_get_domain, + DocNodeHTMLDocument2_put_cookie, + DocNodeHTMLDocument2_get_cookie, + DocNodeHTMLDocument2_put_expando, + DocNodeHTMLDocument2_get_expando, + DocNodeHTMLDocument2_put_charset, + DocNodeHTMLDocument2_get_charset, + DocNodeHTMLDocument2_put_defaultCharset, + DocNodeHTMLDocument2_get_defaultCharset, + DocNodeHTMLDocument2_get_mimeType, + DocNodeHTMLDocument2_get_fileSize, + DocNodeHTMLDocument2_get_fileCreatedDate, + DocNodeHTMLDocument2_get_fileModifiedDate, + DocNodeHTMLDocument2_get_fileUpdatedDate, + DocNodeHTMLDocument2_get_security, + DocNodeHTMLDocument2_get_protocol, + DocNodeHTMLDocument2_get_nameProp, + DocNodeHTMLDocument2_write, + DocNodeHTMLDocument2_writeln, + DocNodeHTMLDocument2_open, + DocNodeHTMLDocument2_close, + DocNodeHTMLDocument2_clear, + DocNodeHTMLDocument2_queryCommandSupported, + DocNodeHTMLDocument2_queryCommandEnabled, + DocNodeHTMLDocument2_queryCommandState, + DocNodeHTMLDocument2_queryCommandIndeterm, + DocNodeHTMLDocument2_queryCommandText, + DocNodeHTMLDocument2_queryCommandValue, + DocNodeHTMLDocument2_execCommand, + DocNodeHTMLDocument2_execCommandShowHelp, + DocNodeHTMLDocument2_createElement, + DocNodeHTMLDocument2_put_onhelp, + DocNodeHTMLDocument2_get_onhelp, + DocNodeHTMLDocument2_put_onclick, + DocNodeHTMLDocument2_get_onclick, + DocNodeHTMLDocument2_put_ondblclick, + DocNodeHTMLDocument2_get_ondblclick, + DocNodeHTMLDocument2_put_onkeyup, + DocNodeHTMLDocument2_get_onkeyup, + DocNodeHTMLDocument2_put_onkeydown, + DocNodeHTMLDocument2_get_onkeydown, + DocNodeHTMLDocument2_put_onkeypress, + DocNodeHTMLDocument2_get_onkeypress, + DocNodeHTMLDocument2_put_onmouseup, + DocNodeHTMLDocument2_get_onmouseup, + DocNodeHTMLDocument2_put_onmousedown, + DocNodeHTMLDocument2_get_onmousedown, + DocNodeHTMLDocument2_put_onmousemove, + DocNodeHTMLDocument2_get_onmousemove, + DocNodeHTMLDocument2_put_onmouseout, + DocNodeHTMLDocument2_get_onmouseout, + DocNodeHTMLDocument2_put_onmouseover, + DocNodeHTMLDocument2_get_onmouseover, + DocNodeHTMLDocument2_put_onreadystatechange, + DocNodeHTMLDocument2_get_onreadystatechange, + DocNodeHTMLDocument2_put_onafterupdate, + DocNodeHTMLDocument2_get_onafterupdate, + DocNodeHTMLDocument2_put_onrowexit, + DocNodeHTMLDocument2_get_onrowexit, + DocNodeHTMLDocument2_put_onrowenter, + DocNodeHTMLDocument2_get_onrowenter, + DocNodeHTMLDocument2_put_ondragstart, + DocNodeHTMLDocument2_get_ondragstart, + DocNodeHTMLDocument2_put_onselectstart, + DocNodeHTMLDocument2_get_onselectstart, + DocNodeHTMLDocument2_elementFromPoint, + DocNodeHTMLDocument2_get_parentWindow, + DocNodeHTMLDocument2_get_styleSheets, + DocNodeHTMLDocument2_put_onbeforeupdate, + DocNodeHTMLDocument2_get_onbeforeupdate, + DocNodeHTMLDocument2_put_onerrorupdate, + DocNodeHTMLDocument2_get_onerrorupdate, + DocNodeHTMLDocument2_toString, + DocNodeHTMLDocument2_createStyleSheet +}; + +static inline HTMLDocumentObj *HTMLDocumentObj_from_IHTMLDocument2(IHTMLDocument2 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument2_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument2) + +static HRESULT WINAPI DocObjHTMLDocument2_get_Script(IHTMLDocument2 *iface, IDispatch **p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + hres = IHTMLDocument7_get_parentWindow(&This->basedoc.IHTMLDocument7_iface, (IHTMLWindow2**)p); + return hres == S_OK && !*p ? E_PENDING : hres; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_all, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_body, IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_activeElement, IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_images, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_applets, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_links, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_forms, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_anchors, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_title, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_title, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_scripts, IHTMLElementCollection**) + +static HRESULT WINAPI DocObjHTMLDocument2_put_designMode(IHTMLDocument2 *iface, BSTR v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + HRESULT hres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(wcsicmp(v, L"on")) { + FIXME("Unsupported arg %s\n", debugstr_w(v)); + return E_NOTIMPL; + } + + hres = setup_edit_mode(This); + if(FAILED(hres)) + return hres; + + call_property_onchanged(&This->cp_container, DISPID_IHTMLDOCUMENT2_DESIGNMODE); + return S_OK; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_designMode(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + FIXME("(%p)->(%p) always returning Off\n", This, p); + + if(!p) + return E_INVALIDARG; + + *p = SysAllocString(L"Off"); + + return S_OK; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_selection, IHTMLSelectionObject**) + +static HRESULT WINAPI DocObjHTMLDocument2_get_readyState(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", iface, p); + + if(!p) + return E_POINTER; + + return get_readystate_string(This->basedoc.window ? This->basedoc.window->readystate : 0, p); +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->basedoc.window) { + /* Not implemented by IE */ + return E_NOTIMPL; + } + return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_embeds, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_plugins, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_alinkColor, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_alinkColor, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_bgColor, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_bgColor, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_fgColor, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_fgColor, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_linkColor, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_linkColor, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_vlinkColor, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_vlinkColor, VARIANT*) + +static HRESULT WINAPI DocObjHTMLDocument2_get_referrer(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + FIXME("(%p)->(%p)\n", This, p); + + *p = NULL; + return S_OK; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_location(IHTMLDocument2 *iface, IHTMLLocation **p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->basedoc.window || !This->basedoc.window->base.inner_window) { + WARN("NULL window\n"); + return E_UNEXPECTED; + } + + return IHTMLWindow2_get_location(&This->basedoc.window->base.inner_window->base.IHTMLWindow2_iface, p); +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_lastModified, BSTR*) + +static HRESULT WINAPI DocObjHTMLDocument2_put_URL(IHTMLDocument2 *iface, BSTR v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(!This->basedoc.window) { + FIXME("No window available\n"); + return E_FAIL; + } + + return navigate_url(This->basedoc.window, v, This->basedoc.window->uri, BINDING_NAVIGATED); +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_URL(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", iface, p); + + *p = SysAllocString(This->basedoc.window && This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"); + return *p ? S_OK : E_OUTOFMEMORY; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_domain, BSTR) + +static HRESULT WINAPI DocObjHTMLDocument2_get_domain(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + nsresult nsres = NS_ERROR_FAILURE; + nsAString nsstr; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&nsstr, NULL); + + if(This->basedoc.doc_node) + nsres = nsIDOMHTMLDocument_GetDomain(This->basedoc.doc_node->nsdoc, &nsstr); + if(NS_SUCCEEDED(nsres) && This->basedoc.window && This->basedoc.window->uri) { + const PRUnichar *str; + HRESULT hres; + + nsAString_GetData(&nsstr, &str); + if(!*str) { + TRACE("Gecko returned empty string, fallback to loaded URL.\n"); + nsAString_Finish(&nsstr); + hres = IUri_GetHost(This->basedoc.window->uri, p); + return FAILED(hres) ? hres : S_OK; + } + } + + return return_nsstr(nsres, &nsstr, p); +} + +static HRESULT WINAPI DocObjHTMLDocument2_put_cookie(IHTMLDocument2 *iface, BSTR v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + BOOL bret; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(!This->basedoc.window) + return S_OK; + + bret = InternetSetCookieExW(This->basedoc.window->url, NULL, v, 0, 0); + if(!bret) { + FIXME("InternetSetCookieExW failed: %lu\n", GetLastError()); + return HRESULT_FROM_WIN32(GetLastError()); + } + + return S_OK; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_cookie(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + DWORD size; + BOOL bret; + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->basedoc.window) { + *p = NULL; + return S_OK; + } + + size = 0; + bret = InternetGetCookieExW(This->basedoc.window->url, NULL, NULL, &size, 0, NULL); + if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + WARN("InternetGetCookieExW failed: %lu\n", GetLastError()); + *p = NULL; + return S_OK; + } + + if(!size) { + *p = NULL; + return S_OK; + } + + *p = SysAllocStringLen(NULL, size/sizeof(WCHAR)-1); + if(!*p) + return E_OUTOFMEMORY; + + bret = InternetGetCookieExW(This->basedoc.window->url, NULL, *p, &size, 0, NULL); + if(!bret) { + ERR("InternetGetCookieExW failed: %lu\n", GetLastError()); + return E_FAIL; + } + + return S_OK; +} + +static HRESULT WINAPI DocObjHTMLDocument2_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_charset, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_charset, BSTR*) + +static HRESULT WINAPI DocObjHTMLDocument2_put_defaultCharset(IHTMLDocument2 *iface, BSTR v) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", This, p); + + *p = charset_string_from_cp(GetACP()); + return *p ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_mimeType(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_fileSize(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_security(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_protocol(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjHTMLDocument2_get_nameProp(IHTMLDocument2 *iface, BSTR *p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, write, SAFEARRAY*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, writeln, SAFEARRAY*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_5(HTMLDocument2, open, BSTR,VARIANT,VARIANT,VARIANT,IDispatch**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument2, close) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument2, clear) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandSupported, BSTR,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandEnabled, BSTR,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandState, BSTR,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandIndeterm, BSTR,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandText, BSTR,BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, queryCommandValue, BSTR,VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_4(HTMLDocument2, execCommand, BSTR,VARIANT_BOOL,VARIANT,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, execCommandShowHelp, BSTR,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument2, createElement, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onhelp, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onhelp, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onclick, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onclick, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_ondblclick, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_ondblclick, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onkeyup, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onkeyup, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onkeydown, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onkeydown, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onkeypress, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onkeypress, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onmouseup, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onmouseup, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onmousedown, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onmousedown, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onmousemove, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onmousemove, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onmouseout, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onmouseout, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onmouseover, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onmouseover, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onreadystatechange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onreadystatechange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onafterupdate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onafterupdate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onrowexit, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onrowexit, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onrowenter, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onrowenter, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_ondragstart, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_ondragstart, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onselectstart, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onselectstart, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument2, elementFromPoint, LONG,LONG,IHTMLElement**) + +static HRESULT WINAPI DocObjHTMLDocument2_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + hres = IHTMLDocument7_get_defaultView(&This->basedoc.IHTMLDocument7_iface, p); + return hres == S_OK && !*p ? E_FAIL : hres; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_styleSheets, IHTMLStyleSheetsCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onbeforeupdate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onbeforeupdate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_onerrorupdate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_onerrorupdate, VARIANT*) + +static HRESULT WINAPI DocObjHTMLDocument2_toString(IHTMLDocument2 *iface, BSTR *String) +{ + HTMLDocumentObj *This = HTMLDocumentObj_from_IHTMLDocument2(iface); + + TRACE("(%p)->(%p)\n", This, String); + + return dispex_to_string(&This->dispex, String); +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument2, createStyleSheet, BSTR,LONG,IHTMLStyleSheet**) + +static const IHTMLDocument2Vtbl DocObjHTMLDocument2Vtbl = { + DocObjHTMLDocument2_QueryInterface, + DocObjHTMLDocument2_AddRef, + DocObjHTMLDocument2_Release, + DocObjHTMLDocument2_GetTypeInfoCount, + DocObjHTMLDocument2_GetTypeInfo, + DocObjHTMLDocument2_GetIDsOfNames, + DocObjHTMLDocument2_Invoke, + DocObjHTMLDocument2_get_Script, + DocObjHTMLDocument2_get_all, + DocObjHTMLDocument2_get_body, + DocObjHTMLDocument2_get_activeElement, + DocObjHTMLDocument2_get_images, + DocObjHTMLDocument2_get_applets, + DocObjHTMLDocument2_get_links, + DocObjHTMLDocument2_get_forms, + DocObjHTMLDocument2_get_anchors, + DocObjHTMLDocument2_put_title, + DocObjHTMLDocument2_get_title, + DocObjHTMLDocument2_get_scripts, + DocObjHTMLDocument2_put_designMode, + DocObjHTMLDocument2_get_designMode, + DocObjHTMLDocument2_get_selection, + DocObjHTMLDocument2_get_readyState, + DocObjHTMLDocument2_get_frames, + DocObjHTMLDocument2_get_embeds, + DocObjHTMLDocument2_get_plugins, + DocObjHTMLDocument2_put_alinkColor, + DocObjHTMLDocument2_get_alinkColor, + DocObjHTMLDocument2_put_bgColor, + DocObjHTMLDocument2_get_bgColor, + DocObjHTMLDocument2_put_fgColor, + DocObjHTMLDocument2_get_fgColor, + DocObjHTMLDocument2_put_linkColor, + DocObjHTMLDocument2_get_linkColor, + DocObjHTMLDocument2_put_vlinkColor, + DocObjHTMLDocument2_get_vlinkColor, + DocObjHTMLDocument2_get_referrer, + DocObjHTMLDocument2_get_location, + DocObjHTMLDocument2_get_lastModified, + DocObjHTMLDocument2_put_URL, + DocObjHTMLDocument2_get_URL, + DocObjHTMLDocument2_put_domain, + DocObjHTMLDocument2_get_domain, + DocObjHTMLDocument2_put_cookie, + DocObjHTMLDocument2_get_cookie, + DocObjHTMLDocument2_put_expando, + DocObjHTMLDocument2_get_expando, + DocObjHTMLDocument2_put_charset, + DocObjHTMLDocument2_get_charset, + DocObjHTMLDocument2_put_defaultCharset, + DocObjHTMLDocument2_get_defaultCharset, + DocObjHTMLDocument2_get_mimeType, + DocObjHTMLDocument2_get_fileSize, + DocObjHTMLDocument2_get_fileCreatedDate, + DocObjHTMLDocument2_get_fileModifiedDate, + DocObjHTMLDocument2_get_fileUpdatedDate, + DocObjHTMLDocument2_get_security, + DocObjHTMLDocument2_get_protocol, + DocObjHTMLDocument2_get_nameProp, + DocObjHTMLDocument2_write, + DocObjHTMLDocument2_writeln, + DocObjHTMLDocument2_open, + DocObjHTMLDocument2_close, + DocObjHTMLDocument2_clear, + DocObjHTMLDocument2_queryCommandSupported, + DocObjHTMLDocument2_queryCommandEnabled, + DocObjHTMLDocument2_queryCommandState, + DocObjHTMLDocument2_queryCommandIndeterm, + DocObjHTMLDocument2_queryCommandText, + DocObjHTMLDocument2_queryCommandValue, + DocObjHTMLDocument2_execCommand, + DocObjHTMLDocument2_execCommandShowHelp, + DocObjHTMLDocument2_createElement, + DocObjHTMLDocument2_put_onhelp, + DocObjHTMLDocument2_get_onhelp, + DocObjHTMLDocument2_put_onclick, + DocObjHTMLDocument2_get_onclick, + DocObjHTMLDocument2_put_ondblclick, + DocObjHTMLDocument2_get_ondblclick, + DocObjHTMLDocument2_put_onkeyup, + DocObjHTMLDocument2_get_onkeyup, + DocObjHTMLDocument2_put_onkeydown, + DocObjHTMLDocument2_get_onkeydown, + DocObjHTMLDocument2_put_onkeypress, + DocObjHTMLDocument2_get_onkeypress, + DocObjHTMLDocument2_put_onmouseup, + DocObjHTMLDocument2_get_onmouseup, + DocObjHTMLDocument2_put_onmousedown, + DocObjHTMLDocument2_get_onmousedown, + DocObjHTMLDocument2_put_onmousemove, + DocObjHTMLDocument2_get_onmousemove, + DocObjHTMLDocument2_put_onmouseout, + DocObjHTMLDocument2_get_onmouseout, + DocObjHTMLDocument2_put_onmouseover, + DocObjHTMLDocument2_get_onmouseover, + DocObjHTMLDocument2_put_onreadystatechange, + DocObjHTMLDocument2_get_onreadystatechange, + DocObjHTMLDocument2_put_onafterupdate, + DocObjHTMLDocument2_get_onafterupdate, + DocObjHTMLDocument2_put_onrowexit, + DocObjHTMLDocument2_get_onrowexit, + DocObjHTMLDocument2_put_onrowenter, + DocObjHTMLDocument2_get_onrowenter, + DocObjHTMLDocument2_put_ondragstart, + DocObjHTMLDocument2_get_ondragstart, + DocObjHTMLDocument2_put_onselectstart, + DocObjHTMLDocument2_get_onselectstart, + DocObjHTMLDocument2_elementFromPoint, + DocObjHTMLDocument2_get_parentWindow, + DocObjHTMLDocument2_get_styleSheets, + DocObjHTMLDocument2_put_onbeforeupdate, + DocObjHTMLDocument2_get_onbeforeupdate, + DocObjHTMLDocument2_put_onerrorupdate, + DocObjHTMLDocument2_get_onerrorupdate, + DocObjHTMLDocument2_toString, + DocObjHTMLDocument2_createStyleSheet };
static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) @@ -2602,7 +3140,7 @@ static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface if(FAILED(hres)) return hres;
- *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface; + *ppNewDoc = &docnode->IHTMLDocument2_iface; return S_OK; }
@@ -3756,7 +4294,7 @@ static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bs
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem);
- return IHTMLDocument2_createElement(&This->IHTMLDocument2_iface, bstrTag, newElem); + return IHTMLDocument2_createElement(&This->doc_node->IHTMLDocument2_iface, bstrTag, newElem); }
static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute) @@ -3831,7 +4369,7 @@ static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementC
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument2_get_all(&This->IHTMLDocument2_iface, p); + return IHTMLDocument2_get_all(&This->doc_node->IHTMLDocument2_iface, p); }
static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p) @@ -4478,7 +5016,7 @@ static HRESULT WINAPI HTMLDocument7_get_body(IHTMLDocument7 *iface, IHTMLElement
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument2_get_body(&This->IHTMLDocument2_iface, p); + return IHTMLDocument2_get_body(&This->doc_node->IHTMLDocument2_iface, p); }
static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement **p) @@ -4841,7 +5379,7 @@ static const IDocumentEventVtbl DocNodeDocumentEventVtbl = {
static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) { - HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, basedoc.IHTMLDocument2_iface); + HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, IHTMLDocument2_iface);
if(This->basedoc.window) update_doc_cp_events(This, cp); @@ -6038,16 +6576,10 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) { *ppv = NULL;
- if(IsEqualGUID(&IID_IUnknown, riid)) - *ppv = &This->IHTMLDocument2_iface; - else if(IsEqualGUID(&IID_IDispatch, riid)) + if(IsEqualGUID(&IID_IDispatch, riid)) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument, riid)) - *ppv = &This->IHTMLDocument2_iface; - else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) - *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) @@ -6058,8 +6590,6 @@ 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(&DIID_DispHTMLDocument, riid)) - *ppv = &This->IHTMLDocument2_iface; else return FALSE;
@@ -6081,7 +6611,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; @@ -6107,10 +6636,16 @@ 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_IDocumentSelector, riid)) + if(IsEqualGUID(&IID_IUnknown, riid)) + *ppv = &This->IHTMLDocument2_iface; + else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) + *ppv = &This->IHTMLDocument2_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)) @@ -6569,6 +7104,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo return NULL;
doc->ref = 1; + doc->IHTMLDocument2_iface.lpVtbl = &DocNodeHTMLDocument2Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocNodeDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocNodeDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocNodeSupportErrorInfoVtbl; @@ -6585,7 +7121,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface, &doc->node.event_target.dispex.IDispatchEx_iface); - ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->basedoc.IHTMLDocument2_iface, HTMLDocumentNode_cpc); + ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); HTMLDocumentNode_Persist_Init(doc); HTMLDocumentNode_Service_Init(doc); HTMLDocumentNode_OleCmd_Init(doc); @@ -6698,12 +7234,16 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IUnknown_inner; }else if(htmldoc_qi(&This->basedoc, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) { + *ppv = &This->IHTMLDocument2_iface; }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(&DIID_DispHTMLDocument, riid)) { + *ppv = &This->IHTMLDocument2_iface; }else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) { *ppv = &This->ISupportErrorInfo_iface; }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) { @@ -7006,6 +7546,7 @@ 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->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 856f55da6c7..4a8ba9cc855 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1811,7 +1811,7 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch ** if(This->node.vtbl->get_document) return This->node.vtbl->get_document(&This->node, p);
- *p = (IDispatch*)&This->node.doc->basedoc.IHTMLDocument2_iface; + *p = (IDispatch*)&This->node.doc->IHTMLDocument2_iface; IDispatch_AddRef(*p); return S_OK; } diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 985ac13cc2f..707de8eebaa 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -655,7 +655,7 @@ static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR return E_FAIL; }
- return IHTMLDocument2_get_readyState(&This->content_window->base.inner_window->doc->basedoc.IHTMLDocument2_iface, p); + return IHTMLDocument2_get_readyState(&This->content_window->base.inner_window->doc->IHTMLDocument2_iface, p); }
static HRESULT WINAPI HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL v) @@ -919,7 +919,7 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p) return S_OK; }
- *p = (IDispatch*)&This->framebase.content_window->base.inner_window->doc->basedoc.IHTMLDocument2_iface; + *p = (IDispatch*)&This->framebase.content_window->base.inner_window->doc->IHTMLDocument2_iface; IDispatch_AddRef(*p); return S_OK; } @@ -1512,7 +1512,7 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p) return S_OK; }
- *p = (IDispatch*)&This->framebase.content_window->base.inner_window->doc->basedoc.IHTMLDocument2_iface; + *p = (IDispatch*)&This->framebase.content_window->base.inner_window->doc->IHTMLDocument2_iface; IDispatch_AddRef(*p); return S_OK; } diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index e1b8e0aca7c..2e04c2fa94a 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1147,7 +1147,7 @@ static HRESULT WINAPI HTMLDOMNode2_get_ownerDocument(IHTMLDOMNode2 *iface, IDisp if(This == &This->doc->node) { *p = NULL; }else { - *p = (IDispatch*)&This->doc->basedoc.IHTMLDocument2_iface; + *p = (IDispatch*)&This->doc->IHTMLDocument2_iface; IDispatch_AddRef(*p); } return S_OK; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index bdfcaca729c..9a4df87b529 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1256,7 +1256,7 @@ static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocumen
if(This->inner_window->doc) { /* FIXME: We should return a wrapper object here */ - *p = &This->inner_window->doc->basedoc.IHTMLDocument2_iface; + *p = &This->inner_window->doc->IHTMLDocument2_iface; IHTMLDocument2_AddRef(*p); }else { *p = NULL; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index cfbb1a2bfbc..9ce987edef0 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; @@ -677,6 +676,7 @@ struct HTMLDocumentObj { DispatchEx dispex; IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; + IHTMLDocument2 IHTMLDocument2_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -896,6 +896,7 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IHTMLDocument2 IHTMLDocument2_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 44211a6e0f2..6f0ca73a778 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -674,7 +674,7 @@ static HRESULT WINAPI ASServiceProvider_QueryService(IServiceProvider *iface, RE if(!This->window || !This->window->doc) return E_NOINTERFACE;
- return IHTMLDocument2_QueryInterface(&This->window->doc->basedoc.IHTMLDocument2_iface, riid, ppv); + return IHTMLDocument2_QueryInterface(&This->window->doc->IHTMLDocument2_iface, riid, ppv); }
FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv); diff --git a/dlls/mshtml/service.c b/dlls/mshtml/service.c index 8f0fa0f691f..d909217fb4e 100644 --- a/dlls/mshtml/service.c +++ b/dlls/mshtml/service.c @@ -362,7 +362,7 @@ static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *ifac
if(IsEqualGUID(&SID_SContainerDispatch, guidService)) { TRACE("SID_SContainerDispatch\n"); - return IHTMLDocument2_QueryInterface(&This->basedoc.IHTMLDocument2_iface, riid, ppv); + return IHTMLDocument2_QueryInterface(&This->IHTMLDocument2_iface, riid, ppv); }
return IServiceProvider_QueryService(&This->basedoc.doc_obj->IServiceProvider_iface, guidService, riid, ppv); @@ -422,7 +422,7 @@ static HRESULT WINAPI DocObjServiceProvider_QueryService(IServiceProvider *iface
if(IsEqualGUID(&SID_SContainerDispatch, guidService)) { TRACE("SID_SContainerDispatch\n"); - return IHTMLDocument2_QueryInterface(&This->basedoc.IHTMLDocument2_iface, riid, ppv); + return IHTMLDocument2_QueryInterface(&This->IHTMLDocument2_iface, riid, ppv); }
if(IsEqualGUID(&IID_IWindowForBindingUI, guidService)) { diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index b66d6653ee0..96d3372174e 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -473,7 +473,7 @@ static HRESULT WINAPI OleDocumentView_GetDocument(IOleDocumentView *iface, IUnkn if(!ppunk) return E_INVALIDARG;
- *ppunk = (IUnknown*)&This->basedoc.IHTMLDocument2_iface; + *ppunk = (IUnknown*)&This->IHTMLDocument2_iface; IUnknown_AddRef(*ppunk); return S_OK; }