ntdll: Always set a valid SUB_Q_HEADER AudioStatus for CD-ROMs.
[wine.git] / dlls / mshtml / htmlinput.c
blob4d25c413fc6d09d7dc38a70f7f9a5aedd04c008b
1 /*
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
19 #include <stdarg.h>
20 #include <assert.h>
21 #include <limits.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 typedef struct {
38 HTMLElement element;
40 IHTMLInputElement IHTMLInputElement_iface;
41 IHTMLInputTextElement IHTMLInputTextElement_iface;
43 nsIDOMHTMLInputElement *nsinput;
44 } HTMLInputElement;
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,
91 ppTInfo);
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);
117 nsAString type_str;
118 nsresult nsres;
120 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
123 * FIXME:
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);
131 return E_FAIL;
134 return S_OK;
137 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
139 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
140 nsAString type_str;
141 nsresult nsres;
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);
153 nsAString val_str;
154 nsresult nsres;
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);
161 if(NS_FAILED(nsres))
162 ERR("SetValue failed: %08x\n", nsres);
164 return S_OK;
167 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
169 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
170 nsAString value_str;
171 nsresult nsres;
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);
183 nsAString name_str;
184 nsresult nsres;
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);
193 return E_FAIL;
196 return S_OK;
199 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
201 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
202 nsAString name_str;
203 nsresult nsres;
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);
216 return E_NOTIMPL;
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);
223 return E_NOTIMPL;
226 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
228 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
229 nsresult nsres;
231 TRACE("(%p)->(%x)\n", This, v);
233 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
234 if(NS_FAILED(nsres))
235 ERR("SetDisabled failed: %08x\n", nsres);
237 return S_OK;
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;
250 return S_OK;
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);
257 return E_NOTIMPL;
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);
264 return E_NOTIMPL;
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);
271 return E_NOTIMPL;
274 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
276 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
277 nsresult nsres;
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");
285 return E_FAIL;
288 return S_OK;
291 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
293 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
294 PRInt32 max_length;
295 nsresult nsres;
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;
304 return S_OK;
307 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
309 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
310 nsresult nsres;
312 TRACE("(%p)\n", This);
314 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
315 if(NS_FAILED(nsres)) {
316 ERR("Select failed: %08x\n", nsres);
317 return E_FAIL;
320 return S_OK;
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);
345 return E_NOTIMPL;
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);
352 return E_NOTIMPL;
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));
359 return E_NOTIMPL;
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);
366 return E_NOTIMPL;
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);
373 return E_NOTIMPL;
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);
380 return E_NOTIMPL;
383 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
385 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
386 FIXME("(%p)->(%p)\n", This, range);
387 return E_NOTIMPL;
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);
394 return E_NOTIMPL;
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);
401 return E_NOTIMPL;
404 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
406 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
407 nsresult nsres;
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);
414 return E_FAIL;
417 return S_OK;
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;
424 nsresult nsres;
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);
431 return E_FAIL;
434 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
435 return S_OK;
438 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
440 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
441 nsresult nsres;
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);
448 return E_FAIL;
451 return S_OK;
454 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
456 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
457 cpp_bool checked;
458 nsresult nsres;
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);
465 return E_FAIL;
468 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
469 TRACE("checked=%x\n", *p);
470 return S_OK;
473 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
475 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
476 FIXME("(%p)->()\n", This);
477 return E_NOTIMPL;
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);
484 return E_NOTIMPL;
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);
491 return E_NOTIMPL;
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);
498 return E_NOTIMPL;
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);
505 return E_NOTIMPL;
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);
512 return E_NOTIMPL;
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));
519 return E_NOTIMPL;
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);
526 return E_NOTIMPL;
529 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
531 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
532 nsAString nsstr;
533 nsresult nsres;
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);
540 if(NS_FAILED(nsres))
541 ERR("SetSrc failed: %08x\n", nsres);
543 return S_OK;
546 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
548 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
549 const PRUnichar *src;
550 nsAString src_str;
551 nsresult nsres;
552 HRESULT hres;
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);
560 return E_FAIL;
563 nsAString_GetData(&src_str, &src);
564 hres = nsuri_to_url(src, FALSE, p);
565 nsAString_Finish(&src_str);
567 return hres;
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));
574 return E_NOTIMPL;
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);
581 return E_NOTIMPL;
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));
588 return E_NOTIMPL;
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);
595 return E_NOTIMPL;
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));
602 return E_NOTIMPL;
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);
609 return E_NOTIMPL;
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);
616 return E_NOTIMPL;
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);
623 return E_NOTIMPL;
626 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
628 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
629 FIXME("(%p)->()\n", This);
630 return E_NOTIMPL;
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);
637 return E_NOTIMPL;
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));
644 return E_NOTIMPL;
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);
651 return E_NOTIMPL;
654 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
656 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
657 FIXME("(%p)->()\n", This);
658 return E_NOTIMPL;
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);
665 return E_NOTIMPL;
668 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
670 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
671 FIXME("(%p)->()\n", This);
672 return E_NOTIMPL;
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);
679 return E_NOTIMPL;
682 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
684 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
685 FIXME("(%p)->()\n", This);
686 return E_NOTIMPL;
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);
693 return E_NOTIMPL;
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);
700 return E_NOTIMPL;
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);
707 return E_NOTIMPL;
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);
714 return E_NOTIMPL;
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);
721 return E_NOTIMPL;
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));
728 return E_NOTIMPL;
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);
735 return E_NOTIMPL;
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,
846 ppTInfo);
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));
915 return E_NOTIMPL;
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);
922 return E_NOTIMPL;
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);
1121 *ppv = NULL;
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;
1137 if(*ppv) {
1138 IUnknown_AddRef((IUnknown*)*ppv);
1139 return S_OK;
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) {
1150 nsresult nsres;
1152 *handled = TRUE;
1154 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1155 if(NS_FAILED(nsres)) {
1156 ERR("Click failed: %08x\n", nsres);
1157 return E_FAIL;
1161 return S_OK;
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,
1179 HTMLElement_clone,
1180 HTMLElement_handle_event,
1181 HTMLElement_get_attr_col,
1182 NULL,
1183 HTMLInputElementImpl_fire_event,
1184 HTMLInputElementImpl_put_disabled,
1185 HTMLInputElementImpl_get_disabled,
1188 static const tid_t HTMLInputElement_iface_tids[] = {
1189 HTMLELEMENT_TIDS,
1190 IHTMLInputElement_tid,
1193 static dispex_static_data_t HTMLInputElement_dispex = {
1194 NULL,
1195 DispHTMLInputElement_tid,
1196 NULL,
1197 HTMLInputElement_iface_tids
1200 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1202 HTMLInputElement *ret;
1203 nsresult nsres;
1205 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1206 if(!ret)
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;
1222 return S_OK;