mshtml: Use heap_alloc_zero for allocating node objects.
This commit is contained in:
parent
e610d2ff12
commit
38b14274fb
|
@ -481,7 +481,7 @@ static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLAnchorElement *ret = heap_alloc(sizeof(HTMLAnchorElement));
|
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
||||||
|
|
|
@ -598,7 +598,7 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *ret = heap_alloc(sizeof(HTMLBodyElement));
|
HTMLBodyElement *ret = heap_alloc_zero(sizeof(HTMLBodyElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", ret, nselem);
|
TRACE("(%p)->(%p)\n", ret, nselem);
|
||||||
|
|
|
@ -1336,7 +1336,7 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
|
||||||
ret = HTMLTextAreaElement_Create(nselem);
|
ret = HTMLTextAreaElement_Create(nselem);
|
||||||
|
|
||||||
if(!ret) {
|
if(!ret) {
|
||||||
ret = heap_alloc(sizeof(HTMLElement));
|
ret = heap_alloc_zero(sizeof(HTMLElement));
|
||||||
HTMLElement_Init(ret);
|
HTMLElement_Init(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLInputElement *ret = heap_alloc(sizeof(HTMLInputElement));
|
HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
|
@ -352,14 +352,13 @@ static HTMLDOMNode *create_node(HTMLDocument *doc, nsIDOMNode *nsnode)
|
||||||
ret = &HTMLElement_Create(nsnode)->node;
|
ret = &HTMLElement_Create(nsnode)->node;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = heap_alloc(sizeof(HTMLDOMNode));
|
ret = heap_alloc_zero(sizeof(HTMLDOMNode));
|
||||||
ret->vtbl = &HTMLDOMNodeImplVtbl;
|
ret->vtbl = &HTMLDOMNodeImplVtbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret->lpHTMLDOMNodeVtbl = &HTMLDOMNodeVtbl;
|
ret->lpHTMLDOMNodeVtbl = &HTMLDOMNodeVtbl;
|
||||||
ret->ref = 1;
|
ret->ref = 1;
|
||||||
ret->doc = doc;
|
ret->doc = doc;
|
||||||
ret->event_target = NULL;
|
|
||||||
|
|
||||||
nsIDOMNode_AddRef(nsnode);
|
nsIDOMNode_AddRef(nsnode);
|
||||||
ret->nsnode = nsnode;
|
ret->nsnode = nsnode;
|
||||||
|
|
|
@ -333,7 +333,7 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLOptionElement *ret = heap_alloc(sizeof(HTMLOptionElement));
|
HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
|
@ -288,7 +288,7 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLScriptElement *ret = heap_alloc(sizeof(HTMLScriptElement));
|
HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
|
@ -422,7 +422,7 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLSelectElement *ret = heap_alloc(sizeof(HTMLSelectElement));
|
HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
|
@ -546,7 +546,7 @@ static const NodeImplVtbl HTMLTableImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLTable *ret = heap_alloc(sizeof(HTMLTable));
|
HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable));
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
||||||
|
|
|
@ -402,7 +402,7 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
|
||||||
|
|
||||||
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
|
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
|
||||||
{
|
{
|
||||||
HTMLTextAreaElement *ret = heap_alloc(sizeof(HTMLTextAreaElement));
|
HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
HTMLElement_Init(&ret->element);
|
HTMLElement_Init(&ret->element);
|
||||||
|
|
Loading…
Reference in New Issue