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 &CLSID_HTMLOptionElement
,
421 HTMLOptionElement_QI
,
422 HTMLElement_destructor
,
425 HTMLElement_handle_event
,
426 HTMLElement_get_attr_col
,
436 HTMLOptionElement_traverse
,
437 HTMLOptionElement_unlink
440 static const tid_t HTMLOptionElement_iface_tids
[] = {
442 IHTMLOptionElement_tid
,
445 static dispex_static_data_t HTMLOptionElement_dispex
= {
447 DispHTMLOptionElement_tid
,
448 HTMLOptionElement_iface_tids
,
449 HTMLElement_init_dispex_info
452 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
454 HTMLOptionElement
*ret
;
457 ret
= heap_alloc_zero(sizeof(HTMLOptionElement
));
459 return E_OUTOFMEMORY
;
461 ret
->IHTMLOptionElement_iface
.lpVtbl
= &HTMLOptionElementVtbl
;
462 ret
->element
.node
.vtbl
= &HTMLOptionElementImplVtbl
;
464 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLOptionElement_dispex
);
466 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLOptionElement
, (void**)&ret
->nsoption
);
467 assert(nsres
== NS_OK
);
469 *elem
= &ret
->element
;
473 static inline HTMLOptionElementFactory
*impl_from_IHTMLOptionElementFactory(IHTMLOptionElementFactory
*iface
)
475 return CONTAINING_RECORD(iface
, HTMLOptionElementFactory
, IHTMLOptionElementFactory_iface
);
478 static HRESULT WINAPI
HTMLOptionElementFactory_QueryInterface(IHTMLOptionElementFactory
*iface
,
479 REFIID riid
, void **ppv
)
481 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
483 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
485 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
486 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
487 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
488 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
489 }else if(IsEqualGUID(&IID_IHTMLOptionElementFactory
, riid
)) {
490 *ppv
= &This
->IHTMLOptionElementFactory_iface
;
491 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
492 return *ppv
? S_OK
: E_NOINTERFACE
;
495 WARN("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
496 return E_NOINTERFACE
;
499 IUnknown_AddRef((IUnknown
*)*ppv
);
503 static ULONG WINAPI
HTMLOptionElementFactory_AddRef(IHTMLOptionElementFactory
*iface
)
505 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
506 LONG ref
= InterlockedIncrement(&This
->ref
);
508 TRACE("(%p) ref=%d\n", This
, ref
);
513 static ULONG WINAPI
HTMLOptionElementFactory_Release(IHTMLOptionElementFactory
*iface
)
515 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
516 LONG ref
= InterlockedDecrement(&This
->ref
);
518 TRACE("(%p) ref=%d\n", This
, ref
);
521 release_dispex(&This
->dispex
);
528 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfoCount(IHTMLOptionElementFactory
*iface
, UINT
*pctinfo
)
530 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
531 return IDispatchEx_GetTypeInfoCount(&This
->dispex
.IDispatchEx_iface
, pctinfo
);
534 static HRESULT WINAPI
HTMLOptionElementFactory_GetTypeInfo(IHTMLOptionElementFactory
*iface
, UINT iTInfo
,
535 LCID lcid
, ITypeInfo
**ppTInfo
)
537 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
538 return IDispatchEx_GetTypeInfo(&This
->dispex
.IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
541 static HRESULT WINAPI
HTMLOptionElementFactory_GetIDsOfNames(IHTMLOptionElementFactory
*iface
, REFIID riid
,
542 LPOLESTR
*rgszNames
, UINT cNames
,
543 LCID lcid
, DISPID
*rgDispId
)
545 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
546 return IDispatchEx_GetIDsOfNames(&This
->dispex
.IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
549 static HRESULT WINAPI
HTMLOptionElementFactory_Invoke(IHTMLOptionElementFactory
*iface
, DISPID dispIdMember
,
550 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
551 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
553 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
554 return IDispatchEx_Invoke(&This
->dispex
.IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
555 pVarResult
, pExcepInfo
, puArgErr
);
558 static HRESULT WINAPI
HTMLOptionElementFactory_create(IHTMLOptionElementFactory
*iface
,
559 VARIANT text
, VARIANT value
, VARIANT defaultselected
, VARIANT selected
,
560 IHTMLOptionElement
**optelem
)
562 HTMLOptionElementFactory
*This
= impl_from_IHTMLOptionElementFactory(iface
);
563 nsIDOMHTMLElement
*nselem
;
567 static const PRUnichar optionW
[] = {'O','P','T','I','O','N',0};
569 TRACE("(%p)->(%s %s %s %s %p)\n", This
, debugstr_variant(&text
), debugstr_variant(&value
),
570 debugstr_variant(&defaultselected
), debugstr_variant(&selected
), optelem
);
572 if(!This
->window
|| !This
->window
->doc
) {
579 hres
= create_nselem(This
->window
->doc
, optionW
, &nselem
);
583 hres
= get_node(This
->window
->doc
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
584 nsIDOMHTMLElement_Release(nselem
);
588 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
,
589 &IID_IHTMLOptionElement
, (void**)optelem
);
592 if(V_VT(&text
) == VT_BSTR
)
593 IHTMLOptionElement_put_text(*optelem
, V_BSTR(&text
));
594 else if(V_VT(&text
) != VT_EMPTY
)
595 FIXME("Unsupported text %s\n", debugstr_variant(&text
));
597 if(V_VT(&value
) == VT_BSTR
)
598 IHTMLOptionElement_put_value(*optelem
, V_BSTR(&value
));
599 else if(V_VT(&value
) != VT_EMPTY
)
600 FIXME("Unsupported value %s\n", debugstr_variant(&value
));
602 if(V_VT(&defaultselected
) != VT_EMPTY
)
603 FIXME("Unsupported defaultselected %s\n", debugstr_variant(&defaultselected
));
604 if(V_VT(&selected
) != VT_EMPTY
)
605 FIXME("Unsupported selected %s\n", debugstr_variant(&selected
));
610 static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl
= {
611 HTMLOptionElementFactory_QueryInterface
,
612 HTMLOptionElementFactory_AddRef
,
613 HTMLOptionElementFactory_Release
,
614 HTMLOptionElementFactory_GetTypeInfoCount
,
615 HTMLOptionElementFactory_GetTypeInfo
,
616 HTMLOptionElementFactory_GetIDsOfNames
,
617 HTMLOptionElementFactory_Invoke
,
618 HTMLOptionElementFactory_create
621 static const tid_t HTMLOptionElementFactory_iface_tids
[] = {
622 IHTMLOptionElementFactory_tid
,
626 static dispex_static_data_t HTMLOptionElementFactory_dispex
= {
628 IHTMLOptionElementFactory_tid
,
629 HTMLOptionElementFactory_iface_tids
,
630 HTMLElement_init_dispex_info
633 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*window
, HTMLOptionElementFactory
**ret_ptr
)
635 HTMLOptionElementFactory
*ret
;
637 ret
= heap_alloc(sizeof(*ret
));
639 return E_OUTOFMEMORY
;
641 ret
->IHTMLOptionElementFactory_iface
.lpVtbl
= &HTMLOptionElementFactoryVtbl
;
643 ret
->window
= window
;
645 init_dispex(&ret
->dispex
, (IUnknown
*)&ret
->IHTMLOptionElementFactory_iface
,
646 &HTMLOptionElementFactory_dispex
);