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
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 IHTMLInputElement IHTMLInputElement_iface
;
41 IHTMLInputTextElement IHTMLInputTextElement_iface
;
43 nsIDOMHTMLInputElement
*nsinput
;
46 static inline HTMLInputElement
*impl_from_IHTMLInputElement(IHTMLInputElement
*iface
)
48 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputElement_iface
);
51 static inline HTMLInputElement
*impl_from_IHTMLInputTextElement(IHTMLInputTextElement
*iface
)
53 return CONTAINING_RECORD(iface
, HTMLInputElement
, IHTMLInputTextElement_iface
);
56 static HRESULT WINAPI
HTMLInputElement_QueryInterface(IHTMLInputElement
*iface
,
57 REFIID riid
, void **ppv
)
59 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
61 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
64 static ULONG WINAPI
HTMLInputElement_AddRef(IHTMLInputElement
*iface
)
66 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
68 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
71 static ULONG WINAPI
HTMLInputElement_Release(IHTMLInputElement
*iface
)
73 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
75 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
78 static HRESULT WINAPI
HTMLInputElement_GetTypeInfoCount(IHTMLInputElement
*iface
, UINT
*pctinfo
)
80 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
82 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
85 static HRESULT WINAPI
HTMLInputElement_GetTypeInfo(IHTMLInputElement
*iface
, UINT iTInfo
,
86 LCID lcid
, ITypeInfo
**ppTInfo
)
88 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
90 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
94 static HRESULT WINAPI
HTMLInputElement_GetIDsOfNames(IHTMLInputElement
*iface
, REFIID riid
,
95 LPOLESTR
*rgszNames
, UINT cNames
,
96 LCID lcid
, DISPID
*rgDispId
)
98 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
100 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
101 cNames
, lcid
, rgDispId
);
104 static HRESULT WINAPI
HTMLInputElement_Invoke(IHTMLInputElement
*iface
, DISPID dispIdMember
,
105 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
106 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
108 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
110 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
111 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
114 static HRESULT WINAPI
HTMLInputElement_put_type(IHTMLInputElement
*iface
, BSTR v
)
116 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
120 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
124 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
126 nsAString_InitDepend(&type_str
, v
);
127 nsres
= nsIDOMHTMLInputElement_SetType(This
->nsinput
, &type_str
);
128 nsAString_Finish(&type_str
);
129 if(NS_FAILED(nsres
)) {
130 ERR("SetType failed: %08x\n", nsres
);
137 static HRESULT WINAPI
HTMLInputElement_get_type(IHTMLInputElement
*iface
, BSTR
*p
)
139 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
143 TRACE("(%p)->(%p)\n", This
, p
);
145 nsAString_Init(&type_str
, NULL
);
146 nsres
= nsIDOMHTMLInputElement_GetType(This
->nsinput
, &type_str
);
147 return return_nsstr(nsres
, &type_str
, p
);
150 static HRESULT WINAPI
HTMLInputElement_put_value(IHTMLInputElement
*iface
, BSTR v
)
152 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
156 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
158 nsAString_InitDepend(&val_str
, v
);
159 nsres
= nsIDOMHTMLInputElement_SetValue(This
->nsinput
, &val_str
);
160 nsAString_Finish(&val_str
);
162 ERR("SetValue failed: %08x\n", nsres
);
167 static HRESULT WINAPI
HTMLInputElement_get_value(IHTMLInputElement
*iface
, BSTR
*p
)
169 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
173 TRACE("(%p)->(%p)\n", This
, p
);
175 nsAString_Init(&value_str
, NULL
);
176 nsres
= nsIDOMHTMLInputElement_GetValue(This
->nsinput
, &value_str
);
177 return return_nsstr(nsres
, &value_str
, p
);
180 static HRESULT WINAPI
HTMLInputElement_put_name(IHTMLInputElement
*iface
, BSTR v
)
182 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
186 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
188 nsAString_InitDepend(&name_str
, v
);
189 nsres
= nsIDOMHTMLInputElement_SetName(This
->nsinput
, &name_str
);
190 nsAString_Finish(&name_str
);
191 if(NS_FAILED(nsres
)) {
192 ERR("SetName failed: %08x\n", nsres
);
199 static HRESULT WINAPI
HTMLInputElement_get_name(IHTMLInputElement
*iface
, BSTR
*p
)
201 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
205 TRACE("(%p)->(%p)\n", This
, p
);
207 nsAString_Init(&name_str
, NULL
);
208 nsres
= nsIDOMHTMLInputElement_GetName(This
->nsinput
, &name_str
);
209 return return_nsstr(nsres
, &name_str
, p
);
212 static HRESULT WINAPI
HTMLInputElement_put_status(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
214 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
215 FIXME("(%p)->(%x)\n", This
, v
);
219 static HRESULT WINAPI
HTMLInputElement_get_status(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
221 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
222 FIXME("(%p)->(%p)\n", This
, p
);
226 static HRESULT WINAPI
HTMLInputElement_put_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
228 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
231 TRACE("(%p)->(%x)\n", This
, v
);
233 nsres
= nsIDOMHTMLInputElement_SetDisabled(This
->nsinput
, v
!= VARIANT_FALSE
);
235 ERR("SetDisabled failed: %08x\n", nsres
);
240 static HRESULT WINAPI
HTMLInputElement_get_disabled(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
242 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
243 cpp_bool disabled
= FALSE
;
245 TRACE("(%p)->(%p)\n", This
, p
);
247 nsIDOMHTMLInputElement_GetDisabled(This
->nsinput
, &disabled
);
249 *p
= disabled
? VARIANT_TRUE
: VARIANT_FALSE
;
253 static HRESULT WINAPI
HTMLInputElement_get_form(IHTMLInputElement
*iface
, IHTMLFormElement
**p
)
255 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
256 FIXME("(%p)->(%p)\n", This
, p
);
260 static HRESULT WINAPI
HTMLInputElement_put_size(IHTMLInputElement
*iface
, LONG v
)
262 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
263 FIXME("(%p)->(%d)\n", This
, v
);
267 static HRESULT WINAPI
HTMLInputElement_get_size(IHTMLInputElement
*iface
, LONG
*p
)
269 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
270 FIXME("(%p)->(%p)\n", This
, p
);
274 static HRESULT WINAPI
HTMLInputElement_put_maxLength(IHTMLInputElement
*iface
, LONG v
)
276 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
279 TRACE("(%p)->(%d)\n", This
, v
);
281 nsres
= nsIDOMHTMLInputElement_SetMaxLength(This
->nsinput
, v
);
282 if(NS_FAILED(nsres
)) {
283 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
284 FIXME("SetMaxLength failed\n");
291 static HRESULT WINAPI
HTMLInputElement_get_maxLength(IHTMLInputElement
*iface
, LONG
*p
)
293 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
297 TRACE("(%p)->(%p)\n", This
, p
);
299 nsres
= nsIDOMHTMLInputElement_GetMaxLength(This
->nsinput
, &max_length
);
300 assert(nsres
== NS_OK
);
302 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
303 *p
= max_length
== -1 ? INT_MAX
: max_length
;
307 static HRESULT WINAPI
HTMLInputElement_select(IHTMLInputElement
*iface
)
309 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
312 TRACE("(%p)\n", This
);
314 nsres
= nsIDOMHTMLInputElement_Select(This
->nsinput
);
315 if(NS_FAILED(nsres
)) {
316 ERR("Select failed: %08x\n", nsres
);
323 static HRESULT WINAPI
HTMLInputElement_put_onchange(IHTMLInputElement
*iface
, VARIANT v
)
325 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
327 TRACE("(%p)->()\n", This
);
329 return set_node_event(&This
->element
.node
, EVENTID_CHANGE
, &v
);
332 static HRESULT WINAPI
HTMLInputElement_get_onchange(IHTMLInputElement
*iface
, VARIANT
*p
)
334 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
336 TRACE("(%p)->(%p)\n", This
, p
);
338 return get_node_event(&This
->element
.node
, EVENTID_CHANGE
, p
);
341 static HRESULT WINAPI
HTMLInputElement_put_onselect(IHTMLInputElement
*iface
, VARIANT v
)
343 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
344 FIXME("(%p)->()\n", This
);
348 static HRESULT WINAPI
HTMLInputElement_get_onselect(IHTMLInputElement
*iface
, VARIANT
*p
)
350 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
351 FIXME("(%p)->(%p)\n", This
, p
);
355 static HRESULT WINAPI
HTMLInputElement_put_defaultValue(IHTMLInputElement
*iface
, BSTR v
)
357 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
358 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
362 static HRESULT WINAPI
HTMLInputElement_get_defaultValue(IHTMLInputElement
*iface
, BSTR
*p
)
364 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
365 FIXME("(%p)->(%p)\n", This
, p
);
369 static HRESULT WINAPI
HTMLInputElement_put_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
371 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
372 FIXME("(%p)->(%x)\n", This
, v
);
376 static HRESULT WINAPI
HTMLInputElement_get_readOnly(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
378 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
379 FIXME("(%p)->(%p)\n", This
, p
);
383 static HRESULT WINAPI
HTMLInputElement_createTextRange(IHTMLInputElement
*iface
, IHTMLTxtRange
**range
)
385 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
386 FIXME("(%p)->(%p)\n", This
, range
);
390 static HRESULT WINAPI
HTMLInputElement_put_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
392 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
393 FIXME("(%p)->(%x)\n", This
, v
);
397 static HRESULT WINAPI
HTMLInputElement_get_indeterminate(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
399 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
400 FIXME("(%p)->(%p)\n", This
, p
);
404 static HRESULT WINAPI
HTMLInputElement_put_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
406 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
409 TRACE("(%p)->(%x)\n", This
, v
);
411 nsres
= nsIDOMHTMLInputElement_SetDefaultChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
412 if(NS_FAILED(nsres
)) {
413 ERR("SetDefaultChecked failed: %08x\n", nsres
);
420 static HRESULT WINAPI
HTMLInputElement_get_defaultChecked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
422 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
423 cpp_bool default_checked
= FALSE
;
426 TRACE("(%p)->(%p)\n", This
, p
);
428 nsres
= nsIDOMHTMLInputElement_GetDefaultChecked(This
->nsinput
, &default_checked
);
429 if(NS_FAILED(nsres
)) {
430 ERR("GetDefaultChecked failed: %08x\n", nsres
);
434 *p
= default_checked
? VARIANT_TRUE
: VARIANT_FALSE
;
438 static HRESULT WINAPI
HTMLInputElement_put_checked(IHTMLInputElement
*iface
, VARIANT_BOOL v
)
440 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
443 TRACE("(%p)->(%x)\n", This
, v
);
445 nsres
= nsIDOMHTMLInputElement_SetChecked(This
->nsinput
, v
!= VARIANT_FALSE
);
446 if(NS_FAILED(nsres
)) {
447 ERR("SetChecked failed: %08x\n", nsres
);
454 static HRESULT WINAPI
HTMLInputElement_get_checked(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
456 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
460 TRACE("(%p)->(%p)\n", This
, p
);
462 nsres
= nsIDOMHTMLInputElement_GetChecked(This
->nsinput
, &checked
);
463 if(NS_FAILED(nsres
)) {
464 ERR("GetChecked failed: %08x\n", nsres
);
468 *p
= checked
? VARIANT_TRUE
: VARIANT_FALSE
;
469 TRACE("checked=%x\n", *p
);
473 static HRESULT WINAPI
HTMLInputElement_put_border(IHTMLInputElement
*iface
, VARIANT v
)
475 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
476 FIXME("(%p)->()\n", This
);
480 static HRESULT WINAPI
HTMLInputElement_get_border(IHTMLInputElement
*iface
, VARIANT
*p
)
482 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
483 FIXME("(%p)->(%p)\n", This
, p
);
487 static HRESULT WINAPI
HTMLInputElement_put_vspace(IHTMLInputElement
*iface
, LONG v
)
489 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
490 FIXME("(%p)->(%d)\n", This
, v
);
494 static HRESULT WINAPI
HTMLInputElement_get_vspace(IHTMLInputElement
*iface
, LONG
*p
)
496 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
497 FIXME("(%p)->(%p)\n", This
, p
);
501 static HRESULT WINAPI
HTMLInputElement_put_hspace(IHTMLInputElement
*iface
, LONG v
)
503 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
504 FIXME("(%p)->(%d)\n", This
, v
);
508 static HRESULT WINAPI
HTMLInputElement_get_hspace(IHTMLInputElement
*iface
, LONG
*p
)
510 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
511 FIXME("(%p)->(%p)\n", This
, p
);
515 static HRESULT WINAPI
HTMLInputElement_put_alt(IHTMLInputElement
*iface
, BSTR v
)
517 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
518 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
522 static HRESULT WINAPI
HTMLInputElement_get_alt(IHTMLInputElement
*iface
, BSTR
*p
)
524 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
525 FIXME("(%p)->(%p)\n", This
, p
);
529 static HRESULT WINAPI
HTMLInputElement_put_src(IHTMLInputElement
*iface
, BSTR v
)
531 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
535 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
537 nsAString_InitDepend(&nsstr
, v
);
538 nsres
= nsIDOMHTMLInputElement_SetSrc(This
->nsinput
, &nsstr
);
539 nsAString_Finish(&nsstr
);
541 ERR("SetSrc failed: %08x\n", nsres
);
546 static HRESULT WINAPI
HTMLInputElement_get_src(IHTMLInputElement
*iface
, BSTR
*p
)
548 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
549 const PRUnichar
*src
;
554 TRACE("(%p)->(%p)\n", This
, p
);
556 nsAString_Init(&src_str
, NULL
);
557 nsres
= nsIDOMHTMLInputElement_GetSrc(This
->nsinput
, &src_str
);
558 if(NS_FAILED(nsres
)) {
559 ERR("GetSrc failed: %08x\n", nsres
);
563 nsAString_GetData(&src_str
, &src
);
564 hres
= nsuri_to_url(src
, FALSE
, p
);
565 nsAString_Finish(&src_str
);
570 static HRESULT WINAPI
HTMLInputElement_put_lowsrc(IHTMLInputElement
*iface
, BSTR v
)
572 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
573 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
577 static HRESULT WINAPI
HTMLInputElement_get_lowsrc(IHTMLInputElement
*iface
, BSTR
*p
)
579 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
580 FIXME("(%p)->(%p)\n", This
, p
);
584 static HRESULT WINAPI
HTMLInputElement_put_vrml(IHTMLInputElement
*iface
, BSTR v
)
586 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
587 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
591 static HRESULT WINAPI
HTMLInputElement_get_vrml(IHTMLInputElement
*iface
, BSTR
*p
)
593 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
594 FIXME("(%p)->(%p)\n", This
, p
);
598 static HRESULT WINAPI
HTMLInputElement_put_dynsrc(IHTMLInputElement
*iface
, BSTR v
)
600 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
601 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
605 static HRESULT WINAPI
HTMLInputElement_get_dynsrc(IHTMLInputElement
*iface
, BSTR
*p
)
607 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
608 FIXME("(%p)->(%p)\n", This
, p
);
612 static HRESULT WINAPI
HTMLInputElement_get_readyState(IHTMLInputElement
*iface
, BSTR
*p
)
614 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
615 FIXME("(%p)->(%p)\n", This
, p
);
619 static HRESULT WINAPI
HTMLInputElement_get_complete(IHTMLInputElement
*iface
, VARIANT_BOOL
*p
)
621 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
622 FIXME("(%p)->(%p)\n", This
, p
);
626 static HRESULT WINAPI
HTMLInputElement_put_loop(IHTMLInputElement
*iface
, VARIANT v
)
628 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
629 FIXME("(%p)->()\n", This
);
633 static HRESULT WINAPI
HTMLInputElement_get_loop(IHTMLInputElement
*iface
, VARIANT
*p
)
635 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
636 FIXME("(%p)->(%p)\n", This
, p
);
640 static HRESULT WINAPI
HTMLInputElement_put_align(IHTMLInputElement
*iface
, BSTR v
)
642 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
643 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
647 static HRESULT WINAPI
HTMLInputElement_get_align(IHTMLInputElement
*iface
, BSTR
*p
)
649 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
650 FIXME("(%p)->(%p)\n", This
, p
);
654 static HRESULT WINAPI
HTMLInputElement_put_onload(IHTMLInputElement
*iface
, VARIANT v
)
656 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
657 FIXME("(%p)->()\n", This
);
661 static HRESULT WINAPI
HTMLInputElement_get_onload(IHTMLInputElement
*iface
, VARIANT
*p
)
663 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
664 FIXME("(%p)->(%p)\n", This
, p
);
668 static HRESULT WINAPI
HTMLInputElement_put_onerror(IHTMLInputElement
*iface
, VARIANT v
)
670 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
671 FIXME("(%p)->()\n", This
);
675 static HRESULT WINAPI
HTMLInputElement_get_onerror(IHTMLInputElement
*iface
, VARIANT
*p
)
677 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
678 FIXME("(%p)->(%p)\n", This
, p
);
682 static HRESULT WINAPI
HTMLInputElement_put_onabort(IHTMLInputElement
*iface
, VARIANT v
)
684 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
685 FIXME("(%p)->()\n", This
);
689 static HRESULT WINAPI
HTMLInputElement_get_onabort(IHTMLInputElement
*iface
, VARIANT
*p
)
691 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
692 FIXME("(%p)->(%p)\n", This
, p
);
696 static HRESULT WINAPI
HTMLInputElement_put_width(IHTMLInputElement
*iface
, LONG v
)
698 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
699 FIXME("(%p)->(%d)\n", This
, v
);
703 static HRESULT WINAPI
HTMLInputElement_get_width(IHTMLInputElement
*iface
, LONG
*p
)
705 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
706 FIXME("(%p)->(%p)\n", This
, p
);
710 static HRESULT WINAPI
HTMLInputElement_put_height(IHTMLInputElement
*iface
, LONG v
)
712 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
713 FIXME("(%p)->(%d)\n", This
, v
);
717 static HRESULT WINAPI
HTMLInputElement_get_height(IHTMLInputElement
*iface
, LONG
*p
)
719 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
720 FIXME("(%p)->(%p)\n", This
, p
);
724 static HRESULT WINAPI
HTMLInputElement_put_start(IHTMLInputElement
*iface
, BSTR v
)
726 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
727 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
731 static HRESULT WINAPI
HTMLInputElement_get_start(IHTMLInputElement
*iface
, BSTR
*p
)
733 HTMLInputElement
*This
= impl_from_IHTMLInputElement(iface
);
734 FIXME("(%p)->(%p)\n", This
, p
);
738 static const IHTMLInputElementVtbl HTMLInputElementVtbl
= {
739 HTMLInputElement_QueryInterface
,
740 HTMLInputElement_AddRef
,
741 HTMLInputElement_Release
,
742 HTMLInputElement_GetTypeInfoCount
,
743 HTMLInputElement_GetTypeInfo
,
744 HTMLInputElement_GetIDsOfNames
,
745 HTMLInputElement_Invoke
,
746 HTMLInputElement_put_type
,
747 HTMLInputElement_get_type
,
748 HTMLInputElement_put_value
,
749 HTMLInputElement_get_value
,
750 HTMLInputElement_put_name
,
751 HTMLInputElement_get_name
,
752 HTMLInputElement_put_status
,
753 HTMLInputElement_get_status
,
754 HTMLInputElement_put_disabled
,
755 HTMLInputElement_get_disabled
,
756 HTMLInputElement_get_form
,
757 HTMLInputElement_put_size
,
758 HTMLInputElement_get_size
,
759 HTMLInputElement_put_maxLength
,
760 HTMLInputElement_get_maxLength
,
761 HTMLInputElement_select
,
762 HTMLInputElement_put_onchange
,
763 HTMLInputElement_get_onchange
,
764 HTMLInputElement_put_onselect
,
765 HTMLInputElement_get_onselect
,
766 HTMLInputElement_put_defaultValue
,
767 HTMLInputElement_get_defaultValue
,
768 HTMLInputElement_put_readOnly
,
769 HTMLInputElement_get_readOnly
,
770 HTMLInputElement_createTextRange
,
771 HTMLInputElement_put_indeterminate
,
772 HTMLInputElement_get_indeterminate
,
773 HTMLInputElement_put_defaultChecked
,
774 HTMLInputElement_get_defaultChecked
,
775 HTMLInputElement_put_checked
,
776 HTMLInputElement_get_checked
,
777 HTMLInputElement_put_border
,
778 HTMLInputElement_get_border
,
779 HTMLInputElement_put_vspace
,
780 HTMLInputElement_get_vspace
,
781 HTMLInputElement_put_hspace
,
782 HTMLInputElement_get_hspace
,
783 HTMLInputElement_put_alt
,
784 HTMLInputElement_get_alt
,
785 HTMLInputElement_put_src
,
786 HTMLInputElement_get_src
,
787 HTMLInputElement_put_lowsrc
,
788 HTMLInputElement_get_lowsrc
,
789 HTMLInputElement_put_vrml
,
790 HTMLInputElement_get_vrml
,
791 HTMLInputElement_put_dynsrc
,
792 HTMLInputElement_get_dynsrc
,
793 HTMLInputElement_get_readyState
,
794 HTMLInputElement_get_complete
,
795 HTMLInputElement_put_loop
,
796 HTMLInputElement_get_loop
,
797 HTMLInputElement_put_align
,
798 HTMLInputElement_get_align
,
799 HTMLInputElement_put_onload
,
800 HTMLInputElement_get_onload
,
801 HTMLInputElement_put_onerror
,
802 HTMLInputElement_get_onerror
,
803 HTMLInputElement_put_onabort
,
804 HTMLInputElement_get_onabort
,
805 HTMLInputElement_put_width
,
806 HTMLInputElement_get_width
,
807 HTMLInputElement_put_height
,
808 HTMLInputElement_get_height
,
809 HTMLInputElement_put_start
,
810 HTMLInputElement_get_start
813 static HRESULT WINAPI
HTMLInputTextElement_QueryInterface(IHTMLInputTextElement
*iface
,
814 REFIID riid
, void **ppv
)
816 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
818 return IHTMLDOMNode_QueryInterface(&This
->element
.node
.IHTMLDOMNode_iface
, riid
, ppv
);
821 static ULONG WINAPI
HTMLInputTextElement_AddRef(IHTMLInputTextElement
*iface
)
823 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
825 return IHTMLDOMNode_AddRef(&This
->element
.node
.IHTMLDOMNode_iface
);
828 static ULONG WINAPI
HTMLInputTextElement_Release(IHTMLInputTextElement
*iface
)
830 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
832 return IHTMLDOMNode_Release(&This
->element
.node
.IHTMLDOMNode_iface
);
835 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement
*iface
, UINT
*pctinfo
)
837 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
838 return IDispatchEx_GetTypeInfoCount(&This
->element
.node
.dispex
.IDispatchEx_iface
, pctinfo
);
841 static HRESULT WINAPI
HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement
*iface
, UINT iTInfo
,
842 LCID lcid
, ITypeInfo
**ppTInfo
)
844 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
845 return IDispatchEx_GetTypeInfo(&This
->element
.node
.dispex
.IDispatchEx_iface
, iTInfo
, lcid
,
849 static HRESULT WINAPI
HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement
*iface
, REFIID riid
,
850 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
852 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
853 return IDispatchEx_GetIDsOfNames(&This
->element
.node
.dispex
.IDispatchEx_iface
, riid
, rgszNames
,
854 cNames
, lcid
, rgDispId
);
857 static HRESULT WINAPI
HTMLInputTextElement_Invoke(IHTMLInputTextElement
*iface
, DISPID dispIdMember
,
858 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
859 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
861 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
862 return IDispatchEx_Invoke(&This
->element
.node
.dispex
.IDispatchEx_iface
, dispIdMember
, riid
,
863 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
866 static HRESULT WINAPI
HTMLInputTextElement_get_type(IHTMLInputTextElement
*iface
, BSTR
*p
)
868 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
870 TRACE("(%p)->(%p)\n", This
, p
);
872 return IHTMLInputElement_get_type(&This
->IHTMLInputElement_iface
, p
);
875 static HRESULT WINAPI
HTMLInputTextElement_put_value(IHTMLInputTextElement
*iface
, BSTR v
)
877 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
879 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
881 return IHTMLInputElement_put_value(&This
->IHTMLInputElement_iface
, v
);
884 static HRESULT WINAPI
HTMLInputTextElement_get_value(IHTMLInputTextElement
*iface
, BSTR
*p
)
886 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
888 TRACE("(%p)->(%p)\n", This
, p
);
890 return IHTMLInputElement_get_value(&This
->IHTMLInputElement_iface
, p
);
893 static HRESULT WINAPI
HTMLInputTextElement_put_name(IHTMLInputTextElement
*iface
, BSTR v
)
895 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
897 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
899 return IHTMLInputElement_put_name(&This
->IHTMLInputElement_iface
, v
);
902 static HRESULT WINAPI
HTMLInputTextElement_get_name(IHTMLInputTextElement
*iface
, BSTR
*p
)
904 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
906 TRACE("(%p)->(%p)\n", This
, p
);
908 return IHTMLInputElement_get_name(&This
->IHTMLInputElement_iface
, p
);
911 static HRESULT WINAPI
HTMLInputTextElement_put_status(IHTMLInputTextElement
*iface
, VARIANT v
)
913 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
914 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
918 static HRESULT WINAPI
HTMLInputTextElement_get_status(IHTMLInputTextElement
*iface
, VARIANT
*p
)
920 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
921 TRACE("(%p)->(%p)\n", This
, p
);
925 static HRESULT WINAPI
HTMLInputTextElement_put_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
927 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
929 TRACE("(%p)->(%x)\n", This
, v
);
931 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
934 static HRESULT WINAPI
HTMLInputTextElement_get_disabled(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
936 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
938 TRACE("(%p)->(%p)\n", This
, p
);
940 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
943 static HRESULT WINAPI
HTMLInputTextElement_get_form(IHTMLInputTextElement
*iface
, IHTMLFormElement
**p
)
945 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
947 TRACE("(%p)->(%p)\n", This
, p
);
949 return IHTMLInputElement_get_form(&This
->IHTMLInputElement_iface
, p
);
952 static HRESULT WINAPI
HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement
*iface
, BSTR v
)
954 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
956 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
958 return IHTMLInputElement_put_defaultValue(&This
->IHTMLInputElement_iface
, v
);
961 static HRESULT WINAPI
HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement
*iface
, BSTR
*p
)
963 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
965 TRACE("(%p)->(%p)\n", This
, p
);
967 return IHTMLInputElement_get_defaultValue(&This
->IHTMLInputElement_iface
, p
);
970 static HRESULT WINAPI
HTMLInputTextElement_put_size(IHTMLInputTextElement
*iface
, LONG v
)
972 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
974 TRACE("(%p)->(%d)\n", This
, v
);
976 return IHTMLInputElement_put_size(&This
->IHTMLInputElement_iface
, v
);
979 static HRESULT WINAPI
HTMLInputTextElement_get_size(IHTMLInputTextElement
*iface
, LONG
*p
)
981 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
983 TRACE("(%p)->(%p)\n", This
, p
);
985 return IHTMLInputElement_get_size(&This
->IHTMLInputElement_iface
, p
);
988 static HRESULT WINAPI
HTMLInputTextElement_put_maxLength(IHTMLInputTextElement
*iface
, LONG v
)
990 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
992 TRACE("(%p)->(%d)\n", This
, v
);
994 return IHTMLInputElement_put_maxLength(&This
->IHTMLInputElement_iface
, v
);
997 static HRESULT WINAPI
HTMLInputTextElement_get_maxLength(IHTMLInputTextElement
*iface
, LONG
*p
)
999 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1001 TRACE("(%p)->(%p)\n", This
, p
);
1003 return IHTMLInputElement_get_maxLength(&This
->IHTMLInputElement_iface
, p
);
1006 static HRESULT WINAPI
HTMLInputTextElement_select(IHTMLInputTextElement
*iface
)
1008 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1010 TRACE("(%p)\n", This
);
1012 return IHTMLInputElement_select(&This
->IHTMLInputElement_iface
);
1015 static HRESULT WINAPI
HTMLInputTextElement_put_onchange(IHTMLInputTextElement
*iface
, VARIANT v
)
1017 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1019 TRACE("(%p)->()\n", This
);
1021 return IHTMLInputElement_put_onchange(&This
->IHTMLInputElement_iface
, v
);
1024 static HRESULT WINAPI
HTMLInputTextElement_get_onchange(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1026 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1028 TRACE("(%p)->(%p)\n", This
, p
);
1030 return IHTMLInputElement_get_onchange(&This
->IHTMLInputElement_iface
, p
);
1033 static HRESULT WINAPI
HTMLInputTextElement_put_onselect(IHTMLInputTextElement
*iface
, VARIANT v
)
1035 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1037 TRACE("(%p)->()\n", This
);
1039 return IHTMLInputElement_put_onselect(&This
->IHTMLInputElement_iface
, v
);
1042 static HRESULT WINAPI
HTMLInputTextElement_get_onselect(IHTMLInputTextElement
*iface
, VARIANT
*p
)
1044 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1046 TRACE("(%p)->(%p)\n", This
, p
);
1048 return IHTMLInputElement_get_onselect(&This
->IHTMLInputElement_iface
, p
);
1051 static HRESULT WINAPI
HTMLInputTextElement_put_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL v
)
1053 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1055 TRACE("(%p)->(%x)\n", This
, v
);
1057 return IHTMLInputElement_put_readOnly(&This
->IHTMLInputElement_iface
, v
);
1060 static HRESULT WINAPI
HTMLInputTextElement_get_readOnly(IHTMLInputTextElement
*iface
, VARIANT_BOOL
*p
)
1062 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1064 TRACE("(%p)->(%p)\n", This
, p
);
1066 return IHTMLInputElement_get_readOnly(&This
->IHTMLInputElement_iface
, p
);
1069 static HRESULT WINAPI
HTMLInputTextElement_createTextRange(IHTMLInputTextElement
*iface
, IHTMLTxtRange
**range
)
1071 HTMLInputElement
*This
= impl_from_IHTMLInputTextElement(iface
);
1073 TRACE("(%p)->(%p)\n", This
, range
);
1075 return IHTMLInputElement_createTextRange(&This
->IHTMLInputElement_iface
, range
);
1078 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl
= {
1079 HTMLInputTextElement_QueryInterface
,
1080 HTMLInputTextElement_AddRef
,
1081 HTMLInputTextElement_Release
,
1082 HTMLInputTextElement_GetTypeInfoCount
,
1083 HTMLInputTextElement_GetTypeInfo
,
1084 HTMLInputTextElement_GetIDsOfNames
,
1085 HTMLInputTextElement_Invoke
,
1086 HTMLInputTextElement_get_type
,
1087 HTMLInputTextElement_put_value
,
1088 HTMLInputTextElement_get_value
,
1089 HTMLInputTextElement_put_name
,
1090 HTMLInputTextElement_get_name
,
1091 HTMLInputTextElement_put_status
,
1092 HTMLInputTextElement_get_status
,
1093 HTMLInputTextElement_put_disabled
,
1094 HTMLInputTextElement_get_disabled
,
1095 HTMLInputTextElement_get_form
,
1096 HTMLInputTextElement_put_defaultValue
,
1097 HTMLInputTextElement_get_defaultValue
,
1098 HTMLInputTextElement_put_size
,
1099 HTMLInputTextElement_get_size
,
1100 HTMLInputTextElement_put_maxLength
,
1101 HTMLInputTextElement_get_maxLength
,
1102 HTMLInputTextElement_select
,
1103 HTMLInputTextElement_put_onchange
,
1104 HTMLInputTextElement_get_onchange
,
1105 HTMLInputTextElement_put_onselect
,
1106 HTMLInputTextElement_get_onselect
,
1107 HTMLInputTextElement_put_readOnly
,
1108 HTMLInputTextElement_get_readOnly
,
1109 HTMLInputTextElement_createTextRange
1112 static inline HTMLInputElement
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
1114 return CONTAINING_RECORD(iface
, HTMLInputElement
, element
.node
);
1117 static HRESULT
HTMLInputElement_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
1119 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1123 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
1124 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
1125 *ppv
= &This
->IHTMLInputElement_iface
;
1126 }else if(IsEqualGUID(&IID_IDispatch
, riid
)) {
1127 TRACE("(%p)->(IID_IDispatch %p)\n", This
, ppv
);
1128 *ppv
= &This
->IHTMLInputElement_iface
;
1129 }else if(IsEqualGUID(&IID_IHTMLInputElement
, riid
)) {
1130 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This
, ppv
);
1131 *ppv
= &This
->IHTMLInputElement_iface
;
1132 }else if(IsEqualGUID(&IID_IHTMLInputTextElement
, riid
)) {
1133 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This
, ppv
);
1134 *ppv
= &This
->IHTMLInputTextElement_iface
;
1138 IUnknown_AddRef((IUnknown
*)*ppv
);
1142 return HTMLElement_QI(&This
->element
.node
, riid
, ppv
);
1145 static HRESULT
HTMLInputElementImpl_fire_event(HTMLDOMNode
*iface
, eventid_t eid
, BOOL
*handled
)
1147 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1149 if(eid
== EVENTID_CLICK
) {
1154 nsres
= nsIDOMHTMLInputElement_Click(This
->nsinput
);
1155 if(NS_FAILED(nsres
)) {
1156 ERR("Click failed: %08x\n", nsres
);
1164 static HRESULT
HTMLInputElementImpl_put_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL v
)
1166 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1167 return IHTMLInputElement_put_disabled(&This
->IHTMLInputElement_iface
, v
);
1170 static HRESULT
HTMLInputElementImpl_get_disabled(HTMLDOMNode
*iface
, VARIANT_BOOL
*p
)
1172 HTMLInputElement
*This
= impl_from_HTMLDOMNode(iface
);
1173 return IHTMLInputElement_get_disabled(&This
->IHTMLInputElement_iface
, p
);
1176 static const NodeImplVtbl HTMLInputElementImplVtbl
= {
1177 HTMLInputElement_QI
,
1178 HTMLElement_destructor
,
1180 HTMLElement_get_attr_col
,
1182 HTMLInputElementImpl_fire_event
,
1184 HTMLInputElementImpl_put_disabled
,
1185 HTMLInputElementImpl_get_disabled
,
1188 static const tid_t HTMLInputElement_iface_tids
[] = {
1190 IHTMLInputElement_tid
,
1193 static dispex_static_data_t HTMLInputElement_dispex
= {
1195 DispHTMLInputElement_tid
,
1197 HTMLInputElement_iface_tids
1200 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*doc
, nsIDOMHTMLElement
*nselem
, HTMLElement
**elem
)
1202 HTMLInputElement
*ret
;
1205 ret
= heap_alloc_zero(sizeof(HTMLInputElement
));
1207 return E_OUTOFMEMORY
;
1209 ret
->IHTMLInputElement_iface
.lpVtbl
= &HTMLInputElementVtbl
;
1210 ret
->IHTMLInputTextElement_iface
.lpVtbl
= &HTMLInputTextElementVtbl
;
1211 ret
->element
.node
.vtbl
= &HTMLInputElementImplVtbl
;
1213 HTMLElement_Init(&ret
->element
, doc
, nselem
, &HTMLInputElement_dispex
);
1215 nsres
= nsIDOMHTMLElement_QueryInterface(nselem
, &IID_nsIDOMHTMLInputElement
, (void**)&ret
->nsinput
);
1217 /* Share nsinput reference with nsnode */
1218 assert(nsres
== NS_OK
&& (nsIDOMNode
*)ret
->nsinput
== ret
->element
.node
.nsnode
);
1219 nsIDOMNode_Release(ret
->element
.node
.nsnode
);
1221 *elem
= &ret
->element
;