mshtml: Improved error handling in element constructors.
This commit is contained in:
parent
a8b94a0377
commit
ecc551b911
|
@ -534,19 +534,27 @@ static dispex_static_data_t HTMLAnchorElement_dispex = {
|
|||
HTMLAnchorElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
|
||||
HTMLAnchorElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLAnchorElement iface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLAnchorElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLAnchorElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -812,24 +812,29 @@ static dispex_static_data_t HTMLBodyElement_dispex = {
|
|||
HTMLBodyElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLBodyElement *ret = heap_alloc_zero(sizeof(HTMLBodyElement));
|
||||
HTMLBodyElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", ret, nselem);
|
||||
ret = heap_alloc_zero(sizeof(HTMLBodyElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
|
||||
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement, (void**)&ret->nsbody);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsDOMHTMLBodyElement: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
HTMLTextContainer_Init(&ret->textcont, doc, nselem, &HTMLBodyElement_dispex);
|
||||
|
||||
ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink, NULL);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement,
|
||||
(void**)&ret->nsbody);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsDOMHTMLBodyElement: %08x\n", nsres);
|
||||
|
||||
return &ret->textcont.element;
|
||||
*elem = &ret->textcont.element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ static const WCHAR trW[] = {'T','R',0};
|
|||
|
||||
typedef struct {
|
||||
const WCHAR *name;
|
||||
HTMLElement *(*constructor)(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HRESULT (*constructor)(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
} tag_desc_t;
|
||||
|
||||
static const tag_desc_t tag_descs[] = {
|
||||
|
@ -1742,8 +1742,7 @@ HRESULT HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_g
|
|||
|
||||
tag = get_tag_desc(class_name);
|
||||
if(tag) {
|
||||
elem = tag->constructor(doc, nselem);
|
||||
hres = elem ? S_OK : E_OUTOFMEMORY;
|
||||
hres = tag->constructor(doc, nselem, &elem);
|
||||
}else if(use_generic) {
|
||||
hres = HTMLGenericElement_Create(doc, nselem, &elem);
|
||||
}else {
|
||||
|
|
|
@ -267,13 +267,18 @@ static dispex_static_data_t HTMLEmbedElement_dispex = {
|
|||
HTMLEmbedElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLEmbedElement *ret = heap_alloc_zero(sizeof(*ret));
|
||||
HTMLEmbedElement *ret;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(*ret));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpIHTMLEmbedElementVtbl = &HTMLEmbedElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLEmbedElementImplVtbl;
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLEmbedElement_dispex);
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -663,19 +663,27 @@ static dispex_static_data_t HTMLFormElement_dispex = {
|
|||
HTMLFormElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLFormElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLFormElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLFormElement *ret = heap_alloc_zero(sizeof(HTMLFormElement));
|
||||
HTMLFormElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLFormElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLFormElementVtbl = &HTMLFormElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLFormElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFormElement, (void**)&ret->nsform);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLFormElement interface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLFormElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFormElement, (void**)&ret->nsform);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLFormElement interface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -292,16 +292,19 @@ static dispex_static_data_t HTMLFrameElement_dispex = {
|
|||
HTMLFrameElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLFrameElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLFrameElement *ret;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLFrameElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->framebase.element.node.vtbl = &HTMLFrameElementImplVtbl;
|
||||
ret->lpIHTMLFrameElement3Vtbl = &HTMLFrameElement3Vtbl;
|
||||
|
||||
HTMLFrameBase_Init(&ret->framebase, doc, nselem, &HTMLFrameElement_dispex);
|
||||
|
||||
return &ret->framebase.element;
|
||||
*elem = &ret->framebase.element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -270,16 +270,19 @@ static dispex_static_data_t HTMLIFrame_dispex = {
|
|||
HTMLIFrame_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLIFrame *ret;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLIFrame));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpIHTMLIFrameElementVtbl = &HTMLIFrameElementVtbl;
|
||||
ret->framebase.element.node.vtbl = &HTMLIFrameImplVtbl;
|
||||
|
||||
HTMLFrameBase_Init(&ret->framebase, doc, nselem, &HTMLIFrame_dispex);
|
||||
|
||||
return &ret->framebase.element;
|
||||
*elem = &ret->framebase.element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -666,21 +666,29 @@ static dispex_static_data_t HTMLImgElement_dispex = {
|
|||
HTMLImgElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLImgElement *ret = heap_alloc_zero(sizeof(HTMLImgElement));
|
||||
HTMLImgElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLImgElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLImgElementVtbl = &HTMLImgElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLImgElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLImageElement, (void**)&ret->nsimg);
|
||||
if(NS_FAILED(nsres))
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLImgElement_dispex);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define HTMLIMGFACTORY_THIS(iface) DEFINE_THIS(HTMLImageElementFactory, HTMLImageElementFactory, iface)
|
||||
|
|
|
@ -1212,21 +1212,28 @@ static dispex_static_data_t HTMLInputElement_dispex = {
|
|||
HTMLInputElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
|
||||
HTMLInputElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLInputElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
|
||||
ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLInputElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
|
||||
(void**)&ret->nsinput);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -457,19 +457,27 @@ static dispex_static_data_t HTMLObjectElement_dispex = {
|
|||
HTMLObjectElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLObjectElement *ret = heap_alloc_zero(sizeof(*ret));
|
||||
HTMLObjectElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(*ret));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpIHTMLObjectElementVtbl = &HTMLObjectElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLObjectElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLObjectElement iface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLObjectElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLObjectElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -356,21 +356,29 @@ static dispex_static_data_t HTMLOptionElement_dispex = {
|
|||
HTMLOptionElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
|
||||
HTMLOptionElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLOptionElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define HTMLOPTFACTORY_THIS(iface) DEFINE_THIS(HTMLOptionElementFactory, HTMLOptionElementFactory, iface)
|
||||
|
|
|
@ -343,19 +343,27 @@ static dispex_static_data_t HTMLScriptElement_dispex = {
|
|||
HTMLScriptElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
|
||||
HTMLScriptElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLScriptElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLScriptElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -636,20 +636,28 @@ static dispex_static_data_t HTMLSelectElement_dispex = {
|
|||
HTMLSelectElement_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLSelectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement));
|
||||
HTMLSelectElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLSelectElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLSelectElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
|
||||
(void**)&ret->nsselect);
|
||||
if(NS_FAILED(nsres))
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLSelectElement interfce: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return &ret->element;
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLSelectElement_dispex);
|
||||
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -267,13 +267,18 @@ static dispex_static_data_t HTMLStyleElement_dispex = {
|
|||
HTMLStyleElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLStyleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLStyleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLStyleElement *ret = heap_alloc_zero(sizeof(*ret));
|
||||
HTMLStyleElement *ret;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(*ret));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpIHTMLStyleElementVtbl = &HTMLStyleElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLStyleElementImplVtbl;
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLStyleElement_dispex);
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -571,21 +571,28 @@ static dispex_static_data_t HTMLTable_dispex = {
|
|||
HTMLTable_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable));
|
||||
HTMLTable *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLTable));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->element.node.vtbl = &HTMLTableImplVtbl;
|
||||
ret->lpHTMLTableVtbl = &HTMLTableVtbl;
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
|
||||
ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents, NULL);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -314,19 +314,27 @@ static dispex_static_data_t HTMLTableRow_dispex = {
|
|||
HTMLTableRow_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow));
|
||||
HTMLTableRow *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLTableRow));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
|
||||
ret->element.node.vtbl = &HTMLTableRowImplVtbl;
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLTableRowElement iface: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableRow_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLTableRowElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -464,20 +464,28 @@ static dispex_static_data_t HTMLTextAreaElement_dispex = {
|
|||
HTMLTextAreaElement_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
|
||||
HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
|
||||
{
|
||||
HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
|
||||
HTMLTextAreaElement *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
|
||||
if(!ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl;
|
||||
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTextAreaElement_dispex);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
|
||||
(void**)&ret->nstextarea);
|
||||
if(NS_FAILED(nsres))
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsDOMHTMLInputElement: %08x\n", nsres);
|
||||
heap_free(ret);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return &ret->element;
|
||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTextAreaElement_dispex);
|
||||
|
||||
*elem = &ret->element;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -822,22 +822,22 @@ HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**);
|
|||
|
||||
HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**);
|
||||
HRESULT HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLElement**);
|
||||
HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLObjectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
|
||||
HRESULT HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLEmbedElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLObjectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
HRESULT HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**);
|
||||
|
||||
void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*);
|
||||
|
|
Loading…
Reference in New Issue