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