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

mshtml: Initialize HTMLElement in the beginning of constructors.

parent a1bdef2d
......@@ -486,6 +486,8 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLAnchorElement *ret = mshtml_alloc(sizeof(HTMLAnchorElement));
HTMLElement_Init(&ret->element);
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
......
......@@ -501,11 +501,11 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
TRACE("(%p)->(%p)\n", ret, nselem);
HTMLTextContainer_Init(&ret->textcont);
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
HTMLTextContainer_Init(&ret->textcont);
ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLBODY(ret));
ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
ConnectionPoint_Init(&ret->cp_txtcontevents, &ret->cp_container, &DIID_HTMLTextContainerEvents);
......
......@@ -1280,6 +1280,14 @@ static const NodeImplVtbl HTMLElementImplVtbl = {
HTMLElement_destructor
};
void HTMLElement_Init(HTMLElement *This)
{
This->node.vtbl = &HTMLElementImplVtbl;
This->lpHTMLElementVtbl = &HTMLElementVtbl;
HTMLElement2_Init(This);
}
HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
{
nsIDOMHTMLElement *nselem;
......@@ -1322,16 +1330,13 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
if(!ret) {
ret = mshtml_alloc(sizeof(HTMLElement));
ret->node.vtbl = &HTMLElementImplVtbl;
HTMLElement_Init(ret);
}
nsAString_Finish(&class_name_str);
ret->lpHTMLElementVtbl = &HTMLElementVtbl;
ret->nselem = nselem;
HTMLElement2_Init(ret);
return ret;
}
......
......@@ -1062,6 +1062,8 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
HTMLInputElement *ret = mshtml_alloc(sizeof(HTMLInputElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
ret->element.node.vtbl = &HTMLInputElementImplVtbl;
......
......@@ -340,6 +340,8 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
......@@ -511,6 +513,7 @@ HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument *doc)
HTMLOptionElementFactory *ret;
ret = mshtml_alloc(sizeof(HTMLOptionElementFactory));
ret->lpHTMLOptionElementFactoryVtbl = &HTMLOptionElementFactoryVtbl;
ret->ref = 1;
ret->doc = doc;
......
......@@ -429,6 +429,8 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
......
......@@ -550,6 +550,8 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
{
HTMLTable *ret = mshtml_alloc(sizeof(HTMLTable));
HTMLElement_Init(&ret->element);
ret->element.node.vtbl = &HTMLTableImplVtbl;
ret->lpHTMLTableVtbl = &HTMLTableVtbl;
......
......@@ -409,6 +409,8 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl;
......
......@@ -213,5 +213,7 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
void HTMLTextContainer_Init(HTMLTextContainer *This)
{
HTMLElement_Init(&This->element);
This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl;
}
......@@ -445,6 +445,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*);
void HTMLElement_Init(HTMLElement*);
void HTMLElement2_Init(HTMLElement*);
void HTMLTextContainer_Init(HTMLTextContainer*);
......
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