include: Define more wuapi interfaces to avoid undefined forward declarations.
[wine] / dlls / mshtml / htmlinput.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include <stdarg.h>
20
21 #define COBJMACROS
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "ole2.h"
27
28 #include "wine/debug.h"
29
30 #include "mshtml_private.h"
31 #include "htmlevent.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
34
35 typedef struct {
36     HTMLElement element;
37
38     IHTMLInputElement IHTMLInputElement_iface;
39     IHTMLInputTextElement IHTMLInputTextElement_iface;
40
41     nsIDOMHTMLInputElement *nsinput;
42 } HTMLInputElement;
43
44 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
45 {
46     return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
47 }
48
49 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
50 {
51     return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
52 }
53
54 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
55                                                          REFIID riid, void **ppv)
56 {
57     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
58
59     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
60 }
61
62 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
63 {
64     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
65
66     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
67 }
68
69 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
70 {
71     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
72
73     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
74 }
75
76 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
77 {
78     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
79
80     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
81 }
82
83 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
84                                               LCID lcid, ITypeInfo **ppTInfo)
85 {
86     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
87
88     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
89 }
90
91 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
92                                                 LPOLESTR *rgszNames, UINT cNames,
93                                                 LCID lcid, DISPID *rgDispId)
94 {
95     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
96
97     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames,
98             cNames, lcid, rgDispId);
99 }
100
101 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
102                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
103                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
104 {
105     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
106
107     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags,
108             pDispParams, pVarResult, pExcepInfo, puArgErr);
109 }
110
111 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
112 {
113     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
114     nsAString type_str;
115     nsresult nsres;
116
117     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
118
119     /*
120      * FIXME:
121      * On IE setting type works only on dynamically created elements before adding them to DOM tree.
122      */
123     nsAString_InitDepend(&type_str, v);
124     nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
125     nsAString_Finish(&type_str);
126     if(NS_FAILED(nsres)) {
127         ERR("SetType failed: %08x\n", nsres);
128         return E_FAIL;
129     }
130
131     return S_OK;
132 }
133
134 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
135 {
136     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
137     nsAString type_str;
138     const PRUnichar *type;
139     nsresult nsres;
140
141     TRACE("(%p)->(%p)\n", This, p);
142
143     nsAString_Init(&type_str, NULL);
144     nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
145
146     if(NS_SUCCEEDED(nsres)) {
147         nsAString_GetData(&type_str, &type);
148         *p = SysAllocString(type);
149     }else {
150         ERR("GetType failed: %08x\n", nsres);
151     }
152
153     nsAString_Finish(&type_str);
154
155     TRACE("type=%s\n", debugstr_w(*p));
156     return S_OK;
157 }
158
159 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
160 {
161     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
162     nsAString val_str;
163     nsresult nsres;
164
165     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
166
167     nsAString_InitDepend(&val_str, v);
168     nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
169     nsAString_Finish(&val_str);
170     if(NS_FAILED(nsres))
171         ERR("SetValue failed: %08x\n", nsres);
172
173     return S_OK;
174 }
175
176 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
177 {
178     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
179     nsAString value_str;
180     const PRUnichar *value = NULL;
181     nsresult nsres;
182
183     TRACE("(%p)->(%p)\n", This, p);
184
185     nsAString_Init(&value_str, NULL);
186
187     nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
188     if(NS_SUCCEEDED(nsres)) {
189         nsAString_GetData(&value_str, &value);
190         *p = SysAllocString(value);
191     }else {
192         ERR("GetValue failed: %08x\n", nsres);
193     }
194
195     nsAString_Finish(&value_str);
196
197     TRACE("value=%s\n", debugstr_w(*p));
198     return S_OK;
199 }
200
201 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
202 {
203     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
204     nsAString name_str;
205     nsresult nsres;
206
207     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
208
209     nsAString_InitDepend(&name_str, v);
210     nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
211     nsAString_Finish(&name_str);
212     if(NS_FAILED(nsres)) {
213         ERR("SetName failed: %08x\n", nsres);
214         return E_FAIL;
215     }
216
217     return S_OK;
218 }
219
220 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
221 {
222     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
223     nsAString name_str;
224     const PRUnichar *name;
225     nsresult nsres;
226     HRESULT hres = S_OK;
227
228     TRACE("(%p)->(%p)\n", This, p);
229
230     nsAString_Init(&name_str, NULL);
231
232     nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
233     if(NS_SUCCEEDED(nsres)) {
234         nsAString_GetData(&name_str, &name);
235         *p = *name ? SysAllocString(name) : NULL;
236     }else {
237         ERR("GetName failed: %08x\n", nsres);
238         hres = E_FAIL;
239     }
240
241     nsAString_Finish(&name_str);
242     return hres;
243 }
244
245 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
246 {
247     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
248     FIXME("(%p)->(%x)\n", This, v);
249     return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
253 {
254     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
255     FIXME("(%p)->(%p)\n", This, p);
256     return E_NOTIMPL;
257 }
258
259 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
260 {
261     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
262     nsresult nsres;
263
264     TRACE("(%p)->(%x)\n", This, v);
265
266     nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
267     if(NS_FAILED(nsres))
268         ERR("SetDisabled failed: %08x\n", nsres);
269
270     return S_OK;
271 }
272
273 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
274 {
275     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
276     PRBool disabled = FALSE;
277
278     TRACE("(%p)->(%p)\n", This, p);
279
280     nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
281
282     *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
283     return S_OK;
284 }
285
286 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
287 {
288     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
289     FIXME("(%p)->(%p)\n", This, p);
290     return E_NOTIMPL;
291 }
292
293 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
294 {
295     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
296     FIXME("(%p)->(%d)\n", This, v);
297     return E_NOTIMPL;
298 }
299
300 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
301 {
302     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
303     FIXME("(%p)->(%p)\n", This, p);
304     return E_NOTIMPL;
305 }
306
307 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
308 {
309     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
310     FIXME("(%p)->(%d)\n", This, v);
311     return E_NOTIMPL;
312 }
313
314 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
315 {
316     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
317     FIXME("(%p)->(%p)\n", This, p);
318     return E_NOTIMPL;
319 }
320
321 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
322 {
323     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
324     nsresult nsres;
325
326     TRACE("(%p)\n", This);
327
328     nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
329     if(NS_FAILED(nsres)) {
330         ERR("Select failed: %08x\n", nsres);
331         return E_FAIL;
332     }
333
334     return S_OK;
335 }
336
337 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
338 {
339     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
340     FIXME("(%p)->()\n", This);
341     return E_NOTIMPL;
342 }
343
344 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
345 {
346     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
347     FIXME("(%p)->(%p)\n", This, p);
348     return E_NOTIMPL;
349 }
350
351 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
352 {
353     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
354     FIXME("(%p)->()\n", This);
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
359 {
360     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
361     FIXME("(%p)->(%p)\n", This, p);
362     return E_NOTIMPL;
363 }
364
365 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
366 {
367     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
368     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
369     return E_NOTIMPL;
370 }
371
372 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
373 {
374     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
375     FIXME("(%p)->(%p)\n", This, p);
376     return E_NOTIMPL;
377 }
378
379 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
380 {
381     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
382     FIXME("(%p)->(%x)\n", This, v);
383     return E_NOTIMPL;
384 }
385
386 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
387 {
388     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
389     FIXME("(%p)->(%p)\n", This, p);
390     return E_NOTIMPL;
391 }
392
393 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
394 {
395     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
396     FIXME("(%p)->(%p)\n", This, range);
397     return E_NOTIMPL;
398 }
399
400 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
401 {
402     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
403     FIXME("(%p)->(%x)\n", This, v);
404     return E_NOTIMPL;
405 }
406
407 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
408 {
409     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
410     FIXME("(%p)->(%p)\n", This, p);
411     return E_NOTIMPL;
412 }
413
414 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
415 {
416     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
417     nsresult nsres;
418
419     TRACE("(%p)->(%x)\n", This, v);
420
421     nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
422     if(NS_FAILED(nsres)) {
423         ERR("SetDefaultChecked failed: %08x\n", nsres);
424         return E_FAIL;
425     }
426
427     return S_OK;
428 }
429
430 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
431 {
432     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
433     PRBool default_checked = FALSE;
434     nsresult nsres;
435
436     TRACE("(%p)->(%p)\n", This, p);
437
438     nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
439     if(NS_FAILED(nsres)) {
440         ERR("GetDefaultChecked failed: %08x\n", nsres);
441         return E_FAIL;
442     }
443
444     *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
445     return S_OK;
446 }
447
448 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
449 {
450     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
451     nsresult nsres;
452
453     TRACE("(%p)->(%x)\n", This, v);
454
455     nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
456     if(NS_FAILED(nsres)) {
457         ERR("SetChecked failed: %08x\n", nsres);
458         return E_FAIL;
459     }
460
461     return S_OK;
462 }
463
464 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
465 {
466     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
467     PRBool checked;
468     nsresult nsres;
469
470     TRACE("(%p)->(%p)\n", This, p);
471
472     nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
473     if(NS_FAILED(nsres)) {
474         ERR("GetChecked failed: %08x\n", nsres);
475         return E_FAIL;
476     }
477
478     *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
479     TRACE("checked=%x\n", *p);
480     return S_OK;
481 }
482
483 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
484 {
485     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
486     FIXME("(%p)->()\n", This);
487     return E_NOTIMPL;
488 }
489
490 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
491 {
492     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
493     FIXME("(%p)->(%p)\n", This, p);
494     return E_NOTIMPL;
495 }
496
497 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
498 {
499     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
500     FIXME("(%p)->(%d)\n", This, v);
501     return E_NOTIMPL;
502 }
503
504 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
505 {
506     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
507     FIXME("(%p)->(%p)\n", This, p);
508     return E_NOTIMPL;
509 }
510
511 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
512 {
513     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
514     FIXME("(%p)->(%d)\n", This, v);
515     return E_NOTIMPL;
516 }
517
518 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
519 {
520     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
521     FIXME("(%p)->(%p)\n", This, p);
522     return E_NOTIMPL;
523 }
524
525 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
526 {
527     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
528     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
529     return E_NOTIMPL;
530 }
531
532 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
533 {
534     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
535     FIXME("(%p)->(%p)\n", This, p);
536     return E_NOTIMPL;
537 }
538
539 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
540 {
541     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
542     nsAString nsstr;
543     nsresult nsres;
544
545     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
546
547     nsAString_InitDepend(&nsstr, v);
548     nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
549     nsAString_Finish(&nsstr);
550     if(NS_FAILED(nsres))
551         ERR("SetSrc failed: %08x\n", nsres);
552
553     return S_OK;
554 }
555
556 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
557 {
558     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
559     const PRUnichar *src;
560     nsAString src_str;
561     nsresult nsres;
562     HRESULT hres;
563
564     TRACE("(%p)->(%p)\n", This, p);
565
566     nsAString_Init(&src_str, NULL);
567     nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
568     if(NS_FAILED(nsres)) {
569         ERR("GetSrc failed: %08x\n", nsres);
570         return E_FAIL;
571     }
572
573     nsAString_GetData(&src_str, &src);
574     hres = nsuri_to_url(src, FALSE, p);
575     nsAString_Finish(&src_str);
576
577     return hres;
578 }
579
580 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
581 {
582     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
583     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
584     return E_NOTIMPL;
585 }
586
587 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
588 {
589     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
590     FIXME("(%p)->(%p)\n", This, p);
591     return E_NOTIMPL;
592 }
593
594 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
595 {
596     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
597     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
598     return E_NOTIMPL;
599 }
600
601 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
602 {
603     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
604     FIXME("(%p)->(%p)\n", This, p);
605     return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
609 {
610     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
611     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
612     return E_NOTIMPL;
613 }
614
615 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
616 {
617     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
618     FIXME("(%p)->(%p)\n", This, p);
619     return E_NOTIMPL;
620 }
621
622 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
623 {
624     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
625     FIXME("(%p)->(%p)\n", This, p);
626     return E_NOTIMPL;
627 }
628
629 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
630 {
631     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
632     FIXME("(%p)->(%p)\n", This, p);
633     return E_NOTIMPL;
634 }
635
636 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
637 {
638     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
639     FIXME("(%p)->()\n", This);
640     return E_NOTIMPL;
641 }
642
643 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
644 {
645     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
646     FIXME("(%p)->(%p)\n", This, p);
647     return E_NOTIMPL;
648 }
649
650 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
651 {
652     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
653     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
654     return E_NOTIMPL;
655 }
656
657 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
658 {
659     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
660     FIXME("(%p)->(%p)\n", This, p);
661     return E_NOTIMPL;
662 }
663
664 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
665 {
666     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
667     FIXME("(%p)->()\n", This);
668     return E_NOTIMPL;
669 }
670
671 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
672 {
673     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
674     FIXME("(%p)->(%p)\n", This, p);
675     return E_NOTIMPL;
676 }
677
678 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
679 {
680     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
681     FIXME("(%p)->()\n", This);
682     return E_NOTIMPL;
683 }
684
685 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
686 {
687     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
688     FIXME("(%p)->(%p)\n", This, p);
689     return E_NOTIMPL;
690 }
691
692 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
693 {
694     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
695     FIXME("(%p)->()\n", This);
696     return E_NOTIMPL;
697 }
698
699 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
700 {
701     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
702     FIXME("(%p)->(%p)\n", This, p);
703     return E_NOTIMPL;
704 }
705
706 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
707 {
708     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
709     FIXME("(%p)->(%d)\n", This, v);
710     return E_NOTIMPL;
711 }
712
713 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
714 {
715     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
716     FIXME("(%p)->(%p)\n", This, p);
717     return E_NOTIMPL;
718 }
719
720 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
721 {
722     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
723     FIXME("(%p)->(%d)\n", This, v);
724     return E_NOTIMPL;
725 }
726
727 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
728 {
729     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
730     FIXME("(%p)->(%p)\n", This, p);
731     return E_NOTIMPL;
732 }
733
734 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
735 {
736     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
737     FIXME("(%p)->(%s)\n", This, debugstr_w(v));
738     return E_NOTIMPL;
739 }
740
741 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
742 {
743     HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
744     FIXME("(%p)->(%p)\n", This, p);
745     return E_NOTIMPL;
746 }
747
748 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
749     HTMLInputElement_QueryInterface,
750     HTMLInputElement_AddRef,
751     HTMLInputElement_Release,
752     HTMLInputElement_GetTypeInfoCount,
753     HTMLInputElement_GetTypeInfo,
754     HTMLInputElement_GetIDsOfNames,
755     HTMLInputElement_Invoke,
756     HTMLInputElement_put_type,
757     HTMLInputElement_get_type,
758     HTMLInputElement_put_value,
759     HTMLInputElement_get_value,
760     HTMLInputElement_put_name,
761     HTMLInputElement_get_name,
762     HTMLInputElement_put_status,
763     HTMLInputElement_get_status,
764     HTMLInputElement_put_disabled,
765     HTMLInputElement_get_disabled,
766     HTMLInputElement_get_form,
767     HTMLInputElement_put_size,
768     HTMLInputElement_get_size,
769     HTMLInputElement_put_maxLength,
770     HTMLInputElement_get_maxLength,
771     HTMLInputElement_select,
772     HTMLInputElement_put_onchange,
773     HTMLInputElement_get_onchange,
774     HTMLInputElement_put_onselect,
775     HTMLInputElement_get_onselect,
776     HTMLInputElement_put_defaultValue,
777     HTMLInputElement_get_defaultValue,
778     HTMLInputElement_put_readOnly,
779     HTMLInputElement_get_readOnly,
780     HTMLInputElement_createTextRange,
781     HTMLInputElement_put_indeterminate,
782     HTMLInputElement_get_indeterminate,
783     HTMLInputElement_put_defaultChecked,
784     HTMLInputElement_get_defaultChecked,
785     HTMLInputElement_put_checked,
786     HTMLInputElement_get_checked,
787     HTMLInputElement_put_border,
788     HTMLInputElement_get_border,
789     HTMLInputElement_put_vspace,
790     HTMLInputElement_get_vspace,
791     HTMLInputElement_put_hspace,
792     HTMLInputElement_get_hspace,
793     HTMLInputElement_put_alt,
794     HTMLInputElement_get_alt,
795     HTMLInputElement_put_src,
796     HTMLInputElement_get_src,
797     HTMLInputElement_put_lowsrc,
798     HTMLInputElement_get_lowsrc,
799     HTMLInputElement_put_vrml,
800     HTMLInputElement_get_vrml,
801     HTMLInputElement_put_dynsrc,
802     HTMLInputElement_get_dynsrc,
803     HTMLInputElement_get_readyState,
804     HTMLInputElement_get_complete,
805     HTMLInputElement_put_loop,
806     HTMLInputElement_get_loop,
807     HTMLInputElement_put_align,
808     HTMLInputElement_get_align,
809     HTMLInputElement_put_onload,
810     HTMLInputElement_get_onload,
811     HTMLInputElement_put_onerror,
812     HTMLInputElement_get_onerror,
813     HTMLInputElement_put_onabort,
814     HTMLInputElement_get_onabort,
815     HTMLInputElement_put_width,
816     HTMLInputElement_get_width,
817     HTMLInputElement_put_height,
818     HTMLInputElement_get_height,
819     HTMLInputElement_put_start,
820     HTMLInputElement_get_start
821 };
822
823 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
824         REFIID riid, void **ppv)
825 {
826     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
827
828     return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
829 }
830
831 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
832 {
833     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
834
835     return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
836 }
837
838 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
839 {
840     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
841
842     return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
843 }
844
845 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
846 {
847     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
848     return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
849 }
850
851 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
852         LCID lcid, ITypeInfo **ppTInfo)
853 {
854     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
855     return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
856 }
857
858 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
859         LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
860 {
861     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
862     return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
863 }
864
865 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
866                             REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
867                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
868 {
869     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
870     return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
871             pVarResult, pExcepInfo, puArgErr);
872 }
873
874 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
875 {
876     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
877
878     TRACE("(%p)->(%p)\n", This, p);
879
880     return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
881 }
882
883 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
884 {
885     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
886
887     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
888
889     return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
890 }
891
892 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
893 {
894     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
895
896     TRACE("(%p)->(%p)\n", This, p);
897
898     return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
899 }
900
901 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
902 {
903     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
904
905     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
906
907     return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
908 }
909
910 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
911 {
912     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
913
914     TRACE("(%p)->(%p)\n", This, p);
915
916     return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
917 }
918
919 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
920 {
921     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
922     FIXME("(%p)->(v)\n", This);
923     return E_NOTIMPL;
924 }
925
926 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
927 {
928     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
929     TRACE("(%p)->(v)\n", This);
930     return E_NOTIMPL;
931 }
932
933 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
934 {
935     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
936
937     TRACE("(%p)->(%x)\n", This, v);
938
939     return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
940 }
941
942 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
943 {
944     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
945
946     TRACE("(%p)->(%p)\n", This, p);
947
948     return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
949 }
950
951 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
952 {
953     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
954
955     TRACE("(%p)->(%p)\n", This, p);
956
957     return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
958 }
959
960 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
961 {
962     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
963
964     TRACE("(%p)->(%s)\n", This, debugstr_w(v));
965
966     return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
967 }
968
969 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
970 {
971     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
972
973     TRACE("(%p)->(%p)\n", This, p);
974
975     return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
976 }
977
978 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
979 {
980     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
981
982     TRACE("(%p)->(%d)\n", This, v);
983
984     return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
985 }
986
987 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
988 {
989     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
990
991     TRACE("(%p)->(%p)\n", This, p);
992
993     return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
994 }
995
996 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
997 {
998     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
999
1000     TRACE("(%p)->(%d)\n", This, v);
1001
1002     return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1003 }
1004
1005 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1006 {
1007     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1008
1009     TRACE("(%p)->(%p)\n", This, p);
1010
1011     return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1012 }
1013
1014 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1015 {
1016     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1017
1018     TRACE("(%p)\n", This);
1019
1020     return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1021 }
1022
1023 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1024 {
1025     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1026
1027     TRACE("(%p)->()\n", This);
1028
1029     return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1030 }
1031
1032 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1033 {
1034     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1035
1036     TRACE("(%p)->(%p)\n", This, p);
1037
1038     return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1039 }
1040
1041 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1042 {
1043     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1044
1045     TRACE("(%p)->()\n", This);
1046
1047     return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1048 }
1049
1050 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1051 {
1052     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1053
1054     TRACE("(%p)->(%p)\n", This, p);
1055
1056     return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1057 }
1058
1059 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1060 {
1061     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1062
1063     TRACE("(%p)->(%x)\n", This, v);
1064
1065     return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1066 }
1067
1068 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1069 {
1070     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1071
1072     TRACE("(%p)->(%p)\n", This, p);
1073
1074     return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1075 }
1076
1077 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1078 {
1079     HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1080
1081     TRACE("(%p)->(%p)\n", This, range);
1082
1083     return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1084 }
1085
1086 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1087     HTMLInputTextElement_QueryInterface,
1088     HTMLInputTextElement_AddRef,
1089     HTMLInputTextElement_Release,
1090     HTMLInputTextElement_GetTypeInfoCount,
1091     HTMLInputTextElement_GetTypeInfo,
1092     HTMLInputTextElement_GetIDsOfNames,
1093     HTMLInputTextElement_Invoke,
1094     HTMLInputTextElement_get_type,
1095     HTMLInputTextElement_put_value,
1096     HTMLInputTextElement_get_value,
1097     HTMLInputTextElement_put_name,
1098     HTMLInputTextElement_get_name,
1099     HTMLInputTextElement_put_status,
1100     HTMLInputTextElement_get_status,
1101     HTMLInputTextElement_put_disabled,
1102     HTMLInputTextElement_get_disabled,
1103     HTMLInputTextElement_get_form,
1104     HTMLInputTextElement_put_defaultValue,
1105     HTMLInputTextElement_get_defaultValue,
1106     HTMLInputTextElement_put_size,
1107     HTMLInputTextElement_get_size,
1108     HTMLInputTextElement_put_maxLength,
1109     HTMLInputTextElement_get_maxLength,
1110     HTMLInputTextElement_select,
1111     HTMLInputTextElement_put_onchange,
1112     HTMLInputTextElement_get_onchange,
1113     HTMLInputTextElement_put_onselect,
1114     HTMLInputTextElement_get_onselect,
1115     HTMLInputTextElement_put_readOnly,
1116     HTMLInputTextElement_get_readOnly,
1117     HTMLInputTextElement_createTextRange
1118 };
1119
1120 #define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
1121
1122 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1123 {
1124     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1125
1126     *ppv = NULL;
1127
1128     if(IsEqualGUID(&IID_IUnknown, riid)) {
1129         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1130         *ppv = &This->IHTMLInputElement_iface;
1131     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1132         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1133         *ppv = &This->IHTMLInputElement_iface;
1134     }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1135         TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1136         *ppv = &This->IHTMLInputElement_iface;
1137     }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1138         TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1139         *ppv = &This->IHTMLInputTextElement_iface;
1140     }
1141
1142     if(*ppv) {
1143         IUnknown_AddRef((IUnknown*)*ppv);
1144         return S_OK;
1145     }
1146
1147     return HTMLElement_QI(&This->element.node, riid, ppv);
1148 }
1149
1150 static void HTMLInputElement_destructor(HTMLDOMNode *iface)
1151 {
1152     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1153
1154     nsIDOMHTMLInputElement_Release(This->nsinput);
1155
1156     HTMLElement_destructor(&This->element.node);
1157 }
1158
1159 static HRESULT HTMLInputElementImpl_call_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1160 {
1161     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1162
1163     if(eid == EVENTID_CLICK) {
1164         nsresult nsres;
1165
1166         *handled = TRUE;
1167
1168         nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1169         if(NS_FAILED(nsres)) {
1170             ERR("Click failed: %08x\n", nsres);
1171             return E_FAIL;
1172         }
1173     }
1174
1175     return S_OK;
1176 }
1177
1178 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1179 {
1180     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1181     return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1182 }
1183
1184 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1185 {
1186     HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
1187     return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1188 }
1189
1190 #undef HTMLINPUT_NODE_THIS
1191
1192 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1193     HTMLInputElement_QI,
1194     HTMLInputElement_destructor,
1195     HTMLElement_clone,
1196     NULL,
1197     HTMLInputElementImpl_call_event,
1198     HTMLInputElementImpl_put_disabled,
1199     HTMLInputElementImpl_get_disabled,
1200 };
1201
1202 static const tid_t HTMLInputElement_iface_tids[] = {
1203     HTMLELEMENT_TIDS,
1204     IHTMLInputElement_tid,
1205     0
1206 };
1207 static dispex_static_data_t HTMLInputElement_dispex = {
1208     NULL,
1209     DispHTMLInputElement_tid,
1210     NULL,
1211     HTMLInputElement_iface_tids
1212 };
1213
1214 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1215 {
1216     HTMLInputElement *ret;
1217     nsresult nsres;
1218
1219     ret = heap_alloc_zero(sizeof(HTMLInputElement));
1220     if(!ret)
1221         return E_OUTOFMEMORY;
1222
1223     ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1224     ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1225     ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1226
1227     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1228     if(NS_FAILED(nsres)) {
1229         ERR("Could not get nsIDOMHTMLInputElement interface: %08x\n", nsres);
1230         heap_free(ret);
1231         return E_FAIL;
1232     }
1233
1234     HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1235
1236     *elem = &ret->element;
1237     return S_OK;
1238 }