This should move all of the remaining interfaces out of basedoc, except for IDispatchEx (and some fields will still remain); those will be for next MR.
Because all of the remaining interfaces are in the `htmldoc.c` file, and they typically tend to just forward to the HTMLDocumentNode, I'm using some macros inspired by the HTMLWINDOW7_ONEVENT_PROPERTY_* in `htmlwindow.c` to reduce duplication. The ones that are exceptions are implemented normally without macros.
The first commit converts all of the non-IHTMLDocument* interfaces because most of the methods are FIXMEs/unimplemented, so splitting it up isn't worth it.
-- v3: mshtml: Move the IHTMLDocument7 interface out of basedoc. mshtml: Move the IHTMLDocument6 interface out of basedoc. mshtml: Move the IHTMLDocument5 interface out of basedoc. mshtml: Move the IHTMLDocument4 interface out of basedoc. mshtml: Move the IHTMLDocument3 interface out of basedoc. mshtml: Move the IHTMLDocument2 interface out of basedoc. mshtml: Move the remaining non-IHTMLDocument* interfaces out of basedoc. mshtml: Move HTMLDocumentObj implementation to oleobj.c.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 363 +---------------------------------- dlls/mshtml/mshtml_private.h | 4 +- dlls/mshtml/oleobj.c | 350 ++++++++++++++++++++++++++++++++- 3 files changed, 361 insertions(+), 356 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 57e922834d6..3d94128a3e6 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1065,16 +1065,6 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca return IHTMLWindow2_get_location(&This->window->base.IHTMLWindow2_iface, p); }
-static HRESULT IHTMLDocument2_location_hook(HTMLDocument *doc, WORD flags, DISPPARAMS *dp, VARIANT *res, - EXCEPINFO *ei, IServiceProvider *caller) -{ - if(!(flags & DISPATCH_PROPERTYPUT) || !doc->window) - return S_FALSE; - - return IDispatchEx_InvokeEx(&doc->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, - 0, flags, dp, res, ei, caller); -} - static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p) { HTMLDocument *This = impl_from_IHTMLDocument2(iface); @@ -5585,7 +5575,7 @@ static const IDocumentRangeVtbl DocumentRangeVtbl = { DocumentRange_createRange, };
-static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) +BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) { *ppv = NULL;
@@ -5666,7 +5656,7 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = { {NULL} };
-static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) +void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; @@ -6036,7 +6026,13 @@ static IHTMLEventObj *HTMLDocumentNode_set_current_event(DispatchEx *dispex, IHT static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { - return IHTMLDocument2_location_hook(&impl_from_DispatchEx(dispex)->basedoc, flags, dp, res, ei, caller); + HTMLDocumentNode *This = impl_from_DispatchEx(dispex); + + if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + return S_FALSE; + + return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + 0, flags, dp, res, ei, caller); }
static const event_target_vtbl_t HTMLDocumentNode_event_target_vtbl = { @@ -6227,344 +6223,3 @@ HRESULT get_document_node(nsIDOMDocument *dom_document, HTMLDocumentNode **ret) *ret = impl_from_HTMLDOMNode(node); return S_OK; } - -static inline HTMLDocumentObj *impl_from_IUnknown(IUnknown *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocumentObj, IUnknown_inner); -} - -static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) -{ - HTMLDocumentObj *This = impl_from_IUnknown(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); - - if(IsEqualGUID(&IID_IUnknown, riid)) { - *ppv = &This->IUnknown_inner; - }else if(htmldoc_qi(&This->basedoc, riid, ppv)) { - return *ppv ? S_OK : E_NOINTERFACE; - }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { - *ppv = &This->ICustomDoc_iface; - }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) { - *ppv = &This->IOleDocumentView_iface; - }else if(IsEqualGUID(&IID_IViewObject, riid)) { - *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IViewObject2, riid)) { - *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) { - *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IPersist, riid)) { - *ppv = &This->IPersistFile_iface; - }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) { - *ppv = &This->IPersistMoniker_iface; - }else if(IsEqualGUID(&IID_IPersistFile, riid)) { - *ppv = &This->IPersistFile_iface; - }else if(IsEqualGUID(&IID_IMonikerProp, riid)) { - *ppv = &This->IMonikerProp_iface; - }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { - *ppv = &This->IPersistStreamInit_iface; - }else if(IsEqualGUID(&IID_IPersistHistory, riid)) { - *ppv = &This->IPersistHistory_iface; - }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) { - *ppv = &This->IHlinkTarget_iface; - }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { - *ppv = &This->IOleCommandTarget_iface; - }else if(IsEqualGUID(&IID_IOleObject, riid)) { - *ppv = &This->IOleObject_iface; - }else if(IsEqualGUID(&IID_IOleDocument, riid)) { - *ppv = &This->IOleDocument_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { - *ppv = &This->IOleInPlaceActiveObject_iface; - }else if(IsEqualGUID(&IID_IOleWindow, riid)) { - *ppv = &This->IOleInPlaceActiveObject_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) { - *ppv = &This->IOleInPlaceObjectWindowless_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) { - *ppv = &This->IOleInPlaceObjectWindowless_iface; - }else if(IsEqualGUID(&IID_IOleControl, riid)) { - *ppv = &This->IOleControl_iface; - }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) { - *ppv = &This->IObjectWithSite_iface; - }else if(IsEqualGUID(&IID_IOleContainer, riid)) { - *ppv = &This->IOleContainer_iface; - }else if(IsEqualGUID(&IID_IObjectSafety, riid)) { - *ppv = &This->IObjectSafety_iface; - }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { - *ppv = &This->IServiceProvider_iface; - }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { - *ppv = &This->ITargetContainer_iface; - }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { - *ppv = &This->cp_container.IConnectionPointContainer_iface; - }else if(dispex_query_interface(&This->dispex, riid, ppv)) { - return *ppv ? S_OK : E_NOINTERFACE; - }else { - FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid)); - *ppv = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; -} - -static ULONG WINAPI HTMLDocumentObj_AddRef(IUnknown *iface) -{ - HTMLDocumentObj *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE("(%p) ref = %lu\n", This, ref); - - return ref; -} - -static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) -{ - HTMLDocumentObj *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref = %lu\n", This, ref); - - if(!ref) { - if(This->basedoc.doc_node) { - This->basedoc.doc_node->basedoc.doc_obj = NULL; - htmldoc_release(&This->basedoc.doc_node->basedoc); - } - if(This->basedoc.window) - IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface); - if(This->advise_holder) - IOleAdviseHolder_Release(This->advise_holder); - - if(This->view_sink) - IAdviseSink_Release(This->view_sink); - if(This->client) - IOleObject_SetClientSite(&This->IOleObject_iface, NULL); - if(This->hostui) - ICustomDoc_SetUIHandler(&This->ICustomDoc_iface, NULL); - if(This->in_place_active) - IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface); - if(This->ipsite) - IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, NULL); - if(This->undomgr) - IOleUndoManager_Release(This->undomgr); - if(This->editsvcs) - IHTMLEditServices_Release(This->editsvcs); - if(This->tooltips_hwnd) - DestroyWindow(This->tooltips_hwnd); - - if(This->hwnd) - DestroyWindow(This->hwnd); - heap_free(This->mime); - - remove_target_tasks(This->task_magic); - ConnectionPointContainer_Destroy(&This->cp_container); - release_dispex(&This->dispex); - - if(This->nscontainer) - detach_gecko_browser(This->nscontainer); - heap_free(This); - } - - return ref; -} - -static const IUnknownVtbl HTMLDocumentObjVtbl = { - HTMLDocumentObj_QueryInterface, - HTMLDocumentObj_AddRef, - HTMLDocumentObj_Release -}; - -/********************************************************** - * ICustomDoc implementation - */ - -static inline HTMLDocumentObj *impl_from_ICustomDoc(ICustomDoc *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocumentObj, ICustomDoc_iface); -} - -static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv) -{ - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); - - return htmldoc_query_interface(&This->basedoc, riid, ppv); -} - -static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) -{ - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); - - return htmldoc_addref(&This->basedoc); -} - -static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) -{ - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); - - return htmldoc_release(&This->basedoc); -} - -static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler) -{ - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); - IOleCommandTarget *cmdtrg; - HRESULT hres; - - TRACE("(%p)->(%p)\n", This, pUIHandler); - - if(This->custom_hostui && This->hostui == pUIHandler) - return S_OK; - - This->custom_hostui = TRUE; - - if(This->hostui) - IDocHostUIHandler_Release(This->hostui); - if(pUIHandler) - IDocHostUIHandler_AddRef(pUIHandler); - This->hostui = pUIHandler; - if(!pUIHandler) - return S_OK; - - hres = IDocHostUIHandler_QueryInterface(pUIHandler, &IID_IOleCommandTarget, (void**)&cmdtrg); - if(SUCCEEDED(hres)) { - FIXME("custom UI handler supports IOleCommandTarget\n"); - IOleCommandTarget_Release(cmdtrg); - } - - return S_OK; -} - -static const ICustomDocVtbl CustomDocVtbl = { - CustomDoc_QueryInterface, - CustomDoc_AddRef, - CustomDoc_Release, - CustomDoc_SetUIHandler -}; - -static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) -{ - HTMLDocumentObj *This = impl_from_IUnknown(iface); - - if(This->basedoc.window && This->basedoc.doc_node) - update_doc_cp_events(This->basedoc.doc_node, cp); -} - -static cp_static_data_t HTMLDocumentObjEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentObj_on_advise }; -static cp_static_data_t HTMLDocumentObjEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocumentObj_on_advise, TRUE }; - -static const cpc_entry_t HTMLDocumentObj_cpc[] = { - {&IID_IDispatch, &HTMLDocumentObjEvents_data}, - {&IID_IPropertyNotifySink}, - {&DIID_HTMLDocumentEvents, &HTMLDocumentObjEvents_data}, - {&DIID_HTMLDocumentEvents2, &HTMLDocumentObjEvents2_data}, - {NULL} -}; - -static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DISPPARAMS *dp, VARIANT *res, - EXCEPINFO *ei, IServiceProvider *caller) -{ - return IHTMLDocument2_location_hook(&CONTAINING_RECORD(dispex, HTMLDocumentObj, dispex)->basedoc, flags, dp, res, ei, caller); -} - -static const tid_t HTMLDocumentObj_iface_tids[] = { - IHTMLDocument3_tid, - IHTMLDocument4_tid, - IHTMLDocument5_tid, - 0 -}; - -static void HTMLDocumentObj_init_dispex_info(dispex_data_t *info, compat_mode_t mode) -{ - static const dispex_hook_t document2_hooks[] = { - {DISPID_IHTMLDOCUMENT2_URL, NULL, L"URL"}, - {DISPID_IHTMLDOCUMENT2_LOCATION, HTMLDocumentObj_location_hook}, - {DISPID_UNKNOWN} - }; - dispex_info_add_interface(info, IHTMLDocument2_tid, document2_hooks); -} - -static dispex_static_data_t HTMLDocumentObj_dispex = { - L"HTMLDocumentObj", - NULL, - DispHTMLDocument_tid, - HTMLDocumentObj_iface_tids, - HTMLDocumentObj_init_dispex_info -}; - -static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID riid, void **ppv) -{ - HTMLDocumentObj *doc; - HRESULT hres; - - if(outer && !IsEqualGUID(&IID_IUnknown, riid)) { - *ppv = NULL; - return E_INVALIDARG; - } - - /* ensure that security manager is initialized */ - if(!get_security_manager()) - return E_OUTOFMEMORY; - - doc = heap_alloc_zero(sizeof(HTMLDocumentObj)); - if(!doc) - return E_OUTOFMEMORY; - - doc->ref = 1; - doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; - doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; - - doc->basedoc.doc_obj = doc; - - init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); - init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); - ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); - HTMLDocumentObj_Persist_Init(doc); - HTMLDocumentObj_Service_Init(doc); - HTMLDocumentObj_OleCmd_Init(doc); - HTMLDocumentObj_OleObj_Init(doc); - TargetContainer_Init(doc); - doc->is_mhtml = is_mhtml; - - doc->task_magic = get_task_target_magic(); - - HTMLDocument_View_Init(doc); - - hres = create_gecko_browser(doc, &doc->nscontainer); - if(FAILED(hres)) { - ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n"); - htmldoc_release(&doc->basedoc); - return hres; - } - - if(IsEqualGUID(&IID_IUnknown, riid)) { - *ppv = &doc->IUnknown_inner; - }else { - hres = htmldoc_query_interface(&doc->basedoc, riid, ppv); - htmldoc_release(&doc->basedoc); - if(FAILED(hres)) - return hres; - } - - doc->basedoc.window = doc->nscontainer->content_window; - IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); - - if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) { - doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc; - htmldoc_addref(&doc->basedoc.doc_node->basedoc); - } - - get_thread_hwnd(); - - return S_OK; -} - -HRESULT HTMLDocument_Create(IUnknown *outer, REFIID riid, void **ppv) -{ - TRACE("(%p %s %p)\n", outer, debugstr_mshtml_guid(riid), ppv); - return create_document_object(FALSE, outer, riid, ppv); -} - -HRESULT MHTMLDocument_Create(IUnknown *outer, REFIID riid, void **ppv) -{ - TRACE("(%p %s %p)\n", outer, debugstr_mshtml_guid(riid), ppv); - return create_document_object(TRUE, outer, riid, ppv); -} diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6b3310e55ab..a2c0a05309b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -680,6 +680,9 @@ static inline ULONG htmldoc_release(HTMLDocument *This) return IUnknown_Release(This->outer_unk); }
+BOOL htmldoc_qi(HTMLDocument*,REFIID,void**) DECLSPEC_HIDDEN; +void init_doc(HTMLDocument*,IUnknown*,IDispatchEx*) DECLSPEC_HIDDEN; + struct HTMLDocumentObj { HTMLDocument basedoc; DispatchEx dispex; @@ -982,7 +985,6 @@ void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Persist_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_Service_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void HTMLDocumentObj_OleCmd_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; -void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN; void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void HTMLDocumentNode_Persist_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index a9bd8a3d558..a32eed92d13 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -33,6 +33,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -2109,7 +2110,7 @@ void HTMLDocumentNode_OleObj_Init(HTMLDocumentNode *This) This->basedoc.doc_obj->extent.cy = 1; }
-void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) +static void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) { This->IOleObject_iface.lpVtbl = &DocObjOleObjectVtbl; This->IOleDocument_iface.lpVtbl = &DocObjOleDocumentVtbl; @@ -2122,3 +2123,350 @@ void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) This->extent.cx = 1; This->extent.cy = 1; } + +static inline HTMLDocumentObj *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IUnknown_inner); +} + +static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = impl_from_IUnknown(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &This->IUnknown_inner; + }else if(htmldoc_qi(&This->basedoc, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; + }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { + *ppv = &This->ICustomDoc_iface; + }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) { + *ppv = &This->IOleDocumentView_iface; + }else if(IsEqualGUID(&IID_IViewObject, riid)) { + *ppv = &This->IViewObjectEx_iface; + }else if(IsEqualGUID(&IID_IViewObject2, riid)) { + *ppv = &This->IViewObjectEx_iface; + }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) { + *ppv = &This->IViewObjectEx_iface; + }else if(IsEqualGUID(&IID_IPersist, riid)) { + *ppv = &This->IPersistFile_iface; + }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) { + *ppv = &This->IPersistMoniker_iface; + }else if(IsEqualGUID(&IID_IPersistFile, riid)) { + *ppv = &This->IPersistFile_iface; + }else if(IsEqualGUID(&IID_IMonikerProp, riid)) { + *ppv = &This->IMonikerProp_iface; + }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { + *ppv = &This->IPersistStreamInit_iface; + }else if(IsEqualGUID(&IID_IPersistHistory, riid)) { + *ppv = &This->IPersistHistory_iface; + }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) { + *ppv = &This->IHlinkTarget_iface; + }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { + *ppv = &This->IOleCommandTarget_iface; + }else if(IsEqualGUID(&IID_IOleObject, riid)) { + *ppv = &This->IOleObject_iface; + }else if(IsEqualGUID(&IID_IOleDocument, riid)) { + *ppv = &This->IOleDocument_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { + *ppv = &This->IOleInPlaceActiveObject_iface; + }else if(IsEqualGUID(&IID_IOleWindow, riid)) { + *ppv = &This->IOleInPlaceActiveObject_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) { + *ppv = &This->IOleInPlaceObjectWindowless_iface; + }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) { + *ppv = &This->IOleInPlaceObjectWindowless_iface; + }else if(IsEqualGUID(&IID_IOleControl, riid)) { + *ppv = &This->IOleControl_iface; + }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) { + *ppv = &This->IObjectWithSite_iface; + }else if(IsEqualGUID(&IID_IOleContainer, riid)) { + *ppv = &This->IOleContainer_iface; + }else if(IsEqualGUID(&IID_IObjectSafety, riid)) { + *ppv = &This->IObjectSafety_iface; + }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { + *ppv = &This->IServiceProvider_iface; + }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { + *ppv = &This->ITargetContainer_iface; + }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { + *ppv = &This->cp_container.IConnectionPointContainer_iface; + }else if(dispex_query_interface(&This->dispex, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; + }else { + FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI HTMLDocumentObj_AddRef(IUnknown *iface) +{ + HTMLDocumentObj *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref = %lu\n", This, ref); + + return ref; +} + +static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) +{ + HTMLDocumentObj *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref = %lu\n", This, ref); + + if(!ref) { + if(This->basedoc.doc_node) { + This->basedoc.doc_node->basedoc.doc_obj = NULL; + htmldoc_release(&This->basedoc.doc_node->basedoc); + } + if(This->basedoc.window) + IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface); + if(This->advise_holder) + IOleAdviseHolder_Release(This->advise_holder); + + if(This->view_sink) + IAdviseSink_Release(This->view_sink); + if(This->client) + IOleObject_SetClientSite(&This->IOleObject_iface, NULL); + if(This->hostui) + ICustomDoc_SetUIHandler(&This->ICustomDoc_iface, NULL); + if(This->in_place_active) + IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface); + if(This->ipsite) + IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, NULL); + if(This->undomgr) + IOleUndoManager_Release(This->undomgr); + if(This->editsvcs) + IHTMLEditServices_Release(This->editsvcs); + if(This->tooltips_hwnd) + DestroyWindow(This->tooltips_hwnd); + + if(This->hwnd) + DestroyWindow(This->hwnd); + heap_free(This->mime); + + remove_target_tasks(This->task_magic); + ConnectionPointContainer_Destroy(&This->cp_container); + release_dispex(&This->dispex); + + if(This->nscontainer) + detach_gecko_browser(This->nscontainer); + heap_free(This); + } + + return ref; +} + +static const IUnknownVtbl HTMLDocumentObjVtbl = { + HTMLDocumentObj_QueryInterface, + HTMLDocumentObj_AddRef, + HTMLDocumentObj_Release +}; + +/********************************************************** + * ICustomDoc implementation + */ + +static inline HTMLDocumentObj *impl_from_ICustomDoc(ICustomDoc *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, ICustomDoc_iface); +} + +static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_release(&This->basedoc); +} + +static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + IOleCommandTarget *cmdtrg; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, pUIHandler); + + if(This->custom_hostui && This->hostui == pUIHandler) + return S_OK; + + This->custom_hostui = TRUE; + + if(This->hostui) + IDocHostUIHandler_Release(This->hostui); + if(pUIHandler) + IDocHostUIHandler_AddRef(pUIHandler); + This->hostui = pUIHandler; + if(!pUIHandler) + return S_OK; + + hres = IDocHostUIHandler_QueryInterface(pUIHandler, &IID_IOleCommandTarget, (void**)&cmdtrg); + if(SUCCEEDED(hres)) { + FIXME("custom UI handler supports IOleCommandTarget\n"); + IOleCommandTarget_Release(cmdtrg); + } + + return S_OK; +} + +static const ICustomDocVtbl CustomDocVtbl = { + CustomDoc_QueryInterface, + CustomDoc_AddRef, + CustomDoc_Release, + CustomDoc_SetUIHandler +}; + +static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) +{ + HTMLDocumentObj *This = impl_from_IUnknown(iface); + + if(This->basedoc.window && This->basedoc.doc_node) + update_doc_cp_events(This->basedoc.doc_node, cp); +} + +static cp_static_data_t HTMLDocumentObjEvents_data = { HTMLDocumentEvents_tid, HTMLDocumentObj_on_advise }; +static cp_static_data_t HTMLDocumentObjEvents2_data = { HTMLDocumentEvents2_tid, HTMLDocumentObj_on_advise, TRUE }; + +static const cpc_entry_t HTMLDocumentObj_cpc[] = { + {&IID_IDispatch, &HTMLDocumentObjEvents_data}, + {&IID_IPropertyNotifySink}, + {&DIID_HTMLDocumentEvents, &HTMLDocumentObjEvents_data}, + {&DIID_HTMLDocumentEvents2, &HTMLDocumentObjEvents2_data}, + {NULL} +}; + +static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DISPPARAMS *dp, VARIANT *res, + EXCEPINFO *ei, IServiceProvider *caller) +{ + HTMLDocumentObj *This = CONTAINING_RECORD(dispex, HTMLDocumentObj, dispex); + + if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + return S_FALSE; + + return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + 0, flags, dp, res, ei, caller); +} + +static const tid_t HTMLDocumentObj_iface_tids[] = { + IHTMLDocument3_tid, + IHTMLDocument4_tid, + IHTMLDocument5_tid, + 0 +}; + +static void HTMLDocumentObj_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + static const dispex_hook_t document2_hooks[] = { + {DISPID_IHTMLDOCUMENT2_URL, NULL, L"URL"}, + {DISPID_IHTMLDOCUMENT2_LOCATION, HTMLDocumentObj_location_hook}, + {DISPID_UNKNOWN} + }; + dispex_info_add_interface(info, IHTMLDocument2_tid, document2_hooks); +} + +static dispex_static_data_t HTMLDocumentObj_dispex = { + L"HTMLDocumentObj", + NULL, + DispHTMLDocument_tid, + HTMLDocumentObj_iface_tids, + HTMLDocumentObj_init_dispex_info +}; + +static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID riid, void **ppv) +{ + HTMLDocumentObj *doc; + HRESULT hres; + + if(outer && !IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = NULL; + return E_INVALIDARG; + } + + /* ensure that security manager is initialized */ + if(!get_security_manager()) + return E_OUTOFMEMORY; + + doc = heap_alloc_zero(sizeof(HTMLDocumentObj)); + if(!doc) + return E_OUTOFMEMORY; + + doc->ref = 1; + doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; + doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; + + doc->basedoc.doc_obj = doc; + + init_dispatch(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex, COMPAT_MODE_QUIRKS); + init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_inner, &doc->dispex.IDispatchEx_iface); + ConnectionPointContainer_Init(&doc->cp_container, &doc->IUnknown_inner, HTMLDocumentObj_cpc); + HTMLDocumentObj_Persist_Init(doc); + HTMLDocumentObj_Service_Init(doc); + HTMLDocumentObj_OleCmd_Init(doc); + HTMLDocumentObj_OleObj_Init(doc); + TargetContainer_Init(doc); + doc->is_mhtml = is_mhtml; + + doc->task_magic = get_task_target_magic(); + + HTMLDocument_View_Init(doc); + + hres = create_gecko_browser(doc, &doc->nscontainer); + if(FAILED(hres)) { + ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n"); + htmldoc_release(&doc->basedoc); + return hres; + } + + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &doc->IUnknown_inner; + }else { + hres = htmldoc_query_interface(&doc->basedoc, riid, ppv); + htmldoc_release(&doc->basedoc); + if(FAILED(hres)) + return hres; + } + + doc->basedoc.window = doc->nscontainer->content_window; + IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); + + if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) { + doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc; + htmldoc_addref(&doc->basedoc.doc_node->basedoc); + } + + get_thread_hwnd(); + + return S_OK; +} + +HRESULT HTMLDocument_Create(IUnknown *outer, REFIID riid, void **ppv) +{ + TRACE("(%p %s %p)\n", outer, debugstr_mshtml_guid(riid), ppv); + return create_document_object(FALSE, outer, riid, ppv); +} + +HRESULT MHTMLDocument_Create(IUnknown *outer, REFIID riid, void **ppv) +{ + TRACE("(%p %s %p)\n", outer, debugstr_mshtml_guid(riid), ppv); + return create_document_object(TRUE, outer, riid, ppv); +}
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 366 ++++++++++++++++++----------------- dlls/mshtml/mshtml_private.h | 24 ++- dlls/mshtml/oleobj.c | 360 ++++++++++++++++++++++++++++++++++ 3 files changed, 562 insertions(+), 188 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 3d94128a3e6..8318c73fb8f 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4569,61 +4569,61 @@ static const IHTMLDocument7Vtbl HTMLDocument7Vtbl = { HTMLDocument7_get_head };
-static inline HTMLDocument *impl_from_IDocumentSelector(IDocumentSelector *iface) +static inline HTMLDocumentNode *impl_from_IDocumentSelector(IDocumentSelector *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentSelector_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentSelector_iface); }
static HRESULT WINAPI DocumentSelector_QueryInterface(IDocumentSelector *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI DocumentSelector_AddRef(IDocumentSelector *iface) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI DocumentSelector_Release(IDocumentSelector *iface) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI DocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentSelector_GetTypeInfo(IDocumentSelector *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentSelector_GetIDsOfNames(IDocumentSelector *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI DocumentSelector_Invoke(IDocumentSelector *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, BSTR v, IHTMLElement **pel) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); nsIDOMElement *nselem; HTMLElement *elem; nsAString nsstr; @@ -4633,7 +4633,7 @@ static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, B TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMHTMLDocument_QuerySelector(This->doc_node->nsdoc, &nsstr, &nselem); + nsres = nsIDOMHTMLDocument_QuerySelector(This->nsdoc, &nsstr, &nselem); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { ERR("QuerySelector failed: %08lx\n", nsres); @@ -4656,7 +4656,7 @@ static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, B
static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface, BSTR v, IHTMLDOMChildrenCollection **pel) { - HTMLDocument *This = impl_from_IDocumentSelector(iface); + HTMLDocumentNode *This = impl_from_IDocumentSelector(iface); nsIDOMNodeList *node_list; nsAString nsstr; HRESULT hres; @@ -4664,14 +4664,14 @@ static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
nsAString_InitDepend(&nsstr, v); - hres = map_nsresult(nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &nsstr, &node_list)); + hres = map_nsresult(nsIDOMHTMLDocument_QuerySelectorAll(This->nsdoc, &nsstr, &node_list)); nsAString_Finish(&nsstr); if(FAILED(hres)) { ERR("QuerySelectorAll failed: %08lx\n", hres); return hres; }
- hres = create_child_collection(node_list, dispex_compat_mode(&This->doc_node->node.event_target.dispex), pel); + hres = create_child_collection(node_list, dispex_compat_mode(&This->node.event_target.dispex), pel); nsIDOMNodeList_Release(node_list); return hres; } @@ -4688,65 +4688,65 @@ static const IDocumentSelectorVtbl DocumentSelectorVtbl = { DocumentSelector_querySelectorAll };
-static inline HTMLDocument *impl_from_IDocumentEvent(IDocumentEvent *iface) +static inline HTMLDocumentNode *impl_from_IDocumentEvent(IDocumentEvent *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentEvent_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentEvent_iface); }
static HRESULT WINAPI DocumentEvent_QueryInterface(IDocumentEvent *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI DocumentEvent_AddRef(IDocumentEvent *iface) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI DocumentEvent_Release(IDocumentEvent *iface) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI DocumentEvent_GetTypeInfoCount(IDocumentEvent *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentEvent_GetTypeInfo(IDocumentEvent *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentEvent_GetIDsOfNames(IDocumentEvent *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI DocumentEvent_Invoke(IDocumentEvent *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI DocumentEvent_createEvent(IDocumentEvent *iface, BSTR eventType, IDOMEvent **p) { - HTMLDocument *This = impl_from_IDocumentEvent(iface); + HTMLDocumentNode *This = impl_from_IDocumentEvent(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eventType), p);
- return create_document_event_str(This->doc_node, eventType, p); + return create_document_event_str(This, eventType, p); }
static const IDocumentEventVtbl DocumentEventVtbl = { @@ -4768,27 +4768,27 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) update_doc_cp_events(This, cp); }
-static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) +static inline HTMLDocumentNode *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, ISupportErrorInfo_iface); }
static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) @@ -5071,47 +5071,47 @@ static const IDispatchExVtbl DocDispatchExVtbl = { DocDispatchEx_GetNameSpaceParent };
-static inline HTMLDocument *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) +static inline HTMLDocumentNode *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IProvideMultipleClassInfo_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface); }
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideMultipleClassInfo *iface) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI ProvideClassInfo_Release(IProvideMultipleClassInfo *iface) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); TRACE("(%p)->(%p)\n", This, ppTI); return get_class_typeinfo(&CLSID_HTMLDocument, ppTI); }
static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%lu %p)\n", This, dwGuidKind, pGUID); return E_NOTIMPL; }
static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%p)\n", This, pcti); *pcti = 1; return S_OK; @@ -5120,7 +5120,7 @@ static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMul static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti, DWORD dwFlags, ITypeInfo **pptiCoClass, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource) { - HTMLDocument *This = impl_from_IProvideMultipleClassInfo(iface); + HTMLDocumentNode *This = impl_from_IProvideMultipleClassInfo(iface); FIXME("(%p)->(%lu %lx %p %p %p %p %p)\n", This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); return E_NOTIMPL; } @@ -5138,32 +5138,32 @@ static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = { /********************************************************** * IMarkupServices implementation */ -static inline HTMLDocument *impl_from_IMarkupServices(IMarkupServices *iface) +static inline HTMLDocumentNode *impl_from_IMarkupServices(IMarkupServices *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IMarkupServices_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IMarkupServices_iface); }
static HRESULT WINAPI MarkupServices_QueryInterface(IMarkupServices *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
static ULONG WINAPI MarkupServices_AddRef(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI MarkupServices_Release(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI MarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface);
TRACE("(%p)->(%p)\n", This, ppPointer);
@@ -5172,7 +5172,7 @@ static HRESULT WINAPI MarkupServices_CreateMarkupPointer(IMarkupServices *iface,
static HRESULT WINAPI MarkupServices_CreateMarkupContainer(IMarkupServices *iface, IMarkupContainer **ppMarkupContainer) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p)\n", This, ppMarkupContainer); return E_NOTIMPL; } @@ -5180,7 +5180,7 @@ static HRESULT WINAPI MarkupServices_CreateMarkupContainer(IMarkupServices *ifac static HRESULT WINAPI MarkupServices_CreateElement(IMarkupServices *iface, ELEMENT_TAG_ID tagID, OLECHAR *pchAttributes, IHTMLElement **ppElement) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%d,%s,%p)\n", This, tagID, debugstr_w(pchAttributes), ppElement); return E_NOTIMPL; } @@ -5188,7 +5188,7 @@ static HRESULT WINAPI MarkupServices_CreateElement(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_CloneElement(IMarkupServices *iface, IHTMLElement *pElemCloneThis, IHTMLElement **ppElementTheClone) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElemCloneThis, ppElementTheClone); return E_NOTIMPL; } @@ -5197,14 +5197,14 @@ static HRESULT WINAPI MarkupServices_InsertElement(IMarkupServices *iface, IHTMLElement *pElementInsert, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pElementInsert, pPointerStart, pPointerFinish); return E_NOTIMPL; }
static HRESULT WINAPI MarkupServices_RemoveElement(IMarkupServices *iface, IHTMLElement *pElementRemove) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p)\n", This, pElementRemove); return E_NOTIMPL; } @@ -5212,7 +5212,7 @@ static HRESULT WINAPI MarkupServices_RemoveElement(IMarkupServices *iface, IHTML static HRESULT WINAPI MarkupServices_Remove(IMarkupServices *iface, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pPointerStart, pPointerFinish); return E_NOTIMPL; } @@ -5221,7 +5221,7 @@ static HRESULT WINAPI MarkupServices_Copy(IMarkupServices *iface, IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); return E_NOTIMPL; } @@ -5230,7 +5230,7 @@ static HRESULT WINAPI MarkupServices_Move(IMarkupServices *iface, IMarkupPointer *pPointerSourceStart, IMarkupPointer *pPointerSourceFinish, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerSourceStart, pPointerSourceFinish, pPointerTarget); return E_NOTIMPL; } @@ -5238,7 +5238,7 @@ static HRESULT WINAPI MarkupServices_Move(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_InsertText(IMarkupServices *iface, OLECHAR *pchText, LONG cch, IMarkupPointer *pPointerTarget) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p)\n", This, debugstr_w(pchText), cch, pPointerTarget); return E_NOTIMPL; } @@ -5247,7 +5247,7 @@ static HRESULT WINAPI MarkupServices_ParseString(IMarkupServices *iface, OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); return E_NOTIMPL; } @@ -5256,7 +5256,7 @@ static HRESULT WINAPI MarkupServices_ParseGlobal(IMarkupServices *iface, HGLOBAL hglobalHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(hglobalHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish); return E_NOTIMPL; } @@ -5264,7 +5264,7 @@ static HRESULT WINAPI MarkupServices_ParseGlobal(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_IsScopedElement(IMarkupServices *iface, IHTMLElement *pElement, BOOL *pfScoped) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElement, pfScoped); return E_NOTIMPL; } @@ -5272,7 +5272,7 @@ static HRESULT WINAPI MarkupServices_IsScopedElement(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_GetElementTagId(IMarkupServices *iface, IHTMLElement *pElement, ELEMENT_TAG_ID *ptagId) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p)\n", This, pElement, ptagId); return E_NOTIMPL; } @@ -5280,7 +5280,7 @@ static HRESULT WINAPI MarkupServices_GetElementTagId(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_GetTagIDForName(IMarkupServices *iface, BSTR bstrName, ELEMENT_TAG_ID *ptagId) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%s,%p)\n", This, debugstr_w(bstrName), ptagId); return E_NOTIMPL; } @@ -5288,7 +5288,7 @@ static HRESULT WINAPI MarkupServices_GetTagIDForName(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_GetNameForTagID(IMarkupServices *iface, ELEMENT_TAG_ID tagId, BSTR *pbstrName) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%d,%p)\n", This, tagId, pbstrName); return E_NOTIMPL; } @@ -5296,7 +5296,7 @@ static HRESULT WINAPI MarkupServices_GetNameForTagID(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_MovePointersToRange(IMarkupServices *iface, IHTMLTxtRange *pIRange, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pIRange, pPointerStart, pPointerFinish); return E_NOTIMPL; } @@ -5304,21 +5304,21 @@ static HRESULT WINAPI MarkupServices_MovePointersToRange(IMarkupServices *iface, static HRESULT WINAPI MarkupServices_MoveRangeToPointers(IMarkupServices *iface, IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish, IHTMLTxtRange *pIRange) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%p,%p,%p)\n", This, pPointerStart, pPointerFinish, pIRange); return E_NOTIMPL; }
static HRESULT WINAPI MarkupServices_BeginUndoUnit(IMarkupServices *iface, OLECHAR *pchTitle) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(pchTitle)); return E_NOTIMPL; }
static HRESULT WINAPI MarkupServices_EndUndoUnit(IMarkupServices *iface) { - HTMLDocument *This = impl_from_IMarkupServices(iface); + HTMLDocumentNode *This = impl_from_IMarkupServices(iface); FIXME("(%p)\n", This); return E_NOTIMPL; } @@ -5352,32 +5352,32 @@ static const IMarkupServicesVtbl MarkupServicesVtbl = { /********************************************************** * IMarkupContainer implementation */ -static inline HTMLDocument *impl_from_IMarkupContainer(IMarkupContainer *iface) +static inline HTMLDocumentNode *impl_from_IMarkupContainer(IMarkupContainer *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IMarkupContainer_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IMarkupContainer_iface); }
static HRESULT WINAPI MarkupContainer_QueryInterface(IMarkupContainer *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
static ULONG WINAPI MarkupContainer_AddRef(IMarkupContainer *iface) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI MarkupContainer_Release(IMarkupContainer *iface) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI MarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) { - HTMLDocument *This = impl_from_IMarkupContainer(iface); + HTMLDocumentNode *This = impl_from_IMarkupContainer(iface); FIXME("(%p)->(%p)\n", This, ppDoc); return E_NOTIMPL; } @@ -5392,32 +5392,32 @@ static const IMarkupContainerVtbl MarkupContainerVtbl = { /********************************************************** * IDisplayServices implementation */ -static inline HTMLDocument *impl_from_IDisplayServices(IDisplayServices *iface) +static inline HTMLDocumentNode *impl_from_IDisplayServices(IDisplayServices *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDisplayServices_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDisplayServices_iface); }
static HRESULT WINAPI DisplayServices_QueryInterface(IDisplayServices *iface, REFIID riid, void **ppvObject) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_query_interface(This, riid, ppvObject); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppvObject); }
static ULONG WINAPI DisplayServices_AddRef(IDisplayServices *iface) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI DisplayServices_Release(IDisplayServices *iface) { - HTMLDocument *This = impl_from_IDisplayServices(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI DisplayServices_CreateDisplayPointer(IDisplayServices *iface, IDisplayPointer **ppDispPointer) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%p)\n", This, ppDispPointer); return E_NOTIMPL; } @@ -5425,7 +5425,7 @@ static HRESULT WINAPI DisplayServices_CreateDisplayPointer(IDisplayServices *ifa static HRESULT WINAPI DisplayServices_TransformRect(IDisplayServices *iface, RECT *pRect, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_rect(pRect), eSource, eDestination, pIElement); return E_NOTIMPL; } @@ -5433,14 +5433,14 @@ static HRESULT WINAPI DisplayServices_TransformRect(IDisplayServices *iface, static HRESULT WINAPI DisplayServices_TransformPoint(IDisplayServices *iface, POINT *pPoint, COORD_SYSTEM eSource, COORD_SYSTEM eDestination, IHTMLElement *pIElement) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%s,%d,%d,%p)\n", This, wine_dbgstr_point(pPoint), eSource, eDestination, pIElement); return E_NOTIMPL; }
static HRESULT WINAPI DisplayServices_GetCaret(IDisplayServices *iface, IHTMLCaret **ppCaret) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%p)\n", This, ppCaret); return E_NOTIMPL; } @@ -5448,7 +5448,7 @@ static HRESULT WINAPI DisplayServices_GetCaret(IDisplayServices *iface, IHTMLCar static HRESULT WINAPI DisplayServices_GetComputedStyle(IDisplayServices *iface, IMarkupPointer *pPointer, IHTMLComputedStyle **ppComputedStyle) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%p,%p)\n", This, pPointer, ppComputedStyle); return E_NOTIMPL; } @@ -5456,7 +5456,7 @@ static HRESULT WINAPI DisplayServices_GetComputedStyle(IDisplayServices *iface, static HRESULT WINAPI DisplayServices_ScrollRectIntoView(IDisplayServices *iface, IHTMLElement *pIElement, RECT rect) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%p,%s)\n", This, pIElement, wine_dbgstr_rect(&rect)); return E_NOTIMPL; } @@ -5464,7 +5464,7 @@ static HRESULT WINAPI DisplayServices_ScrollRectIntoView(IDisplayServices *iface static HRESULT WINAPI DisplayServices_HasFlowLayout(IDisplayServices *iface, IHTMLElement *pIElement, BOOL *pfHasFlowLayout) { - HTMLDocument *This = impl_from_IDisplayServices(iface); + HTMLDocumentNode *This = impl_from_IDisplayServices(iface); FIXME("(%p)->(%p,%p)\n", This, pIElement, pfHasFlowLayout); return E_NOTIMPL; } @@ -5485,81 +5485,81 @@ static const IDisplayServicesVtbl DisplayServicesVtbl = { /********************************************************** * IDocumentRange implementation */ -static inline HTMLDocument *impl_from_IDocumentRange(IDocumentRange *iface) +static inline HTMLDocumentNode *impl_from_IDocumentRange(IDocumentRange *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDocumentRange_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IDocumentRange_iface); }
static HRESULT WINAPI DocumentRange_QueryInterface(IDocumentRange *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_query_interface(This, riid, ppv); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI DocumentRange_AddRef(IDocumentRange *iface) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_addref(This); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI DocumentRange_Release(IDocumentRange *iface) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return htmldoc_release(This); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI DocumentRange_GetTypeInfoCount(IDocumentRange *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
static HRESULT WINAPI DocumentRange_GetTypeInfo(IDocumentRange *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI DocumentRange_GetIDsOfNames(IDocumentRange *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI DocumentRange_Invoke(IDocumentRange *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface);
- return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI DocumentRange_createRange(IDocumentRange *iface, IHTMLDOMRange **p) { - HTMLDocument *This = impl_from_IDocumentRange(iface); + HTMLDocumentNode *This = impl_from_IDocumentRange(iface); nsIDOMRange *nsrange; HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- if(NS_FAILED(nsIDOMHTMLDocument_CreateRange(This->doc_node->nsdoc, &nsrange))) + if(NS_FAILED(nsIDOMHTMLDocument_CreateRange(This->nsdoc, &nsrange))) return E_FAIL;
- hres = create_dom_range(nsrange, dispex_compat_mode(&This->doc_node->node.event_target.dispex), p); + hres = create_dom_range(nsrange, dispex_compat_mode(&This->node.event_target.dispex), p); nsIDOMRange_Release(nsrange); return hres; } @@ -5572,7 +5572,7 @@ static const IDocumentRangeVtbl DocumentRangeVtbl = { DocumentRange_GetTypeInfo, DocumentRange_GetIDsOfNames, DocumentRange_Invoke, - DocumentRange_createRange, + DocumentRange_createRange };
BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) @@ -5599,46 +5599,10 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) *ppv = &This->IHTMLDocument7_iface; - else if(IsEqualGUID(&IID_IDocumentSelector, riid)) - *ppv = &This->IDocumentSelector_iface; - else if(IsEqualGUID(&IID_IDocumentEvent, riid)) - *ppv = &This->IDocumentEvent_iface; else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; - else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) - *ppv = &This->ISupportErrorInfo_iface; - else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) - *ppv = &This->IProvideMultipleClassInfo_iface; - else if(IsEqualGUID(&IID_IMarkupServices, riid)) - *ppv = &This->IMarkupServices_iface; - else if(IsEqualGUID(&IID_IMarkupContainer, riid)) - *ppv = &This->IMarkupContainer_iface; - else if(IsEqualGUID(&IID_IDisplayServices, riid)) - *ppv = &This->IDisplayServices_iface; - else if(IsEqualGUID(&IID_IDocumentRange, riid)) - *ppv = &This->IDocumentRange_iface; - else if(IsEqualGUID(&CLSID_CMarkup, riid)) { - FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { - TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { - TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { - TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { - TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); - *ppv = NULL; - }else { + else return FALSE; - }
if(*ppv) IUnknown_AddRef((IUnknown*)*ppv); @@ -5665,14 +5629,6 @@ void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; - doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; - doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; - doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; - doc->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; - doc->IMarkupServices_iface.lpVtbl = &MarkupServicesVtbl; - doc->IMarkupContainer_iface.lpVtbl = &MarkupContainerVtbl; - doc->IDisplayServices_iface.lpVtbl = &DisplayServicesVtbl; - doc->IDocumentRange_iface.lpVtbl = &DocumentRangeVtbl;
doc->outer_unk = outer; doc->dispex = dispex; @@ -5692,8 +5648,26 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) if(htmldoc_qi(&This->basedoc, riid, ppv)) return *ppv ? S_OK : E_NOINTERFACE;
- if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) - *ppv = &This->IInternetHostSecurityManager_iface; + if(IsEqualGUID(&IID_IDocumentSelector, riid)) + *ppv = &This->IDocumentSelector_iface; + else if(IsEqualGUID(&IID_IDocumentEvent, riid)) + *ppv = &This->IDocumentEvent_iface; + else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) + *ppv = &This->ISupportErrorInfo_iface; + else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) + *ppv = &This->IProvideMultipleClassInfo_iface; + else if(IsEqualGUID(&IID_IMarkupServices, riid)) + *ppv = &This->IMarkupServices_iface; + else if(IsEqualGUID(&IID_IMarkupContainer, riid)) + *ppv = &This->IMarkupContainer_iface; + else if(IsEqualGUID(&IID_IDisplayServices, riid)) + *ppv = &This->IDisplayServices_iface; + else if(IsEqualGUID(&IID_IDocumentRange, riid)) + *ppv = &This->IDocumentRange_iface; else if(IsEqualGUID(&IID_IPersist, riid)) *ppv = &This->IPersistFile_iface; else if(IsEqualGUID(&IID_IPersistMoniker, riid)) @@ -5732,10 +5706,33 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IObjectSafety_iface; else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; + else if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) + *ppv = &This->IInternetHostSecurityManager_iface; else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) *ppv = &This->cp_container.IConnectionPointContainer_iface; - else + else if(IsEqualGUID(&CLSID_CMarkup, riid)) { + FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { + TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { + TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { + TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { + TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else { return HTMLDOMNode_QI(&This->node, riid, ppv); + }
IUnknown_AddRef((IUnknown*)*ppv); return S_OK; @@ -6119,6 +6116,15 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo return NULL;
doc->ref = 1; + doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; + doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; + doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; + doc->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; + doc->IMarkupServices_iface.lpVtbl = &MarkupServicesVtbl; + doc->IMarkupContainer_iface.lpVtbl = &MarkupContainerVtbl; + doc->IDisplayServices_iface.lpVtbl = &DisplayServicesVtbl; + doc->IDocumentRange_iface.lpVtbl = &DocumentRangeVtbl; + doc->basedoc.doc_node = doc; doc->basedoc.doc_obj = doc_obj; doc->basedoc.window = window ? window->base.outer_window : NULL; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a2c0a05309b..530eb705400 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -646,15 +646,7 @@ struct HTMLDocument { IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; - IDocumentSelector IDocumentSelector_iface; - IDocumentEvent IDocumentEvent_iface; IDispatchEx IDispatchEx_iface; - ISupportErrorInfo ISupportErrorInfo_iface; - IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; - IMarkupServices IMarkupServices_iface; - IMarkupContainer IMarkupContainer_iface; - IDisplayServices IDisplayServices_iface; - IDocumentRange IDocumentRange_iface;
IUnknown *outer_unk; IDispatchEx *dispex; @@ -688,6 +680,14 @@ struct HTMLDocumentObj { DispatchEx dispex; IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; + IDocumentSelector IDocumentSelector_iface; + IDocumentEvent IDocumentEvent_iface; + ISupportErrorInfo ISupportErrorInfo_iface; + IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IMarkupServices IMarkupServices_iface; + IMarkupContainer IMarkupContainer_iface; + IDisplayServices IDisplayServices_iface; + IDocumentRange IDocumentRange_iface; IOleDocumentView IOleDocumentView_iface; IViewObjectEx IViewObjectEx_iface; IPersistMoniker IPersistMoniker_iface; @@ -899,6 +899,14 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IDocumentSelector IDocumentSelector_iface; + IDocumentEvent IDocumentEvent_iface; + ISupportErrorInfo ISupportErrorInfo_iface; + IProvideMultipleClassInfo IProvideMultipleClassInfo_iface; + IMarkupServices IMarkupServices_iface; + IMarkupContainer IMarkupContainer_iface; + IDisplayServices IDisplayServices_iface; + IDocumentRange IDocumentRange_iface; IPersistMoniker IPersistMoniker_iface; IPersistFile IPersistFile_iface; IMonikerProp IMonikerProp_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index a32eed92d13..1398e085ea5 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2124,6 +2124,318 @@ static void HTMLDocumentObj_OleObj_Init(HTMLDocumentObj *This) This->extent.cy = 1; }
+#define HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(iface) \ +static HRESULT WINAPI DocObj##iface##_QueryInterface(I##iface *_0, REFIID riid, void **ppv) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return htmldoc_query_interface(&This->basedoc, riid, ppv); \ +} \ +static ULONG WINAPI DocObj##iface##_AddRef(I##iface *_0) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return htmldoc_addref(&This->basedoc); \ +} \ +static ULONG WINAPI DocObj##iface##_Release(I##iface *_0) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return htmldoc_release(&This->basedoc); \ +} + +#define HTMLDOCUMENTOBJ_IDISPATCH_METHODS(iface) HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(iface) \ +static HRESULT WINAPI DocObj##iface##_GetTypeInfoCount(I##iface *_0, UINT *pctinfo) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); \ +} \ +static HRESULT WINAPI DocObj##iface##_GetTypeInfo(I##iface *_0, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); \ +} \ +static HRESULT WINAPI DocObj##iface##_GetIDsOfNames(I##iface *_0, REFIID riid, LPOLESTR *rgszNames, UINT cNames, \ + LCID lcid, DISPID *rgDispId) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); \ +} \ +static HRESULT WINAPI DocObj##iface##_Invoke(I##iface *_0, DISPID dispIdMember, REFIID riid, LCID lcid, \ + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); \ +} + +#define HTMLDOCUMENTOBJ_FWD_TO_NODE_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); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1) : E_UNEXPECTED; \ +} + +#define HTMLDOCUMENTOBJ_FWD_TO_NODE_2(iface, method, a,b) static HRESULT WINAPI DocObj##iface##_##method(I##iface *_0, a _1, b _2) \ +{ \ + HTMLDocumentObj *This = CONTAINING_RECORD(_0, HTMLDocumentObj, I##iface##_iface); \ + return This->basedoc.doc_node ? This->basedoc.doc_node->I##iface##_iface.lpVtbl->method(&This->basedoc.doc_node->I##iface##_iface, _1, _2) : E_UNEXPECTED; \ +} + +#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; \ +} + +/********************************************************** + * ISupportErrorInfo implementation + */ +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(SupportErrorInfo) + +static HRESULT WINAPI DocObjSupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) +{ + FIXME("(%p)->(%s)\n", iface, debugstr_mshtml_guid(riid)); + return S_FALSE; +} + +static const ISupportErrorInfoVtbl DocObjSupportErrorInfoVtbl = { + DocObjSupportErrorInfo_QueryInterface, + DocObjSupportErrorInfo_AddRef, + DocObjSupportErrorInfo_Release, + DocObjSupportErrorInfo_InterfaceSupportsErrorInfo +}; + +/********************************************************** + * IProvideMultipleClassInfo implementation + */ +static inline HTMLDocumentObj *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IProvideMultipleClassInfo_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(ProvideMultipleClassInfo) + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI) +{ + HTMLDocumentObj *This = impl_from_IProvideMultipleClassInfo(iface); + TRACE("(%p)->(%p)\n", This, ppTI); + return get_class_typeinfo(&CLSID_HTMLDocument, ppTI); +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID) +{ + HTMLDocumentObj *This = impl_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%lu %p)\n", This, dwGuidKind, pGUID); + return E_NOTIMPL; +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti) +{ + HTMLDocumentObj *This = impl_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%p)\n", This, pcti); + *pcti = 1; + return S_OK; +} + +static HRESULT WINAPI DocObjProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti, + DWORD dwFlags, ITypeInfo **pptiCoClass, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource) +{ + HTMLDocumentObj *This = impl_from_IProvideMultipleClassInfo(iface); + FIXME("(%p)->(%lu %lx %p %p %p %p %p)\n", This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource); + return E_NOTIMPL; +} + +static const IProvideMultipleClassInfoVtbl DocObjProvideMultipleClassInfoVtbl = { + DocObjProvideMultipleClassInfo_QueryInterface, + DocObjProvideMultipleClassInfo_AddRef, + DocObjProvideMultipleClassInfo_Release, + DocObjProvideMultipleClassInfo_GetClassInfo, + DocObjProvideMultipleClassInfo_GetGUID, + DocObjProvideMultipleClassInfo_GetMultiTypeInfoCount, + DocObjProvideMultipleClassInfo_GetInfoOfIndex +}; + +/********************************************************** + * IMarkupServices implementation + */ +static inline HTMLDocumentObj *impl_from_IMarkupServices(IMarkupServices *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IMarkupServices_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(MarkupServices) + +static HRESULT WINAPI DocObjMarkupServices_CreateMarkupPointer(IMarkupServices *iface, IMarkupPointer **ppPointer) +{ + HTMLDocumentObj *This = impl_from_IMarkupServices(iface); + + TRACE("(%p)->(%p)\n", This, ppPointer); + + return create_markup_pointer(ppPointer); +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(MarkupServices, CreateMarkupContainer, IMarkupContainer**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, CreateElement, ELEMENT_TAG_ID,OLECHAR*,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, CloneElement, IHTMLElement*,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, InsertElement, IHTMLElement*,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(MarkupServices, RemoveElement, IHTMLElement*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, Remove, IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, Copy, IMarkupPointer*,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, Move, IMarkupPointer*,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, InsertText, OLECHAR*,LONG,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_5(MarkupServices, ParseString, OLECHAR*,DWORD,IMarkupContainer**,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_5(MarkupServices, ParseGlobal, HGLOBAL,DWORD,IMarkupContainer**,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, IsScopedElement, IHTMLElement*,BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, GetElementTagId, IHTMLElement*,ELEMENT_TAG_ID*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, GetTagIDForName, BSTR,ELEMENT_TAG_ID*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(MarkupServices, GetNameForTagID, ELEMENT_TAG_ID,BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, MovePointersToRange, IHTMLTxtRange*,IMarkupPointer*,IMarkupPointer*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(MarkupServices, MoveRangeToPointers, IMarkupPointer*,IMarkupPointer*,IHTMLTxtRange*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(MarkupServices, BeginUndoUnit, OLECHAR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(MarkupServices, EndUndoUnit) + +static const IMarkupServicesVtbl DocObjMarkupServicesVtbl = { + DocObjMarkupServices_QueryInterface, + DocObjMarkupServices_AddRef, + DocObjMarkupServices_Release, + DocObjMarkupServices_CreateMarkupPointer, + DocObjMarkupServices_CreateMarkupContainer, + DocObjMarkupServices_CreateElement, + DocObjMarkupServices_CloneElement, + DocObjMarkupServices_InsertElement, + DocObjMarkupServices_RemoveElement, + DocObjMarkupServices_Remove, + DocObjMarkupServices_Copy, + DocObjMarkupServices_Move, + DocObjMarkupServices_InsertText, + DocObjMarkupServices_ParseString, + DocObjMarkupServices_ParseGlobal, + DocObjMarkupServices_IsScopedElement, + DocObjMarkupServices_GetElementTagId, + DocObjMarkupServices_GetTagIDForName, + DocObjMarkupServices_GetNameForTagID, + DocObjMarkupServices_MovePointersToRange, + DocObjMarkupServices_MoveRangeToPointers, + DocObjMarkupServices_BeginUndoUnit, + DocObjMarkupServices_EndUndoUnit +}; + +/********************************************************** + * IMarkupContainer implementation + */ +static inline HTMLDocumentObj *impl_from_IMarkupContainer(IMarkupContainer *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IMarkupContainer_iface); +} + +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(MarkupContainer) + +static HRESULT WINAPI DocObjMarkupContainer_OwningDoc(IMarkupContainer *iface, IHTMLDocument2 **ppDoc) +{ + HTMLDocumentObj *This = impl_from_IMarkupContainer(iface); + FIXME("(%p)->(%p)\n", This, ppDoc); + return E_NOTIMPL; +} + +static const IMarkupContainerVtbl DocObjMarkupContainerVtbl = { + DocObjMarkupContainer_QueryInterface, + DocObjMarkupContainer_AddRef, + DocObjMarkupContainer_Release, + DocObjMarkupContainer_OwningDoc +}; + +/********************************************************** + * IDisplayServices implementation + */ +HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DisplayServices) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DisplayServices, CreateDisplayPointer, IDisplayPointer**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_4(DisplayServices, TransformRect, RECT*,COORD_SYSTEM,COORD_SYSTEM,IHTMLElement*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_4(DisplayServices, TransformPoint, POINT*,COORD_SYSTEM,COORD_SYSTEM,IHTMLElement*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DisplayServices, GetCaret, IHTMLCaret**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DisplayServices, GetComputedStyle, IMarkupPointer*,IHTMLComputedStyle**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DisplayServices, ScrollRectIntoView, IHTMLElement*,RECT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DisplayServices, HasFlowLayout, IHTMLElement*,BOOL*) + +static const IDisplayServicesVtbl DocObjDisplayServicesVtbl = { + DocObjDisplayServices_QueryInterface, + DocObjDisplayServices_AddRef, + DocObjDisplayServices_Release, + DocObjDisplayServices_CreateDisplayPointer, + DocObjDisplayServices_TransformRect, + DocObjDisplayServices_TransformPoint, + DocObjDisplayServices_GetCaret, + DocObjDisplayServices_GetComputedStyle, + DocObjDisplayServices_ScrollRectIntoView, + DocObjDisplayServices_HasFlowLayout +}; + +/********************************************************** + * IDocumentSelector implementation + */ +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentSelector) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentSelector, querySelector, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentSelector, querySelectorAll, BSTR,IHTMLDOMChildrenCollection**) + +static const IDocumentSelectorVtbl DocObjDocumentSelectorVtbl = { + DocObjDocumentSelector_QueryInterface, + DocObjDocumentSelector_AddRef, + DocObjDocumentSelector_Release, + DocObjDocumentSelector_GetTypeInfoCount, + DocObjDocumentSelector_GetTypeInfo, + DocObjDocumentSelector_GetIDsOfNames, + DocObjDocumentSelector_Invoke, + DocObjDocumentSelector_querySelector, + DocObjDocumentSelector_querySelectorAll +}; + +/********************************************************** + * IDocumentEvent implementation + */ +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentEvent) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DocumentEvent, createEvent, BSTR,IDOMEvent**) + +static const IDocumentEventVtbl DocObjDocumentEventVtbl = { + DocObjDocumentEvent_QueryInterface, + DocObjDocumentEvent_AddRef, + DocObjDocumentEvent_Release, + DocObjDocumentEvent_GetTypeInfoCount, + DocObjDocumentEvent_GetTypeInfo, + DocObjDocumentEvent_GetIDsOfNames, + DocObjDocumentEvent_Invoke, + DocObjDocumentEvent_createEvent +}; + +/********************************************************** + * IDocumentRange implementation + */ +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(DocumentRange) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DocumentRange, createRange, IHTMLDOMRange**) + +static const IDocumentRangeVtbl DocObjDocumentRangeVtbl = { + DocObjDocumentRange_QueryInterface, + DocObjDocumentRange_AddRef, + DocObjDocumentRange_Release, + DocObjDocumentRange_GetTypeInfoCount, + DocObjDocumentRange_GetTypeInfo, + DocObjDocumentRange_GetIDsOfNames, + DocObjDocumentRange_Invoke, + DocObjDocumentRange_createRange +}; + static inline HTMLDocumentObj *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, HTMLDocumentObj, IUnknown_inner); @@ -2141,6 +2453,26 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii return *ppv ? S_OK : E_NOINTERFACE; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; + }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { + *ppv = &This->IDocumentSelector_iface; + }else if(IsEqualGUID(&IID_IDocumentEvent, riid)) { + *ppv = &This->IDocumentEvent_iface; + }else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) { + *ppv = &This->ISupportErrorInfo_iface; + }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) { + *ppv = &This->IProvideMultipleClassInfo_iface; + }else if(IsEqualGUID(&IID_IMarkupServices, riid)) { + *ppv = &This->IMarkupServices_iface; + }else if(IsEqualGUID(&IID_IMarkupContainer, riid)) { + *ppv = &This->IMarkupContainer_iface; + }else if(IsEqualGUID(&IID_IDisplayServices, riid)) { + *ppv = &This->IDisplayServices_iface; + }else if(IsEqualGUID(&IID_IDocumentRange, riid)) { + *ppv = &This->IDocumentRange_iface; }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) { *ppv = &This->IOleDocumentView_iface; }else if(IsEqualGUID(&IID_IViewObject, riid)) { @@ -2191,6 +2523,26 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->ITargetContainer_iface; }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { *ppv = &This->cp_container.IConnectionPointContainer_iface; + }else if(IsEqualGUID(&CLSID_CMarkup, riid)) { + FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { + TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) { + TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IExternalConnection, riid)) { + TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; + }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { + TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); + *ppv = NULL; + return E_NOINTERFACE; }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; }else { @@ -2413,6 +2765,14 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->ref = 1; doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; + doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; + doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; + doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; + doc->IProvideMultipleClassInfo_iface.lpVtbl = &DocObjProvideMultipleClassInfoVtbl; + doc->IMarkupServices_iface.lpVtbl = &DocObjMarkupServicesVtbl; + doc->IMarkupContainer_iface.lpVtbl = &DocObjMarkupContainerVtbl; + doc->IDisplayServices_iface.lpVtbl = &DocObjDisplayServicesVtbl; + doc->IDocumentRange_iface.lpVtbl = &DocObjDocumentRangeVtbl;
doc->basedoc.doc_obj = doc;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 532 +++++++++++++++++------------------ 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/oleobj.c | 319 +++++++++++++++++++++ dlls/mshtml/script.c | 2 +- dlls/mshtml/service.c | 4 +- dlls/mshtml/view.c | 2 +- 10 files changed, 594 insertions(+), 280 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 8318c73fb8f..46e1f4b10f7 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -411,81 +411,79 @@ HRESULT create_doctype_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNo return S_OK; }
-static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface) +static inline HTMLDocumentNode *impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return htmldoc_addref(This); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
- return htmldoc_release(This); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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 HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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 HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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 HTMLDocument_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 = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMElement *nselem = NULL; HTMLDOMNode *node; nsresult nsres; @@ -493,12 +491,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; @@ -521,17 +519,17 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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; @@ -554,7 +552,7 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMElement *nselem; HTMLElement *elem; nsresult nsres; @@ -562,7 +560,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; } @@ -571,7 +569,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; @@ -593,7 +591,7 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM
static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -604,19 +602,19 @@ 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); }
@@ -625,7 +623,7 @@ static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElemen
static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -636,19 +634,19 @@ 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); }
@@ -657,7 +655,7 @@ static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLEleme
static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -668,19 +666,19 @@ 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); }
@@ -689,7 +687,7 @@ static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElement
static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -700,19 +698,19 @@ 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); }
@@ -721,7 +719,7 @@ static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElement
static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -732,19 +730,19 @@ 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); }
@@ -753,19 +751,19 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme
static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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); @@ -775,21 +773,21 @@ static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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); @@ -806,7 +804,7 @@ static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLCollection *nscoll = NULL; nsresult nsres;
@@ -817,19 +815,19 @@ 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); }
@@ -838,7 +836,7 @@ static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLEleme
static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v)); @@ -848,18 +846,17 @@ 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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p) always returning Off\n", This, p);
if(!p) @@ -872,78 +869,77 @@ static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p
static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); - + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); IHTMLElement *element = NULL; IHTMLBodyElement *body; HRESULT hr; @@ -976,20 +972,20 @@ static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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"); @@ -1001,59 +997,59 @@ static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p
static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
FIXME("(%p)->(%p)\n", This, p);
*p = NULL; return S_OK; - } +}
static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p) { - HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface)->doc_node; + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -1067,45 +1063,45 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca
static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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); @@ -1117,15 +1113,15 @@ static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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;
@@ -1133,7 +1129,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) if(!*str) { TRACE("Gecko returned empty string, fallback to loaded URL.\n"); nsAString_Finish(&nsstr); - hres = IUri_GetHost(This->window->uri, p); + hres = IUri_GetHost(This->basedoc.window->uri, p); return FAILED(hres) ? hres : S_OK; } } @@ -1143,15 +1139,15 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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()); @@ -1162,19 +1158,19 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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; @@ -1190,7 +1186,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; @@ -1201,44 +1197,44 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -1248,61 +1244,61 @@ static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BST
static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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; @@ -1311,7 +1307,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; } @@ -1332,7 +1328,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) { @@ -1347,9 +1343,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); @@ -1367,7 +1363,7 @@ static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", iface, psarray);
@@ -1376,7 +1372,7 @@ static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarr
static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
TRACE("(%p)->(%p)\n", This, psarray);
@@ -1384,9 +1380,9 @@ static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psa }
static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name, - VARIANT features, VARIANT replace, IDispatch **pomWindowResult) + VARIANT features, VARIANT replace, IDispatch **pomWindowResult) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsISupports *tmp; nsresult nsres;
@@ -1395,10 +1391,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; } @@ -1407,8 +1403,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; @@ -1417,24 +1413,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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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; @@ -1445,12 +1441,12 @@ static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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; @@ -1491,57 +1487,57 @@ static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid) }
static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + BSTR *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + VARIANT *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); OLECMDID cmdid; VARIANT ret; HRESULT hres; @@ -1552,7 +1548,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; @@ -1567,23 +1563,23 @@ static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID }
static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID, - VARIANT_BOOL *pfRet) + VARIANT_BOOL *pfRet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + IHTMLElement **newElem) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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;
@@ -1593,298 +1589,298 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + IHTMLElement **elementHit) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMElement *nselem; HTMLElement *element; nsresult nsres; @@ -1892,7 +1888,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; @@ -1914,19 +1910,19 @@ static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG
static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + IHTMLStyleSheetsCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMStyleSheetList *nsstylelist; nsresult nsres; HRESULT hres; @@ -1935,64 +1931,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) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_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) + LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet) { - HTMLDocument *This = impl_from_IHTMLDocument2(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); nsIDOMHTMLHeadElement *head_elem; IHTMLStyleElement *style_elem; HTMLElement *elem; @@ -2001,7 +1997,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; } @@ -2011,15 +2007,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;
@@ -2539,7 +2535,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; }
@@ -3693,7 +3689,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) @@ -3768,7 +3764,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) @@ -4415,7 +4411,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) @@ -4762,7 +4758,7 @@ static const IDocumentEventVtbl DocumentEventVtbl = {
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); @@ -5579,16 +5575,10 @@ 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)) @@ -5599,8 +5589,6 @@ 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;
@@ -5622,7 +5610,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
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; @@ -5648,10 +5635,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)) @@ -6116,6 +6109,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo return NULL;
doc->ref = 1; + doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; @@ -6132,7 +6126,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); 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 530eb705400..21f0479d524 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; @@ -680,6 +679,7 @@ struct HTMLDocumentObj { DispatchEx dispex; IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; + IHTMLDocument2 IHTMLDocument2_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -899,6 +899,7 @@ struct HTMLDocumentNode { HTMLDOMNode node; HTMLDocument basedoc;
+ IHTMLDocument2 IHTMLDocument2_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 1398e085ea5..f6e13182974 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2201,6 +2201,320 @@ 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, _3, _4, _5) : E_UNEXPECTED; \ }
+/********************************************************** + * IHTMLDocument2 implementation + */ +static inline HTMLDocumentObj *impl_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 = impl_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 = impl_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 = 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; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_selection, IHTMLSelectionObject**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_readyState, BSTR*) + +static HRESULT WINAPI DocObjHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) +{ + HTMLDocumentObj *This = impl_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*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_referrer, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_location, IHTMLLocation**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_lastModified, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_URL, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_URL, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_domain, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_domain, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_cookie, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_cookie, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_expando, VARIANT_BOOL) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_expando, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_charset, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_charset, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, put_defaultCharset, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_defaultCharset, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_mimeType, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_fileSize, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_fileCreatedDate, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_fileModifiedDate, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_fileUpdatedDate, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_security, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_protocol, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_nameProp, BSTR*) +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 = impl_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 = impl_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 +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -2451,12 +2765,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)) { @@ -2765,6 +3083,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/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; }
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 227 +++++++++++++++++------------------ dlls/mshtml/htmlwindow.c | 4 +- dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/oleobj.c | 112 +++++++++++++++++ 4 files changed, 223 insertions(+), 123 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 46e1f4b10f7..4bf3f18f4b0 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2161,71 +2161,67 @@ static const IHTMLDocument2Vtbl HTMLDocumentVtbl = { HTMLDocument_createStyleSheet };
-static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) +static inline HTMLDocumentNode *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument3_iface); }
-static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
WARN("(%p)->(%x)\n", This, fForce);
@@ -2233,10 +2229,9 @@ static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL f return S_OK; }
-static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, - IHTMLDOMNode **newTextNode) +static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, IHTMLDOMNode **newTextNode) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsIDOMText *nstext; HTMLDOMNode *node; nsAString text_str; @@ -2245,20 +2240,20 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&text_str, text); - nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext); + nsres = nsIDOMHTMLDocument_CreateTextNode(This->nsdoc, &text_str, &nstext); nsAString_Finish(&text_str); if(NS_FAILED(nsres)) { ERR("CreateTextNode failed: %08lx\n", nsres); return E_FAIL; }
- hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node); + hres = HTMLDOMTextNode_Create(This, (nsIDOMNode*)nstext, &node); nsIDOMText_Release(nstext); if(FAILED(hres)) return hres; @@ -2269,7 +2264,7 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsIDOMElement *nselem = NULL; HTMLElement *element; nsresult nsres; @@ -2277,17 +2272,17 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
- if(This->window && This->window->readystate == READYSTATE_UNINITIALIZED) { + if(This->basedoc.window && This->basedoc.window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; return S_OK; }
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
- nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem); + nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem); if(NS_FAILED(nsres)) { ERR("GetDocumentElement failed: %08lx\n", nsres); return E_FAIL; @@ -2309,146 +2304,145 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
static HRESULT WINAPI HTMLDocument3_get_uniqueID(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return elem_unique_id(++This->doc_node->unique_id, p); + return elem_unique_id(++This->unique_id, p); }
-static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch* pDisp, VARIANT_BOOL *pfResult) +static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch* pDisp, + VARIANT_BOOL *pfResult) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
- return attach_event(&This->doc_node->node.event_target, event, pDisp, pfResult); + return attach_event(&This->node.event_target, event, pDisp, pfResult); }
-static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch *pDisp) +static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch *pDisp) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
- return detach_event(&This->doc_node->node.event_target, event, pDisp); + return detach_event(&This->node.event_target, event, pDisp); }
static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsAString dir_str; nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&dir_str, v); - nsres = nsIDOMHTMLDocument_SetDir(This->doc_node->nsdoc, &dir_str); + nsres = nsIDOMHTMLDocument_SetDir(This->nsdoc, &dir_str); nsAString_Finish(&dir_str); if(NS_FAILED(nsres)) { ERR("SetDir failed: %08lx\n", nsres); @@ -2460,58 +2454,57 @@ static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsAString dir_str; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_Init(&dir_str, NULL); - nsres = nsIDOMHTMLDocument_GetDir(This->doc_node->nsdoc, &dir_str); + nsres = nsIDOMHTMLDocument_GetDir(This->nsdoc, &dir_str); return return_nsstr(nsres, &dir_str, p); }
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->()\n", This);
- return set_doc_event(This, EVENTID_CONTEXTMENU, &v); + return set_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, &v); }
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_CONTEXTMENU, p); + return get_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, p); }
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, - IHTMLDocument2 **ppNewDoc) +static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, IHTMLDocument2 **ppNewDoc) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsIDOMDocumentFragment *doc_frag; HTMLDocumentNode *docnode; nsresult nsres; @@ -2519,18 +2512,18 @@ static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface
TRACE("(%p)->(%p)\n", This, ppNewDoc);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_NOTIMPL; }
- nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag); + nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->nsdoc, &doc_frag); if(NS_FAILED(nsres)) { ERR("CreateDocumentFragment failed: %08lx\n", nsres); return E_FAIL; }
- hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode); + hres = create_document_fragment((nsIDOMNode*)doc_frag, This, &docnode); nsIDOMDocumentFragment_Release(doc_frag); if(FAILED(hres)) return hres; @@ -2539,87 +2532,82 @@ static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface return S_OK; }
-static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, - IHTMLDocument2 **p) +static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, IHTMLDocument2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL v) +static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL *p) +static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface);
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p); + return IHTMLDOMNode_get_childNodes(&This->node.IHTMLDOMNode_iface, p); }
-static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL v) +static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL *p) +static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **ppelColl) + IHTMLElementCollection **ppelColl) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsIDOMNodeList *node_list; nsAString selector_str; WCHAR *selector; @@ -2628,7 +2616,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
- if(!This->doc_node || !This->doc_node->nsdoc) { + if(!This->nsdoc) { /* We should probably return an empty collection. */ FIXME("No nsdoc\n"); return E_NOTIMPL; @@ -2645,7 +2633,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST * types and search should be case insensitive. Those are currently not supported properly. */ nsAString_InitDepend(&selector_str, selector); - nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &selector_str, &node_list); + nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->nsdoc, &selector_str, &node_list); nsAString_Finish(&selector_str); heap_free(selector); if(NS_FAILED(nsres)) { @@ -2653,22 +2641,21 @@ static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BST return E_FAIL; }
- *ppelColl = create_collection_from_nodelist(node_list, This->doc_node->document_mode); + *ppelColl = create_collection_from_nodelist(node_list, This->document_mode); nsIDOMNodeList_Release(node_list); return S_OK; }
-static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, - IHTMLElement **pel) +static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, IHTMLElement **pel) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); HTMLElement *elem; HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
- hres = get_doc_elem_by_id(This->doc_node, v, &elem); + hres = get_doc_elem_by_id(This, v, &elem); if(FAILED(hres) || !elem) { *pel = NULL; return hres; @@ -2680,18 +2667,18 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **pelColl) + IHTMLElementCollection **pelColl) { - HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument3(iface); nsIDOMNodeList *nslist; nsAString id_str; nsresult nsres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
- if(This->doc_node->nsdoc) { + if(This->nsdoc) { nsAString_InitDepend(&id_str, v); - nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist); + nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->nsdoc, &id_str, &nslist); nsAString_Finish(&id_str); if(FAILED(nsres)) { ERR("GetElementByName failed: %08lx\n", nsres); @@ -2711,7 +2698,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, } }
- nsres = nsIDOMNode_QueryInterface(This->doc_node->node.nsnode, &IID_nsIDOMDocumentFragment, (void**)&docfrag); + nsres = nsIDOMNode_QueryInterface(This->node.nsnode, &IID_nsIDOMDocumentFragment, (void**)&docfrag); if(NS_FAILED(nsres)) { ERR("Could not get nsIDOMDocumentFragment iface: %08lx\n", nsres); return E_UNEXPECTED; @@ -2728,7 +2715,7 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, }
- *pelColl = create_collection_from_nodelist(nslist, This->doc_node->document_mode); + *pelColl = create_collection_from_nodelist(nslist, This->document_mode); nsIDOMNodeList_Release(nslist);
return S_OK; @@ -5579,8 +5566,6 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) - *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) *ppv = &This->IHTMLDocument4_iface; else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) @@ -5610,7 +5595,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; @@ -5639,6 +5623,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) *ppv = &This->IHTMLDocument2_iface; + else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) + *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -6110,6 +6096,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc->ref = 1; doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; + doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 9a4df87b529..ac2ca06bb14 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3607,7 +3607,7 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, global_prop_t *prop; IHTMLElement *elem;
- hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->basedoc.IHTMLDocument3_iface, + hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->IHTMLDocument3_iface, bstrName, &elem); if(SUCCEEDED(hres) && elem) { IHTMLElement_Release(elem); @@ -3813,7 +3813,7 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD case DISPATCH_PROPERTYGET: { IHTMLElement *elem;
- hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->basedoc.IHTMLDocument3_iface, + hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->IHTMLDocument3_iface, prop->name, &elem); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 21f0479d524..090dc738943 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; @@ -680,6 +679,7 @@ struct HTMLDocumentObj { IUnknown IUnknown_inner; ICustomDoc ICustomDoc_iface; IHTMLDocument2 IHTMLDocument2_iface; + IHTMLDocument3 IHTMLDocument3_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -900,6 +900,7 @@ struct HTMLDocumentNode { HTMLDocument basedoc;
IHTMLDocument2 IHTMLDocument2_iface; + IHTMLDocument3 IHTMLDocument3_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index f6e13182974..8203d3ed3d5 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2515,6 +2515,115 @@ static const IHTMLDocument2Vtbl DocObjHTMLDocument2Vtbl = { DocObjHTMLDocument2_createStyleSheet };
+/********************************************************** + * IHTMLDocument3 implementation + */ +static inline HTMLDocumentObj *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument3_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument3) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument3, releaseCapture) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, recalc, VARIANT_BOOL) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, createTextNode, BSTR,IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_documentElement, IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_uniqueID, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument3, attachEvent, BSTR,IDispatch*,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, detachEvent, BSTR,IDispatch*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onrowsdelete, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onrowsdelete, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onrowsinserted, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onrowsinserted, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_oncellchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_oncellchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondatasetchanged, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondatasetchanged, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondataavailable, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondataavailable, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_ondatasetcomplete, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_ondatasetcomplete, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onpropertychange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onpropertychange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_dir, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_dir, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_oncontextmenu, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_oncontextmenu, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onstop, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onstop, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, createDocumentFragment, IHTMLDocument2**) + +static HRESULT WINAPI DocObjHTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, IHTMLDocument2 **p) +{ + HTMLDocumentObj *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_enableDownload, VARIANT_BOOL) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_enableDownload, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_baseUrl, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_baseUrl, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_childNodes, IDispatch**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_inheritStyleSheets, VARIANT_BOOL) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_inheritStyleSheets, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, put_onbeforeeditfocus, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument3, get_onbeforeeditfocus, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementsByName, BSTR,IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementById, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument3, getElementsByTagName, BSTR,IHTMLElementCollection**) + +static const IHTMLDocument3Vtbl DocObjHTMLDocument3Vtbl = { + DocObjHTMLDocument3_QueryInterface, + DocObjHTMLDocument3_AddRef, + DocObjHTMLDocument3_Release, + DocObjHTMLDocument3_GetTypeInfoCount, + DocObjHTMLDocument3_GetTypeInfo, + DocObjHTMLDocument3_GetIDsOfNames, + DocObjHTMLDocument3_Invoke, + DocObjHTMLDocument3_releaseCapture, + DocObjHTMLDocument3_recalc, + DocObjHTMLDocument3_createTextNode, + DocObjHTMLDocument3_get_documentElement, + DocObjHTMLDocument3_get_uniqueID, + DocObjHTMLDocument3_attachEvent, + DocObjHTMLDocument3_detachEvent, + DocObjHTMLDocument3_put_onrowsdelete, + DocObjHTMLDocument3_get_onrowsdelete, + DocObjHTMLDocument3_put_onrowsinserted, + DocObjHTMLDocument3_get_onrowsinserted, + DocObjHTMLDocument3_put_oncellchange, + DocObjHTMLDocument3_get_oncellchange, + DocObjHTMLDocument3_put_ondatasetchanged, + DocObjHTMLDocument3_get_ondatasetchanged, + DocObjHTMLDocument3_put_ondataavailable, + DocObjHTMLDocument3_get_ondataavailable, + DocObjHTMLDocument3_put_ondatasetcomplete, + DocObjHTMLDocument3_get_ondatasetcomplete, + DocObjHTMLDocument3_put_onpropertychange, + DocObjHTMLDocument3_get_onpropertychange, + DocObjHTMLDocument3_put_dir, + DocObjHTMLDocument3_get_dir, + DocObjHTMLDocument3_put_oncontextmenu, + DocObjHTMLDocument3_get_oncontextmenu, + DocObjHTMLDocument3_put_onstop, + DocObjHTMLDocument3_get_onstop, + DocObjHTMLDocument3_createDocumentFragment, + DocObjHTMLDocument3_get_parentDocument, + DocObjHTMLDocument3_put_enableDownload, + DocObjHTMLDocument3_get_enableDownload, + DocObjHTMLDocument3_put_baseUrl, + DocObjHTMLDocument3_get_baseUrl, + DocObjHTMLDocument3_get_childNodes, + DocObjHTMLDocument3_put_inheritStyleSheets, + DocObjHTMLDocument3_get_inheritStyleSheets, + DocObjHTMLDocument3_put_onbeforeeditfocus, + DocObjHTMLDocument3_get_onbeforeeditfocus, + DocObjHTMLDocument3_getElementsByName, + DocObjHTMLDocument3_getElementById, + DocObjHTMLDocument3_getElementsByTagName +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -2767,6 +2876,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii return *ppv ? S_OK : E_NOINTERFACE; }else if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) { *ppv = &This->IHTMLDocument2_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) { + *ppv = &This->IHTMLDocument3_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -3084,6 +3195,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IUnknown_inner.lpVtbl = &HTMLDocumentObjVtbl; doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; + doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 112 +++++++++++++++++------------------ dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/oleobj.c | 59 ++++++++++++++++++ 3 files changed, 115 insertions(+), 59 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 4bf3f18f4b0..085b262e313 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2772,70 +2772,66 @@ static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = { HTMLDocument3_getElementsByTagName };
-static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) +static inline HTMLDocumentNode *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument4_iface); }
-static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); nsIDOMHTMLElement *nsbody; nsresult nsres;
TRACE("(%p)->()\n", This);
- nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody); + nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody); if(NS_FAILED(nsres) || !nsbody) { ERR("GetBody failed: %08lx\n", nsres); return E_FAIL; @@ -2853,18 +2849,18 @@ static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); cpp_bool has_focus; nsresult nsres;
TRACE("(%p)->(%p)\n", This, pfFocus);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("Unimplemented for fragments.\n"); return E_NOTIMPL; }
- nsres = nsIDOMHTMLDocument_HasFocus(This->doc_node->nsdoc, &has_focus); + nsres = nsIDOMHTMLDocument_HasFocus(This->nsdoc, &has_focus); assert(nsres == NS_OK);
*pfFocus = variant_bool(has_focus); @@ -2873,60 +2869,60 @@ static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL
static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_SELECTIONCHANGE, &v); + return set_doc_event(&This->basedoc, EVENTID_SELECTIONCHANGE, &v); }
static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_SELECTIONCHANGE, p); + return get_doc_event(&This->basedoc, EVENTID_SELECTIONCHANGE, p); }
static HRESULT WINAPI HTMLDocument4_get_namespaces(IHTMLDocument4 *iface, IDispatch **p) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->namespaces) { + if(!This->namespaces) { HRESULT hres;
- hres = create_namespace_collection(dispex_compat_mode(&This->doc_node->node.event_target.dispex), - &This->doc_node->namespaces); + hres = create_namespace_collection(dispex_compat_mode(&This->node.event_target.dispex), + &This->namespaces); if(FAILED(hres)) return hres; }
- IHTMLNamespaceCollection_AddRef(This->doc_node->namespaces); - *p = (IDispatch*)This->doc_node->namespaces; + IHTMLNamespaceCollection_AddRef(This->namespaces); + *p = (IDispatch*)This->namespaces; return S_OK; }
static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl, BSTR bstrOptions, IHTMLDocument2 **newDoc) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; } @@ -2934,7 +2930,7 @@ static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p) static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface, VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
@@ -2943,44 +2939,44 @@ static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface, return E_NOTIMPL; }
- return create_event_obj(dispex_compat_mode(&This->doc_node->node.event_target.dispex), ppEventObj); + return create_event_obj(dispex_compat_mode(&This->node.event_target.dispex), ppEventObj); }
static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName, VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface);
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
- return fire_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled); + return fire_event(&This->node, bstrEventName, pvarEventObject, pfCanceled); }
static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v, IHTMLRenderStyle **ppIHTMLRenderStyle) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
-static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p) +static HRESULT WINAPI HTMLDocument4_get_URLUnencoded(IHTMLDocument4 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument4(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument4(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; } @@ -3006,7 +3002,7 @@ static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = { HTMLDocument4_createRenderStyle, HTMLDocument4_put_oncontrolselect, HTMLDocument4_get_oncontrolselect, - HTMLDocument4_get_URLEncoded + HTMLDocument4_get_URLUnencoded };
static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) @@ -5566,8 +5562,6 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) - *ppv = &This->IHTMLDocument4_iface; else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) @@ -5595,7 +5589,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; @@ -5625,6 +5618,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument2_iface; else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) *ppv = &This->IHTMLDocument3_iface; + else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) + *ppv = &This->IHTMLDocument4_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -6097,6 +6092,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->ref = 1; doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; + doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 090dc738943..4014e77338d 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; @@ -680,6 +679,7 @@ struct HTMLDocumentObj { ICustomDoc ICustomDoc_iface; IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; + IHTMLDocument4 IHTMLDocument4_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -901,6 +901,7 @@ struct HTMLDocumentNode {
IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; + IHTMLDocument4 IHTMLDocument4_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 8203d3ed3d5..1100a8b3ff1 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2624,6 +2624,62 @@ static const IHTMLDocument3Vtbl DocObjHTMLDocument3Vtbl = { DocObjHTMLDocument3_getElementsByTagName };
+/********************************************************** + * IHTMLDocument4 implementation + */ +static inline HTMLDocumentObj *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument4_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument4) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument4, focus) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, hasFocus, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, put_onselectionchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_onselectionchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_namespaces, IDispatch**) + +static HRESULT WINAPI DocObjHTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl, + BSTR bstrOptions, IHTMLDocument2 **newDoc) +{ + HTMLDocumentObj *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc); + return E_NOTIMPL; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, put_media, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_media, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument4, createEventObject, VARIANT*,IHTMLEventObj**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument4, fireEvent, BSTR,VARIANT*,VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument4, createRenderStyle, BSTR,IHTMLRenderStyle**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, put_oncontrolselect, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_oncontrolselect, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_URLUnencoded, BSTR*) + +static const IHTMLDocument4Vtbl DocObjHTMLDocument4Vtbl = { + DocObjHTMLDocument4_QueryInterface, + DocObjHTMLDocument4_AddRef, + DocObjHTMLDocument4_Release, + DocObjHTMLDocument4_GetTypeInfoCount, + DocObjHTMLDocument4_GetTypeInfo, + DocObjHTMLDocument4_GetIDsOfNames, + DocObjHTMLDocument4_Invoke, + DocObjHTMLDocument4_focus, + DocObjHTMLDocument4_hasFocus, + DocObjHTMLDocument4_put_onselectionchange, + DocObjHTMLDocument4_get_onselectionchange, + DocObjHTMLDocument4_get_namespaces, + DocObjHTMLDocument4_createDocumentFromUrl, + DocObjHTMLDocument4_put_media, + DocObjHTMLDocument4_get_media, + DocObjHTMLDocument4_createEventObject, + DocObjHTMLDocument4_fireEvent, + DocObjHTMLDocument4_createRenderStyle, + DocObjHTMLDocument4_put_oncontrolselect, + DocObjHTMLDocument4_get_oncontrolselect, + DocObjHTMLDocument4_get_URLUnencoded +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -2878,6 +2934,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHTMLDocument2_iface; }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) { *ppv = &This->IHTMLDocument3_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) { + *ppv = &This->IHTMLDocument4_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -3196,6 +3254,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; + doc->IHTMLDocument4_iface.lpVtbl = &DocObjHTMLDocument4Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 131 +++++++++++++++++------------------ dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/oleobj.c | 72 +++++++++++++++++++ 3 files changed, 137 insertions(+), 69 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 085b262e313..cce29f6bf20 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -3005,82 +3005,78 @@ static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = { HTMLDocument4_get_URLUnencoded };
-static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) +static inline HTMLDocumentNode *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument5_iface); }
-static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_MOUSEWHEEL, &v); + return set_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, &v); }
static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_MOUSEWHEEL, p); + return get_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, p); }
static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - HTMLDocumentNode *doc_node = This->doc_node; + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); nsIDOMDocumentType *nsdoctype; HTMLDOMNode *doctype_node; nsresult nsres; @@ -3088,12 +3084,12 @@ static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMN
TRACE("(%p)->(%p)\n", This, p);
- if(dispex_compat_mode(&doc_node->node.event_target.dispex) < COMPAT_MODE_IE9) { + if(dispex_compat_mode(&This->node.event_target.dispex) < COMPAT_MODE_IE9) { *p = NULL; return S_OK; }
- nsres = nsIDOMHTMLDocument_GetDoctype(doc_node->nsdoc, &nsdoctype); + nsres = nsIDOMHTMLDocument_GetDoctype(This->nsdoc, &nsdoctype); if(NS_FAILED(nsres)) return map_nsresult(nsres); if(!nsdoctype) { @@ -3111,34 +3107,33 @@ static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMN
static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - HTMLDocumentNode *doc_node = This->doc_node; + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- if(!doc_node->dom_implementation) { + if(!This->dom_implementation) { HRESULT hres;
- hres = create_dom_implementation(doc_node, &doc_node->dom_implementation); + hres = create_dom_implementation(This, &This->dom_implementation); if(FAILED(hres)) return hres; }
- IHTMLDOMImplementation_AddRef(doc_node->dom_implementation); - *p = doc_node->dom_implementation; + IHTMLDOMImplementation_AddRef(This->dom_implementation); + *p = This->dom_implementation; return S_OK; }
static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName, IHTMLDOMAttribute **ppattribute) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); HTMLDOMAttribute *attr; HRESULT hres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
- hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->doc_node->node.event_target.dispex), &attr); + hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, dispex_compat_mode(&This->node.event_target.dispex), &attr); if(FAILED(hres)) return hres;
@@ -3149,7 +3144,7 @@ static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata, IHTMLDOMNode **ppRetNode) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); nsIDOMComment *nscomment; HTMLElement *elem; nsAString str; @@ -3158,20 +3153,20 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; }
nsAString_InitDepend(&str, bstrdata); - nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment); + nsres = nsIDOMHTMLDocument_CreateComment(This->nsdoc, &str, &nscomment); nsAString_Finish(&str); if(NS_FAILED(nsres)) { ERR("CreateTextNode failed: %08lx\n", nsres); return E_FAIL; }
- hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem); + hres = HTMLCommentElement_Create(This, (nsIDOMNode*)nscomment, &elem); nsIDOMComment_Release(nscomment); if(FAILED(hres)) return hres; @@ -3182,103 +3177,103 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_FOCUSIN, &v); + return set_doc_event(&This->basedoc, EVENTID_FOCUSIN, &v); }
static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_FOCUSIN, p); + return get_doc_event(&This->basedoc, EVENTID_FOCUSIN, p); }
static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_FOCUSOUT, &v); + return set_doc_event(&This->basedoc, EVENTID_FOCUSOUT, &v); }
static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_FOCUSOUT, p); + return get_doc_event(&This->basedoc, EVENTID_FOCUSOUT, p); }
static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument5(iface);
TRACE("(%p)->(%p)\n", This, p);
- *p = SysAllocString(This->doc_node->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat"); + *p = SysAllocString(This->document_mode <= COMPAT_MODE_IE5 ? L"BackCompat" : L"CSS1Compat"); return *p ? S_OK : E_OUTOFMEMORY; }
@@ -3681,7 +3676,7 @@ static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
- return IHTMLDocument5_createAttribute(&This->IHTMLDocument5_iface, bstrAttrName, ppAttribute); + return IHTMLDocument5_createAttribute(&This->doc_node->IHTMLDocument5_iface, bstrAttrName, ppAttribute); }
static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel) @@ -5562,8 +5557,6 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) - *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) @@ -5589,7 +5582,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; @@ -5620,6 +5612,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument3_iface; else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) *ppv = &This->IHTMLDocument4_iface; + else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) + *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -6093,6 +6087,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; + doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4014e77338d..3e37f8cfcfe 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; IDispatchEx IDispatchEx_iface; @@ -680,6 +679,7 @@ struct HTMLDocumentObj { IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; + IHTMLDocument5 IHTMLDocument5_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -902,6 +902,7 @@ struct HTMLDocumentNode { IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; + IHTMLDocument5 IHTMLDocument5_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 1100a8b3ff1..a6e1d60fa55 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2680,6 +2680,75 @@ static const IHTMLDocument4Vtbl DocObjHTMLDocument4Vtbl = { DocObjHTMLDocument4_get_URLUnencoded };
+/********************************************************** + * IHTMLDocument5 implementation + */ +static inline HTMLDocumentObj *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument5_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument5) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onmousewheel, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onmousewheel, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_doctype, IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_implementation, IHTMLDOMImplementation**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument5, createAttribute, BSTR,IHTMLDOMAttribute**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument5, createComment, BSTR,IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onfocusin, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onfocusin, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onfocusout, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onfocusout, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_ondeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_ondeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforedeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforedeactivate, VARIANT*) + +static HRESULT WINAPI DocObjHTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +{ + HTMLDocumentObj *This = impl_from_IHTMLDocument5(iface); + + if(This->basedoc.doc_node) + return IHTMLDocument5_get_compatMode(&This->basedoc.doc_node->IHTMLDocument5_iface, p); + + TRACE("(%p)->(%p)\n", This, p); + + return (*p = SysAllocString(L"BackCompat")) ? S_OK : E_OUTOFMEMORY; +} + +static const IHTMLDocument5Vtbl DocObjHTMLDocument5Vtbl = { + DocObjHTMLDocument5_QueryInterface, + DocObjHTMLDocument5_AddRef, + DocObjHTMLDocument5_Release, + DocObjHTMLDocument5_GetTypeInfoCount, + DocObjHTMLDocument5_GetTypeInfo, + DocObjHTMLDocument5_GetIDsOfNames, + DocObjHTMLDocument5_Invoke, + DocObjHTMLDocument5_put_onmousewheel, + DocObjHTMLDocument5_get_onmousewheel, + DocObjHTMLDocument5_get_doctype, + DocObjHTMLDocument5_get_implementation, + DocObjHTMLDocument5_createAttribute, + DocObjHTMLDocument5_createComment, + DocObjHTMLDocument5_put_onfocusin, + DocObjHTMLDocument5_get_onfocusin, + DocObjHTMLDocument5_put_onfocusout, + DocObjHTMLDocument5_get_onfocusout, + DocObjHTMLDocument5_put_onactivate, + DocObjHTMLDocument5_get_onactivate, + DocObjHTMLDocument5_put_ondeactivate, + DocObjHTMLDocument5_get_ondeactivate, + DocObjHTMLDocument5_put_onbeforeactivate, + DocObjHTMLDocument5_get_onbeforeactivate, + DocObjHTMLDocument5_put_onbeforedeactivate, + DocObjHTMLDocument5_get_onbeforedeactivate, + DocObjHTMLDocument5_get_compatMode +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -2936,6 +3005,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHTMLDocument3_iface; }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) { *ppv = &This->IHTMLDocument4_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) { + *ppv = &This->IHTMLDocument5_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -3255,6 +3326,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IHTMLDocument2_iface.lpVtbl = &DocObjHTMLDocument2Vtbl; doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &DocObjHTMLDocument4Vtbl; + doc->IHTMLDocument5_iface.lpVtbl = &DocObjHTMLDocument5Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 90 ++++++++++++++++-------------------- dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/oleobj.c | 34 ++++++++++++++ 3 files changed, 77 insertions(+), 50 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index cce29f6bf20..f301fac74ec 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -3306,126 +3306,118 @@ static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = { HTMLDocument5_get_compatMode };
-static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) +static inline HTMLDocumentNode *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument6_iface); }
-static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface, - REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface, IHTMLDocumentCompatibleInfoCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface);
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node) { - FIXME("NULL doc_node\n"); - return E_UNEXPECTED; - } - V_VT(p) = VT_R4; - V_R4(p) = compat_mode_info[This->doc_node->document_mode].document_mode; + V_R4(p) = compat_mode_info[This->document_mode].document_mode; return S_OK; }
static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_STORAGE, p); + return get_doc_event(&This->basedoc, EVENTID_STORAGE, p); }
static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_STORAGE, &v); + return set_doc_event(&This->basedoc, EVENTID_STORAGE, &v); }
static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface);
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(This, EVENTID_STORAGECOMMIT, p); + return get_doc_event(&This->basedoc, EVENTID_STORAGECOMMIT, p); }
static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(This, EVENTID_STORAGECOMMIT, &v); + return set_doc_event(&This->basedoc, EVENTID_STORAGECOMMIT, &v); }
static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface, BSTR bstrId, IHTMLElement2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); nsIDOMElement *nselem; HTMLElement *elem; nsAString nsstr; @@ -3439,13 +3431,13 @@ static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface, * not search for name attributes, so we may simply let Gecko do the right thing. */
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("Not a document\n"); return E_FAIL; }
nsAString_InitDepend(&nsstr, bstrId); - nsres = nsIDOMHTMLDocument_GetElementById(This->doc_node->nsdoc, &nsstr, &nselem); + nsres = nsIDOMHTMLDocument_GetElementById(This->nsdoc, &nsstr, &nselem); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { ERR("GetElementById failed: %08lx\n", nsres); @@ -3468,7 +3460,7 @@ static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument6(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument6(iface); FIXME("(%p)->()\n", This); return E_NOTIMPL; } @@ -5557,8 +5549,6 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) - *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) *ppv = &This->IHTMLDocument7_iface; else @@ -5582,7 +5572,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl;
@@ -5614,6 +5603,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument4_iface; else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) *ppv = &This->IHTMLDocument5_iface; + else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) + *ppv = &This->IHTMLDocument6_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -6088,6 +6079,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; + doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 3e37f8cfcfe..3464f9c5bbd 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument6 IHTMLDocument6_iface; IHTMLDocument7 IHTMLDocument7_iface; IDispatchEx IDispatchEx_iface;
@@ -680,6 +679,7 @@ struct HTMLDocumentObj { IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; + IHTMLDocument6 IHTMLDocument6_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -903,6 +903,7 @@ struct HTMLDocumentNode { IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; + IHTMLDocument6 IHTMLDocument6_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index a6e1d60fa55..1e4a8931e48 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2749,6 +2749,37 @@ static const IHTMLDocument5Vtbl DocObjHTMLDocument5Vtbl = { DocObjHTMLDocument5_get_compatMode };
+/********************************************************** + * IHTMLDocument6 implementation + */ +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument6) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, get_compatible, IHTMLDocumentCompatibleInfoCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, get_documentMode, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, put_onstorage, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, get_onstorage, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, put_onstoragecommit, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument6, get_onstoragecommit, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument6, getElementById, BSTR,IHTMLElement2**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument6, updateSettings) + +static const IHTMLDocument6Vtbl DocObjHTMLDocument6Vtbl = { + DocObjHTMLDocument6_QueryInterface, + DocObjHTMLDocument6_AddRef, + DocObjHTMLDocument6_Release, + DocObjHTMLDocument6_GetTypeInfoCount, + DocObjHTMLDocument6_GetTypeInfo, + DocObjHTMLDocument6_GetIDsOfNames, + DocObjHTMLDocument6_Invoke, + DocObjHTMLDocument6_get_compatible, + DocObjHTMLDocument6_get_documentMode, + DocObjHTMLDocument6_put_onstorage, + DocObjHTMLDocument6_get_onstorage, + DocObjHTMLDocument6_put_onstoragecommit, + DocObjHTMLDocument6_get_onstoragecommit, + DocObjHTMLDocument6_getElementById, + DocObjHTMLDocument6_updateSettings +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -3007,6 +3038,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHTMLDocument4_iface; }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) { *ppv = &This->IHTMLDocument5_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) { + *ppv = &This->IHTMLDocument6_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -3327,6 +3360,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IHTMLDocument3_iface.lpVtbl = &DocObjHTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &DocObjHTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &DocObjHTMLDocument5Vtbl; + doc->IHTMLDocument6_iface.lpVtbl = &DocObjHTMLDocument6Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 374 +++++++++++++++++------------------ dlls/mshtml/htmlevent.h | 8 +- dlls/mshtml/mshtml_private.h | 3 +- dlls/mshtml/oleobj.c | 259 +++++++++++++++++++++++- dlls/mshtml/omnavigator.c | 2 +- 5 files changed, 450 insertions(+), 196 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f301fac74ec..e89671d2ad6 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -477,7 +477,7 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_parentWindow(&This->basedoc.IHTMLDocument7_iface, (IHTMLWindow2**)p); + hres = IHTMLDocument7_get_parentWindow(&This->IHTMLDocument7_iface, (IHTMLWindow2**)p); return hres == S_OK && !*p ? E_PENDING : hres; }
@@ -1222,7 +1222,7 @@ static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument7_get_characterSet(&This->basedoc.IHTMLDocument7_iface, p); + return IHTMLDocument7_get_characterSet(&This->IHTMLDocument7_iface, p); }
static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v) @@ -1607,7 +1607,7 @@ static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_CLICK, &v); + return set_doc_event(This, EVENTID_CLICK, &v); }
static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p) @@ -1616,7 +1616,7 @@ static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_CLICK, p); + return get_doc_event(This, EVENTID_CLICK, p); }
static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v) @@ -1625,7 +1625,7 @@ static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_DBLCLICK, &v); + return set_doc_event(This, EVENTID_DBLCLICK, &v); }
static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p) @@ -1634,7 +1634,7 @@ static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_DBLCLICK, p); + return get_doc_event(This, EVENTID_DBLCLICK, p); }
static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v) @@ -1643,7 +1643,7 @@ static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_KEYUP, &v); + return set_doc_event(This, EVENTID_KEYUP, &v); }
static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p) @@ -1652,7 +1652,7 @@ static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_KEYUP, p); + return get_doc_event(This, EVENTID_KEYUP, p); }
static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v) @@ -1661,7 +1661,7 @@ static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_KEYDOWN, &v); + return set_doc_event(This, EVENTID_KEYDOWN, &v); }
static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p) @@ -1670,7 +1670,7 @@ static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_KEYDOWN, p); + return get_doc_event(This, EVENTID_KEYDOWN, p); }
static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v) @@ -1679,7 +1679,7 @@ static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_KEYPRESS, &v); + return set_doc_event(This, EVENTID_KEYPRESS, &v); }
static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p) @@ -1688,7 +1688,7 @@ static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_KEYPRESS, p); + return get_doc_event(This, EVENTID_KEYPRESS, p); }
static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v) @@ -1697,7 +1697,7 @@ static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEUP, &v); + return set_doc_event(This, EVENTID_MOUSEUP, &v); }
static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p) @@ -1706,7 +1706,7 @@ static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEUP, p); + return get_doc_event(This, EVENTID_MOUSEUP, p); }
static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v) @@ -1715,7 +1715,7 @@ static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEDOWN, &v); + return set_doc_event(This, EVENTID_MOUSEDOWN, &v); }
static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p) @@ -1724,7 +1724,7 @@ static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEDOWN, p); + return get_doc_event(This, EVENTID_MOUSEDOWN, p); }
static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v) @@ -1733,7 +1733,7 @@ static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEMOVE, &v); + return set_doc_event(This, EVENTID_MOUSEMOVE, &v); }
static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p) @@ -1742,7 +1742,7 @@ static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEMOVE, p); + return get_doc_event(This, EVENTID_MOUSEMOVE, p); }
static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v) @@ -1751,7 +1751,7 @@ static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEOUT, &v); + return set_doc_event(This, EVENTID_MOUSEOUT, &v); }
static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p) @@ -1760,7 +1760,7 @@ static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEOUT, p); + return get_doc_event(This, EVENTID_MOUSEOUT, p); }
static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v) @@ -1769,7 +1769,7 @@ static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEOVER, &v); + return set_doc_event(This, EVENTID_MOUSEOVER, &v); }
static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p) @@ -1778,7 +1778,7 @@ static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEOVER, p); + return get_doc_event(This, EVENTID_MOUSEOVER, p); }
static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v) @@ -1787,7 +1787,7 @@ static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface,
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_READYSTATECHANGE, &v); + return set_doc_event(This, EVENTID_READYSTATECHANGE, &v); }
static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p) @@ -1796,7 +1796,7 @@ static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface,
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_READYSTATECHANGE, p); + return get_doc_event(This, EVENTID_READYSTATECHANGE, p); }
static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v) @@ -1847,7 +1847,7 @@ static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_DRAGSTART, &v); + return set_doc_event(This, EVENTID_DRAGSTART, &v); }
static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p) @@ -1856,7 +1856,7 @@ static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_DRAGSTART, p); + return get_doc_event(This, EVENTID_DRAGSTART, p); }
static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v) @@ -1865,7 +1865,7 @@ static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARI
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_SELECTSTART, &v); + return set_doc_event(This, EVENTID_SELECTSTART, &v); }
static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p) @@ -1874,7 +1874,7 @@ static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARI
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_SELECTSTART, p); + return get_doc_event(This, EVENTID_SELECTSTART, p); }
static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y, @@ -1915,7 +1915,7 @@ static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTML
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_defaultView(&This->basedoc.IHTMLDocument7_iface, p); + hres = IHTMLDocument7_get_defaultView(&This->IHTMLDocument7_iface, p); return hres == S_OK && !*p ? E_FAIL : hres; }
@@ -2476,7 +2476,7 @@ static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VAR
TRACE("(%p)->()\n", This);
- return set_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, &v); + return set_doc_event(This, EVENTID_CONTEXTMENU, &v); }
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) @@ -2485,7 +2485,7 @@ static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VAR
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_CONTEXTMENU, p); + return get_doc_event(This, EVENTID_CONTEXTMENU, p); }
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) @@ -2873,7 +2873,7 @@ static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface,
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_SELECTIONCHANGE, &v); + return set_doc_event(This, EVENTID_SELECTIONCHANGE, &v); }
static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p) @@ -2882,7 +2882,7 @@ static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface,
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_SELECTIONCHANGE, p); + return get_doc_event(This, EVENTID_SELECTIONCHANGE, p); }
static HRESULT WINAPI HTMLDocument4_get_namespaces(IHTMLDocument4 *iface, IDispatch **p) @@ -3062,7 +3062,7 @@ static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARI
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, &v); + return set_doc_event(This, EVENTID_MOUSEWHEEL, &v); }
static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) @@ -3071,7 +3071,7 @@ static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARI
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_MOUSEWHEEL, p); + return get_doc_event(This, EVENTID_MOUSEWHEEL, p); }
static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) @@ -3181,7 +3181,7 @@ static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_FOCUSIN, &v); + return set_doc_event(This, EVENTID_FOCUSIN, &v); }
static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) @@ -3190,7 +3190,7 @@ static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_FOCUSIN, p); + return get_doc_event(This, EVENTID_FOCUSIN, p); }
static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) @@ -3199,7 +3199,7 @@ static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIAN
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_FOCUSOUT, &v); + return set_doc_event(This, EVENTID_FOCUSOUT, &v); }
static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) @@ -3208,7 +3208,7 @@ static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_FOCUSOUT, p); + return get_doc_event(This, EVENTID_FOCUSOUT, p); }
static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) @@ -3383,7 +3383,7 @@ static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_STORAGE, p); + return get_doc_event(This, EVENTID_STORAGE, p); }
static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v) @@ -3392,7 +3392,7 @@ static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_STORAGE, &v); + return set_doc_event(This, EVENTID_STORAGE, &v); }
static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface, @@ -3402,7 +3402,7 @@ static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
TRACE("(%p)->(%p)\n", This, p);
- return get_doc_event(&This->basedoc, EVENTID_STORAGECOMMIT, p); + return get_doc_event(This, EVENTID_STORAGECOMMIT, p); }
static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v) @@ -3411,7 +3411,7 @@ static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, V
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- return set_doc_event(&This->basedoc, EVENTID_STORAGECOMMIT, &v); + return set_doc_event(This, EVENTID_STORAGECOMMIT, &v); }
static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface, @@ -3483,62 +3483,60 @@ static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = { HTMLDocument6_updateSettings };
-static inline HTMLDocument *impl_from_IHTMLDocument7(IHTMLDocument7 *iface) +static inline HTMLDocumentNode *impl_from_IHTMLDocument7(IHTMLDocument7 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument7_iface); + return CONTAINING_RECORD(iface, HTMLDocumentNode, IHTMLDocument7_iface); }
static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return htmldoc_query_interface(&This->basedoc, riid, ppv); }
static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return htmldoc_addref(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return htmldoc_addref(&This->basedoc); }
static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return htmldoc_release(This); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return htmldoc_release(&This->basedoc); }
static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetTypeInfoCount(&This->basedoc.IDispatchEx_iface, pctinfo); }
-static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetTypeInfo(&This->basedoc.IDispatchEx_iface, iTInfo, lcid, ppTInfo); }
-static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetIDsOfNames(&This->basedoc.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId); }
-static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_Invoke(&This->basedoc.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTMLWindow2 **p) { - HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface)->doc_node; + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3553,14 +3551,14 @@ static HRESULT WINAPI HTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTML
static HRESULT WINAPI HTMLDocument7_createCDATASection(IHTMLDocument7 *iface, BSTR text, IHTMLDOMNode **newCDATASectionNode) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, newCDATASectionNode); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSelection **ppIHTMLSelection) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, ppIHTMLSelection); return E_NOTIMPL; } @@ -3568,14 +3566,14 @@ static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSel static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrLocalName, IHTMLElementCollection **pelColl) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrLocalName), pelColl); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrTag, IHTMLElement **newElem) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); nsIDOMElement *dom_element; HTMLElement *element; nsAString ns, tag; @@ -3584,7 +3582,7 @@ static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIA
TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrTag), newElem);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_FAIL; } @@ -3594,7 +3592,7 @@ static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIA
nsAString_InitDepend(&ns, pvarNS && V_VT(pvarNS) == VT_BSTR ? V_BSTR(pvarNS) : NULL); nsAString_InitDepend(&tag, bstrTag); - nsres = nsIDOMHTMLDocument_CreateElementNS(This->doc_node->nsdoc, &ns, &tag, &dom_element); + nsres = nsIDOMHTMLDocument_CreateElementNS(This->nsdoc, &ns, &tag, &dom_element); nsAString_Finish(&ns); nsAString_Finish(&tag); if(NS_FAILED(nsres)) { @@ -3602,7 +3600,7 @@ static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIA return map_nsresult(nsres); }
- hres = HTMLElement_Create(This->doc_node, (nsIDOMNode*)dom_element, FALSE, &element); + hres = HTMLElement_Create(This, (nsIDOMNode*)dom_element, FALSE, &element); nsIDOMElement_Release(dom_element); if(FAILED(hres)) return hres; @@ -3614,21 +3612,21 @@ static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIA static HRESULT WINAPI HTMLDocument7_createAttributeNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrAttrName), ppAttribute); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3637,56 +3635,56 @@ static HRESULT WINAPI HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7 *iface
static HRESULT WINAPI HTMLDocument7_get_characterSet(IHTMLDocument7 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); nsAString charset_str; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc\n"); return E_FAIL; }
nsAString_Init(&charset_str, NULL); - nsres = nsIDOMHTMLDocument_GetCharacterSet(This->doc_node->nsdoc, &charset_str); + nsres = nsIDOMHTMLDocument_GetCharacterSet(This->nsdoc, &charset_str); return return_nsstr(nsres, &charset_str, p); }
static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bstrTag, IHTMLElement **newElem) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem);
- return IHTMLDocument2_createElement(&This->doc_node->IHTMLDocument2_iface, bstrTag, newElem); + return IHTMLDocument2_createElement(&This->IHTMLDocument2_iface, bstrTag, newElem); }
static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
- return IHTMLDocument5_createAttribute(&This->doc_node->IHTMLDocument5_iface, bstrAttrName, ppAttribute); + return IHTMLDocument5_createAttribute(&This->IHTMLDocument5_iface, bstrAttrName, ppAttribute); }
static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); nsIDOMNodeList *nslist; nsAString nsstr; nsresult nsres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("NULL nsdoc not supported\n"); return E_NOTIMPL; }
nsAString_InitDepend(&nsstr, v); - nsres = nsIDOMHTMLDocument_GetElementsByClassName(This->doc_node->nsdoc, &nsstr, &nslist); + nsres = nsIDOMHTMLDocument_GetElementsByClassName(This->nsdoc, &nsstr, &nslist); nsAString_Finish(&nsstr); if(FAILED(nsres)) { ERR("GetElementByClassName failed: %08lx\n", nsres); @@ -3694,7 +3692,7 @@ static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface }
- *pel = create_collection_from_nodelist(nslist, This->doc_node->document_mode); + *pel = create_collection_from_nodelist(nslist, This->document_mode); nsIDOMNodeList_Release(nslist); return S_OK; } @@ -3702,93 +3700,93 @@ static HRESULT WINAPI HTMLDocument7_getElementsByClassName(IHTMLDocument7 *iface static HRESULT WINAPI HTMLDocument7_createProcessingInstruction(IHTMLDocument7 *iface, BSTR target, BSTR data, IDOMProcessingInstruction **newProcessingInstruction) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), newProcessingInstruction); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_adoptNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, IHTMLDOMNode3 **ppNodeDest) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p %p)\n", This, pNodeSource, ppNodeDest); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementCollection **p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument2_get_all(&This->doc_node->IHTMLDocument2_iface, p); + return IHTMLDocument2_get_all(&This->IHTMLDocument2_iface, p); }
static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_xmlEncoding(IHTMLDocument7 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%x)\n", This, v); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_xmlVersion(IHTMLDocument7 *iface, BSTR v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_w(v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_xmlVersion(IHTMLDocument7 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_hasAttributes(IHTMLDocument7 *iface, VARIANT_BOOL *pfHasAttributes) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, pfHasAttributes); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -3797,7 +3795,7 @@ static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v
static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3806,7 +3804,7 @@ static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *
static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -3815,7 +3813,7 @@ static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v)
static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3824,35 +3822,35 @@ static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p
static HRESULT WINAPI HTMLDocument7_put_oncanplay(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_oncanplay(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_oncanplaythrough(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_oncanplaythrough(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -3861,7 +3859,7 @@ static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3870,7 +3868,7 @@ static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -3879,7 +3877,7 @@ static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v)
static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -3888,119 +3886,119 @@ static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p
static HRESULT WINAPI HTMLDocument7_put_ondragend(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondragend(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ondragenter(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondragenter(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ondragleave(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondragleave(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ondragover(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondragover(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ondrop(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondrop(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ondurationchange(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ondurationchange(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onemptied(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onemptied(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onended(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onended(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4009,7 +4007,7 @@ static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v
static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4018,7 +4016,7 @@ static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *
static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4027,7 +4025,7 @@ static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v
static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4036,7 +4034,7 @@ static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *
static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4045,7 +4043,7 @@ static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v
static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4054,7 +4052,7 @@ static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *
static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4063,7 +4061,7 @@ static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v)
static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4072,133 +4070,133 @@ static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p
static HRESULT WINAPI HTMLDocument7_put_onloadeddata(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onloadeddata(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onloadedmetadata(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onloadedmetadata(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onloadstart(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onloadstart(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onpause(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onpause(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onplay(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onplay(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onplaying(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onplaying(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onprogress(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onprogress(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onratechange(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onratechange(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onreset(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onreset(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4207,7 +4205,7 @@ static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4216,63 +4214,63 @@ static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_put_onseekend(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onseekend(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onseeking(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onseeking(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onselect(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onselect(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onstalled(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onstalled(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onsubmit(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
@@ -4281,7 +4279,7 @@ static HRESULT WINAPI HTMLDocument7_put_onsubmit(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_get_onsubmit(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4290,63 +4288,63 @@ static HRESULT WINAPI HTMLDocument7_get_onsubmit(IHTMLDocument7 *iface, VARIANT
static HRESULT WINAPI HTMLDocument7_put_onsuspend(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onsuspend(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_ontimeupdate(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_ontimeupdate(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onvolumechange(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onvolumechange(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_put_onwaiting(IHTMLDocument7 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_onwaiting(IHTMLDocument7 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_normalize(IHTMLDocument7 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)\n", This); return E_NOTIMPL; } @@ -4354,14 +4352,14 @@ static HRESULT WINAPI HTMLDocument7_normalize(IHTMLDocument7 *iface) static HRESULT WINAPI HTMLDocument7_importNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, VARIANT_BOOL fDeep, IHTMLDOMNode3 **ppNodeDest) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p %x %p)\n", This, pNodeSource, fDeep, ppNodeDest); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTMLWindow2 **p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
@@ -4370,23 +4368,23 @@ static HRESULT WINAPI HTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTM
static HRESULT WINAPI HTMLDocument7_put_body(IHTMLDocument7 *iface, IHTMLElement *v) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); FIXME("(%p)->(%p)\n", This, v); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument7_get_body(IHTMLDocument7 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface);
TRACE("(%p)->(%p)\n", This, p);
- return IHTMLDocument2_get_body(&This->doc_node->IHTMLDocument2_iface, p); + return IHTMLDocument2_get_body(&This->IHTMLDocument2_iface, p); }
static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement **p) { - HTMLDocument *This = impl_from_IHTMLDocument7(iface); + HTMLDocumentNode *This = impl_from_IHTMLDocument7(iface); nsIDOMHTMLHeadElement *nshead; nsIDOMElement *nselem; HTMLElement *elem; @@ -4395,12 +4393,12 @@ static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement
TRACE("(%p)->(%p)\n", This, p);
- if(!This->doc_node->nsdoc) { + if(!This->nsdoc) { FIXME("No document\n"); return E_FAIL; }
- nsres = nsIDOMHTMLDocument_GetHead(This->doc_node->nsdoc, &nshead); + nsres = nsIDOMHTMLDocument_GetHead(This->nsdoc, &nshead); assert(nsres == NS_OK);
if(!nshead) { @@ -5549,8 +5547,6 @@ BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv) *ppv = &This->IDispatchEx_iface; else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) - *ppv = &This->IHTMLDocument7_iface; else return FALSE;
@@ -5572,7 +5568,6 @@ static const cpc_entry_t HTMLDocumentNode_cpc[] = {
void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { - doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl;
doc->outer_unk = outer; @@ -5605,6 +5600,8 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) *ppv = &This->IHTMLDocument5_iface; else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) *ppv = &This->IHTMLDocument6_iface; + else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) + *ppv = &This->IHTMLDocument7_iface; else if(IsEqualGUID(&IID_IDocumentSelector, riid)) *ppv = &This->IDocumentSelector_iface; else if(IsEqualGUID(&IID_IDocumentEvent, riid)) @@ -6080,6 +6077,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; + doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index fb2b395ca7a..f78c4a0f188 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -149,12 +149,12 @@ static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT * return get_event_handler(get_node_event_prop_target(node, eid), eid, var); }
-static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) +static inline HRESULT set_doc_event(HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) { - return set_event_handler(&doc->doc_node->node.event_target, eid, var); + return set_event_handler(&doc->node.event_target, eid, var); }
-static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) +static inline HRESULT get_doc_event(HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) { - return get_event_handler(&doc->doc_node->node.event_target, eid, var); + return get_event_handler(&doc->node.event_target, eid, var); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 3464f9c5bbd..50d756309fe 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -640,7 +640,6 @@ struct ConnectionPoint { };
struct HTMLDocument { - IHTMLDocument7 IHTMLDocument7_iface; IDispatchEx IDispatchEx_iface;
IUnknown *outer_unk; @@ -680,6 +679,7 @@ struct HTMLDocumentObj { IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; + IHTMLDocument7 IHTMLDocument7_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; @@ -904,6 +904,7 @@ struct HTMLDocumentNode { IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; + IHTMLDocument7 IHTMLDocument7_iface; IDocumentSelector IDocumentSelector_iface; IDocumentEvent IDocumentEvent_iface; ISupportErrorInfo ISupportErrorInfo_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 1e4a8931e48..bca1d43848c 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -2218,7 +2218,7 @@ static HRESULT WINAPI DocObjHTMLDocument2_get_Script(IHTMLDocument2 *iface, IDis
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_parentWindow(&This->basedoc.IHTMLDocument7_iface, (IHTMLWindow2**)p); + hres = IHTMLDocument7_get_parentWindow(&This->IHTMLDocument7_iface, (IHTMLWindow2**)p); return hres == S_OK && !*p ? E_PENDING : hres; }
@@ -2375,7 +2375,7 @@ static HRESULT WINAPI DocObjHTMLDocument2_get_parentWindow(IHTMLDocument2 *iface
TRACE("(%p)->(%p)\n", This, p);
- hres = IHTMLDocument7_get_defaultView(&This->basedoc.IHTMLDocument7_iface, p); + hres = IHTMLDocument7_get_defaultView(&This->IHTMLDocument7_iface, p); return hres == S_OK && !*p ? E_FAIL : hres; }
@@ -2780,6 +2780,258 @@ static const IHTMLDocument6Vtbl DocObjHTMLDocument6Vtbl = { DocObjHTMLDocument6_updateSettings };
+/********************************************************** + * IHTMLDocument7 implementation + */ +static inline HTMLDocumentObj *impl_from_IHTMLDocument7(IHTMLDocument7 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, IHTMLDocument7_iface); +} + +HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument7) + +static HRESULT WINAPI DocObjHTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTMLWindow2 **p) +{ + HTMLDocumentObj *This = impl_from_IHTMLDocument7(iface); + + TRACE("(%p)->(%p)\n", This, p); + + if(This->basedoc.window) { + *p = &This->basedoc.window->base.IHTMLWindow2_iface; + IHTMLWindow2_AddRef(*p); + }else { + *p = NULL; + } + return S_OK; +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument7, createCDATASection, BSTR,IHTMLDOMNode**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, getSelection, IHTMLSelection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument7, getElementsByTagNameNS, VARIANT*,BSTR,IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument7, createElementNS, VARIANT*,BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument7, createAttributeNS, VARIANT*,BSTR,IHTMLDOMAttribute**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onmsthumbnailclick, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onmsthumbnailclick, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_characterSet, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument7, createElement, BSTR,IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument7, createAttribute, BSTR,IHTMLDOMAttribute**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument7, getElementsByClassName, BSTR,IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument7, createProcessingInstruction, BSTR,BSTR,IDOMProcessingInstruction**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_2(HTMLDocument7, adoptNode, IHTMLDOMNode*,IHTMLDOMNode3**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onmssitemodejumplistitemremoved, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onmssitemodejumplistitemremoved, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_all, IHTMLElementCollection**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_inputEncoding, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_xmlEncoding, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_xmlStandalone, VARIANT_BOOL) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_xmlStandalone, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_xmlVersion, BSTR) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_xmlVersion, BSTR*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, hasAttributes, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onabort, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onabort, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onblur, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onblur, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_oncanplay, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_oncanplay, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_oncanplaythrough, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_oncanplaythrough, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondrag, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondrag, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondragend, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondragend, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondragenter, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondragenter, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondragleave, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondragleave, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondragover, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondragover, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondrop, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondrop, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ondurationchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ondurationchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onemptied, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onemptied, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onended, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onended, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onerror, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onerror, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onfocus, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onfocus, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_oninput, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_oninput, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onload, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onload, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onloadeddata, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onloadeddata, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onloadedmetadata, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onloadedmetadata, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onloadstart, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onloadstart, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onpause, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onpause, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onplay, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onplay, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onplaying, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onplaying, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onprogress, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onprogress, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onratechange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onratechange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onreset, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onreset, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onscroll, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onscroll, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onseeked, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onseeked, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onseeking, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onseeking, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onselect, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onselect, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onstalled, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onstalled, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onsubmit, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onsubmit, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onsuspend, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onsuspend, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_ontimeupdate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_ontimeupdate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onvolumechange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onvolumechange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, put_onwaiting, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_onwaiting, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument7, normalize) +HTMLDOCUMENTOBJ_FWD_TO_NODE_3(HTMLDocument7, importNode, IHTMLDOMNode*,VARIANT_BOOL,IHTMLDOMNode3**) + +static HRESULT WINAPI DocObjHTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTMLWindow2 **p) +{ + HTMLDocumentObj *This = impl_from_IHTMLDocument7(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return IHTMLDocument7_get_defaultView(&This->IHTMLDocument7_iface, p); +} + +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, putref_body, IHTMLElement*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_body, IHTMLElement**) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument7, get_head, IHTMLElement**) + +static const IHTMLDocument7Vtbl DocObjHTMLDocument7Vtbl = { + DocObjHTMLDocument7_QueryInterface, + DocObjHTMLDocument7_AddRef, + DocObjHTMLDocument7_Release, + DocObjHTMLDocument7_GetTypeInfoCount, + DocObjHTMLDocument7_GetTypeInfo, + DocObjHTMLDocument7_GetIDsOfNames, + DocObjHTMLDocument7_Invoke, + DocObjHTMLDocument7_get_defaultView, + DocObjHTMLDocument7_createCDATASection, + DocObjHTMLDocument7_getSelection, + DocObjHTMLDocument7_getElementsByTagNameNS, + DocObjHTMLDocument7_createElementNS, + DocObjHTMLDocument7_createAttributeNS, + DocObjHTMLDocument7_put_onmsthumbnailclick, + DocObjHTMLDocument7_get_onmsthumbnailclick, + DocObjHTMLDocument7_get_characterSet, + DocObjHTMLDocument7_createElement, + DocObjHTMLDocument7_createAttribute, + DocObjHTMLDocument7_getElementsByClassName, + DocObjHTMLDocument7_createProcessingInstruction, + DocObjHTMLDocument7_adoptNode, + DocObjHTMLDocument7_put_onmssitemodejumplistitemremoved, + DocObjHTMLDocument7_get_onmssitemodejumplistitemremoved, + DocObjHTMLDocument7_get_all, + DocObjHTMLDocument7_get_inputEncoding, + DocObjHTMLDocument7_get_xmlEncoding, + DocObjHTMLDocument7_put_xmlStandalone, + DocObjHTMLDocument7_get_xmlStandalone, + DocObjHTMLDocument7_put_xmlVersion, + DocObjHTMLDocument7_get_xmlVersion, + DocObjHTMLDocument7_hasAttributes, + DocObjHTMLDocument7_put_onabort, + DocObjHTMLDocument7_get_onabort, + DocObjHTMLDocument7_put_onblur, + DocObjHTMLDocument7_get_onblur, + DocObjHTMLDocument7_put_oncanplay, + DocObjHTMLDocument7_get_oncanplay, + DocObjHTMLDocument7_put_oncanplaythrough, + DocObjHTMLDocument7_get_oncanplaythrough, + DocObjHTMLDocument7_put_onchange, + DocObjHTMLDocument7_get_onchange, + DocObjHTMLDocument7_put_ondrag, + DocObjHTMLDocument7_get_ondrag, + DocObjHTMLDocument7_put_ondragend, + DocObjHTMLDocument7_get_ondragend, + DocObjHTMLDocument7_put_ondragenter, + DocObjHTMLDocument7_get_ondragenter, + DocObjHTMLDocument7_put_ondragleave, + DocObjHTMLDocument7_get_ondragleave, + DocObjHTMLDocument7_put_ondragover, + DocObjHTMLDocument7_get_ondragover, + DocObjHTMLDocument7_put_ondrop, + DocObjHTMLDocument7_get_ondrop, + DocObjHTMLDocument7_put_ondurationchange, + DocObjHTMLDocument7_get_ondurationchange, + DocObjHTMLDocument7_put_onemptied, + DocObjHTMLDocument7_get_onemptied, + DocObjHTMLDocument7_put_onended, + DocObjHTMLDocument7_get_onended, + DocObjHTMLDocument7_put_onerror, + DocObjHTMLDocument7_get_onerror, + DocObjHTMLDocument7_put_onfocus, + DocObjHTMLDocument7_get_onfocus, + DocObjHTMLDocument7_put_oninput, + DocObjHTMLDocument7_get_oninput, + DocObjHTMLDocument7_put_onload, + DocObjHTMLDocument7_get_onload, + DocObjHTMLDocument7_put_onloadeddata, + DocObjHTMLDocument7_get_onloadeddata, + DocObjHTMLDocument7_put_onloadedmetadata, + DocObjHTMLDocument7_get_onloadedmetadata, + DocObjHTMLDocument7_put_onloadstart, + DocObjHTMLDocument7_get_onloadstart, + DocObjHTMLDocument7_put_onpause, + DocObjHTMLDocument7_get_onpause, + DocObjHTMLDocument7_put_onplay, + DocObjHTMLDocument7_get_onplay, + DocObjHTMLDocument7_put_onplaying, + DocObjHTMLDocument7_get_onplaying, + DocObjHTMLDocument7_put_onprogress, + DocObjHTMLDocument7_get_onprogress, + DocObjHTMLDocument7_put_onratechange, + DocObjHTMLDocument7_get_onratechange, + DocObjHTMLDocument7_put_onreset, + DocObjHTMLDocument7_get_onreset, + DocObjHTMLDocument7_put_onscroll, + DocObjHTMLDocument7_get_onscroll, + DocObjHTMLDocument7_put_onseeked, + DocObjHTMLDocument7_get_onseeked, + DocObjHTMLDocument7_put_onseeking, + DocObjHTMLDocument7_get_onseeking, + DocObjHTMLDocument7_put_onselect, + DocObjHTMLDocument7_get_onselect, + DocObjHTMLDocument7_put_onstalled, + DocObjHTMLDocument7_get_onstalled, + DocObjHTMLDocument7_put_onsubmit, + DocObjHTMLDocument7_get_onsubmit, + DocObjHTMLDocument7_put_onsuspend, + DocObjHTMLDocument7_get_onsuspend, + DocObjHTMLDocument7_put_ontimeupdate, + DocObjHTMLDocument7_get_ontimeupdate, + DocObjHTMLDocument7_put_onvolumechange, + DocObjHTMLDocument7_get_onvolumechange, + DocObjHTMLDocument7_put_onwaiting, + DocObjHTMLDocument7_get_onwaiting, + DocObjHTMLDocument7_normalize, + DocObjHTMLDocument7_importNode, + DocObjHTMLDocument7_get_parentWindow, + DocObjHTMLDocument7_putref_body, + DocObjHTMLDocument7_get_body, + DocObjHTMLDocument7_get_head +}; + /********************************************************** * ISupportErrorInfo implementation */ @@ -3040,6 +3292,8 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii *ppv = &This->IHTMLDocument5_iface; }else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) { *ppv = &This->IHTMLDocument6_iface; + }else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) { + *ppv = &This->IHTMLDocument7_iface; }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_IDocumentSelector, riid)) { @@ -3361,6 +3615,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii doc->IHTMLDocument4_iface.lpVtbl = &DocObjHTMLDocument4Vtbl; doc->IHTMLDocument5_iface.lpVtbl = &DocObjHTMLDocument5Vtbl; doc->IHTMLDocument6_iface.lpVtbl = &DocObjHTMLDocument6Vtbl; + doc->IHTMLDocument7_iface.lpVtbl = &DocObjHTMLDocument7Vtbl; doc->IDocumentSelector_iface.lpVtbl = &DocObjDocumentSelectorVtbl; doc->IDocumentEvent_iface.lpVtbl = &DocObjDocumentEventVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &DocObjSupportErrorInfoVtbl; diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index c49f1b4f55f..d3ffc29af4b 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -270,7 +270,7 @@ static HRESULT WINAPI HTMLDOMImplementation2_createHTMLDocument(IHTMLDOMImplemen if(FAILED(hres)) return hres;
- *new_document = &new_document_node->basedoc.IHTMLDocument7_iface; + *new_document = &new_document_node->IHTMLDocument7_iface; return S_OK; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125329
Your paranoid android.
=== debian11 (build log) ===
Task: Could not create the win32 wineprefix: Failed to disable the crash dialogs: Task: WineTest did not produce the win32 report
On Fri Oct 21 18:59:31 2022 +0000, Gabriel Ivăncescu wrote:
For stubs, I generally avoided those that don't have some respective gecko interface, because I was a bit unsure how their implementation would actually look like. Some of the others aren't forwarded because they used some fields from the former `basedoc`, which are different on HTMLDocumentObj compared to node (most commonly "window"), and I didn't want to change the existing behavior at all, but keep it no-op. As for the "other way around", seems it's just get_referrer; since this is likely tied to the window, I wanted to avoid forwarding it to the node (same reason as above). As I understand, the doc object is always available, but the node might not always be. It should be fine this way? Which stubs did you have in mind to forward, only the IHTMLDocument* ones, or also for the other interfaces?
I mostly meant DOM APIs, those are all IHTML* interfaces. And yes, for functions returning window object it may be a bit more tricky. This will need more testing (and possibly changes to window object), so we may keep it for now. But that doesn't really apply to get_referrer(). Even if window representation may differ, top document node and document object still refer to the same actual window with the same navigation history, so it should be fine to forward to node.
Jacek Caban (@jacek) commented about dlls/mshtml/oleobj.c:
+}
+HTMLDOCUMENTOBJ_IDISPATCH_METHODS(HTMLDocument4) +HTMLDOCUMENTOBJ_FWD_TO_NODE_0(HTMLDocument4, focus) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, hasFocus, VARIANT_BOOL*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, put_onselectionchange, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_onselectionchange, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument4, get_namespaces, IDispatch**)
+static HRESULT WINAPI DocObjHTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
BSTR bstrOptions, IHTMLDocument2 **newDoc)
+{
- HTMLDocumentObj *This = impl_from_IHTMLDocument4(iface);
- FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
- return E_NOTIMPL;
+}
It should be fine to forward this one.
Jacek Caban (@jacek) commented about dlls/mshtml/oleobj.c:
+HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforeactivate, VARIANT*) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, put_onbeforedeactivate, VARIANT) +HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument5, get_onbeforedeactivate, VARIANT*)
+static HRESULT WINAPI DocObjHTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +{
- HTMLDocumentObj *This = impl_from_IHTMLDocument5(iface);
- if(This->basedoc.doc_node)
return IHTMLDocument5_get_compatMode(&This->basedoc.doc_node->IHTMLDocument5_iface, p);
- TRACE("(%p)->(%p)\n", This, p);
- return (*p = SysAllocString(L"BackCompat")) ? S_OK : E_OUTOFMEMORY;
+}
I think this should use the same logic for forwarding as other functions. I guess you didn't do that because of different NULL doc_node handling, but that rises a question: when does it matter? I don't think that NULL doc_node is a valid state. Unless I'm missing something, those tests for NULL are leftovers from times when we allowed creating document object even if creating Gecko object failed, but that's not the case anymore.
On Mon Oct 24 11:40:35 2022 +0000, Jacek Caban wrote:
It should be fine to forward this one.
Ok. I wasn't sure if it returned a different document's IHTMLDocument2 interface (i.e. the document obj instead of the node).