Commit 46d4d263 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Get rid of the outer_unk in basedoc.

parent f852f1a6
......@@ -1441,7 +1441,7 @@ void HTMLDOMNode_destructor(HTMLDOMNode *This)
if(This->nsnode)
nsIDOMNode_Release(This->nsnode);
if(This->doc && &This->doc->node != This)
htmldoc_release(&This->doc->basedoc);
IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface);
}
static HRESULT HTMLDOMNode_clone(HTMLDOMNode *This, nsIDOMNode *nsnode, HTMLDOMNode **ret)
......@@ -1479,7 +1479,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno
EventTarget_Init(&node->event_target, (IUnknown*)&node->IHTMLDOMNode_iface, dispex_data, doc->document_mode);
if(&doc->node != node)
htmldoc_addref(&doc->basedoc);
IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface);
node->doc = doc;
nsIDOMNode_AddRef(nsnode);
......@@ -1601,7 +1601,7 @@ static nsresult NSAPI HTMLDOMNode_unlink(void *p)
if(This->doc && &This->doc->node != This) {
HTMLDocumentNode *doc = This->doc;
This->doc = NULL;
htmldoc_release(&doc->basedoc);
IHTMLDOMNode_Release(&doc->node.IHTMLDOMNode_iface);
}else {
This->doc = NULL;
}
......@@ -1667,6 +1667,6 @@ HRESULT get_node(nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
return E_FAIL;
hres = create_node(document, nsnode, ret);
htmldoc_release(&document->basedoc);
IHTMLDOMNode_Release(&document->node.IHTMLDOMNode_iface);
return hres;
}
......@@ -259,7 +259,7 @@ static void release_inner_window(HTMLInnerWindow *This)
if(This->doc) {
This->doc->window = NULL;
htmldoc_release(&This->doc->basedoc);
IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface);
}
release_event_target(&This->event_target);
......@@ -4187,9 +4187,9 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
if(is_main_content_window(outer_window) || !outer_window->browser->content_window) {
HTMLDocumentObj *doc_obj = outer_window->browser->doc;
if(doc_obj->basedoc.doc_node)
htmldoc_release(&doc_obj->basedoc.doc_node->basedoc);
IHTMLDOMNode_Release(&doc_obj->basedoc.doc_node->node.IHTMLDOMNode_iface);
doc_obj->basedoc.doc_node = window->doc;
htmldoc_addref(&window->doc->basedoc);
IHTMLDOMNode_AddRef(&window->doc->node.IHTMLDOMNode_iface);
}
return hres;
......
......@@ -640,29 +640,12 @@ struct ConnectionPoint {
};
struct HTMLDocument {
IUnknown *outer_unk;
HTMLDocumentObj *doc_obj;
HTMLDocumentNode *doc_node;
HTMLOuterWindow *window;
};
static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
{
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
}
static inline ULONG htmldoc_addref(HTMLDocument *This)
{
return IUnknown_AddRef(This->outer_unk);
}
static inline ULONG htmldoc_release(HTMLDocument *This)
{
return IUnknown_Release(This->outer_unk);
}
struct HTMLDocumentObj {
HTMLDocument basedoc;
DispatchEx dispex;
......@@ -707,6 +690,7 @@ struct HTMLDocumentObj {
LONG ref;
IUnknown *outer_unk;
GeckoBrowser *nscontainer;
IOleClientSite *client;
......
......@@ -605,7 +605,7 @@ static nsrefcnt NSAPI nsRunnable_Release(nsIRunnable *iface)
TRACE("(%p) ref=%ld\n", This, ref);
if(!ref) {
htmldoc_release(&This->doc->basedoc);
IHTMLDOMNode_Release(&This->doc->node.IHTMLDOMNode_iface);
if(This->arg1)
nsISupports_Release(This->arg1);
if(This->arg2)
......@@ -641,7 +641,7 @@ static void add_script_runner(HTMLDocumentNode *This, runnable_proc_t proc, nsIS
runnable->nsIRunnable_iface.lpVtbl = &nsRunnableVtbl;
runnable->ref = 1;
htmldoc_addref(&This->basedoc);
IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
runnable->doc = This;
runnable->proc = proc;
......@@ -683,20 +683,20 @@ static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *ifa
return NS_NOINTERFACE;
}
htmldoc_addref(&This->basedoc);
IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
return NS_OK;
}
static nsrefcnt NSAPI nsDocumentObserver_AddRef(nsIDocumentObserver *iface)
{
HTMLDocumentNode *This = impl_from_nsIDocumentObserver(iface);
return htmldoc_addref(&This->basedoc);
return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
}
static nsrefcnt NSAPI nsDocumentObserver_Release(nsIDocumentObserver *iface)
{
HTMLDocumentNode *This = impl_from_nsIDocumentObserver(iface);
return htmldoc_release(&This->basedoc);
return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface);
}
static void NSAPI nsDocumentObserver_CharacterDataWillChange(nsIDocumentObserver *iface,
......
......@@ -237,7 +237,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
connect_scripts(doc->window);
htmldoc_addref(&doc->basedoc);
IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface);
if(doc_obj)
handle_docobj_load(doc_obj);
......@@ -278,7 +278,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
WARN("no window\n");
}
htmldoc_release(&doc->basedoc);
IHTMLDOMNode_Release(&doc->node.IHTMLDOMNode_iface);
return NS_OK;
}
......
......@@ -801,19 +801,19 @@ static const cmdtable_t base_cmds[] = {
static HRESULT WINAPI DocNodeOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppv);
return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI DocNodeOleCommandTarget_AddRef(IOleCommandTarget *iface)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface);
return htmldoc_addref(&This->basedoc);
return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
}
static ULONG WINAPI DocNodeOleCommandTarget_Release(IOleCommandTarget *iface)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IOleCommandTarget(iface);
return htmldoc_release(&This->basedoc);
return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface);
}
static HRESULT query_from_table(HTMLDocumentNode *doc, const cmdtable_t *cmdtable, OLECMD *cmd)
......@@ -965,19 +965,19 @@ static const IOleCommandTargetVtbl DocNodeOleCommandTargetVtbl = {
static HRESULT WINAPI DocObjOleCommandTarget_QueryInterface(IOleCommandTarget *iface, REFIID riid, void **ppv)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppv);
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
}
static ULONG WINAPI DocObjOleCommandTarget_AddRef(IOleCommandTarget *iface)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
return htmldoc_addref(&This->basedoc);
return IUnknown_AddRef(This->outer_unk);
}
static ULONG WINAPI DocObjOleCommandTarget_Release(IOleCommandTarget *iface)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IOleCommandTarget(iface);
return htmldoc_release(&This->basedoc);
return IUnknown_Release(This->outer_unk);
}
static HRESULT WINAPI DocObjOleCommandTarget_QueryStatus(IOleCommandTarget *iface, const GUID *pguidCmdGroup,
......
......@@ -1473,7 +1473,7 @@ static EventTarget *find_event_target(HTMLDocumentNode *doc, HTMLScriptElement *
FIXME("Empty for attribute\n");
}else if(!wcscmp(target_id, L"document")) {
event_target = &doc->node.event_target;
htmldoc_addref(&doc->basedoc);
IHTMLDOMNode_AddRef(&doc->node.IHTMLDOMNode_iface);
}else if(!wcscmp(target_id, L"window")) {
if(doc->window) {
event_target = &doc->window->event_target;
......
......@@ -340,19 +340,19 @@ static inline HTMLDocumentNode *HTMLDocumentNode_from_IServiceProvider(IServiceP
static HRESULT WINAPI DocNodeServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppv);
return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI DocNodeServiceProvider_AddRef(IServiceProvider *iface)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface);
return htmldoc_addref(&This->basedoc);
return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
}
static ULONG WINAPI DocNodeServiceProvider_Release(IServiceProvider *iface)
{
HTMLDocumentNode *This = HTMLDocumentNode_from_IServiceProvider(iface);
return htmldoc_release(&This->basedoc);
return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI DocNodeServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
......@@ -383,19 +383,19 @@ static inline HTMLDocumentObj *HTMLDocumentObj_from_IServiceProvider(IServicePro
static HRESULT WINAPI DocObjServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppv);
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
}
static ULONG WINAPI DocObjServiceProvider_AddRef(IServiceProvider *iface)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface);
return htmldoc_addref(&This->basedoc);
return IUnknown_AddRef(This->outer_unk);
}
static ULONG WINAPI DocObjServiceProvider_Release(IServiceProvider *iface)
{
HTMLDocumentObj *This = HTMLDocumentObj_from_IServiceProvider(iface);
return htmldoc_release(&This->basedoc);
return IUnknown_Release(This->outer_unk);
}
static HRESULT WINAPI DocObjServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
......
......@@ -419,19 +419,19 @@ static inline HTMLDocumentObj *impl_from_IOleDocumentView(IOleDocumentView *ifac
static HRESULT WINAPI OleDocumentView_QueryInterface(IOleDocumentView *iface, REFIID riid, void **ppvObject)
{
HTMLDocumentObj *This = impl_from_IOleDocumentView(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppvObject);
return IUnknown_QueryInterface(This->outer_unk, riid, ppvObject);
}
static ULONG WINAPI OleDocumentView_AddRef(IOleDocumentView *iface)
{
HTMLDocumentObj *This = impl_from_IOleDocumentView(iface);
return htmldoc_addref(&This->basedoc);
return IUnknown_AddRef(This->outer_unk);
}
static ULONG WINAPI OleDocumentView_Release(IOleDocumentView *iface)
{
HTMLDocumentObj *This = impl_from_IOleDocumentView(iface);
return htmldoc_release(&This->basedoc);
return IUnknown_Release(This->outer_unk);
}
static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IOleInPlaceSite *pIPSite)
......@@ -727,19 +727,19 @@ static inline HTMLDocumentObj *impl_from_IViewObjectEx(IViewObjectEx *iface)
static HRESULT WINAPI ViewObject_QueryInterface(IViewObjectEx *iface, REFIID riid, void **ppv)
{
HTMLDocumentObj *This = impl_from_IViewObjectEx(iface);
return htmldoc_query_interface(&This->basedoc, riid, ppv);
return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
}
static ULONG WINAPI ViewObject_AddRef(IViewObjectEx *iface)
{
HTMLDocumentObj *This = impl_from_IViewObjectEx(iface);
return htmldoc_addref(&This->basedoc);
return IUnknown_AddRef(This->outer_unk);
}
static ULONG WINAPI ViewObject_Release(IViewObjectEx *iface)
{
HTMLDocumentObj *This = impl_from_IViewObjectEx(iface);
return htmldoc_release(&This->basedoc);
return IUnknown_Release(This->outer_unk);
}
static HRESULT WINAPI ViewObject_Draw(IViewObjectEx *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect,
......@@ -894,13 +894,13 @@ static HRESULT WINAPI WindowForBindingUI_QueryInterface(IWindowForBindingUI *ifa
static ULONG WINAPI WindowForBindingUI_AddRef(IWindowForBindingUI *iface)
{
HTMLDocumentObj *This = impl_from_IWindowForBindingUI(iface);
return htmldoc_addref(&This->basedoc);
return IUnknown_AddRef(This->outer_unk);
}
static ULONG WINAPI WindowForBindingUI_Release(IWindowForBindingUI *iface)
{
HTMLDocumentObj *This = impl_from_IWindowForBindingUI(iface);
return htmldoc_release(&This->basedoc);
return IUnknown_Release(This->outer_unk);
}
static HRESULT WINAPI WindowForBindingUI_GetWindow(IWindowForBindingUI *iface, REFGUID rguidReason, HWND *phwnd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment