2 * Copyright 2006,2007 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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
35 struct HTMLOptionElement
{
38 IHTMLOptionElement IHTMLOptionElement_iface
;
40 nsIDOMHTMLOptionElement
*nsoption
;
43 static inline HTMLOptionElement
*impl_from_IHTMLOptionElement(IHTMLOptionElement
*iface
)
45 return CONTAINING_RECORD(iface
, HTMLOptionElement
, IHTMLOptionElement_iface
);
48 static HRESULT WINAPI
HTMLOptionElement_QueryInterface(IHTMLOptionElement
*iface
,
49 REFIID riid
, void **ppv
)
51 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
53 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
56 static ULONG WINAPI
HTMLOptionElement_AddRef(IHTMLOptionElement
*iface
)
58 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
60 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
63 static ULONG WINAPI
HTMLOptionElement_Release(IHTMLOptionElement
*iface
)
65 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
67 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
70 static HRESULT WINAPI
HTMLOptionElement_GetTypeInfoCount(IHTMLOptionElement
*iface
, UINT
*pctinfo
)
72 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
73 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
76 static HRESULT WINAPI
HTMLOptionElement_GetTypeInfo(IHTMLOptionElement
*iface
, UINT iTInfo
,
77 LCID lcid
, ITypeInfo
**ppTInfo
)
79 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
80 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
84 static HRESULT WINAPI
HTMLOptionElement_GetIDsOfNames(IHTMLOptionElement
*iface
, REFIID riid
,
85 LPOLESTR
*rgszNames
, UINT cNames
,
86 LCID lcid
, DISPID
*rgDispId
)
88 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
89 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
90 cNames
, lcid
, rgDispId
);
93 static HRESULT WINAPI
HTMLOptionElement_Invoke(IHTMLOptionElement
*iface
, DISPID dispIdMember
,
94 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
95 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
97 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
98 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
99 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
102 static HRESULT WINAPI
HTMLOptionElement_put_selected(IHTMLOptionElement
*iface
, VARIANT_BOOL v
)
104 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
107 TRACE("(%p)->(%x)\n", This
, v
);
109 nsres
= nsIDOMHTMLOptionElement_SetSelected(This
->nsoption
, v
!= VARIANT_FALSE
);
110 if(NS_FAILED(nsres
)) {
111 ERR("SetSelected failed: %08lx\n", nsres
);
118 static HRESULT WINAPI
HTMLOptionElement_get_selected(IHTMLOptionElement
*iface
, VARIANT_BOOL
*p
)
120 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
124 TRACE("(%p)->(%p)\n", This
, p
);
126 nsres
= nsIDOMHTMLOptionElement_GetSelected(This
->nsoption
, &selected
);
127 if(NS_FAILED(nsres
)) {
128 ERR("GetSelected failed: %08lx\n", nsres
);
132 *p
= variant_bool(selected
);
136 static HRESULT WINAPI
HTMLOptionElement_put_value(IHTMLOptionElement
*iface
, BSTR v
)
138 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
142 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
144 nsAString_InitDepend(&value_str
, v
);
145 nsres
= nsIDOMHTMLOptionElement_SetValue(This
->nsoption
, &value_str
);
146 nsAString_Finish(&value_str
);
148 ERR("SetValue failed: %08lx\n", nsres
);
153 static HRESULT WINAPI
HTMLOptionElement_get_value(IHTMLOptionElement
*iface
, BSTR
*p
)
155 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
159 TRACE("(%p)->(%p)\n", This
, p
);
161 nsAString_Init(&value_str
, NULL
);
162 nsres
= nsIDOMHTMLOptionElement_GetValue(This
->nsoption
, &value_str
);
163 return return_nsstr(nsres
, &value_str
, p
);
166 static HRESULT WINAPI
HTMLOptionElement_put_defaultSelected(IHTMLOptionElement
*iface
, VARIANT_BOOL v
)
168 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
169 cpp_bool val
, selected
;
172 TRACE("(%p)->(%x)\n", This
, v
);
174 val
= (v
== VARIANT_TRUE
);
176 nsres
= nsIDOMHTMLOptionElement_GetSelected(This
->nsoption
, &selected
);
177 if(NS_FAILED(nsres
)) {
178 ERR("GetSelected failed: %08lx\n", nsres
);
182 nsres
= nsIDOMHTMLOptionElement_SetDefaultSelected(This
->nsoption
, val
);
183 if(NS_FAILED(nsres
)) {
184 ERR("SetDefaultSelected failed: %08lx\n", nsres
);
188 if(val
!= selected
) {
189 nsres
= nsIDOMHTMLOptionElement_SetSelected(This
->nsoption
, selected
); /* WinAPI will reserve selected property */
190 if(NS_FAILED(nsres
)) {
191 ERR("SetSelected failed: %08lx\n", nsres
);
199 static HRESULT WINAPI
HTMLOptionElement_get_defaultSelected(IHTMLOptionElement
*iface
, VARIANT_BOOL
*p
)
201 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
205 TRACE("(%p)->(%p)\n", This
, p
);
208 nsres
= nsIDOMHTMLOptionElement_GetDefaultSelected(This
->nsoption
, &val
);
209 if(NS_FAILED(nsres
)) {
210 ERR("GetDefaultSelected failed: %08lx\n", nsres
);
214 *p
= variant_bool(val
);
218 static HRESULT WINAPI
HTMLOptionElement_put_index(IHTMLOptionElement
*iface
, LONG v
)
220 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
221 FIXME("(%p)->(%ld)\n", This
, v
);
225 static HRESULT WINAPI
HTMLOptionElement_get_index(IHTMLOptionElement
*iface
, LONG
*p
)
227 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
231 TRACE("(%p)->(%p)\n", This
, p
);
236 nsres
= nsIDOMHTMLOptionElement_GetIndex(This
->nsoption
, &val
);
237 if(NS_FAILED(nsres
)) {
238 ERR("GetIndex failed: %08lx\n", nsres
);
245 static HRESULT WINAPI
HTMLOptionElement_put_text(IHTMLOptionElement
*iface
, BSTR v
)
247 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
248 nsIDOMText
*text_node
;
253 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
255 if(!This
->element
.node
.doc
->nsdoc
) {
256 WARN("NULL nsdoc\n");
263 nsres
= nsIDOMElement_GetFirstChild(This
->element
.dom_element
, &child
);
264 if(NS_FAILED(nsres
) || !child
)
267 nsres
= nsIDOMElement_RemoveChild(This
->element
.dom_element
, child
, &tmp
);
268 nsIDOMNode_Release(child
);
269 if(NS_SUCCEEDED(nsres
)) {
270 nsIDOMNode_Release(tmp
);
272 ERR("RemoveChild failed: %08lx\n", nsres
);
277 nsAString_InitDepend(&text_str
, v
);
278 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->element
.node
.doc
->nsdoc
, &text_str
, &text_node
);
279 nsAString_Finish(&text_str
);
280 if(NS_FAILED(nsres
)) {
281 ERR("CreateTextNode failed: %08lx\n", nsres
);
285 nsres
= nsIDOMElement_AppendChild(This
->element
.dom_element
, (nsIDOMNode
*)text_node
, &tmp
);
286 if(NS_SUCCEEDED(nsres
))
287 nsIDOMNode_Release(tmp
);
289 ERR("AppendChild failed: %08lx\n", nsres
);
294 static HRESULT WINAPI
HTMLOptionElement_get_text(IHTMLOptionElement
*iface
, BSTR
*p
)
296 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
300 TRACE("(%p)->(%p)\n", This
, p
);
302 nsAString_Init(&text_str
, NULL
);
303 nsres
= nsIDOMHTMLOptionElement_GetText(This
->nsoption
, &text_str
);
304 return return_nsstr(nsres
, &text_str
, p
);
307 static HRESULT WINAPI
HTMLOptionElement_get_form(IHTMLOptionElement
*iface
, IHTMLFormElement
**p
)
309 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
310 nsIDOMHTMLFormElement
*nsform
;
313 TRACE("(%p)->(%p)\n", This
, p
);
318 nsres
= nsIDOMHTMLOptionElement_GetForm(This
->nsoption
, &nsform
);
319 return return_nsform(nsres
, nsform
, p
);
322 static const IHTMLOptionElementVtbl HTMLOptionElementVtbl
= {
323 HTMLOptionElement_QueryInterface
,
324 HTMLOptionElement_AddRef
,
325 HTMLOptionElement_Release
,
326 HTMLOptionElement_GetTypeInfoCount
,
327 HTMLOptionElement_GetTypeInfo
,
328 HTMLOptionElement_GetIDsOfNames
,
329 HTMLOptionElement_Invoke
,
330 HTMLOptionElement_put_selected
,
331 HTMLOptionElement_get_selected
,
332 HTMLOptionElement_put_value
,
333 HTMLOptionElement_get_value
,
334 HTMLOptionElement_put_defaultSelected
,
335 HTMLOptionElement_get_defaultSelected
,
336 HTMLOptionElement_put_index
,
337 HTMLOptionElement_get_index
,
338 HTMLOptionElement_put_text
,
339 HTMLOptionElement_get_text
,
340 HTMLOptionElement_get_form
343 static inline HTMLOptionElement
*HTMLOptionElement_from_HTMLDOMNode(HTMLDOMNode
*iface
)
345 return CONTAINING_RECORD(iface
, HTMLOptionElement
, element
.node
);
348 static HRESULT
HTMLOptionElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
350 HTMLOptionElement
*This
= HTMLOptionElement_from_HTMLDOMNode(iface
);
354 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
355 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
356 *ppv
= &This
->IHTMLOptionElement_iface
;
357 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
358 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
359 *ppv
= &This
->IHTMLOptionElement_iface
;
360 }else if(IsEqualGUID(&IID_IHTMLOptionElement
, riid
)) {
361 TRACE("(%p)->(IID_IHTMLOptionElement %p)\n", This
, ppv
);
362 *ppv
= &This
->IHTMLOptionElement_iface
;
366 IUnknown_AddRef((IUnknown
*)*ppv
);
370 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
373 static void HTMLOptionElement_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
375 HTMLOptionElement
*This
= HTMLOptionElement_from_HTMLDOMNode(iface
);
378 note_cc_edge((nsISupports
*)This
->nsoption
, "This->nsoption", cb
);
381 static void HTMLOptionElement_unlink(HTMLDOMNode
*iface
)
383 HTMLOptionElement
*This
= HTMLOptionElement_from_HTMLDOMNode(iface
);
386 nsIDOMHTMLOptionElement
*nsoption
= This
->nsoption
;
388 This
->nsoption
= NULL
;
389 nsIDOMHTMLOptionElement_Release(nsoption
);
393 static const NodeImplVtbl HTMLOptionElementImplVtbl
= {
394 &CLSID_HTMLOptionElement
,
395 HTMLOptionElement_QI
,
396 HTMLElement_destructor
,
399 HTMLElement_handle_event
,
400 HTMLElement_get_attr_col
,
409 HTMLOptionElement_traverse
,
410 HTMLOptionElement_unlink
413 static const tid_t HTMLOptionElement_iface_tids
[] = {
415 IHTMLOptionElement_tid
,
418 static dispex_static_data_t HTMLOptionElement_dispex
= {
419 L
"HTMLOptionElement",
421 DispHTMLOptionElement_tid
,
422 HTMLOptionElement_iface_tids
,
423 HTMLElement_init_dispex_info
426 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
428 HTMLOptionElement
*ret
;
431 ret
= heap_alloc_zero(sizeof(HTMLOptionElement
));
433 return E_OUTOFMEMORY
;
435 ret
->IHTMLOptionElement_iface
.lpVtbl
= &HTMLOptionElementVtbl
;
436 ret
->element
.node
.vtbl
= &HTMLOptionElementImplVtbl
;
438 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLOptionElement_dispex
);
440 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLOptionElement
, (void**)&ret
->nsoption
);
441 assert(nsres
== NS_OK
);
443 *elem
= &ret
->element
;
447 static inline HTMLOptionElementFactory
*impl_from_IHTMLOptionElementFactory(IHTMLOptionElementFactory
*iface
)
449 return CONTAINING_RECORD(iface
, HTMLOptionElementFactory
, IHTMLOptionElementFactory_iface
);
452 static HRESULT WINAPI
HTMLOptionElementFactory_QueryInterface(IHTMLOptionElementFactory
*iface
,
453 REFIID riid
, void **ppv
)
455 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
457 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
459 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
460 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
461 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
462 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
463 }else if(IsEqualGUID(&IID_IHTMLOptionElementFactory
, riid
)) {
464 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
465 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
466 return *ppv
? S_OK
: E_NOINTERFACE
;
469 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
470 return E_NOINTERFACE
;
473 IUnknown_AddRef((IUnknown
*)*ppv
);
477 static ULONG WINAPI
HTMLOptionElementFactory_AddRef(IHTMLOptionElementFactory
*iface
)
479 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
480 LONG ref
= InterlockedIncrement(&This
->ref
);
482 TRACE("(%p) ref=%ld\n", This
, ref
);
487 static ULONG WINAPI
HTMLOptionElementFactory_Release(IHTMLOptionElementFactory
*iface
)
489 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
490 LONG ref
= InterlockedDecrement(&This
->ref
);
492 TRACE("(%p) ref=%ld\n", This
, ref
);
495 release_dispex(&This
->dispex
);
502 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfoCount(IHTMLOptionElementFactory
*iface
, UINT
*pctinfo
)
504 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
505 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
508 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfo(IHTMLOptionElementFactory
*iface
, UINT iTInfo
,
509 LCID lcid
, ITypeInfo
**ppTInfo
)
511 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
512 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
515 static HRESULT WINAPI
HTMLOptionElementFactory_GetIDsOfNames(IHTMLOptionElementFactory
*iface
, REFIID riid
,
516 LPOLESTR
*rgszNames
, UINT cNames
,
517 LCID lcid
, DISPID
*rgDispId
)
519 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
520 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
523 static HRESULT WINAPI
HTMLOptionElementFactory_Invoke(IHTMLOptionElementFactory
*iface
, DISPID dispIdMember
,
524 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
525 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
527 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
528 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
529 pVarResult
, pExcepInfo
, puArgErr
);
532 static HRESULT WINAPI
HTMLOptionElementFactory_create(IHTMLOptionElementFactory
*iface
,
533 VARIANT text
, VARIANT value
, VARIANT defaultselected
, VARIANT selected
,
534 IHTMLOptionElement
**optelem
)
536 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
537 nsIDOMElement
*nselem
;
541 TRACE("(%p)->(%s %s %s %s %p)\n", This
, debugstr_variant(&text
), debugstr_variant(&value
),
542 debugstr_variant(&defaultselected
), debugstr_variant(&selected
), optelem
);
544 if(!This
->window
|| !This
->window
->doc
) {
551 hres
= create_nselem(This
->window
->doc
, L
"OPTION", &nselem
);
555 hres
= get_node((nsIDOMNode
*)nselem
, TRUE
, &node
);
556 nsIDOMElement_Release(nselem
);
560 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
,
561 &IID_IHTMLOptionElement
, (void**)optelem
);
564 if(V_VT(&text
) == VT_BSTR
)
565 IHTMLOptionElement_put_text(*optelem
, V_BSTR(&text
));
566 else if(V_VT(&text
) != VT_EMPTY
)
567 FIXME("Unsupported text %s\n", debugstr_variant(&text
));
569 if(V_VT(&value
) == VT_BSTR
)
570 IHTMLOptionElement_put_value(*optelem
, V_BSTR(&value
));
571 else if(V_VT(&value
) != VT_EMPTY
)
572 FIXME("Unsupported value %s\n", debugstr_variant(&value
));
574 if(V_VT(&defaultselected
) != VT_EMPTY
)
575 FIXME("Unsupported defaultselected %s\n", debugstr_variant(&defaultselected
));
576 if(V_VT(&selected
) != VT_EMPTY
)
577 FIXME("Unsupported selected %s\n", debugstr_variant(&selected
));
582 static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
= {
583 HTMLOptionElementFactory_QueryInterface
,
584 HTMLOptionElementFactory_AddRef
,
585 HTMLOptionElementFactory_Release
,
586 HTMLOptionElementFactory_GetTypeInfoCount
,
587 HTMLOptionElementFactory_GetTypeInfo
,
588 HTMLOptionElementFactory_GetIDsOfNames
,
589 HTMLOptionElementFactory_Invoke
,
590 HTMLOptionElementFactory_create
593 static inline HTMLOptionElementFactory
*HTMLOptionElementFactory_from_DispatchEx(DispatchEx
*iface
)
595 return CONTAINING_RECORD(iface
, HTMLOptionElementFactory
, dispex
);
598 static HRESULT
HTMLOptionElementFactory_value(DispatchEx
*dispex
, LCID lcid
,
599 WORD flags
, DISPPARAMS
*params
, VARIANT
*res
, EXCEPINFO
*ei
,
600 IServiceProvider
*caller
)
602 HTMLOptionElementFactory
*This
= HTMLOptionElementFactory_from_DispatchEx(dispex
);
603 unsigned int i
, argc
= params
->cArgs
- params
->cNamedArgs
;
604 IHTMLOptionElement
*opt
;
605 VARIANT empty
, *arg
[4];
608 if(flags
!= DISPATCH_CONSTRUCT
) {
609 FIXME("flags %x not supported\n", flags
);
614 V_VT(&empty
) = VT_EMPTY
;
616 for(i
= 0; i
< ARRAY_SIZE(arg
); i
++)
617 arg
[i
] = argc
> i
? ¶ms
->rgvarg
[params
->cArgs
- 1 - i
] : &empty
;
619 hres
= IHTMLOptionElementFactory_create(&This
->IHTMLOptionElementFactory_iface
,
620 *arg
[0], *arg
[1], *arg
[2], *arg
[3], &opt
);
624 V_VT(res
) = VT_DISPATCH
;
625 V_DISPATCH(res
) = (IDispatch
*)opt
;
630 static const tid_t HTMLOptionElementFactory_iface_tids
[] = {
631 IHTMLOptionElementFactory_tid
,
635 static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl
= {
636 HTMLOptionElementFactory_value
,
642 static dispex_static_data_t HTMLOptionElementFactory_dispex
= {
644 &HTMLOptionElementFactory_dispex_vtbl
,
645 IHTMLOptionElementFactory_tid
,
646 HTMLOptionElementFactory_iface_tids
,
647 HTMLElement_init_dispex_info
650 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*window
, HTMLOptionElementFactory
**ret_ptr
)
652 HTMLOptionElementFactory
*ret
;
654 ret
= heap_alloc(sizeof(*ret
));
656 return E_OUTOFMEMORY
;
658 ret
->IHTMLOptionElementFactory_iface
.lpVtbl
= &HTMLOptionElementFactoryVtbl
;
660 ret
->window
= window
;
662 init_dispatch(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLOptionElementFactory_iface
,
663 &HTMLOptionElementFactory_dispex
, dispex_compat_mode(&window
->event_target
.dispex
));
669 struct HTMLSelectElement
{
672 IHTMLSelectElement IHTMLSelectElement_iface
;
674 nsIDOMHTMLSelectElement
*nsselect
;
677 static inline HTMLSelectElement
*impl_from_IHTMLSelectElement(IHTMLSelectElement
*iface
)
679 return CONTAINING_RECORD(iface
, HTMLSelectElement
, IHTMLSelectElement_iface
);
682 static HRESULT
htmlselect_item(HTMLSelectElement
*This
, int i
, IDispatch
**ret
)
684 nsIDOMHTMLOptionsCollection
*nscol
;
689 nsres
= nsIDOMHTMLSelectElement_GetOptions(This
->nsselect
, &nscol
);
690 if(NS_FAILED(nsres
)) {
691 ERR("GetOptions failed: %08lx\n", nsres
);
695 nsres
= nsIDOMHTMLOptionsCollection_Item(nscol
, i
, &nsnode
);
696 nsIDOMHTMLOptionsCollection_Release(nscol
);
697 if(NS_FAILED(nsres
)) {
698 ERR("Item failed: %08lx\n", nsres
);
705 hres
= get_node(nsnode
, TRUE
, &node
);
706 nsIDOMNode_Release(nsnode
);
710 *ret
= (IDispatch
*)&node
->IHTMLDOMNode_iface
;
717 static HRESULT WINAPI
HTMLSelectElement_QueryInterface(IHTMLSelectElement
*iface
,
718 REFIID riid
, void **ppv
)
720 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
722 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
725 static ULONG WINAPI
HTMLSelectElement_AddRef(IHTMLSelectElement
*iface
)
727 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
729 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
732 static ULONG WINAPI
HTMLSelectElement_Release(IHTMLSelectElement
*iface
)
734 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
736 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
739 static HRESULT WINAPI
HTMLSelectElement_GetTypeInfoCount(IHTMLSelectElement
*iface
, UINT
*pctinfo
)
741 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
743 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, pctinfo
);
746 static HRESULT WINAPI
HTMLSelectElement_GetTypeInfo(IHTMLSelectElement
*iface
, UINT iTInfo
,
747 LCID lcid
, ITypeInfo
**ppTInfo
)
749 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
751 return IDispatchEx_GetTypeInfo(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
755 static HRESULT WINAPI
HTMLSelectElement_GetIDsOfNames(IHTMLSelectElement
*iface
, REFIID riid
,
756 LPOLESTR
*rgszNames
, UINT cNames
,
757 LCID lcid
, DISPID
*rgDispId
)
759 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
761 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
762 cNames
, lcid
, rgDispId
);
765 static HRESULT WINAPI
HTMLSelectElement_Invoke(IHTMLSelectElement
*iface
, DISPID dispIdMember
,
766 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
767 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
769 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
771 return IDispatchEx_Invoke(&This
->element
.node
.event_target
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
772 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
775 static HRESULT WINAPI
HTMLSelectElement_put_size(IHTMLSelectElement
*iface
, LONG v
)
777 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
780 TRACE("(%p)->(%ld)\n", This
, v
);
782 return CTL_E_INVALIDPROPERTYVALUE
;
784 nsres
= nsIDOMHTMLSelectElement_SetSize(This
->nsselect
, v
);
785 if(NS_FAILED(nsres
)) {
786 ERR("SetSize failed: %08lx\n", nsres
);
792 static HRESULT WINAPI
HTMLSelectElement_get_size(IHTMLSelectElement
*iface
, LONG
*p
)
794 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
798 TRACE("(%p)->(%p)\n", This
, p
);
802 nsres
= nsIDOMHTMLSelectElement_GetSize(This
->nsselect
, &val
);
803 if(NS_FAILED(nsres
)) {
804 ERR("GetSize failed: %08lx\n", nsres
);
811 static HRESULT WINAPI
HTMLSelectElement_put_multiple(IHTMLSelectElement
*iface
, VARIANT_BOOL v
)
813 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
816 TRACE("(%p)->(%x)\n", This
, v
);
818 nsres
= nsIDOMHTMLSelectElement_SetMultiple(This
->nsselect
, !!v
);
819 assert(nsres
== NS_OK
);
823 static HRESULT WINAPI
HTMLSelectElement_get_multiple(IHTMLSelectElement
*iface
, VARIANT_BOOL
*p
)
825 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
829 TRACE("(%p)->(%p)\n", This
, p
);
831 nsres
= nsIDOMHTMLSelectElement_GetMultiple(This
->nsselect
, &val
);
832 assert(nsres
== NS_OK
);
834 *p
= variant_bool(val
);
838 static HRESULT WINAPI
HTMLSelectElement_put_name(IHTMLSelectElement
*iface
, BSTR v
)
840 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
844 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
845 nsAString_InitDepend(&str
, v
);
846 nsres
= nsIDOMHTMLSelectElement_SetName(This
->nsselect
, &str
);
847 nsAString_Finish(&str
);
849 if(NS_FAILED(nsres
)) {
850 ERR("SetName failed: %08lx\n", nsres
);
856 static HRESULT WINAPI
HTMLSelectElement_get_name(IHTMLSelectElement
*iface
, BSTR
*p
)
858 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
862 TRACE("(%p)->(%p)\n", This
, p
);
864 nsAString_Init(&name_str
, NULL
);
865 nsres
= nsIDOMHTMLSelectElement_GetName(This
->nsselect
, &name_str
);
867 return return_nsstr(nsres
, &name_str
, p
);
870 static HRESULT WINAPI
HTMLSelectElement_get_options(IHTMLSelectElement
*iface
, IDispatch
**p
)
872 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
874 TRACE("(%p)->(%p)\n", This
, p
);
876 *p
= (IDispatch
*)&This
->IHTMLSelectElement_iface
;
877 IDispatch_AddRef(*p
);
881 static HRESULT WINAPI
HTMLSelectElement_put_onchange(IHTMLSelectElement
*iface
, VARIANT v
)
883 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
885 TRACE("(%p)->()\n", This
);
887 return set_node_event(&This
->element
.node
, EVENTID_CHANGE
, &v
);
890 static HRESULT WINAPI
HTMLSelectElement_get_onchange(IHTMLSelectElement
*iface
, VARIANT
*p
)
892 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
893 FIXME("(%p)->(%p)\n", This
, p
);
897 static HRESULT WINAPI
HTMLSelectElement_put_selectedIndex(IHTMLSelectElement
*iface
, LONG v
)
899 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
902 TRACE("(%p)->(%ld)\n", This
, v
);
904 nsres
= nsIDOMHTMLSelectElement_SetSelectedIndex(This
->nsselect
, v
);
906 ERR("SetSelectedIndex failed: %08lx\n", nsres
);
911 static HRESULT WINAPI
HTMLSelectElement_get_selectedIndex(IHTMLSelectElement
*iface
, LONG
*p
)
913 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
916 TRACE("(%p)->(%p)\n", This
, p
);
918 nsres
= nsIDOMHTMLSelectElement_GetSelectedIndex(This
->nsselect
, p
);
919 if(NS_FAILED(nsres
)) {
920 ERR("GetSelectedIndex failed: %08lx\n", nsres
);
927 static HRESULT WINAPI
HTMLSelectElement_get_type(IHTMLSelectElement
*iface
, BSTR
*p
)
929 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
933 TRACE("(%p)->(%p)\n", This
, p
);
935 nsAString_Init(&type_str
, NULL
);
936 nsres
= nsIDOMHTMLSelectElement_GetType(This
->nsselect
, &type_str
);
937 return return_nsstr(nsres
, &type_str
, p
);
940 static HRESULT WINAPI
HTMLSelectElement_put_value(IHTMLSelectElement
*iface
, BSTR v
)
942 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
946 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
948 nsAString_InitDepend(&value_str
, v
);
949 nsres
= nsIDOMHTMLSelectElement_SetValue(This
->nsselect
, &value_str
);
950 nsAString_Finish(&value_str
);
952 ERR("SetValue failed: %08lx\n", nsres
);
957 static HRESULT WINAPI
HTMLSelectElement_get_value(IHTMLSelectElement
*iface
, BSTR
*p
)
959 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
963 TRACE("(%p)->(%p)\n", This
, p
);
965 nsAString_Init(&value_str
, NULL
);
966 nsres
= nsIDOMHTMLSelectElement_GetValue(This
->nsselect
, &value_str
);
967 return return_nsstr(nsres
, &value_str
, p
);
970 static HRESULT WINAPI
HTMLSelectElement_put_disabled(IHTMLSelectElement
*iface
, VARIANT_BOOL v
)
972 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
975 TRACE("(%p)->(%x)\n", This
, v
);
977 nsres
= nsIDOMHTMLSelectElement_SetDisabled(This
->nsselect
, v
!= VARIANT_FALSE
);
978 if(NS_FAILED(nsres
)) {
979 ERR("SetDisabled failed: %08lx\n", nsres
);
986 static HRESULT WINAPI
HTMLSelectElement_get_disabled(IHTMLSelectElement
*iface
, VARIANT_BOOL
*p
)
988 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
989 cpp_bool disabled
= FALSE
;
992 TRACE("(%p)->(%p)\n", This
, p
);
994 nsres
= nsIDOMHTMLSelectElement_GetDisabled(This
->nsselect
, &disabled
);
995 if(NS_FAILED(nsres
)) {
996 ERR("GetDisabled failed: %08lx\n", nsres
);
1000 *p
= variant_bool(disabled
);
1004 static HRESULT WINAPI
HTMLSelectElement_get_form(IHTMLSelectElement
*iface
, IHTMLFormElement
**p
)
1006 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1007 nsIDOMHTMLFormElement
*nsform
;
1010 TRACE("(%p)->(%p)\n", This
, p
);
1015 nsres
= nsIDOMHTMLSelectElement_GetForm(This
->nsselect
, &nsform
);
1016 return return_nsform(nsres
, nsform
, p
);
1019 static HRESULT WINAPI
HTMLSelectElement_add(IHTMLSelectElement
*iface
, IHTMLElement
*element
,
1022 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1023 nsIWritableVariant
*nsvariant
;
1024 HTMLElement
*element_obj
;
1027 TRACE("(%p)->(%p %s)\n", This
, element
, debugstr_variant(&before
));
1029 element_obj
= unsafe_impl_from_IHTMLElement(element
);
1031 FIXME("External IHTMLElement implementation?\n");
1032 return E_INVALIDARG
;
1035 if(!element_obj
->html_element
) {
1036 FIXME("Not HTML element\n");
1040 nsvariant
= create_nsvariant();
1044 switch(V_VT(&before
)) {
1047 nsres
= nsIWritableVariant_SetAsEmpty(nsvariant
);
1050 nsres
= nsIWritableVariant_SetAsInt16(nsvariant
, V_I2(&before
));
1053 FIXME("unhandled before %s\n", debugstr_variant(&before
));
1054 nsIWritableVariant_Release(nsvariant
);
1058 if(NS_SUCCEEDED(nsres
))
1059 nsres
= nsIDOMHTMLSelectElement_Add(This
->nsselect
, element_obj
->html_element
, (nsIVariant
*)nsvariant
);
1060 nsIWritableVariant_Release(nsvariant
);
1061 if(NS_FAILED(nsres
)) {
1062 ERR("Add failed: %08lx\n", nsres
);
1069 static HRESULT WINAPI
HTMLSelectElement_remove(IHTMLSelectElement
*iface
, LONG index
)
1071 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1073 TRACE("(%p)->(%ld)\n", This
, index
);
1075 return E_INVALIDARG
;
1077 nsres
= nsIDOMHTMLSelectElement_select_Remove(This
->nsselect
, index
);
1078 if(NS_FAILED(nsres
)) {
1079 ERR("Remove failed: %08lx\n", nsres
);
1085 static HRESULT WINAPI
HTMLSelectElement_put_length(IHTMLSelectElement
*iface
, LONG v
)
1087 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1090 TRACE("(%p)->(%ld)\n", This
, v
);
1092 nsres
= nsIDOMHTMLSelectElement_SetLength(This
->nsselect
, v
);
1093 if(NS_FAILED(nsres
))
1094 ERR("SetLength failed: %08lx\n", nsres
);
1099 static HRESULT WINAPI
HTMLSelectElement_get_length(IHTMLSelectElement
*iface
, LONG
*p
)
1101 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1105 TRACE("(%p)->(%p)\n", This
, p
);
1107 nsres
= nsIDOMHTMLSelectElement_GetLength(This
->nsselect
, &length
);
1108 if(NS_FAILED(nsres
))
1109 ERR("GetLength failed: %08lx\n", nsres
);
1113 TRACE("ret %ld\n", *p
);
1117 static HRESULT WINAPI
HTMLSelectElement_get__newEnum(IHTMLSelectElement
*iface
, IUnknown
**p
)
1119 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1120 FIXME("(%p)->(%p)\n", This
, p
);
1124 static HRESULT WINAPI
HTMLSelectElement_item(IHTMLSelectElement
*iface
, VARIANT name
,
1125 VARIANT index
, IDispatch
**pdisp
)
1127 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1129 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_variant(&name
), debugstr_variant(&index
), pdisp
);
1135 if(V_VT(&name
) == VT_I4
) {
1137 return E_INVALIDARG
;
1138 return htmlselect_item(This
, V_I4(&name
), pdisp
);
1141 FIXME("Unsupported args\n");
1145 static HRESULT WINAPI
HTMLSelectElement_tags(IHTMLSelectElement
*iface
, VARIANT tagName
,
1148 HTMLSelectElement
*This
= impl_from_IHTMLSelectElement(iface
);
1149 FIXME("(%p)->(v %p)\n", This
, pdisp
);
1153 static const IHTMLSelectElementVtbl HTMLSelectElementVtbl
= {
1154 HTMLSelectElement_QueryInterface
,
1155 HTMLSelectElement_AddRef
,
1156 HTMLSelectElement_Release
,
1157 HTMLSelectElement_GetTypeInfoCount
,
1158 HTMLSelectElement_GetTypeInfo
,
1159 HTMLSelectElement_GetIDsOfNames
,
1160 HTMLSelectElement_Invoke
,
1161 HTMLSelectElement_put_size
,
1162 HTMLSelectElement_get_size
,
1163 HTMLSelectElement_put_multiple
,
1164 HTMLSelectElement_get_multiple
,
1165 HTMLSelectElement_put_name
,
1166 HTMLSelectElement_get_name
,
1167 HTMLSelectElement_get_options
,
1168 HTMLSelectElement_put_onchange
,
1169 HTMLSelectElement_get_onchange
,
1170 HTMLSelectElement_put_selectedIndex
,
1171 HTMLSelectElement_get_selectedIndex
,
1172 HTMLSelectElement_get_type
,
1173 HTMLSelectElement_put_value
,
1174 HTMLSelectElement_get_value
,
1175 HTMLSelectElement_put_disabled
,
1176 HTMLSelectElement_get_disabled
,
1177 HTMLSelectElement_get_form
,
1178 HTMLSelectElement_add
,
1179 HTMLSelectElement_remove
,
1180 HTMLSelectElement_put_length
,
1181 HTMLSelectElement_get_length
,
1182 HTMLSelectElement_get__newEnum
,
1183 HTMLSelectElement_item
,
1184 HTMLSelectElement_tags
1187 static inline HTMLSelectElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1189 return CONTAINING_RECORD(iface
, HTMLSelectElement
, element
.node
);
1192 static HRESULT
HTMLSelectElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1194 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1198 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1199 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1200 *ppv
= &This
->IHTMLSelectElement_iface
;
1201 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1202 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1203 *ppv
= &This
->IHTMLSelectElement_iface
;
1204 }else if(IsEqualGUID(&IID_IHTMLSelectElement
, riid
)) {
1205 TRACE("(%p)->(IID_IHTMLSelectElement %p)\n", This
, ppv
);
1206 *ppv
= &This
->IHTMLSelectElement_iface
;
1210 IUnknown_AddRef((IUnknown
*)*ppv
);
1214 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1217 static HRESULT
HTMLSelectElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1219 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1220 return IHTMLSelectElement_put_disabled(&This
->IHTMLSelectElement_iface
, v
);
1223 static HRESULT
HTMLSelectElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1225 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1226 return IHTMLSelectElement_get_disabled(&This
->IHTMLSelectElement_iface
, p
);
1229 #define DISPID_OPTIONCOL_0 MSHTML_DISPID_CUSTOM_MIN
1231 static HRESULT
HTMLSelectElement_get_dispid(HTMLDOMNode
*iface
, BSTR name
, DWORD flags
, DISPID
*dispid
)
1236 for(ptr
= name
; *ptr
&& is_digit(*ptr
); ptr
++) {
1237 idx
= idx
*10 + (*ptr
-'0');
1238 if(idx
> MSHTML_CUSTOM_DISPID_CNT
) {
1239 WARN("too big idx\n");
1240 return DISP_E_UNKNOWNNAME
;
1244 return DISP_E_UNKNOWNNAME
;
1246 *dispid
= DISPID_OPTIONCOL_0
+ idx
;
1250 static HRESULT
HTMLSelectElement_invoke(HTMLDOMNode
*iface
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
1251 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
1253 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1255 TRACE("(%p)->(%lx %lx %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
1258 case DISPATCH_PROPERTYGET
: {
1262 hres
= htmlselect_item(This
, id
-DISPID_OPTIONCOL_0
, &ret
);
1267 V_VT(res
) = VT_DISPATCH
;
1268 V_DISPATCH(res
) = ret
;
1270 V_VT(res
) = VT_NULL
;
1276 FIXME("unimplemented flags %x\n", flags
);
1283 static void HTMLSelectElement_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
1285 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1288 note_cc_edge((nsISupports
*)This
->nsselect
, "This->nsselect", cb
);
1291 static void HTMLSelectElement_unlink(HTMLDOMNode
*iface
)
1293 HTMLSelectElement
*This
= impl_from_HTMLDOMNode(iface
);
1295 if(This
->nsselect
) {
1296 nsIDOMHTMLSelectElement
*nsselect
= This
->nsselect
;
1298 This
->nsselect
= NULL
;
1299 nsIDOMHTMLSelectElement_Release(nsselect
);
1303 static const NodeImplVtbl HTMLSelectElementImplVtbl
= {
1304 &CLSID_HTMLSelectElement
,
1305 HTMLSelectElement_QI
,
1306 HTMLElement_destructor
,
1309 HTMLElement_handle_event
,
1310 HTMLElement_get_attr_col
,
1312 HTMLSelectElementImpl_put_disabled
,
1313 HTMLSelectElementImpl_get_disabled
,
1316 HTMLSelectElement_get_dispid
,
1317 HTMLSelectElement_invoke
,
1319 HTMLSelectElement_traverse
,
1320 HTMLSelectElement_unlink
1323 static const tid_t HTMLSelectElement_tids
[] = {
1325 IHTMLSelectElement_tid
,
1329 static dispex_static_data_t HTMLSelectElement_dispex
= {
1330 L
"HTMLSelectElement",
1332 DispHTMLSelectElement_tid
,
1333 HTMLSelectElement_tids
,
1334 HTMLElement_init_dispex_info
1337 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*doc
, nsIDOMElement
*nselem
, HTMLElement
**elem
)
1339 HTMLSelectElement
*ret
;
1342 ret
= heap_alloc_zero(sizeof(HTMLSelectElement
));
1344 return E_OUTOFMEMORY
;
1346 ret
->IHTMLSelectElement_iface
.lpVtbl
= &HTMLSelectElementVtbl
;
1347 ret
->element
.node
.vtbl
= &HTMLSelectElementImplVtbl
;
1349 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLSelectElement_dispex
);
1351 nsres
= nsIDOMElement_QueryInterface(nselem
, &IID_nsIDOMHTMLSelectElement
, (void**)&ret
->nsselect
);
1352 assert(nsres
== NS_OK
);
1354 *elem
= &ret
->element
;