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