2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/debug.h"
31 #include "mshtml_private.h"
32 #include "htmlevent.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
36 struct HTMLSelectElement
{
39 IHTMLSelectElement IHTMLSelectElement_iface
;
41 nsIDOMHTMLSelectElement
*nsselect
;
44 static inline HTMLSelectElement
*impl_from_IHTMLSelectElement(IHTMLSelectElement
*iface
)
46 return CONTAINING_RECORD(iface
, HTMLSelectElement
, IHTMLSelectElement_iface
);
49 static HRESULT
htmlselect_item(HTMLSelectElement
*This
, int i
, IDispatch
**ret
)
51 nsIDOMHTMLOptionsCollection
*nscol
;
56 nsres
= nsIDOMHTMLSelectElement_GetOptions(This
->nsselect
, &nscol
);
57 if(NS_FAILED(nsres
)) {
58 ERR("GetOptions failed: %08x\n", nsres
);
62 nsres
= nsIDOMHTMLOptionsCollection_Item(nscol
, i
, &nsnode
);
63 nsIDOMHTMLOptionsCollection_Release(nscol
);
64 if(NS_FAILED(nsres
)) {
65 ERR("Item failed: %08x\n", nsres
);
72 hres
= get_node(This
->element
.node
.doc
, nsnode
, TRUE
, &node
);
73 nsIDOMNode_Release(nsnode
);
77 *ret
= (IDispatch
*)&node
->IHTMLDOMNode_iface
;
84 static HRESULT WINAPI
HTMLSelectElement_QueryInterface(IHTMLSelectElement
*iface
,
85 REFIID riid
, void **ppv
)
87 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
89 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
92 static ULONG WINAPI
HTMLSelectElement_AddRef(IHTMLSelectElement
*iface
)
94 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
96 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
99 static ULONG WINAPI
HTMLSelectElement_Release(IHTMLSelectElement
*iface
)
101 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
103 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
106 static HRESULT WINAPI
HTMLSelectElement_GetTypeInfoCount(IHTMLSelectElement
*iface
, UINT
*pctinfo
)
108 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
110 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
113 static HRESULT WINAPI
HTMLSelectElement_GetTypeInfo(IHTMLSelectElement
*iface
, UINT iTInfo
,
114 LCID lcid
, ITypeInfo
**ppTInfo
)
116 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
118 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
122 static HRESULT WINAPI
HTMLSelectElement_GetIDsOfNames(IHTMLSelectElement
*iface
, REFIID riid
,
123 LPOLESTR
*rgszNames
, UINT cNames
,
124 LCID lcid
, DISPID
*rgDispId
)
126 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
128 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
129 cNames
, lcid
, rgDispId
);
132 static HRESULT WINAPI
HTMLSelectElement_Invoke(IHTMLSelectElement
*iface
, DISPID dispIdMember
,
133 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
134 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
136 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
138 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
139 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
142 static HRESULT WINAPI
HTMLSelectElement_put_size(IHTMLSelectElement
*iface
, LONG v
)
144 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
147 TRACE("(%p)->(%d)\n", This
, v
);
149 return CTL_E_INVALIDPROPERTYVALUE
;
151 nsres
= nsIDOMHTMLSelectElement_SetSize(This
->nsselect
, v
);
152 if(NS_FAILED(nsres
)) {
153 ERR("SetSize failed: %08x\n", nsres
);
159 static HRESULT WINAPI
HTMLSelectElement_get_size(IHTMLSelectElement
*iface
, LONG
*p
)
161 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
165 TRACE("(%p)->(%p)\n", This
, p
);
169 nsres
= nsIDOMHTMLSelectElement_GetSize(This
->nsselect
, &val
);
170 if(NS_FAILED(nsres
)) {
171 ERR("GetSize failed: %08x\n", nsres
);
178 static HRESULT WINAPI
HTMLSelectElement_put_multiple(IHTMLSelectElement
*iface
, VARIANT_BOOL v
)
180 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
183 TRACE("(%p)->(%x)\n", This
, v
);
185 nsres
= nsIDOMHTMLSelectElement_SetMultiple(This
->nsselect
, !!v
);
186 assert(nsres
== NS_OK
);
190 static HRESULT WINAPI
HTMLSelectElement_get_multiple(IHTMLSelectElement
*iface
, VARIANT_BOOL
*p
)
192 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
196 TRACE("(%p)->(%p)\n", This
, p
);
198 nsres
= nsIDOMHTMLSelectElement_GetMultiple(This
->nsselect
, &val
);
199 assert(nsres
== NS_OK
);
201 *p
= val
? VARIANT_TRUE
: VARIANT_FALSE
;
205 static HRESULT WINAPI
HTMLSelectElement_put_name(IHTMLSelectElement
*iface
, BSTR v
)
207 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
211 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
212 nsAString_InitDepend(&str
, v
);
213 nsres
= nsIDOMHTMLSelectElement_SetName(This
->nsselect
, &str
);
214 nsAString_Finish(&str
);
216 if(NS_FAILED(nsres
)) {
217 ERR("SetName failed: %08x\n", nsres
);
223 static HRESULT WINAPI
HTMLSelectElement_get_name(IHTMLSelectElement
*iface
, BSTR
*p
)
225 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
229 TRACE("(%p)->(%p)\n", This
, p
);
231 nsAString_Init(&name_str
, NULL
);
232 nsres
= nsIDOMHTMLSelectElement_GetName(This
->nsselect
, &name_str
);
234 return return_nsstr(nsres
, &name_str
, p
);
237 static HRESULT WINAPI
HTMLSelectElement_get_options(IHTMLSelectElement
*iface
, IDispatch
**p
)
239 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
241 TRACE("(%p)->(%p)\n", This
, p
);
243 *p
= (IDispatch
*)&This
->IHTMLSelectElement_iface
;
244 IDispatch_AddRef(*p
);
248 static HRESULT WINAPI
HTMLSelectElement_put_onchange(IHTMLSelectElement
*iface
, VARIANT v
)
250 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
252 TRACE("(%p)->()\n", This
);
254 return set_node_event(&This
->element
.node
, EVENTID_CHANGE
, &v
);
257 static HRESULT WINAPI
HTMLSelectElement_get_onchange(IHTMLSelectElement
*iface
, VARIANT
*p
)
259 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
260 FIXME("(%p)->(%p)\n", This
, p
);
264 static HRESULT WINAPI
HTMLSelectElement_put_selectedIndex(IHTMLSelectElement
*iface
, LONG v
)
266 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
269 TRACE("(%p)->(%d)\n", This
, v
);
271 nsres
= nsIDOMHTMLSelectElement_SetSelectedIndex(This
->nsselect
, v
);
273 ERR("SetSelectedIndex failed: %08x\n", nsres
);
278 static HRESULT WINAPI
HTMLSelectElement_get_selectedIndex(IHTMLSelectElement
*iface
, LONG
*p
)
280 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
283 TRACE("(%p)->(%p)\n", This
, p
);
285 nsres
= nsIDOMHTMLSelectElement_GetSelectedIndex(This
->nsselect
, p
);
286 if(NS_FAILED(nsres
)) {
287 ERR("GetSelectedIndex failed: %08x\n", nsres
);
294 static HRESULT WINAPI
HTMLSelectElement_get_type(IHTMLSelectElement
*iface
, BSTR
*p
)
296 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
300 TRACE("(%p)->(%p)\n", This
, p
);
302 nsAString_Init(&type_str
, NULL
);
303 nsres
= nsIDOMHTMLSelectElement_GetType(This
->nsselect
, &type_str
);
304 return return_nsstr(nsres
, &type_str
, p
);
307 static HRESULT WINAPI
HTMLSelectElement_put_value(IHTMLSelectElement
*iface
, BSTR v
)
309 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
313 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
315 nsAString_InitDepend(&value_str
, v
);
316 nsres
= nsIDOMHTMLSelectElement_SetValue(This
->nsselect
, &value_str
);
317 nsAString_Finish(&value_str
);
319 ERR("SetValue failed: %08x\n", nsres
);
324 static HRESULT WINAPI
HTMLSelectElement_get_value(IHTMLSelectElement
*iface
, BSTR
*p
)
326 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
330 TRACE("(%p)->(%p)\n", This
, p
);
332 nsAString_Init(&value_str
, NULL
);
333 nsres
= nsIDOMHTMLSelectElement_GetValue(This
->nsselect
, &value_str
);
334 return return_nsstr(nsres
, &value_str
, p
);
337 static HRESULT WINAPI
HTMLSelectElement_put_disabled(IHTMLSelectElement
*iface
, VARIANT_BOOL v
)
339 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
342 TRACE("(%p)->(%x)\n", This
, v
);
344 nsres
= nsIDOMHTMLSelectElement_SetDisabled(This
->nsselect
, v
!= VARIANT_FALSE
);
345 if(NS_FAILED(nsres
)) {
346 ERR("SetDisabled failed: %08x\n", nsres
);
353 static HRESULT WINAPI
HTMLSelectElement_get_disabled(IHTMLSelectElement
*iface
, VARIANT_BOOL
*p
)
355 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
356 cpp_bool disabled
= FALSE
;
359 TRACE("(%p)->(%p)\n", This
, p
);
361 nsres
= nsIDOMHTMLSelectElement_GetDisabled(This
->nsselect
, &disabled
);
362 if(NS_FAILED(nsres
)) {
363 ERR("GetDisabled failed: %08x\n", nsres
);
367 *p
= disabled
? VARIANT_TRUE
: VARIANT_FALSE
;
371 static HRESULT WINAPI
HTMLSelectElement_get_form(IHTMLSelectElement
*iface
, IHTMLFormElement
**p
)
373 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
374 nsIDOMHTMLFormElement
*nsform
;
375 nsIDOMNode
*form_node
;
380 TRACE("(%p)->(%p)\n", This
, p
);
385 nsres
= nsIDOMHTMLSelectElement_GetForm(This
->nsselect
, &nsform
);
386 if (NS_FAILED(nsres
)) {
387 ERR("GetForm failed: %08x, nsform: %p\n", nsres
, nsform
);
391 if (nsform
== NULL
) {
392 TRACE("nsform not found\n");
397 nsres
= nsIDOMHTMLFormElement_QueryInterface(nsform
, &IID_nsIDOMNode
, (void**)&form_node
);
398 nsIDOMHTMLFormElement_Release(nsform
);
399 assert(nsres
== NS_OK
);
401 hres
= get_node(This
->element
.node
.doc
, form_node
, TRUE
, &node
);
402 nsIDOMNode_Release(form_node
);
406 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
412 static HRESULT WINAPI
HTMLSelectElement_add(IHTMLSelectElement
*iface
, IHTMLElement
*element
,
415 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
416 nsIWritableVariant
*nsvariant
;
417 HTMLElement
*element_obj
;
420 TRACE("(%p)->(%p %s)\n", This
, element
, debugstr_variant(&before
));
422 element_obj
= unsafe_impl_from_IHTMLElement(element
);
424 FIXME("External IHTMLElement implementation?\n");
428 nsvariant
= create_nsvariant();
432 switch(V_VT(&before
)) {
435 nsres
= nsIWritableVariant_SetAsEmpty(nsvariant
);
438 nsres
= nsIWritableVariant_SetAsInt16(nsvariant
, V_I2(&before
));
441 FIXME("unhandled before %s\n", debugstr_variant(&before
));
442 nsIWritableVariant_Release(nsvariant
);
446 if(NS_SUCCEEDED(nsres
))
447 nsres
= nsIDOMHTMLSelectElement_Add(This
->nsselect
, element_obj
->nselem
, (nsIVariant
*)nsvariant
);
448 nsIWritableVariant_Release(nsvariant
);
449 if(NS_FAILED(nsres
)) {
450 ERR("Add failed: %08x\n", nsres
);
457 static HRESULT WINAPI
HTMLSelectElement_remove(IHTMLSelectElement
*iface
, LONG index
)
459 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
461 TRACE("(%p)->(%d)\n", This
, index
);
465 nsres
= nsIDOMHTMLSelectElement_select_Remove(This
->nsselect
, index
);
466 if(NS_FAILED(nsres
)) {
467 ERR("Remove failed: %08x\n", nsres
);
473 static HRESULT WINAPI
HTMLSelectElement_put_length(IHTMLSelectElement
*iface
, LONG v
)
475 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
478 TRACE("(%p)->(%d)\n", This
, v
);
480 nsres
= nsIDOMHTMLSelectElement_SetLength(This
->nsselect
, v
);
482 ERR("SetLength failed: %08x\n", nsres
);
487 static HRESULT WINAPI
HTMLSelectElement_get_length(IHTMLSelectElement
*iface
, LONG
*p
)
489 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
493 TRACE("(%p)->(%p)\n", This
, p
);
495 nsres
= nsIDOMHTMLSelectElement_GetLength(This
->nsselect
, &length
);
497 ERR("GetLength failed: %08x\n", nsres
);
501 TRACE("ret %d\n", *p
);
505 static HRESULT WINAPI
HTMLSelectElement_get__newEnum(IHTMLSelectElement
*iface
, IUnknown
**p
)
507 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
508 FIXME("(%p)->(%p)\n", This
, p
);
512 static HRESULT WINAPI
HTMLSelectElement_item(IHTMLSelectElement
*iface
, VARIANT name
,
513 VARIANT index
, IDispatch
**pdisp
)
515 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
517 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_variant(&name
), debugstr_variant(&index
), pdisp
);
523 if(V_VT(&name
) == VT_I4
) {
526 return htmlselect_item(This
, V_I4(&name
), pdisp
);
529 FIXME("Unsupported args\n");
533 static HRESULT WINAPI
HTMLSelectElement_tags(IHTMLSelectElement
*iface
, VARIANT tagName
,
536 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
537 FIXME("(%p)->(v %p)\n", This
, pdisp
);
541 static const IHTMLSelectElementVtbl HTMLSelectElementVtbl
= {
542 HTMLSelectElement_QueryInterface
,
543 HTMLSelectElement_AddRef
,
544 HTMLSelectElement_Release
,
545 HTMLSelectElement_GetTypeInfoCount
,
546 HTMLSelectElement_GetTypeInfo
,
547 HTMLSelectElement_GetIDsOfNames
,
548 HTMLSelectElement_Invoke
,
549 HTMLSelectElement_put_size
,
550 HTMLSelectElement_get_size
,
551 HTMLSelectElement_put_multiple
,
552 HTMLSelectElement_get_multiple
,
553 HTMLSelectElement_put_name
,
554 HTMLSelectElement_get_name
,
555 HTMLSelectElement_get_options
,
556 HTMLSelectElement_put_onchange
,
557 HTMLSelectElement_get_onchange
,
558 HTMLSelectElement_put_selectedIndex
,
559 HTMLSelectElement_get_selectedIndex
,
560 HTMLSelectElement_get_type
,
561 HTMLSelectElement_put_value
,
562 HTMLSelectElement_get_value
,
563 HTMLSelectElement_put_disabled
,
564 HTMLSelectElement_get_disabled
,
565 HTMLSelectElement_get_form
,
566 HTMLSelectElement_add
,
567 HTMLSelectElement_remove
,
568 HTMLSelectElement_put_length
,
569 HTMLSelectElement_get_length
,
570 HTMLSelectElement_get__newEnum
,
571 HTMLSelectElement_item
,
572 HTMLSelectElement_tags
575 static inline HTMLSelectElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
577 return CONTAINING_RECORD(iface
, HTMLSelectElement
, element
.node
);
580 static HRESULT
HTMLSelectElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
582 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
586 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
587 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
588 *ppv
= &This
->IHTMLSelectElement_iface
;
589 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
590 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
591 *ppv
= &This
->IHTMLSelectElement_iface
;
592 }else if(IsEqualGUID(&IID_IHTMLSelectElement
, riid
)) {
593 TRACE("(%p)->(IID_IHTMLSelectElement %p)\n", This
, ppv
);
594 *ppv
= &This
->IHTMLSelectElement_iface
;
598 IUnknown_AddRef((IUnknown
*)*ppv
);
602 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
605 static HRESULT
HTMLSelectElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
607 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
608 return IHTMLSelectElement_put_disabled(&This
->IHTMLSelectElement_iface
, v
);
611 static HRESULT
HTMLSelectElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
613 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
614 return IHTMLSelectElement_get_disabled(&This
->IHTMLSelectElement_iface
, p
);
617 #define DISPID_OPTIONCOL_0 MSHTML_DISPID_CUSTOM_MIN
619 static HRESULT
HTMLSelectElement_get_dispid(HTMLDOMNode
*iface
, BSTR name
, DWORD flags
, DISPID
*dispid
)
624 for(ptr
= name
; *ptr
&& isdigitW(*ptr
); ptr
++) {
625 idx
= idx
*10 + (*ptr
-'0');
626 if(idx
> MSHTML_CUSTOM_DISPID_CNT
) {
627 WARN("too big idx\n");
628 return DISP_E_UNKNOWNNAME
;
632 return DISP_E_UNKNOWNNAME
;
634 *dispid
= DISPID_OPTIONCOL_0
+ idx
;
638 static HRESULT
HTMLSelectElement_invoke(HTMLDOMNode
*iface
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
639 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
641 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
643 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
646 case DISPATCH_PROPERTYGET
: {
650 hres
= htmlselect_item(This
, id
-DISPID_OPTIONCOL_0
, &ret
);
655 V_VT(res
) = VT_DISPATCH
;
656 V_DISPATCH(res
) = ret
;
664 FIXME("unimplemented flags %x\n", flags
);
671 static void HTMLSelectElement_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
673 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
676 note_cc_edge((nsISupports
*)This
->nsselect
, "This->nsselect", cb
);
679 static void HTMLSelectElement_unlink(HTMLDOMNode
*iface
)
681 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
684 nsIDOMHTMLSelectElement
*nsselect
= This
->nsselect
;
686 This
->nsselect
= NULL
;
687 nsIDOMHTMLSelectElement_Release(nsselect
);
691 static const NodeImplVtbl HTMLSelectElementImplVtbl
= {
692 &CLSID_HTMLSelectElement
,
693 HTMLSelectElement_QI
,
694 HTMLElement_destructor
,
697 HTMLElement_handle_event
,
698 HTMLElement_get_attr_col
,
701 HTMLSelectElementImpl_put_disabled
,
702 HTMLSelectElementImpl_get_disabled
,
705 HTMLSelectElement_get_dispid
,
706 HTMLSelectElement_invoke
,
708 HTMLSelectElement_traverse
,
709 HTMLSelectElement_unlink
712 static const tid_t HTMLSelectElement_tids
[] = {
714 IHTMLSelectElement_tid
,
718 static dispex_static_data_t HTMLSelectElement_dispex
= {
720 DispHTMLSelectElement_tid
,
721 HTMLSelectElement_tids
,
722 HTMLElement_init_dispex_info
725 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
727 HTMLSelectElement
*ret
;
730 ret
= heap_alloc_zero(sizeof(HTMLSelectElement
));
732 return E_OUTOFMEMORY
;
734 ret
->IHTMLSelectElement_iface
.lpVtbl
= &HTMLSelectElementVtbl
;
735 ret
->element
.node
.vtbl
= &HTMLSelectElementImplVtbl
;
737 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLSelectElement_dispex
);
739 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLSelectElement
,
740 (void**)&ret
->nsselect
);
741 assert(nsres
== NS_OK
);
743 *elem
= &ret
->element
;