2 * Copyright 2009 Andrew Eikum 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 HTMLFormElement
{
38 IHTMLFormElement IHTMLFormElement_iface
;
40 nsIDOMHTMLFormElement
*nsform
;
43 static HRESULT
htmlform_item(HTMLFormElement
*This
, int i
, IDispatch
**ret
)
45 nsIDOMHTMLCollection
*elements
;
51 nsres
= nsIDOMHTMLFormElement_GetElements(This
->nsform
, &elements
);
52 if(NS_FAILED(nsres
)) {
53 FIXME("GetElements failed: 0x%08x\n", nsres
);
57 nsres
= nsIDOMHTMLCollection_Item(elements
, i
, &item
);
58 nsIDOMHTMLCollection_Release(elements
);
59 if(NS_FAILED(nsres
)) {
60 FIXME("Item failed: 0x%08x\n", nsres
);
65 hres
= get_node(This
->element
.node
.doc
, item
, TRUE
, &node
);
69 nsIDOMNode_Release(item
);
70 *ret
= (IDispatch
*)&node
->IHTMLDOMNode_iface
;
78 static inline HTMLFormElement
*impl_from_IHTMLFormElement(IHTMLFormElement
*iface
)
80 return CONTAINING_RECORD(iface
, HTMLFormElement
, IHTMLFormElement_iface
);
83 static HRESULT WINAPI
HTMLFormElement_QueryInterface(IHTMLFormElement
*iface
,
84 REFIID riid
, void **ppv
)
86 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
88 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
91 static ULONG WINAPI
HTMLFormElement_AddRef(IHTMLFormElement
*iface
)
93 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
95 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
98 static ULONG WINAPI
HTMLFormElement_Release(IHTMLFormElement
*iface
)
100 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
102 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
105 static HRESULT WINAPI
HTMLFormElement_GetTypeInfoCount(IHTMLFormElement
*iface
, UINT
*pctinfo
)
107 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
108 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
111 static HRESULT WINAPI
HTMLFormElement_GetTypeInfo(IHTMLFormElement
*iface
, UINT iTInfo
,
112 LCID lcid
, ITypeInfo
**ppTInfo
)
114 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
115 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
119 static HRESULT WINAPI
HTMLFormElement_GetIDsOfNames(IHTMLFormElement
*iface
, REFIID riid
,
120 LPOLESTR
*rgszNames
, UINT cNames
,
121 LCID lcid
, DISPID
*rgDispId
)
123 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
124 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
125 cNames
, lcid
, rgDispId
);
128 static HRESULT WINAPI
HTMLFormElement_Invoke(IHTMLFormElement
*iface
, DISPID dispIdMember
,
129 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
130 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
132 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
133 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
134 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
137 static HRESULT WINAPI
HTMLFormElement_put_action(IHTMLFormElement
*iface
, BSTR v
)
139 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
140 nsAString action_str
;
143 TRACE("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
145 nsAString_InitDepend(&action_str
, v
);
146 nsres
= nsIDOMHTMLFormElement_SetAction(This
->nsform
, &action_str
);
147 nsAString_Finish(&action_str
);
148 if(NS_FAILED(nsres
)) {
149 ERR("SetAction failed: %08x\n", nsres
);
156 static HRESULT WINAPI
HTMLFormElement_get_action(IHTMLFormElement
*iface
, BSTR
*p
)
158 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
159 nsAString action_str
;
163 TRACE("(%p)->(%p)\n", This
, p
);
165 nsAString_Init(&action_str
, NULL
);
166 nsres
= nsIDOMHTMLFormElement_GetAction(This
->nsform
, &action_str
);
167 if(NS_SUCCEEDED(nsres
)) {
168 const PRUnichar
*action
;
169 nsAString_GetData(&action_str
, &action
);
170 hres
= nsuri_to_url(action
, FALSE
, p
);
172 ERR("GetAction failed: %08x\n", nsres
);
176 nsAString_Finish(&action_str
);
180 static HRESULT WINAPI
HTMLFormElement_put_dir(IHTMLFormElement
*iface
, BSTR v
)
182 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
183 FIXME("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
187 static HRESULT WINAPI
HTMLFormElement_get_dir(IHTMLFormElement
*iface
, BSTR
*p
)
189 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
190 FIXME("(%p)->(%p)\n", This
, p
);
194 static HRESULT WINAPI
HTMLFormElement_put_encoding(IHTMLFormElement
*iface
, BSTR v
)
196 static const WCHAR urlencodedW
[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
197 'x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0};
198 static const WCHAR dataW
[] = {'m','u','l','t','i','p','a','r','t','/',
199 'f','o','r','m','-','d','a','t','a',0};
200 static const WCHAR plainW
[] = {'t','e','x','t','/','p','l','a','i','n',0};
202 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
203 nsAString encoding_str
;
206 TRACE("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
208 if(lstrcmpiW(v
, urlencodedW
) && lstrcmpiW(v
, dataW
) && lstrcmpiW(v
, plainW
)) {
209 WARN("incorrect enctype\n");
213 nsAString_InitDepend(&encoding_str
, v
);
214 nsres
= nsIDOMHTMLFormElement_SetEnctype(This
->nsform
, &encoding_str
);
215 nsAString_Finish(&encoding_str
);
222 static HRESULT WINAPI
HTMLFormElement_get_encoding(IHTMLFormElement
*iface
, BSTR
*p
)
224 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
225 nsAString encoding_str
;
228 TRACE("(%p)->(%p)\n", This
, p
);
230 nsAString_Init(&encoding_str
, NULL
);
231 nsres
= nsIDOMHTMLFormElement_GetEnctype(This
->nsform
, &encoding_str
);
232 return return_nsstr(nsres
, &encoding_str
, p
);
235 static HRESULT WINAPI
HTMLFormElement_put_method(IHTMLFormElement
*iface
, BSTR v
)
237 static const WCHAR postW
[] = {'P','O','S','T',0};
238 static const WCHAR getW
[] = {'G','E','T',0};
240 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
241 nsAString method_str
;
244 TRACE("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
246 if(lstrcmpiW(v
, postW
) && lstrcmpiW(v
, getW
)) {
247 WARN("unrecognized method\n");
251 nsAString_InitDepend(&method_str
, v
);
252 nsres
= nsIDOMHTMLFormElement_SetMethod(This
->nsform
, &method_str
);
253 nsAString_Finish(&method_str
);
260 static HRESULT WINAPI
HTMLFormElement_get_method(IHTMLFormElement
*iface
, BSTR
*p
)
262 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
263 nsAString method_str
;
266 TRACE("(%p)->(%p)\n", This
, p
);
268 nsAString_Init(&method_str
, NULL
);
269 nsres
= nsIDOMHTMLFormElement_GetMethod(This
->nsform
, &method_str
);
270 return return_nsstr(nsres
, &method_str
, p
);
273 static HRESULT WINAPI
HTMLFormElement_get_elements(IHTMLFormElement
*iface
, IDispatch
**p
)
275 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
277 TRACE("(%p)->(%p)\n", This
, p
);
279 *p
= (IDispatch
*)&This
->IHTMLFormElement_iface
;
280 IDispatch_AddRef(*p
);
284 static HRESULT WINAPI
HTMLFormElement_put_target(IHTMLFormElement
*iface
, BSTR v
)
286 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
287 FIXME("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
291 static HRESULT WINAPI
HTMLFormElement_get_target(IHTMLFormElement
*iface
, BSTR
*p
)
293 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
294 FIXME("(%p)->(%p)\n", This
, p
);
298 static HRESULT WINAPI
HTMLFormElement_put_name(IHTMLFormElement
*iface
, BSTR v
)
300 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
304 TRACE("(%p)->(%s)\n", This
, wine_dbgstr_w(v
));
306 nsAString_InitDepend(&name_str
, v
);
307 nsres
= nsIDOMHTMLFormElement_SetName(This
->nsform
, &name_str
);
308 nsAString_Finish(&name_str
);
315 static HRESULT WINAPI
HTMLFormElement_get_name(IHTMLFormElement
*iface
, BSTR
*p
)
317 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
321 TRACE("(%p)->(%p)\n", This
, p
);
323 nsAString_Init(&name_str
, NULL
);
324 nsres
= nsIDOMHTMLFormElement_GetName(This
->nsform
, &name_str
);
325 return return_nsstr(nsres
, &name_str
, p
);
328 static HRESULT WINAPI
HTMLFormElement_put_onsubmit(IHTMLFormElement
*iface
, VARIANT v
)
330 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
332 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
334 return set_node_event(&This
->element
.node
, EVENTID_SUBMIT
, &v
);
337 static HRESULT WINAPI
HTMLFormElement_get_onsubmit(IHTMLFormElement
*iface
, VARIANT
*p
)
339 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
341 TRACE("(%p)->(%p)\n", This
, p
);
343 return get_node_event(&This
->element
.node
, EVENTID_SUBMIT
, p
);
346 static HRESULT WINAPI
HTMLFormElement_put_onreset(IHTMLFormElement
*iface
, VARIANT v
)
348 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
349 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
353 static HRESULT WINAPI
HTMLFormElement_get_onreset(IHTMLFormElement
*iface
, VARIANT
*p
)
355 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
356 FIXME("(%p)->(%p)\n", This
, p
);
360 static HRESULT WINAPI
HTMLFormElement_submit(IHTMLFormElement
*iface
)
362 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
365 TRACE("(%p)->()\n", This
);
367 nsres
= nsIDOMHTMLFormElement_Submit(This
->nsform
);
368 if(NS_FAILED(nsres
)) {
369 ERR("Submit failed: %08x\n", nsres
);
376 static HRESULT WINAPI
HTMLFormElement_reset(IHTMLFormElement
*iface
)
378 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
379 FIXME("(%p)->()\n", This
);
383 static HRESULT WINAPI
HTMLFormElement_put_length(IHTMLFormElement
*iface
, LONG v
)
385 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
386 FIXME("(%p)->(%d)\n", This
, v
);
390 static HRESULT WINAPI
HTMLFormElement_get_length(IHTMLFormElement
*iface
, LONG
*p
)
392 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
396 TRACE("(%p)->(%p)\n", This
, p
);
398 nsres
= nsIDOMHTMLFormElement_GetLength(This
->nsform
, &length
);
399 if(NS_FAILED(nsres
)) {
400 ERR("GetLength failed: %08x\n", nsres
);
408 static HRESULT WINAPI
HTMLFormElement__newEnum(IHTMLFormElement
*iface
, IUnknown
**p
)
410 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
411 FIXME("(%p)->(%p)\n", This
, p
);
415 static HRESULT WINAPI
HTMLFormElement_item(IHTMLFormElement
*iface
, VARIANT name
,
416 VARIANT index
, IDispatch
**pdisp
)
418 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
420 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_variant(&name
), debugstr_variant(&index
), pdisp
);
426 if(V_VT(&name
) == VT_I4
) {
429 return htmlform_item(This
, V_I4(&name
), pdisp
);
432 FIXME("Unsupported args\n");
436 static HRESULT WINAPI
HTMLFormElement_tags(IHTMLFormElement
*iface
, VARIANT tagName
,
439 HTMLFormElement
*This
= impl_from_IHTMLFormElement(iface
);
440 FIXME("(%p)->(v %p)\n", This
, pdisp
);
444 static const IHTMLFormElementVtbl HTMLFormElementVtbl
= {
445 HTMLFormElement_QueryInterface
,
446 HTMLFormElement_AddRef
,
447 HTMLFormElement_Release
,
448 HTMLFormElement_GetTypeInfoCount
,
449 HTMLFormElement_GetTypeInfo
,
450 HTMLFormElement_GetIDsOfNames
,
451 HTMLFormElement_Invoke
,
452 HTMLFormElement_put_action
,
453 HTMLFormElement_get_action
,
454 HTMLFormElement_put_dir
,
455 HTMLFormElement_get_dir
,
456 HTMLFormElement_put_encoding
,
457 HTMLFormElement_get_encoding
,
458 HTMLFormElement_put_method
,
459 HTMLFormElement_get_method
,
460 HTMLFormElement_get_elements
,
461 HTMLFormElement_put_target
,
462 HTMLFormElement_get_target
,
463 HTMLFormElement_put_name
,
464 HTMLFormElement_get_name
,
465 HTMLFormElement_put_onsubmit
,
466 HTMLFormElement_get_onsubmit
,
467 HTMLFormElement_put_onreset
,
468 HTMLFormElement_get_onreset
,
469 HTMLFormElement_submit
,
470 HTMLFormElement_reset
,
471 HTMLFormElement_put_length
,
472 HTMLFormElement_get_length
,
473 HTMLFormElement__newEnum
,
474 HTMLFormElement_item
,
478 static inline HTMLFormElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
480 return CONTAINING_RECORD(iface
, HTMLFormElement
, element
.node
);
483 static HRESULT
HTMLFormElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
485 HTMLFormElement
*This
= impl_from_HTMLDOMNode(iface
);
489 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
490 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
491 *ppv
= &This
->IHTMLFormElement_iface
;
492 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
493 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
494 *ppv
= &This
->IHTMLFormElement_iface
;
495 }else if(IsEqualGUID(&IID_IHTMLFormElement
, riid
)) {
496 TRACE("(%p)->(IID_IHTMLFormElement %p)\n", This
, ppv
);
497 *ppv
= &This
->IHTMLFormElement_iface
;
501 IUnknown_AddRef((IUnknown
*)*ppv
);
505 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
508 static void HTMLFormElement_destructor(HTMLDOMNode
*iface
)
510 HTMLFormElement
*This
= impl_from_HTMLDOMNode(iface
);
513 nsIDOMHTMLFormElement_Release(This
->nsform
);
515 HTMLElement_destructor(&This
->element
.node
);
518 static HRESULT
HTMLFormElement_get_dispid(HTMLDOMNode
*iface
,
519 BSTR name
, DWORD grfdex
, DISPID
*pid
)
521 HTMLFormElement
*This
= impl_from_HTMLDOMNode(iface
);
522 nsIDOMHTMLCollection
*elements
;
523 nsAString nsname
, nsstr
;
526 HRESULT hres
= DISP_E_UNKNOWNNAME
;
528 static const PRUnichar nameW
[] = {'n','a','m','e',0};
530 TRACE("(%p)->(%s %x %p)\n", This
, wine_dbgstr_w(name
), grfdex
, pid
);
532 nsres
= nsIDOMHTMLFormElement_GetElements(This
->nsform
, &elements
);
533 if(NS_FAILED(nsres
)) {
534 FIXME("GetElements failed: 0x%08x\n", nsres
);
538 nsres
= nsIDOMHTMLCollection_GetLength(elements
, &len
);
539 if(NS_FAILED(nsres
)) {
540 FIXME("GetLength failed: 0x%08x\n", nsres
);
541 nsIDOMHTMLCollection_Release(elements
);
545 if(len
> MSHTML_CUSTOM_DISPID_CNT
)
546 len
= MSHTML_CUSTOM_DISPID_CNT
;
548 /* FIXME: Implement in more generic way */
549 if('0' <= *name
&& *name
<= '9') {
552 i
= strtoulW(name
, &end_ptr
, 10);
553 if(!*end_ptr
&& i
< len
) {
554 *pid
= MSHTML_DISPID_CUSTOM_MIN
+ i
;
559 nsAString_InitDepend(&nsname
, nameW
);
560 nsAString_Init(&nsstr
, NULL
);
561 for(i
= 0; i
< len
; ++i
) {
563 nsIDOMHTMLElement
*nshtml_elem
;
564 const PRUnichar
*str
;
566 nsres
= nsIDOMHTMLCollection_Item(elements
, i
, &nsitem
);
567 if(NS_FAILED(nsres
)) {
568 FIXME("Item failed: 0x%08x\n", nsres
);
573 nsres
= nsIDOMNode_QueryInterface(nsitem
, &IID_nsIDOMHTMLElement
, (void**)&nshtml_elem
);
574 nsIDOMNode_Release(nsitem
);
575 if(NS_FAILED(nsres
)) {
576 FIXME("Failed to get nsIDOMHTMLNode interface: 0x%08x\n", nsres
);
581 /* compare by id attr */
582 nsres
= nsIDOMHTMLElement_GetId(nshtml_elem
, &nsstr
);
583 if(NS_FAILED(nsres
)) {
584 FIXME("GetId failed: 0x%08x\n", nsres
);
585 nsIDOMHTMLElement_Release(nshtml_elem
);
589 nsAString_GetData(&nsstr
, &str
);
590 if(!strcmpiW(str
, name
)) {
591 nsIDOMHTMLElement_Release(nshtml_elem
);
592 /* FIXME: using index for dispid */
593 *pid
= MSHTML_DISPID_CUSTOM_MIN
+ i
;
598 /* compare by name attr */
599 nsres
= nsIDOMHTMLElement_GetAttribute(nshtml_elem
, &nsname
, &nsstr
);
600 nsIDOMHTMLElement_Release(nshtml_elem
);
601 nsAString_GetData(&nsstr
, &str
);
602 if(!strcmpiW(str
, name
)) {
603 /* FIXME: using index for dispid */
604 *pid
= MSHTML_DISPID_CUSTOM_MIN
+ i
;
609 nsAString_Finish(&nsname
);
610 nsAString_Finish(&nsstr
);
612 nsIDOMHTMLCollection_Release(elements
);
617 static HRESULT
HTMLFormElement_invoke(HTMLDOMNode
*iface
,
618 DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
, VARIANT
*res
,
619 EXCEPINFO
*ei
, IServiceProvider
*caller
)
621 HTMLFormElement
*This
= impl_from_HTMLDOMNode(iface
);
625 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, flags
, params
, res
, ei
, caller
);
627 hres
= htmlform_item(This
, id
- MSHTML_DISPID_CUSTOM_MIN
, &ret
);
632 V_VT(res
) = VT_DISPATCH
;
633 V_DISPATCH(res
) = ret
;
640 static const NodeImplVtbl HTMLFormElementImplVtbl
= {
642 HTMLFormElement_destructor
,
644 HTMLElement_get_attr_col
,
652 HTMLFormElement_get_dispid
,
653 HTMLFormElement_invoke
656 static const tid_t HTMLFormElement_iface_tids
[] = {
658 IHTMLFormElement_tid
,
662 static dispex_static_data_t HTMLFormElement_dispex
= {
664 DispHTMLFormElement_tid
,
666 HTMLFormElement_iface_tids
669 HRESULT
HTMLFormElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
671 HTMLFormElement
*ret
;
674 ret
= heap_alloc_zero(sizeof(HTMLFormElement
));
676 return E_OUTOFMEMORY
;
678 ret
->IHTMLFormElement_iface
.lpVtbl
= &HTMLFormElementVtbl
;
679 ret
->element
.node
.vtbl
= &HTMLFormElementImplVtbl
;
681 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLFormElement
, (void**)&ret
->nsform
);
682 if(NS_FAILED(nsres
)) {
683 ERR("Could not get nsIDOMHTMLFormElement interface: %08x\n", nsres
);
688 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLFormElement_dispex
);
690 *elem
= &ret
->element
;