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

mshtml: Moved whole element initialization to HTMLElement_Init.

parent cc94a1db
...@@ -518,7 +518,7 @@ static dispex_static_data_t HTMLAnchorElement_dispex = { ...@@ -518,7 +518,7 @@ static dispex_static_data_t HTMLAnchorElement_dispex = {
HTMLAnchorElement_iface_tids HTMLAnchorElement_iface_tids
}; };
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement)); HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
nsresult nsres; nsresult nsres;
...@@ -526,7 +526,7 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem) ...@@ -526,7 +526,7 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl; ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl; ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLAnchorElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLAnchorElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -759,7 +759,7 @@ static dispex_static_data_t HTMLBodyElement_dispex = { ...@@ -759,7 +759,7 @@ static dispex_static_data_t HTMLBodyElement_dispex = {
HTMLBodyElement_iface_tids HTMLBodyElement_iface_tids
}; };
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLBodyElement *ret = heap_alloc_zero(sizeof(HTMLBodyElement)); HTMLBodyElement *ret = heap_alloc_zero(sizeof(HTMLBodyElement));
nsresult nsres; nsresult nsres;
...@@ -769,7 +769,7 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem) ...@@ -769,7 +769,7 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl; ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl; ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
HTMLTextContainer_Init(&ret->textcont, &HTMLBodyElement_dispex); HTMLTextContainer_Init(&ret->textcont, doc, nselem, &HTMLBodyElement_dispex);
ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink); ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink);
......
...@@ -193,8 +193,10 @@ HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode ...@@ -193,8 +193,10 @@ HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode
ret->element.node.vtbl = &HTMLCommentElementImplVtbl; ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl; ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
HTMLElement_Init(&ret->element, &HTMLCommentElement_dispex); HTMLElement_Init(&ret->element, doc, NULL, &HTMLCommentElement_dispex);
HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
nsIDOMNode_AddRef(nsnode);
ret->element.node.nsnode = nsnode;
return &ret->element; return &ret->element;
} }
...@@ -1489,16 +1489,22 @@ static dispex_static_data_t HTMLElement_dispex = { ...@@ -1489,16 +1489,22 @@ static dispex_static_data_t HTMLElement_dispex = {
HTMLElement_iface_tids HTMLElement_iface_tids
}; };
void HTMLElement_Init(HTMLElement *This, dispex_static_data_t *dispex_data) void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
{ {
This->lpHTMLElementVtbl = &HTMLElementVtbl; This->lpHTMLElementVtbl = &HTMLElementVtbl;
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
HTMLElement2_Init(This); HTMLElement2_Init(This);
HTMLElement3_Init(This); HTMLElement3_Init(This);
init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), dispex_data ? dispex_data : &HTMLElement_dispex); init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), dispex_data ? dispex_data : &HTMLElement_dispex);
if(nselem)
nsIDOMHTMLElement_AddRef(nselem);
This->nselem = nselem;
HTMLDOMNode_Init(doc, &This->node, (nsIDOMNode*)nselem);
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
} }
HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic) HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic)
...@@ -1531,42 +1537,40 @@ HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL ...@@ -1531,42 +1537,40 @@ HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL
nsAString_GetData(&class_name_str, &class_name); nsAString_GetData(&class_name_str, &class_name);
if(!strcmpW(class_name, wszA)) if(!strcmpW(class_name, wszA))
ret = HTMLAnchorElement_Create(nselem); ret = HTMLAnchorElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszBODY)) else if(!strcmpW(class_name, wszBODY))
ret = HTMLBodyElement_Create(nselem); ret = HTMLBodyElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszIFRAME)) else if(!strcmpW(class_name, wszIFRAME))
ret = HTMLIFrame_Create(nselem); ret = HTMLIFrame_Create(doc, nselem);
else if(!strcmpW(class_name, wszIMG)) else if(!strcmpW(class_name, wszIMG))
ret = HTMLImgElement_Create(nselem); ret = HTMLImgElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszINPUT)) else if(!strcmpW(class_name, wszINPUT))
ret = HTMLInputElement_Create(nselem); ret = HTMLInputElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszOPTION)) else if(!strcmpW(class_name, wszOPTION))
ret = HTMLOptionElement_Create(nselem); ret = HTMLOptionElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszSCRIPT)) else if(!strcmpW(class_name, wszSCRIPT))
ret = HTMLScriptElement_Create(nselem); ret = HTMLScriptElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszSELECT)) else if(!strcmpW(class_name, wszSELECT))
ret = HTMLSelectElement_Create(nselem); ret = HTMLSelectElement_Create(doc, nselem);
else if(!strcmpW(class_name, wszTABLE)) else if(!strcmpW(class_name, wszTABLE))
ret = HTMLTable_Create(nselem); ret = HTMLTable_Create(doc, nselem);
else if(!strcmpW(class_name, wszTR)) else if(!strcmpW(class_name, wszTR))
ret = HTMLTableRow_Create(nselem); ret = HTMLTableRow_Create(doc, nselem);
else if(!strcmpW(class_name, wszTEXTAREA)) else if(!strcmpW(class_name, wszTEXTAREA))
ret = HTMLTextAreaElement_Create(nselem); ret = HTMLTextAreaElement_Create(doc, nselem);
else if(use_generic) else if(use_generic)
ret = HTMLGenericElement_Create(nselem); ret = HTMLGenericElement_Create(doc, nselem);
if(!ret) { if(!ret) {
ret = heap_alloc_zero(sizeof(HTMLElement)); ret = heap_alloc_zero(sizeof(HTMLElement));
HTMLElement_Init(ret, NULL); HTMLElement_Init(ret, doc, nselem, NULL);
ret->node.vtbl = &HTMLElementImplVtbl; ret->node.vtbl = &HTMLElementImplVtbl;
} }
TRACE("%s ret %p\n", debugstr_w(class_name), ret); TRACE("%s ret %p\n", debugstr_w(class_name), ret);
nsIDOMElement_Release(nselem);
nsAString_Finish(&class_name_str); nsAString_Finish(&class_name_str);
ret->nselem = nselem;
HTMLDOMNode_Init(doc, &ret->node, (nsIDOMNode*)nselem);
return ret; return ret;
} }
...@@ -169,7 +169,7 @@ static dispex_static_data_t HTMLGenericElement_dispex = { ...@@ -169,7 +169,7 @@ static dispex_static_data_t HTMLGenericElement_dispex = {
HTMLGenericElement_iface_tids HTMLGenericElement_iface_tids
}; };
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLGenericElement *ret; HTMLGenericElement *ret;
...@@ -178,7 +178,7 @@ HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem) ...@@ -178,7 +178,7 @@ HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl; ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl;
ret->element.node.vtbl = &HTMLGenericElementImplVtbl; ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLGenericElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);
return &ret->element; return &ret->element;
} }
...@@ -481,7 +481,7 @@ static dispex_static_data_t HTMLIFrame_dispex = { ...@@ -481,7 +481,7 @@ static dispex_static_data_t HTMLIFrame_dispex = {
HTMLIFrame_iface_tids HTMLIFrame_iface_tids
}; };
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLIFrame_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLIFrame *ret; HTMLIFrame *ret;
nsresult nsres; nsresult nsres;
...@@ -492,7 +492,7 @@ HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem) ...@@ -492,7 +492,7 @@ HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem)
ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl; ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl;
ret->element.node.vtbl = &HTMLIFrameImplVtbl; ret->element.node.vtbl = &HTMLIFrameImplVtbl;
HTMLElement_Init(&ret->element, &HTMLIFrame_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLIFrame_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -595,7 +595,7 @@ static dispex_static_data_t HTMLImgElement_dispex = { ...@@ -595,7 +595,7 @@ static dispex_static_data_t HTMLImgElement_dispex = {
HTMLImgElement_iface_tids HTMLImgElement_iface_tids
}; };
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLImgElement *ret = heap_alloc_zero(sizeof(HTMLImgElement)); HTMLImgElement *ret = heap_alloc_zero(sizeof(HTMLImgElement));
nsresult nsres; nsresult nsres;
...@@ -607,7 +607,7 @@ HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem) ...@@ -607,7 +607,7 @@ HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem)
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres); ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres);
HTMLElement_Init(&ret->element, &HTMLImgElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLImgElement_dispex);
return &ret->element; return &ret->element;
} }
......
...@@ -1188,7 +1188,7 @@ static dispex_static_data_t HTMLInputElement_dispex = { ...@@ -1188,7 +1188,7 @@ static dispex_static_data_t HTMLInputElement_dispex = {
HTMLInputElement_iface_tids HTMLInputElement_iface_tids
}; };
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement)); HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
nsresult nsres; nsresult nsres;
...@@ -1197,7 +1197,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) ...@@ -1197,7 +1197,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl; ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
ret->element.node.vtbl = &HTMLInputElementImplVtbl; ret->element.node.vtbl = &HTMLInputElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLInputElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
(void**)&ret->nsinput); (void**)&ret->nsinput);
......
...@@ -911,7 +911,8 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno ...@@ -911,7 +911,8 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno
node->ref = 1; node->ref = 1;
node->doc = doc; node->doc = doc;
nsIDOMNode_AddRef(nsnode); if(nsnode)
nsIDOMNode_AddRef(nsnode);
node->nsnode = nsnode; node->nsnode = nsnode;
node->next = doc->nodes; node->next = doc->nodes;
......
...@@ -339,7 +339,7 @@ static dispex_static_data_t HTMLOptionElement_dispex = { ...@@ -339,7 +339,7 @@ static dispex_static_data_t HTMLOptionElement_dispex = {
HTMLOptionElement_iface_tids HTMLOptionElement_iface_tids
}; };
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement)); HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
nsresult nsres; nsresult nsres;
...@@ -347,7 +347,7 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) ...@@ -347,7 +347,7 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl; ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl; ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLOptionElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -306,7 +306,7 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = { ...@@ -306,7 +306,7 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_destructor HTMLScriptElement_destructor
}; };
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement)); HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
nsresult nsres; nsresult nsres;
...@@ -314,7 +314,7 @@ HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem) ...@@ -314,7 +314,7 @@ HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl; ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl;
ret->element.node.vtbl = &HTMLScriptElementImplVtbl; ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
HTMLElement_Init(&ret->element, NULL); HTMLElement_Init(&ret->element, doc, nselem, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -503,7 +503,7 @@ static dispex_static_data_t HTMLSelectElement_dispex = { ...@@ -503,7 +503,7 @@ static dispex_static_data_t HTMLSelectElement_dispex = {
HTMLSelectElement_tids HTMLSelectElement_tids
}; };
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement)); HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement));
nsresult nsres; nsresult nsres;
...@@ -511,7 +511,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem) ...@@ -511,7 +511,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl; ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
ret->element.node.vtbl = &HTMLSelectElementImplVtbl; ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
HTMLElement_Init(&ret->element, &HTMLSelectElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLSelectElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
(void**)&ret->nsselect); (void**)&ret->nsselect);
......
...@@ -574,7 +574,7 @@ static dispex_static_data_t HTMLTable_dispex = { ...@@ -574,7 +574,7 @@ static dispex_static_data_t HTMLTable_dispex = {
HTMLTable_iface_tids HTMLTable_iface_tids
}; };
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLTable_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable)); HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable));
nsresult nsres; nsresult nsres;
...@@ -582,7 +582,7 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem) ...@@ -582,7 +582,7 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
ret->element.node.vtbl = &HTMLTableImplVtbl; ret->element.node.vtbl = &HTMLTableImplVtbl;
ret->lpHTMLTableVtbl = &HTMLTableVtbl; ret->lpHTMLTableVtbl = &HTMLTableVtbl;
HTMLElement_Init(&ret->element, &HTMLTable_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLTable_dispex);
ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents); ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents);
......
...@@ -317,7 +317,7 @@ static dispex_static_data_t HTMLTableRow_dispex = { ...@@ -317,7 +317,7 @@ static dispex_static_data_t HTMLTableRow_dispex = {
HTMLTableRow_iface_tids HTMLTableRow_iface_tids
}; };
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow)); HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow));
nsresult nsres; nsresult nsres;
...@@ -325,7 +325,7 @@ HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem) ...@@ -325,7 +325,7 @@ HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl; ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
ret->element.node.vtbl = &HTMLTableRowImplVtbl; ret->element.node.vtbl = &HTMLTableRowImplVtbl;
HTMLElement_Init(&ret->element, &HTMLTableRow_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableRow_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -411,7 +411,7 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = { ...@@ -411,7 +411,7 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLTextAreaElementImpl_get_disabled HTMLTextAreaElementImpl_get_disabled
}; };
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{ {
HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement)); HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
nsresult nsres; nsresult nsres;
...@@ -419,7 +419,7 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem) ...@@ -419,7 +419,7 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl; ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl; ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl;
HTMLElement_Init(&ret->element, NULL); HTMLElement_Init(&ret->element, doc, nselem, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
(void**)&ret->nstextarea); (void**)&ret->nstextarea);
......
...@@ -182,11 +182,12 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = { ...@@ -182,11 +182,12 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
HTMLTextContainer_get_onscroll HTMLTextContainer_get_onscroll
}; };
void HTMLTextContainer_Init(HTMLTextContainer *This, dispex_static_data_t *dispex_data) void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
dispex_static_data_t *dispex_data)
{ {
This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl; This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl;
HTMLElement_Init(&This->element, dispex_data); HTMLElement_Init(&This->element, doc, nselem, dispex_data);
ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents); ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents);
} }
...@@ -684,24 +684,24 @@ HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*); ...@@ -684,24 +684,24 @@ HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*);
HTMLElement *HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL); HTMLElement *HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL);
HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*); HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode*,nsIDOMNode*);
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLAnchorElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLBodyElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement*); HTMLElement *HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLInputElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLOptionElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLSelectElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement*); HTMLElement *HTMLTable_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement*); HTMLElement *HTMLTableRow_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLTextAreaElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLGenericElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*);
void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*); void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*);
void HTMLElement_Init(HTMLElement*,dispex_static_data_t*); void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
void HTMLElement2_Init(HTMLElement*); void HTMLElement2_Init(HTMLElement*);
void HTMLElement3_Init(HTMLElement*); void HTMLElement3_Init(HTMLElement*);
void HTMLTextContainer_Init(HTMLTextContainer*,dispex_static_data_t*); void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*);
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**); HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
void HTMLDOMNode_destructor(HTMLDOMNode*); void HTMLDOMNode_destructor(HTMLDOMNode*);
......
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