2 * Copyright 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
29 #include "wine/debug.h"
31 #include "mshtml_private.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: %08x\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: %08x\n", nsres
);
132 *p
= selected
? VARIANT_TRUE
: VARIANT_FALSE
;
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: %08x\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: %08x\n", nsres
);
182 nsres
= nsIDOMHTMLOptionElement_SetDefaultSelected(This
->nsoption
, val
);
183 if(NS_FAILED(nsres
)) {
184 ERR("SetDefaultSelected failed: %08x\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: %08x\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: %08x\n", nsres
);
214 *p
= val
? VARIANT_TRUE
: VARIANT_FALSE
;
218 static HRESULT WINAPI
HTMLOptionElement_put_index(IHTMLOptionElement
*iface
, LONG v
)
220 HTMLOptionElement
*This
= impl_from_IHTMLOptionElement(iface
);
221 FIXME("(%p)->(%d)\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: %08x\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
= nsIDOMHTMLElement_GetFirstChild(This
->element
.nselem
, &child
);
264 if(NS_FAILED(nsres
) || !child
)
267 nsres
= nsIDOMHTMLElement_RemoveChild(This
->element
.nselem
, child
, &tmp
);
268 nsIDOMNode_Release(child
);
269 if(NS_SUCCEEDED(nsres
)) {
270 nsIDOMNode_Release(tmp
);
272 ERR("RemoveChild failed: %08x\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: %08x\n", nsres
);
285 nsres
= nsIDOMHTMLElement_AppendChild(This
->element
.nselem
, (nsIDOMNode
*)text_node
, &tmp
);
286 if(NS_SUCCEEDED(nsres
))
287 nsIDOMNode_Release(tmp
);
289 ERR("AppendChild failed: %08x\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
;
311 nsIDOMNode
*form_node
;
316 TRACE("(%p)->(%p)\n", This
, p
);
321 nsres
= nsIDOMHTMLOptionElement_GetForm(This
->nsoption
, &nsform
);
322 if (NS_FAILED(nsres
)) {
323 ERR("GetForm failed: %08x, nsform: %p\n", nsres
, nsform
);
327 if (nsform
== NULL
) {
328 TRACE("nsform not found\n");
333 nsres
= nsIDOMHTMLFormElement_QueryInterface(nsform
, &IID_nsIDOMNode
, (void**)&form_node
);
334 nsIDOMHTMLFormElement_Release(nsform
);
335 assert(nsres
== NS_OK
);
337 hres
= get_node(This
->element
.node
.doc
, form_node
, TRUE
, &node
);
338 nsIDOMNode_Release(form_node
);
342 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
348 static const IHTMLOptionElementVtbl HTMLOptionElementVtbl
= {
349 HTMLOptionElement_QueryInterface
,
350 HTMLOptionElement_AddRef
,
351 HTMLOptionElement_Release
,
352 HTMLOptionElement_GetTypeInfoCount
,
353 HTMLOptionElement_GetTypeInfo
,
354 HTMLOptionElement_GetIDsOfNames
,
355 HTMLOptionElement_Invoke
,
356 HTMLOptionElement_put_selected
,
357 HTMLOptionElement_get_selected
,
358 HTMLOptionElement_put_value
,
359 HTMLOptionElement_get_value
,
360 HTMLOptionElement_put_defaultSelected
,
361 HTMLOptionElement_get_defaultSelected
,
362 HTMLOptionElement_put_index
,
363 HTMLOptionElement_get_index
,
364 HTMLOptionElement_put_text
,
365 HTMLOptionElement_get_text
,
366 HTMLOptionElement_get_form
369 static inline HTMLOptionElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
371 return CONTAINING_RECORD(iface
, HTMLOptionElement
, element
.node
);
374 static HRESULT
HTMLOptionElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
376 HTMLOptionElement
*This
= impl_from_HTMLDOMNode(iface
);
380 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
381 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
382 *ppv
= &This
->IHTMLOptionElement_iface
;
383 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
384 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
385 *ppv
= &This
->IHTMLOptionElement_iface
;
386 }else if(IsEqualGUID(&IID_IHTMLOptionElement
, riid
)) {
387 TRACE("(%p)->(IID_IHTMLOptionElement %p)\n", This
, ppv
);
388 *ppv
= &This
->IHTMLOptionElement_iface
;
392 IUnknown_AddRef((IUnknown
*)*ppv
);
396 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
399 static void HTMLOptionElement_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
401 HTMLOptionElement
*This
= impl_from_HTMLDOMNode(iface
);
404 note_cc_edge((nsISupports
*)This
->nsoption
, "This->nsoption", cb
);
407 static void HTMLOptionElement_unlink(HTMLDOMNode
*iface
)
409 HTMLOptionElement
*This
= impl_from_HTMLDOMNode(iface
);
412 nsIDOMHTMLOptionElement
*nsoption
= This
->nsoption
;
414 This
->nsoption
= NULL
;
415 nsIDOMHTMLOptionElement_Release(nsoption
);
419 static const NodeImplVtbl HTMLOptionElementImplVtbl
= {
420 HTMLOptionElement_QI
,
421 HTMLElement_destructor
,
424 HTMLElement_handle_event
,
425 HTMLElement_get_attr_col
,
435 HTMLOptionElement_traverse
,
436 HTMLOptionElement_unlink
439 static const tid_t HTMLOptionElement_iface_tids
[] = {
441 IHTMLOptionElement_tid
,
444 static dispex_static_data_t HTMLOptionElement_dispex
= {
446 DispHTMLOptionElement_tid
,
447 HTMLOptionElement_iface_tids
,
448 HTMLElement_init_dispex_info
451 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
453 HTMLOptionElement
*ret
;
456 ret
= heap_alloc_zero(sizeof(HTMLOptionElement
));
458 return E_OUTOFMEMORY
;
460 ret
->IHTMLOptionElement_iface
.lpVtbl
= &HTMLOptionElementVtbl
;
461 ret
->element
.node
.vtbl
= &HTMLOptionElementImplVtbl
;
463 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLOptionElement_dispex
);
465 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLOptionElement
, (void**)&ret
->nsoption
);
466 assert(nsres
== NS_OK
);
468 *elem
= &ret
->element
;
472 static inline HTMLOptionElementFactory
*impl_from_IHTMLOptionElementFactory(IHTMLOptionElementFactory
*iface
)
474 return CONTAINING_RECORD(iface
, HTMLOptionElementFactory
, IHTMLOptionElementFactory_iface
);
477 static HRESULT WINAPI
HTMLOptionElementFactory_QueryInterface(IHTMLOptionElementFactory
*iface
,
478 REFIID riid
, void **ppv
)
480 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
482 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
484 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
485 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
486 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
487 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
488 }else if(IsEqualGUID(&IID_IHTMLOptionElementFactory
, riid
)) {
489 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
490 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
491 return *ppv
? S_OK
: E_NOINTERFACE
;
494 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
495 return E_NOINTERFACE
;
498 IUnknown_AddRef((IUnknown
*)*ppv
);
502 static ULONG WINAPI
HTMLOptionElementFactory_AddRef(IHTMLOptionElementFactory
*iface
)
504 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
505 LONG ref
= InterlockedIncrement(&This
->ref
);
507 TRACE("(%p) ref=%d\n", This
, ref
);
512 static ULONG WINAPI
HTMLOptionElementFactory_Release(IHTMLOptionElementFactory
*iface
)
514 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
515 LONG ref
= InterlockedDecrement(&This
->ref
);
517 TRACE("(%p) ref=%d\n", This
, ref
);
520 release_dispex(&This
->dispex
);
527 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfoCount(IHTMLOptionElementFactory
*iface
, UINT
*pctinfo
)
529 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
530 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
533 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfo(IHTMLOptionElementFactory
*iface
, UINT iTInfo
,
534 LCID lcid
, ITypeInfo
**ppTInfo
)
536 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
537 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
540 static HRESULT WINAPI
HTMLOptionElementFactory_GetIDsOfNames(IHTMLOptionElementFactory
*iface
, REFIID riid
,
541 LPOLESTR
*rgszNames
, UINT cNames
,
542 LCID lcid
, DISPID
*rgDispId
)
544 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
545 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
548 static HRESULT WINAPI
HTMLOptionElementFactory_Invoke(IHTMLOptionElementFactory
*iface
, DISPID dispIdMember
,
549 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
550 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
552 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
553 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
554 pVarResult
, pExcepInfo
, puArgErr
);
557 static HRESULT WINAPI
HTMLOptionElementFactory_create(IHTMLOptionElementFactory
*iface
,
558 VARIANT text
, VARIANT value
, VARIANT defaultselected
, VARIANT selected
,
559 IHTMLOptionElement
**optelem
)
561 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
562 nsIDOMHTMLElement
*nselem
;
566 static const PRUnichar optionW
[] = {'O','P','T','I','O','N',0};
568 TRACE("(%p)->(%s %s %s %s %p)\n", This
, debugstr_variant(&text
), debugstr_variant(&value
),
569 debugstr_variant(&defaultselected
), debugstr_variant(&selected
), optelem
);
571 if(!This
->window
|| !This
->window
->doc
) {
578 hres
= create_nselem(This
->window
->doc
, optionW
, &nselem
);
582 hres
= get_node(This
->window
->doc
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
583 nsIDOMHTMLElement_Release(nselem
);
587 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
,
588 &IID_IHTMLOptionElement
, (void**)optelem
);
591 if(V_VT(&text
) == VT_BSTR
)
592 IHTMLOptionElement_put_text(*optelem
, V_BSTR(&text
));
593 else if(V_VT(&text
) != VT_EMPTY
)
594 FIXME("Unsupported text %s\n", debugstr_variant(&text
));
596 if(V_VT(&value
) == VT_BSTR
)
597 IHTMLOptionElement_put_value(*optelem
, V_BSTR(&value
));
598 else if(V_VT(&value
) != VT_EMPTY
)
599 FIXME("Unsupported value %s\n", debugstr_variant(&value
));
601 if(V_VT(&defaultselected
) != VT_EMPTY
)
602 FIXME("Unsupported defaultselected %s\n", debugstr_variant(&defaultselected
));
603 if(V_VT(&selected
) != VT_EMPTY
)
604 FIXME("Unsupported selected %s\n", debugstr_variant(&selected
));
609 static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
= {
610 HTMLOptionElementFactory_QueryInterface
,
611 HTMLOptionElementFactory_AddRef
,
612 HTMLOptionElementFactory_Release
,
613 HTMLOptionElementFactory_GetTypeInfoCount
,
614 HTMLOptionElementFactory_GetTypeInfo
,
615 HTMLOptionElementFactory_GetIDsOfNames
,
616 HTMLOptionElementFactory_Invoke
,
617 HTMLOptionElementFactory_create
620 static const tid_t HTMLOptionElementFactory_iface_tids
[] = {
621 IHTMLOptionElementFactory_tid
,
625 static dispex_static_data_t HTMLOptionElementFactory_dispex
= {
627 IHTMLOptionElementFactory_tid
,
628 HTMLOptionElementFactory_iface_tids
,
629 HTMLElement_init_dispex_info
632 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*window
, HTMLOptionElementFactory
**ret_ptr
)
634 HTMLOptionElementFactory
*ret
;
636 ret
= heap_alloc(sizeof(*ret
));
638 return E_OUTOFMEMORY
;
640 ret
->IHTMLOptionElementFactory_iface
.lpVtbl
= &HTMLOptionElementFactoryVtbl
;
642 ret
->window
= window
;
644 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLOptionElementFactory_iface
,
645 &HTMLOptionElementFactory_dispex
);