Commit 835b814e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store HTMLElement struct instead of pointer in HTMLSelectElement.

parent 8a8af7b4
......@@ -1300,6 +1300,8 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
ret = HTMLBodyElement_Create(nselem);
else if(!strcmpW(class_name, wszINPUT))
ret = HTMLInputElement_Create(nselem);
if(!strcmpW(class_name, wszSELECT))
ret = HTMLSelectElement_Create(nselem);
else {
ret = mshtml_alloc(sizeof(HTMLElement));
......@@ -1307,9 +1309,7 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
ret->destructor = NULL;
ret->nselem = nselem;
if(!strcmpW(class_name, wszSELECT))
HTMLSelectElement_Create(ret);
else if(!strcmpW(class_name, wszTEXTAREA))
if(!strcmpW(class_name, wszTEXTAREA))
HTMLTextAreaElement_Create(ret);
}
......
......@@ -36,9 +36,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct {
HTMLElement element;
const IHTMLSelectElementVtbl *lpHTMLSelectElementVtbl;
HTMLElement *element;
nsIDOMHTMLSelectElement *nsselect;
} HTMLSelectElement;
......@@ -70,7 +71,7 @@ static HRESULT WINAPI HTMLSelectElement_QueryInterface(IHTMLSelectElement *iface
return S_OK;
}
hres = HTMLElement_QI(This->element, riid, ppv);
hres = HTMLElement_QI(&This->element, riid, ppv);
if(FAILED(hres))
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
......@@ -83,7 +84,7 @@ static ULONG WINAPI HTMLSelectElement_AddRef(IHTMLSelectElement *iface)
TRACE("(%p)\n", This);
return IHTMLDocument2_AddRef(HTMLDOC(This->element->node.doc));
return IHTMLDocument2_AddRef(HTMLDOC(This->element.node.doc));
}
static ULONG WINAPI HTMLSelectElement_Release(IHTMLSelectElement *iface)
......@@ -92,7 +93,7 @@ static ULONG WINAPI HTMLSelectElement_Release(IHTMLSelectElement *iface)
TRACE("(%p)\n", This);
return IHTMLDocument2_Release(HTMLDOC(This->element->node.doc));
return IHTMLDocument2_Release(HTMLDOC(This->element.node.doc));
}
static HRESULT WINAPI HTMLSelectElement_GetTypeInfoCount(IHTMLSelectElement *iface, UINT *pctinfo)
......@@ -386,19 +387,20 @@ static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = {
HTMLSelectElement_tags
};
void HTMLSelectElement_Create(HTMLElement *element)
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement));
nsresult nsres;
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
ret->element = element;
nsres = nsIDOMHTMLElement_QueryInterface(element->nselem, &IID_nsIDOMHTMLSelectElement,
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
(void**)&ret->nsselect);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLSelectElement interfce: %08x\n", nsres);
element->impl = (IUnknown*)HTMLSELECT(ret);
element->destructor = HTMLSelectElement_destructor;
ret->element.impl = (IUnknown*)HTMLSELECT(ret);
ret->element.destructor = HTMLSelectElement_destructor;
return &ret->element;
}
......@@ -419,7 +419,7 @@ HTMLElement *HTMLElement_Create(nsIDOMNode*);
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement*);
void HTMLSelectElement_Create(HTMLElement*);
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*);
void HTMLTextAreaElement_Create(HTMLElement*);
void HTMLElement2_Init(HTMLElement*);
......
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