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