Commit 11eb1b08 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Make COM inproc object and document node separated objects inheriting from HTMLDocument.

parent 74f28d4a
......@@ -38,7 +38,7 @@ typedef struct {
LONG ref;
nsIDOMHTMLIFrameElement *nsiframe;
HTMLDocument *content_doc;
HTMLDocumentNode *content_doc;
} HTMLIFrame;
#define HTMLFRAMEBASE2(x) (&(x)->lpIHTMLFrameBase2Vtbl)
......@@ -134,7 +134,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
return hres;
}
return IHTMLDocument2_get_parentWindow(HTMLDOC(This->content_doc), p);
return IHTMLDocument2_get_parentWindow(HTMLDOC(&This->content_doc->basedoc), p);
}
static HRESULT WINAPI HTMLIFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
......@@ -230,7 +230,7 @@ static void HTMLIFrame_destructor(HTMLDOMNode *iface)
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
if(This->content_doc)
IHTMLDocument2_Release(HTMLDOC(This->content_doc));
htmldoc_release(&This->content_doc->basedoc);
if(This->nsiframe)
nsIDOMHTMLIFrameElement_Release(This->nsiframe);
......
......@@ -242,8 +242,15 @@ struct ConnectionPoint {
ConnectionPoint *next;
};
typedef struct {
HRESULT (*query_interface)(HTMLDocument*,REFIID,void**);
ULONG (*addref)(HTMLDocument*);
ULONG (*release)(HTMLDocument*);
} htmldoc_vtbl_t;
struct HTMLDocument {
DispatchEx dispex;
const htmldoc_vtbl_t *vtbl;
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
const IHTMLDocument3Vtbl *lpHTMLDocument3Vtbl;
const IHTMLDocument4Vtbl *lpHTMLDocument4Vtbl;
......@@ -266,7 +273,6 @@ struct HTMLDocument {
const ICustomDocVtbl *lpCustomDocVtbl;
const IDispatchExVtbl *lpIDispatchExVtbl;
const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl;
LONG ref;
NSContainer *nscontainer;
HTMLWindow *window;
......@@ -314,6 +320,33 @@ struct HTMLDocument {
HTMLDOMNode *nodes;
};
static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)
{
return This->vtbl->query_interface(This, riid, ppv);
}
static inline ULONG htmldoc_addref(HTMLDocument *This)
{
return This->vtbl->addref(This);
}
static inline ULONG htmldoc_release(HTMLDocument *This)
{
return This->vtbl->release(This);
}
typedef struct {
HTMLDocument basedoc;
LONG ref;
} HTMLDocumentNode;
typedef struct {
HTMLDocument basedoc;
LONG ref;
} HTMLDocumentObj;
typedef struct {
const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl;
NSContainer *This;
......@@ -508,7 +541,7 @@ typedef struct {
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocument**);
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentNode**);
HRESULT HTMLWindow_Create(HTMLDocument*,nsIDOMWindow*,HTMLWindow**);
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
......
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