Commit f52e0a77 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't use DEFINE_THIS2 for HTMLDOMNode vtbl functions.

parent 76c028b7
...@@ -473,11 +473,14 @@ static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = { ...@@ -473,11 +473,14 @@ static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
HTMLAnchorElement_blur HTMLAnchorElement_blur
}; };
#define HTMLANCHOR_NODE_THIS(iface) DEFINE_THIS2(HTMLAnchorElement, element.node, iface) static inline HTMLAnchorElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLAnchorElement, element.node);
}
static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface); HTMLAnchorElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -502,7 +505,7 @@ static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -502,7 +505,7 @@ static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLAnchorElement_destructor(HTMLDOMNode *iface) static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
{ {
HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface); HTMLAnchorElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsanchor) if(This->nsanchor)
nsIDOMHTMLAnchorElement_Release(This->nsanchor); nsIDOMHTMLAnchorElement_Release(This->nsanchor);
...@@ -510,8 +513,6 @@ static void HTMLAnchorElement_destructor(HTMLDOMNode *iface) ...@@ -510,8 +513,6 @@ static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLANCHOR_NODE_THIS
static const NodeImplVtbl HTMLAnchorElementImplVtbl = { static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
HTMLAnchorElement_QI, HTMLAnchorElement_QI,
HTMLAnchorElement_destructor, HTMLAnchorElement_destructor,
......
...@@ -738,11 +738,14 @@ static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = { ...@@ -738,11 +738,14 @@ static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
HTMLBodyElement_createTextRange HTMLBodyElement_createTextRange
}; };
#define HTMLBODY_NODE_THIS(iface) DEFINE_THIS2(HTMLBodyElement, textcont.element.node, iface) static inline HTMLBodyElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLBodyElement, textcont.element.node);
}
static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLBodyElement *This = HTMLBODY_NODE_THIS(iface); HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -770,7 +773,7 @@ static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -770,7 +773,7 @@ static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLBodyElement_destructor(HTMLDOMNode *iface) static void HTMLBodyElement_destructor(HTMLDOMNode *iface)
{ {
HTMLBodyElement *This = HTMLBODY_NODE_THIS(iface); HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMHTMLBodyElement_Release(This->nsbody); nsIDOMHTMLBodyElement_Release(This->nsbody);
...@@ -779,15 +782,13 @@ static void HTMLBodyElement_destructor(HTMLDOMNode *iface) ...@@ -779,15 +782,13 @@ static void HTMLBodyElement_destructor(HTMLDOMNode *iface)
static event_target_t **HTMLBodyElement_get_event_target(HTMLDOMNode *iface) static event_target_t **HTMLBodyElement_get_event_target(HTMLDOMNode *iface)
{ {
HTMLBodyElement *This = HTMLBODY_NODE_THIS(iface); HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
return This->textcont.element.node.doc return This->textcont.element.node.doc
? &This->textcont.element.node.doc->body_event_target ? &This->textcont.element.node.doc->body_event_target
: &This->textcont.element.node.event_target; : &This->textcont.element.node.event_target;
} }
#undef HTMLBODY_NODE_THIS
static const NodeImplVtbl HTMLBodyElementImplVtbl = { static const NodeImplVtbl HTMLBodyElementImplVtbl = {
HTMLBodyElement_QI, HTMLBodyElement_QI,
HTMLBodyElement_destructor, HTMLBodyElement_destructor,
......
...@@ -139,11 +139,14 @@ static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = { ...@@ -139,11 +139,14 @@ static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
HTMLCommentElement_get_atomic HTMLCommentElement_get_atomic
}; };
#define HTMLCOMMENT_NODE_THIS(iface) DEFINE_THIS2(HTMLCommentElement, element.node, iface) static inline HTMLCommentElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLCommentElement, element.node);
}
static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface); HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -160,13 +163,11 @@ static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv ...@@ -160,13 +163,11 @@ static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv
static void HTMLCommentElement_destructor(HTMLDOMNode *iface) static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
{ {
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface); HTMLCommentElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLCOMMENT_NODE_THIS
static const NodeImplVtbl HTMLCommentElementImplVtbl = { static const NodeImplVtbl HTMLCommentElementImplVtbl = {
HTMLCommentElement_QI, HTMLCommentElement_QI,
HTMLCommentElement_destructor, HTMLCommentElement_destructor,
......
...@@ -1870,11 +1870,14 @@ static void destroy_htmldoc(HTMLDocument *This) ...@@ -1870,11 +1870,14 @@ static void destroy_htmldoc(HTMLDocument *This)
ConnectionPointContainer_Destroy(&This->cp_container); ConnectionPointContainer_Destroy(&This->cp_container);
} }
#define HTMLDOCNODE_NODE_THIS(iface) DEFINE_THIS2(HTMLDocumentNode, node, iface) static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLDocumentNode, node);
}
static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface); HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
if(htmldoc_qi(&This->basedoc, riid, ppv)) if(htmldoc_qi(&This->basedoc, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE; return *ppv ? S_OK : E_NOINTERFACE;
...@@ -1892,7 +1895,7 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -1892,7 +1895,7 @@ static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLDocumentNode_destructor(HTMLDOMNode *iface) static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
{ {
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface); HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
if(This->body_event_target) if(This->body_event_target)
release_event_target(This->body_event_target); release_event_target(This->body_event_target);
...@@ -1921,7 +1924,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface) ...@@ -1921,7 +1924,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
{ {
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface); HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
FIXME("%p\n", This); FIXME("%p\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -1934,7 +1937,7 @@ static const NodeImplVtbl HTMLDocumentNodeImplVtbl = { ...@@ -1934,7 +1937,7 @@ static const NodeImplVtbl HTMLDocumentNodeImplVtbl = {
static HRESULT HTMLDocumentFragment_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) static HRESULT HTMLDocumentFragment_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
{ {
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface); HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
HTMLDocumentNode *new_node; HTMLDocumentNode *new_node;
HRESULT hres; HRESULT hres;
...@@ -1946,8 +1949,6 @@ static HRESULT HTMLDocumentFragment_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode ...@@ -1946,8 +1949,6 @@ static HRESULT HTMLDocumentFragment_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode
return S_OK; return S_OK;
} }
#undef HTMLDOCNODE_NODE_THIS
static const NodeImplVtbl HTMLDocumentFragmentImplVtbl = { static const NodeImplVtbl HTMLDocumentFragmentImplVtbl = {
HTMLDocumentNode_QI, HTMLDocumentNode_QI,
HTMLDocumentNode_destructor, HTMLDocumentNode_destructor,
......
...@@ -144,8 +144,6 @@ HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMHTMLElement ...@@ -144,8 +144,6 @@ HRESULT create_nselem(HTMLDocumentNode *doc, const WCHAR *tag, nsIDOMHTMLElement
return S_OK; return S_OK;
} }
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
static HRESULT WINAPI HTMLElement_QueryInterface(IHTMLElement *iface, static HRESULT WINAPI HTMLElement_QueryInterface(IHTMLElement *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
...@@ -1591,9 +1589,14 @@ static const IHTMLElementVtbl HTMLElementVtbl = { ...@@ -1591,9 +1589,14 @@ static const IHTMLElementVtbl HTMLElementVtbl = {
HTMLElement_get_all HTMLElement_get_all
}; };
static inline HTMLElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLElement, node);
}
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLElement *This = HTMLELEM_NODE_THIS(iface); HTMLElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -1627,7 +1630,7 @@ HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -1627,7 +1630,7 @@ HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
void HTMLElement_destructor(HTMLDOMNode *iface) void HTMLElement_destructor(HTMLDOMNode *iface)
{ {
HTMLElement *This = HTMLELEM_NODE_THIS(iface); HTMLElement *This = impl_from_HTMLDOMNode(iface);
ConnectionPointContainer_Destroy(&This->cp_container); ConnectionPointContainer_Destroy(&This->cp_container);
...@@ -1639,7 +1642,7 @@ void HTMLElement_destructor(HTMLDOMNode *iface) ...@@ -1639,7 +1642,7 @@ void HTMLElement_destructor(HTMLDOMNode *iface)
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
{ {
HTMLElement *This = HTMLELEM_NODE_THIS(iface); HTMLElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement *new_elem; HTMLElement *new_elem;
HRESULT hres; HRESULT hres;
......
...@@ -50,6 +50,12 @@ typedef struct { ...@@ -50,6 +50,12 @@ typedef struct {
DWORD size; DWORD size;
} elem_vector_t; } elem_vector_t;
/* FIXME: Handle it better way */
static inline HTMLElement *elem_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLElement, node);
}
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk, static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk,
HTMLElement **elems, DWORD len); HTMLElement **elems, DWORD len);
...@@ -85,7 +91,6 @@ static inline BOOL is_elem_node(nsIDOMNode *node) ...@@ -85,7 +91,6 @@ static inline BOOL is_elem_node(nsIDOMNode *node)
} }
#define ELEMCOL_THIS(iface) DEFINE_THIS(HTMLElementCollection, HTMLElementCollection, iface) #define ELEMCOL_THIS(iface) DEFINE_THIS(HTMLElementCollection, HTMLElementCollection, iface)
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface, static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
...@@ -514,7 +519,7 @@ static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vecto ...@@ -514,7 +519,7 @@ static void create_all_list(HTMLDocumentNode *doc, HTMLDOMNode *elem, elem_vecto
continue; continue;
} }
elem_vector_add(buf, HTMLELEM_NODE_THIS(node)); elem_vector_add(buf, elem_from_HTMLDOMNode(node));
create_all_list(doc, node, buf); create_all_list(doc, node, buf);
} }
} }
...@@ -527,7 +532,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node, BOOL include_ro ...@@ -527,7 +532,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node, BOOL include_ro
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**)); buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
if(include_root) if(include_root)
elem_vector_add(&buf, HTMLELEM_NODE_THIS(node)); elem_vector_add(&buf, elem_from_HTMLDOMNode(node));
create_all_list(node->doc, node, &buf); create_all_list(node->doc, node, &buf);
elem_vector_normalize(&buf); elem_vector_normalize(&buf);
...@@ -556,7 +561,7 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, I ...@@ -556,7 +561,7 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, I
hres = get_node(doc, nsnode, TRUE, &node); hres = get_node(doc, nsnode, TRUE, &node);
if(FAILED(hres)) if(FAILED(hres))
continue; continue;
buf.buf[buf.len++] = HTMLELEM_NODE_THIS(node); buf.buf[buf.len++] = elem_from_HTMLDOMNode(node);
} }
nsIDOMNode_Release(nsnode); nsIDOMNode_Release(nsnode);
} }
...@@ -590,7 +595,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, IU ...@@ -590,7 +595,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, IU
nsIDOMNode_Release(nsnode); nsIDOMNode_Release(nsnode);
if(FAILED(hres)) if(FAILED(hres))
break; break;
buf.buf[i] = HTMLELEM_NODE_THIS(node); buf.buf[i] = elem_from_HTMLDOMNode(node);
} }
}else { }else {
buf.buf = NULL; buf.buf = NULL;
......
...@@ -217,11 +217,14 @@ static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl = { ...@@ -217,11 +217,14 @@ static const IHTMLEmbedElementVtbl HTMLEmbedElementVtbl = {
HTMLEmbedElement_get_height HTMLEmbedElement_get_height
}; };
#define HTMLEMBED_NODE_THIS(iface) DEFINE_THIS2(HTMLEmbedElement, element.node, iface) static inline HTMLEmbedElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLEmbedElement, element.node);
}
static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLEmbedElement *This = HTMLEMBED_NODE_THIS(iface); HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
...@@ -242,13 +245,11 @@ static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -242,13 +245,11 @@ static HRESULT HTMLEmbedElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLEmbedElement_destructor(HTMLDOMNode *iface) static void HTMLEmbedElement_destructor(HTMLDOMNode *iface)
{ {
HTMLEmbedElement *This = HTMLEMBED_NODE_THIS(iface); HTMLEmbedElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLEMBED_NODE_THIS
static const NodeImplVtbl HTMLEmbedElementImplVtbl = { static const NodeImplVtbl HTMLEmbedElementImplVtbl = {
HTMLEmbedElement_QI, HTMLEmbedElement_QI,
HTMLEmbedElement_destructor, HTMLEmbedElement_destructor,
......
...@@ -489,11 +489,14 @@ static const IHTMLFormElementVtbl HTMLFormElementVtbl = { ...@@ -489,11 +489,14 @@ static const IHTMLFormElementVtbl HTMLFormElementVtbl = {
HTMLFormElement_tags HTMLFormElement_tags
}; };
#define HTMLFORM_NODE_THIS(iface) DEFINE_THIS2(HTMLFormElement, element.node, iface) static inline HTMLFormElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLFormElement, element.node);
}
static HRESULT HTMLFormElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLFormElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLFormElement *This = HTMLFORM_NODE_THIS(iface); HTMLFormElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -518,7 +521,7 @@ static HRESULT HTMLFormElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -518,7 +521,7 @@ static HRESULT HTMLFormElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLFormElement_destructor(HTMLDOMNode *iface) static void HTMLFormElement_destructor(HTMLDOMNode *iface)
{ {
HTMLFormElement *This = HTMLFORM_NODE_THIS(iface); HTMLFormElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsform) if(This->nsform)
nsIDOMHTMLFormElement_Release(This->nsform); nsIDOMHTMLFormElement_Release(This->nsform);
...@@ -529,7 +532,7 @@ static void HTMLFormElement_destructor(HTMLDOMNode *iface) ...@@ -529,7 +532,7 @@ static void HTMLFormElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface, static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
BSTR name, DWORD grfdex, DISPID *pid) BSTR name, DWORD grfdex, DISPID *pid)
{ {
HTMLFormElement *This = HTMLFORM_NODE_THIS(iface); HTMLFormElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMHTMLCollection *elements; nsIDOMHTMLCollection *elements;
nsAString nsname, nsstr; nsAString nsname, nsstr;
PRUint32 len, i; PRUint32 len, i;
...@@ -615,7 +618,7 @@ static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface, ...@@ -615,7 +618,7 @@ static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface,
DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res,
EXCEPINFO *ei, IServiceProvider *caller) EXCEPINFO *ei, IServiceProvider *caller)
{ {
HTMLFormElement *This = HTMLFORM_NODE_THIS(iface); HTMLFormElement *This = impl_from_HTMLDOMNode(iface);
IDispatch *ret; IDispatch *ret;
HRESULT hres; HRESULT hres;
...@@ -634,8 +637,6 @@ static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface, ...@@ -634,8 +637,6 @@ static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface,
return S_OK; return S_OK;
} }
#undef HTMLFORM_NODE_THIS
static const NodeImplVtbl HTMLFormElementImplVtbl = { static const NodeImplVtbl HTMLFormElementImplVtbl = {
HTMLFormElement_QI, HTMLFormElement_QI,
HTMLFormElement_destructor, HTMLFormElement_destructor,
......
...@@ -172,11 +172,14 @@ static const IHTMLFrameElement3Vtbl HTMLFrameElement3Vtbl = { ...@@ -172,11 +172,14 @@ static const IHTMLFrameElement3Vtbl HTMLFrameElement3Vtbl = {
HTMLFrameElement3_get_frameBorder HTMLFrameElement3_get_frameBorder
}; };
#define HTMLFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLFrameElement, framebase.element.node, iface) static inline HTMLFrameElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLFrameElement, framebase.element.node);
}
static HRESULT HTMLFrameElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLFrameElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IHTMLFrameElement3, riid)) { if(IsEqualGUID(&IID_IHTMLFrameElement3, riid)) {
TRACE("(%p)->(IID_IHTMLFrameElement3 %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLFrameElement3 %p)\n", This, ppv);
...@@ -191,14 +194,14 @@ static HRESULT HTMLFrameElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -191,14 +194,14 @@ static HRESULT HTMLFrameElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLFrameElement_destructor(HTMLDOMNode *iface) static void HTMLFrameElement_destructor(HTMLDOMNode *iface)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
HTMLFrameBase_destructor(&This->framebase); HTMLFrameBase_destructor(&This->framebase);
} }
static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p) static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window || !This->framebase.content_window->doc) { if(!This->framebase.content_window || !This->framebase.content_window->doc) {
*p = NULL; *p = NULL;
...@@ -212,7 +215,7 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p) ...@@ -212,7 +215,7 @@ static HRESULT HTMLFrameElement_get_document(HTMLDOMNode *iface, IDispatch **p)
static HRESULT HTMLFrameElement_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLFrameElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p); return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p);
} }
...@@ -220,7 +223,7 @@ static HRESULT HTMLFrameElement_get_readystate(HTMLDOMNode *iface, BSTR *p) ...@@ -220,7 +223,7 @@ static HRESULT HTMLFrameElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name, static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name,
DWORD grfdex, DISPID *pid) DWORD grfdex, DISPID *pid)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window) if(!This->framebase.content_window)
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
...@@ -231,7 +234,7 @@ static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name, ...@@ -231,7 +234,7 @@ static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name,
static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window) { if(!This->framebase.content_window) {
ERR("no content window to invoke on\n"); ERR("no content window to invoke on\n");
...@@ -243,7 +246,7 @@ static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, ...@@ -243,7 +246,7 @@ static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface) static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface)
{ {
HTMLFrameElement *This = HTMLFRAME_NODE_THIS(iface); HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMDocument *nsdoc; nsIDOMDocument *nsdoc;
nsresult nsres; nsresult nsres;
HRESULT hres; HRESULT hres;
...@@ -259,7 +262,7 @@ static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface) ...@@ -259,7 +262,7 @@ static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface)
return hres; return hres;
} }
#undef HTMLFRAME_NODE_THIS #undef impl_from_HTMLDOMNode
static const NodeImplVtbl HTMLFrameElementImplVtbl = { static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI, HTMLFrameElement_QI,
......
...@@ -120,11 +120,14 @@ static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = { ...@@ -120,11 +120,14 @@ static const IHTMLGenericElementVtbl HTMLGenericElementVtbl = {
HTMLGenericElement_namedRecordset HTMLGenericElement_namedRecordset
}; };
#define HTMLGENERIC_NODE_THIS(iface) DEFINE_THIS2(HTMLGenericElement, element.node, iface) static inline HTMLGenericElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLGenericElement, element.node);
}
static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface); HTMLGenericElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -141,13 +144,11 @@ static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv ...@@ -141,13 +144,11 @@ static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv
static void HTMLGenericElement_destructor(HTMLDOMNode *iface) static void HTMLGenericElement_destructor(HTMLDOMNode *iface)
{ {
HTMLGenericElement *This = HTMLGENERIC_NODE_THIS(iface); HTMLGenericElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLGENERIC_NODE_THIS
static const NodeImplVtbl HTMLGenericElementImplVtbl = { static const NodeImplVtbl HTMLGenericElementImplVtbl = {
HTMLGenericElement_QI, HTMLGenericElement_QI,
HTMLGenericElement_destructor, HTMLGenericElement_destructor,
......
...@@ -150,11 +150,14 @@ static const IHTMLIFrameElementVtbl HTMLIFrameElementVtbl = { ...@@ -150,11 +150,14 @@ static const IHTMLIFrameElementVtbl HTMLIFrameElementVtbl = {
HTMLIFrameElement_get_align HTMLIFrameElement_get_align
}; };
#define HTMLIFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLIFrame, framebase.element.node, iface) static inline HTMLIFrame *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLIFrame, framebase.element.node);
}
static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IHTMLIFrameElement, riid)) { if(IsEqualGUID(&IID_IHTMLIFrameElement, riid)) {
TRACE("(%p)->(IID_IHTMLIFrameElement %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLIFrameElement %p)\n", This, ppv);
...@@ -169,14 +172,14 @@ static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -169,14 +172,14 @@ static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLIFrame_destructor(HTMLDOMNode *iface) static void HTMLIFrame_destructor(HTMLDOMNode *iface)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
HTMLFrameBase_destructor(&This->framebase); HTMLFrameBase_destructor(&This->framebase);
} }
static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p) static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window || !This->framebase.content_window->doc) { if(!This->framebase.content_window || !This->framebase.content_window->doc) {
*p = NULL; *p = NULL;
...@@ -191,7 +194,7 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p) ...@@ -191,7 +194,7 @@ static HRESULT HTMLIFrame_get_document(HTMLDOMNode *iface, IDispatch **p)
static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name, static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name,
DWORD grfdex, DISPID *pid) DWORD grfdex, DISPID *pid)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window) if(!This->framebase.content_window)
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
...@@ -202,7 +205,7 @@ static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name, ...@@ -202,7 +205,7 @@ static HRESULT HTMLIFrame_get_dispid(HTMLDOMNode *iface, BSTR name,
static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(!This->framebase.content_window) { if(!This->framebase.content_window) {
ERR("no content window to invoke on\n"); ERR("no content window to invoke on\n");
...@@ -214,14 +217,14 @@ static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, ...@@ -214,14 +217,14 @@ static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p); return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p);
} }
static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface) static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface)
{ {
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface); HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
nsIDOMDocument *nsdoc; nsIDOMDocument *nsdoc;
nsresult nsres; nsresult nsres;
HRESULT hres; HRESULT hres;
...@@ -237,8 +240,6 @@ static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface) ...@@ -237,8 +240,6 @@ static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface)
return hres; return hres;
} }
#undef HTMLIFRAME_NODE_THIS
static const NodeImplVtbl HTMLIFrameImplVtbl = { static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_QI, HTMLIFrame_QI,
HTMLIFrame_destructor, HTMLIFrame_destructor,
......
...@@ -603,11 +603,14 @@ static const IHTMLImgElementVtbl HTMLImgElementVtbl = { ...@@ -603,11 +603,14 @@ static const IHTMLImgElementVtbl HTMLImgElementVtbl = {
HTMLImgElement_get_start HTMLImgElement_get_start
}; };
#define HTMLIMG_NODE_THIS(iface) DEFINE_THIS2(HTMLImgElement, element.node, iface) static inline HTMLImgElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLImgElement, element.node);
}
static HRESULT HTMLImgElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLImgElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLImgElement *This = HTMLIMG_NODE_THIS(iface); HTMLImgElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -624,7 +627,7 @@ static HRESULT HTMLImgElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -624,7 +627,7 @@ static HRESULT HTMLImgElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLImgElement_destructor(HTMLDOMNode *iface) static void HTMLImgElement_destructor(HTMLDOMNode *iface)
{ {
HTMLImgElement *This = HTMLIMG_NODE_THIS(iface); HTMLImgElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsimg) if(This->nsimg)
nsIDOMHTMLImageElement_Release(This->nsimg); nsIDOMHTMLImageElement_Release(This->nsimg);
...@@ -634,13 +637,11 @@ static void HTMLImgElement_destructor(HTMLDOMNode *iface) ...@@ -634,13 +637,11 @@ static void HTMLImgElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLImgElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLImgElement *This = HTMLIMG_NODE_THIS(iface); HTMLImgElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLImgElement_get_readyState(&This->IHTMLImgElement_iface, p); return IHTMLImgElement_get_readyState(&This->IHTMLImgElement_iface, p);
} }
#undef HTMLIMG_NODE_THIS
static const NodeImplVtbl HTMLImgElementImplVtbl = { static const NodeImplVtbl HTMLImgElementImplVtbl = {
HTMLImgElement_QI, HTMLImgElement_QI,
HTMLImgElement_destructor, HTMLImgElement_destructor,
......
...@@ -1117,11 +1117,14 @@ static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = { ...@@ -1117,11 +1117,14 @@ static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
HTMLInputTextElement_createTextRange HTMLInputTextElement_createTextRange
}; };
#define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface) static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
}
static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface); HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -1149,7 +1152,7 @@ static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -1149,7 +1152,7 @@ static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLInputElement_destructor(HTMLDOMNode *iface) static void HTMLInputElement_destructor(HTMLDOMNode *iface)
{ {
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface); HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMHTMLInputElement_Release(This->nsinput); nsIDOMHTMLInputElement_Release(This->nsinput);
...@@ -1158,7 +1161,7 @@ static void HTMLInputElement_destructor(HTMLDOMNode *iface) ...@@ -1158,7 +1161,7 @@ static void HTMLInputElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled) static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
{ {
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface); HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
if(eid == EVENTID_CLICK) { if(eid == EVENTID_CLICK) {
nsresult nsres; nsresult nsres;
...@@ -1177,18 +1180,16 @@ static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid ...@@ -1177,18 +1180,16 @@ static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid
static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v) static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
{ {
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface); HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v); return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
} }
static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p) static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
{ {
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface); HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p); return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
} }
#undef HTMLINPUT_NODE_THIS
static const NodeImplVtbl HTMLInputElementImplVtbl = { static const NodeImplVtbl HTMLInputElementImplVtbl = {
HTMLInputElement_QI, HTMLInputElement_QI,
HTMLInputElement_destructor, HTMLInputElement_destructor,
......
...@@ -393,11 +393,14 @@ static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = { ...@@ -393,11 +393,14 @@ static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
HTMLObjectElement_get_hspace HTMLObjectElement_get_hspace
}; };
#define HTMLOBJECT_NODE_THIS(iface) DEFINE_THIS2(HTMLObjectElement, plugin_container.element.node, iface) static inline HTMLObjectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLObjectElement, plugin_container.element.node);
}
static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface); HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
...@@ -422,7 +425,7 @@ static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -422,7 +425,7 @@ static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLObjectElement_destructor(HTMLDOMNode *iface) static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
{ {
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface); HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
if(This->plugin_container.plugin_host) if(This->plugin_container.plugin_host)
detach_plugin_host(This->plugin_container.plugin_host); detach_plugin_host(This->plugin_container.plugin_host);
...@@ -434,7 +437,7 @@ static void HTMLObjectElement_destructor(HTMLDOMNode *iface) ...@@ -434,7 +437,7 @@ static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface); HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -442,7 +445,7 @@ static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p) ...@@ -442,7 +445,7 @@ static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name, static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
DWORD grfdex, DISPID *pid) DWORD grfdex, DISPID *pid)
{ {
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface); HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid); TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid);
...@@ -452,14 +455,14 @@ static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name, ...@@ -452,14 +455,14 @@ static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{ {
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface); HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
TRACE("(%p)->(%d)\n", This, id); TRACE("(%p)->(%d)\n", This, id);
return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei); return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei);
} }
#undef HTMLOBJECT_NODE_THIS #undef impl_from_HTMLDOMNode
static const NodeImplVtbl HTMLObjectElementImplVtbl = { static const NodeImplVtbl HTMLObjectElementImplVtbl = {
HTMLObjectElement_QI, HTMLObjectElement_QI,
......
...@@ -299,11 +299,14 @@ static const IHTMLOptionElementVtbl HTMLOptionElementVtbl = { ...@@ -299,11 +299,14 @@ static const IHTMLOptionElementVtbl HTMLOptionElementVtbl = {
HTMLOptionElement_get_form HTMLOptionElement_get_form
}; };
#define HTMLOPTION_NODE_THIS(iface) DEFINE_THIS2(HTMLOptionElement, element.node, iface) static inline HTMLOptionElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLOptionElement, element.node);
}
static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface); HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -328,7 +331,7 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -328,7 +331,7 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLOptionElement_destructor(HTMLDOMNode *iface) static void HTMLOptionElement_destructor(HTMLDOMNode *iface)
{ {
HTMLOptionElement *This = HTMLOPTION_NODE_THIS(iface); HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsoption) if(This->nsoption)
nsIDOMHTMLOptionElement_Release(This->nsoption); nsIDOMHTMLOptionElement_Release(This->nsoption);
...@@ -336,8 +339,6 @@ static void HTMLOptionElement_destructor(HTMLDOMNode *iface) ...@@ -336,8 +339,6 @@ static void HTMLOptionElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLOPTION_NODE_THIS
static const NodeImplVtbl HTMLOptionElementImplVtbl = { static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLOptionElement_QI, HTMLOptionElement_QI,
HTMLOptionElement_destructor, HTMLOptionElement_destructor,
......
...@@ -281,11 +281,14 @@ static const IHTMLScriptElementVtbl HTMLScriptElementVtbl = { ...@@ -281,11 +281,14 @@ static const IHTMLScriptElementVtbl HTMLScriptElementVtbl = {
HTMLScriptElement_get_type HTMLScriptElement_get_type
}; };
#define HTMLSCRIPT_NODE_THIS(iface) DEFINE_THIS2(HTMLScriptElement, element.node, iface) static inline HTMLScriptElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLScriptElement, element.node);
}
static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface); HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -310,19 +313,17 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -310,19 +313,17 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLScriptElement_destructor(HTMLDOMNode *iface) static void HTMLScriptElement_destructor(HTMLDOMNode *iface)
{ {
HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface); HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p) static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface); HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLScriptElement_get_readyState(&This->IHTMLScriptElement_iface, p); return IHTMLScriptElement_get_readyState(&This->IHTMLScriptElement_iface, p);
} }
#undef HTMLSCRIPT_NODE_THIS
static const NodeImplVtbl HTMLScriptElementImplVtbl = { static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_QI, HTMLScriptElement_QI,
HTMLScriptElement_destructor, HTMLScriptElement_destructor,
......
...@@ -504,11 +504,14 @@ static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = { ...@@ -504,11 +504,14 @@ static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = {
HTMLSelectElement_tags HTMLSelectElement_tags
}; };
#define HTMLSELECT_NODE_THIS(iface) DEFINE_THIS2(HTMLSelectElement, element.node, iface) static inline HTMLSelectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLSelectElement, element.node);
}
static HRESULT HTMLSelectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLSelectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface); HTMLSelectElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -533,7 +536,7 @@ static HRESULT HTMLSelectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -533,7 +536,7 @@ static HRESULT HTMLSelectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLSelectElement_destructor(HTMLDOMNode *iface) static void HTMLSelectElement_destructor(HTMLDOMNode *iface)
{ {
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface); HTMLSelectElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMHTMLSelectElement_Release(This->nsselect); nsIDOMHTMLSelectElement_Release(This->nsselect);
...@@ -542,13 +545,13 @@ static void HTMLSelectElement_destructor(HTMLDOMNode *iface) ...@@ -542,13 +545,13 @@ static void HTMLSelectElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLSelectElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v) static HRESULT HTMLSelectElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
{ {
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface); HTMLSelectElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLSelectElement_put_disabled(&This->IHTMLSelectElement_iface, v); return IHTMLSelectElement_put_disabled(&This->IHTMLSelectElement_iface, v);
} }
static HRESULT HTMLSelectElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p) static HRESULT HTMLSelectElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
{ {
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface); HTMLSelectElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLSelectElement_get_disabled(&This->IHTMLSelectElement_iface, p); return IHTMLSelectElement_get_disabled(&This->IHTMLSelectElement_iface, p);
} }
...@@ -576,7 +579,7 @@ static HRESULT HTMLSelectElement_get_dispid(HTMLDOMNode *iface, BSTR name, DWORD ...@@ -576,7 +579,7 @@ static HRESULT HTMLSelectElement_get_dispid(HTMLDOMNode *iface, BSTR name, DWORD
static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{ {
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface); HTMLSelectElement *This = impl_from_HTMLDOMNode(iface);
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller); TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
...@@ -606,8 +609,6 @@ static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid ...@@ -606,8 +609,6 @@ static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid
return S_OK; return S_OK;
} }
#undef HTMLSELECT_NODE_THIS
static const NodeImplVtbl HTMLSelectElementImplVtbl = { static const NodeImplVtbl HTMLSelectElementImplVtbl = {
HTMLSelectElement_QI, HTMLSelectElement_QI,
HTMLSelectElement_destructor, HTMLSelectElement_destructor,
......
...@@ -255,11 +255,14 @@ static const IHTMLStyleElementVtbl HTMLStyleElementVtbl = { ...@@ -255,11 +255,14 @@ static const IHTMLStyleElementVtbl HTMLStyleElementVtbl = {
HTMLStyleElement_get_media HTMLStyleElement_get_media
}; };
#define HTMLSTYLE_NODE_THIS(iface) DEFINE_THIS2(HTMLStyleElement, element.node, iface) static inline HTMLStyleElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLStyleElement, element.node);
}
static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLStyleElement *This = HTMLSTYLE_NODE_THIS(iface); HTMLStyleElement *This = impl_from_HTMLDOMNode(iface);
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
...@@ -280,7 +283,7 @@ static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -280,7 +283,7 @@ static HRESULT HTMLStyleElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLStyleElement_destructor(HTMLDOMNode *iface) static void HTMLStyleElement_destructor(HTMLDOMNode *iface)
{ {
HTMLStyleElement *This = HTMLSTYLE_NODE_THIS(iface); HTMLStyleElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsstyle) if(This->nsstyle)
nsIDOMHTMLStyleElement_Release(This->nsstyle); nsIDOMHTMLStyleElement_Release(This->nsstyle);
...@@ -288,8 +291,6 @@ static void HTMLStyleElement_destructor(HTMLDOMNode *iface) ...@@ -288,8 +291,6 @@ static void HTMLStyleElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLSTYLE_NODE_THIS
static const NodeImplVtbl HTMLStyleElementImplVtbl = { static const NodeImplVtbl HTMLStyleElementImplVtbl = {
HTMLStyleElement_QI, HTMLStyleElement_QI,
HTMLStyleElement_destructor, HTMLStyleElement_destructor,
......
...@@ -513,11 +513,14 @@ static const IHTMLTableVtbl HTMLTableVtbl = { ...@@ -513,11 +513,14 @@ static const IHTMLTableVtbl HTMLTableVtbl = {
HTMLTable_get_onreadystatechange HTMLTable_get_onreadystatechange
}; };
#define HTMLTABLE_NODE_THIS(iface) DEFINE_THIS2(HTMLTable, element.node, iface) static inline HTMLTable *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLTable, element.node);
}
static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLTable *This = HTMLTABLE_NODE_THIS(iface); HTMLTable *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -542,7 +545,7 @@ static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -542,7 +545,7 @@ static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLTable_destructor(HTMLDOMNode *iface) static void HTMLTable_destructor(HTMLDOMNode *iface)
{ {
HTMLTable *This = HTMLTABLE_NODE_THIS(iface); HTMLTable *This = impl_from_HTMLDOMNode(iface);
if(This->nstable) if(This->nstable)
nsIDOMHTMLTableElement_Release(This->nstable); nsIDOMHTMLTableElement_Release(This->nstable);
...@@ -550,8 +553,6 @@ static void HTMLTable_destructor(HTMLDOMNode *iface) ...@@ -550,8 +553,6 @@ static void HTMLTable_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLTABLE_NODE_THIS
static const NodeImplVtbl HTMLTableImplVtbl = { static const NodeImplVtbl HTMLTableImplVtbl = {
HTMLTable_QI, HTMLTable_QI,
HTMLTable_destructor, HTMLTable_destructor,
......
...@@ -255,11 +255,14 @@ static const IHTMLTableRowVtbl HTMLTableRowVtbl = { ...@@ -255,11 +255,14 @@ static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
HTMLTableRow_deleteCell HTMLTableRow_deleteCell
}; };
#define HTMLTABLEROW_NODE_THIS(iface) DEFINE_THIS2(HTMLTableRow, element.node, iface) static inline HTMLTableRow *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLTableRow, element.node);
}
static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface); HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -284,7 +287,7 @@ static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -284,7 +287,7 @@ static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLTableRow_destructor(HTMLDOMNode *iface) static void HTMLTableRow_destructor(HTMLDOMNode *iface)
{ {
HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface); HTMLTableRow *This = impl_from_HTMLDOMNode(iface);
if(This->nsrow) if(This->nsrow)
nsIDOMHTMLTableRowElement_Release(This->nsrow); nsIDOMHTMLTableRowElement_Release(This->nsrow);
...@@ -292,8 +295,6 @@ static void HTMLTableRow_destructor(HTMLDOMNode *iface) ...@@ -292,8 +295,6 @@ static void HTMLTableRow_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(&This->element.node); HTMLElement_destructor(&This->element.node);
} }
#undef HTMLTABLEROW_NODE_THIS
static const NodeImplVtbl HTMLTableRowImplVtbl = { static const NodeImplVtbl HTMLTableRowImplVtbl = {
HTMLTableRow_QI, HTMLTableRow_QI,
HTMLTableRow_destructor, HTMLTableRow_destructor,
......
...@@ -390,11 +390,14 @@ static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = { ...@@ -390,11 +390,14 @@ static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
HTMLTextAreaElement_createTextRange HTMLTextAreaElement_createTextRange
}; };
#define HTMLTXTAREA_NODE_THIS(iface) DEFINE_THIS2(HTMLTextAreaElement, element.node, iface) static inline HTMLTextAreaElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLTextAreaElement, element.node);
}
static HRESULT HTMLTextAreaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLTextAreaElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface); HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -419,7 +422,7 @@ static HRESULT HTMLTextAreaElement_QI(HTMLDOMNode *iface, REFIID riid, void **pp ...@@ -419,7 +422,7 @@ static HRESULT HTMLTextAreaElement_QI(HTMLDOMNode *iface, REFIID riid, void **pp
static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface) static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface)
{ {
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface); HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
nsIDOMHTMLTextAreaElement_Release(This->nstextarea); nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
...@@ -428,18 +431,16 @@ static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface) ...@@ -428,18 +431,16 @@ static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface)
static HRESULT HTMLTextAreaElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v) static HRESULT HTMLTextAreaElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
{ {
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface); HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLTextAreaElement_put_disabled(&This->IHTMLTextAreaElement_iface, v); return IHTMLTextAreaElement_put_disabled(&This->IHTMLTextAreaElement_iface, v);
} }
static HRESULT HTMLTextAreaElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p) static HRESULT HTMLTextAreaElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
{ {
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface); HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLTextAreaElement_get_disabled(&This->IHTMLTextAreaElement_iface, p); return IHTMLTextAreaElement_get_disabled(&This->IHTMLTextAreaElement_iface, p);
} }
#undef HTMLTXTAREA_NODE_THIS
static const NodeImplVtbl HTMLTextAreaElementImplVtbl = { static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLTextAreaElement_QI, HTMLTextAreaElement_QI,
HTMLTextAreaElement_destructor, HTMLTextAreaElement_destructor,
......
...@@ -43,8 +43,6 @@ struct HTMLDOMTextNode { ...@@ -43,8 +43,6 @@ struct HTMLDOMTextNode {
#define HTMLTEXT_THIS(iface) DEFINE_THIS(HTMLDOMTextNode, IHTMLDOMTextNode, iface) #define HTMLTEXT_THIS(iface) DEFINE_THIS(HTMLDOMTextNode, IHTMLDOMTextNode, iface)
#define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface)
static HRESULT WINAPI HTMLDOMTextNode_QueryInterface(IHTMLDOMTextNode *iface, static HRESULT WINAPI HTMLDOMTextNode_QueryInterface(IHTMLDOMTextNode *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
...@@ -158,11 +156,14 @@ static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = { ...@@ -158,11 +156,14 @@ static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = {
HTMLDOMTextNode_splitText HTMLDOMTextNode_splitText
}; };
#define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface) static inline HTMLDOMTextNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{
return CONTAINING_RECORD(iface, HTMLDOMTextNode, node);
}
static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
{ {
HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface); HTMLDOMTextNode *This = impl_from_HTMLDOMNode(iface);
*ppv = NULL; *ppv = NULL;
...@@ -179,7 +180,7 @@ static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -179,7 +180,7 @@ static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface) static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface)
{ {
HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface); HTMLDOMTextNode *This = impl_from_HTMLDOMNode(iface);
if(This->nstext) if(This->nstext)
IHTMLDOMTextNode_Release(This->nstext); IHTMLDOMTextNode_Release(This->nstext);
...@@ -189,7 +190,7 @@ static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface) ...@@ -189,7 +190,7 @@ static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface)
static HRESULT HTMLDOMTextNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) static HRESULT HTMLDOMTextNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
{ {
HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface); HTMLDOMTextNode *This = impl_from_HTMLDOMNode(iface);
HRESULT hres; HRESULT hres;
hres = HTMLDOMTextNode_Create(This->node.doc, nsnode, ret); hres = HTMLDOMTextNode_Create(This->node.doc, nsnode, ret);
...@@ -200,8 +201,6 @@ static HRESULT HTMLDOMTextNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTM ...@@ -200,8 +201,6 @@ static HRESULT HTMLDOMTextNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTM
return S_OK; return S_OK;
} }
#undef HTMLTEXT_NODE_THIS
static const NodeImplVtbl HTMLDOMTextNodeImplVtbl = { static const NodeImplVtbl HTMLDOMTextNodeImplVtbl = {
HTMLDOMTextNode_QI, HTMLDOMTextNode_QI,
HTMLDOMTextNode_destructor, HTMLDOMTextNode_destructor,
......
...@@ -668,8 +668,7 @@ struct HTMLDocumentNode { ...@@ -668,8 +668,7 @@ struct HTMLDocumentNode {
#define HOSTSECMGR(x) ((IInternetHostSecurityManager*) &(x)->lpIInternetHostSecurityManagerVtbl) #define HOSTSECMGR(x) ((IInternetHostSecurityManager*) &(x)->lpIInternetHostSecurityManagerVtbl)
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc))) #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**); HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**); HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
......
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