msvcrt: Pass pthreadlocinfo to update_threadlocinfo_category helper function.
[wine.git] / dlls / mshtml / htmlinput.c
blobe83cbc135a52d193443336aaf7bfd2420c2211e1
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
20 #include <assert.h>
21 #include <limits.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "htmlevent.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 typedef struct {
38 HTMLElement element;
40 IHTMLInputElement IHTMLInputElement_iface;
41 IHTMLInputTextElement IHTMLInputTextElement_iface;
43 nsIDOMHTMLInputElement *nsinput;
44 } HTMLInputElement;
46 static const WCHAR forW[] = {'f','o','r',0};
48 static inline HTMLInputElement *impl_from_IHTMLInputElement(IHTMLInputElement *iface)
50 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputElement_iface);
53 static inline HTMLInputElement *impl_from_IHTMLInputTextElement(IHTMLInputTextElement *iface)
55 return CONTAINING_RECORD(iface, HTMLInputElement, IHTMLInputTextElement_iface);
58 static HRESULT WINAPI HTMLInputElement_QueryInterface(IHTMLInputElement *iface,
59 REFIID riid, void **ppv)
61 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
63 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
66 static ULONG WINAPI HTMLInputElement_AddRef(IHTMLInputElement *iface)
68 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
70 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
73 static ULONG WINAPI HTMLInputElement_Release(IHTMLInputElement *iface)
75 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
77 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
80 static HRESULT WINAPI HTMLInputElement_GetTypeInfoCount(IHTMLInputElement *iface, UINT *pctinfo)
82 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
84 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
87 static HRESULT WINAPI HTMLInputElement_GetTypeInfo(IHTMLInputElement *iface, UINT iTInfo,
88 LCID lcid, ITypeInfo **ppTInfo)
90 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
92 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
93 ppTInfo);
96 static HRESULT WINAPI HTMLInputElement_GetIDsOfNames(IHTMLInputElement *iface, REFIID riid,
97 LPOLESTR *rgszNames, UINT cNames,
98 LCID lcid, DISPID *rgDispId)
100 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
102 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
103 cNames, lcid, rgDispId);
106 static HRESULT WINAPI HTMLInputElement_Invoke(IHTMLInputElement *iface, DISPID dispIdMember,
107 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
108 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
110 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
112 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
113 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
116 static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
118 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
119 nsAString type_str;
120 nsresult nsres;
122 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
125 * FIXME:
126 * On IE setting type works only on dynamically created elements before adding them to DOM tree.
128 nsAString_InitDepend(&type_str, v);
129 nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
130 nsAString_Finish(&type_str);
131 if(NS_FAILED(nsres)) {
132 ERR("SetType failed: %08x\n", nsres);
133 return E_FAIL;
136 return S_OK;
139 static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
141 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
142 nsAString type_str;
143 nsresult nsres;
145 TRACE("(%p)->(%p)\n", This, p);
147 nsAString_Init(&type_str, NULL);
148 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &type_str);
149 return return_nsstr(nsres, &type_str, p);
152 static HRESULT WINAPI HTMLInputElement_put_value(IHTMLInputElement *iface, BSTR v)
154 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
155 nsAString val_str;
156 nsresult nsres;
158 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
160 nsAString_InitDepend(&val_str, v);
161 nsres = nsIDOMHTMLInputElement_SetValue(This->nsinput, &val_str);
162 nsAString_Finish(&val_str);
163 if(NS_FAILED(nsres))
164 ERR("SetValue failed: %08x\n", nsres);
166 return S_OK;
169 static HRESULT WINAPI HTMLInputElement_get_value(IHTMLInputElement *iface, BSTR *p)
171 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
172 nsAString value_str;
173 nsresult nsres;
175 TRACE("(%p)->(%p)\n", This, p);
177 nsAString_Init(&value_str, NULL);
178 nsres = nsIDOMHTMLInputElement_GetValue(This->nsinput, &value_str);
179 return return_nsstr(nsres, &value_str, p);
182 static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
184 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
185 nsAString name_str;
186 nsresult nsres;
188 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
190 nsAString_InitDepend(&name_str, v);
191 nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
192 nsAString_Finish(&name_str);
193 if(NS_FAILED(nsres)) {
194 ERR("SetName failed: %08x\n", nsres);
195 return E_FAIL;
198 return S_OK;
201 static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
203 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
204 nsAString name_str;
205 nsresult nsres;
207 TRACE("(%p)->(%p)\n", This, p);
209 nsAString_Init(&name_str, NULL);
210 nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
211 return return_nsstr(nsres, &name_str, p);
214 static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL v)
216 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
217 FIXME("(%p)->(%x)\n", This, v);
218 return E_NOTIMPL;
221 static HRESULT WINAPI HTMLInputElement_get_status(IHTMLInputElement *iface, VARIANT_BOOL *p)
223 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
224 FIXME("(%p)->(%p)\n", This, p);
225 return E_NOTIMPL;
228 static HRESULT WINAPI HTMLInputElement_put_disabled(IHTMLInputElement *iface, VARIANT_BOOL v)
230 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
231 nsresult nsres;
233 TRACE("(%p)->(%x)\n", This, v);
235 nsres = nsIDOMHTMLInputElement_SetDisabled(This->nsinput, v != VARIANT_FALSE);
236 if(NS_FAILED(nsres))
237 ERR("SetDisabled failed: %08x\n", nsres);
239 return S_OK;
242 static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VARIANT_BOOL *p)
244 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
245 cpp_bool disabled = FALSE;
247 TRACE("(%p)->(%p)\n", This, p);
249 nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
251 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
252 return S_OK;
255 static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLFormElement **p)
257 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
258 nsIDOMHTMLFormElement *nsform;
259 nsIDOMNode *form_node;
260 HTMLDOMNode *node;
261 HRESULT hres;
262 nsresult nsres;
264 TRACE("(%p)->(%p)\n", This, p);
266 nsres = nsIDOMHTMLInputElement_GetForm(This->nsinput, &nsform);
267 if (NS_FAILED(nsres) || nsform == NULL) {
268 ERR("GetForm failed: %08x, nsform: %p\n", nsres, nsform);
269 *p = NULL;
270 return E_FAIL;
273 nsres = nsIDOMHTMLFormElement_QueryInterface(nsform, &IID_nsIDOMNode, (void**)&form_node);
274 nsIDOMHTMLFormElement_Release(nsform);
275 assert(nsres == NS_OK);
277 hres = get_node(This->element.node.doc, form_node, TRUE, &node);
278 nsIDOMNode_Release(form_node);
279 if (FAILED(hres))
280 return hres;
282 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
284 node_release(node);
285 return hres;
288 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
290 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
291 UINT32 val = v;
292 nsresult nsres;
294 TRACE("(%p)->(%d)\n", This, v);
295 if (v <= 0)
296 return CTL_E_INVALIDPROPERTYVALUE;
298 nsres = nsIDOMHTMLInputElement_SetSize(This->nsinput, val);
299 if (NS_FAILED(nsres)) {
300 ERR("Set Size(%u) failed: %08x\n", val, nsres);
301 return E_FAIL;
303 return S_OK;
306 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
308 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
309 UINT32 val;
310 nsresult nsres;
312 TRACE("(%p)->(%p)\n", This, p);
313 if (p == NULL)
314 return E_INVALIDARG;
316 nsres = nsIDOMHTMLInputElement_GetSize(This->nsinput, &val);
317 if (NS_FAILED(nsres)) {
318 ERR("Get Size failed: %08x\n", nsres);
319 return E_FAIL;
321 *p = val;
322 return S_OK;
325 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
327 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
328 nsresult nsres;
330 TRACE("(%p)->(%d)\n", This, v);
332 nsres = nsIDOMHTMLInputElement_SetMaxLength(This->nsinput, v);
333 if(NS_FAILED(nsres)) {
334 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
335 FIXME("SetMaxLength failed\n");
336 return E_FAIL;
339 return S_OK;
342 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
344 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
345 LONG max_length;
346 nsresult nsres;
348 TRACE("(%p)->(%p)\n", This, p);
350 nsres = nsIDOMHTMLInputElement_GetMaxLength(This->nsinput, &max_length);
351 assert(nsres == NS_OK);
353 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
354 *p = max_length == -1 ? INT_MAX : max_length;
355 return S_OK;
358 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
360 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
361 nsresult nsres;
363 TRACE("(%p)\n", This);
365 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
366 if(NS_FAILED(nsres)) {
367 ERR("Select failed: %08x\n", nsres);
368 return E_FAIL;
371 return S_OK;
374 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
376 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
378 TRACE("(%p)->()\n", This);
380 return set_node_event(&This->element.node, EVENTID_CHANGE, &v);
383 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
385 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
387 TRACE("(%p)->(%p)\n", This, p);
389 return get_node_event(&This->element.node, EVENTID_CHANGE, p);
392 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
394 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
395 FIXME("(%p)->()\n", This);
396 return E_NOTIMPL;
399 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
401 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
402 FIXME("(%p)->(%p)\n", This, p);
403 return E_NOTIMPL;
406 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
408 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
409 nsAString nsstr;
410 nsresult nsres;
412 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
414 nsAString_InitDepend(&nsstr, v);
415 nsres = nsIDOMHTMLInputElement_SetDefaultValue(This->nsinput, &nsstr);
416 nsAString_Finish(&nsstr);
417 if(NS_FAILED(nsres)) {
418 ERR("SetValue failed: %08x\n", nsres);
419 return E_FAIL;
422 return S_OK;
425 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
427 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
428 nsAString nsstr;
429 nsresult nsres;
431 TRACE("(%p)->(%p)\n", This, p);
433 nsAString_Init(&nsstr, NULL);
434 nsres = nsIDOMHTMLInputElement_GetDefaultValue(This->nsinput, &nsstr);
435 return return_nsstr(nsres, &nsstr, p);
438 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
440 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
441 nsresult nsres;
443 TRACE("(%p)->(%x)\n", This, v);
445 nsres = nsIDOMHTMLInputElement_SetReadOnly(This->nsinput, v != VARIANT_FALSE);
446 if (NS_FAILED(nsres)) {
447 ERR("Set ReadOnly Failed: %08x\n", nsres);
448 return E_FAIL;
450 return S_OK;
453 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
455 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
456 nsresult nsres;
457 cpp_bool b;
459 TRACE("(%p)->(%p)\n", This, p);
461 nsres = nsIDOMHTMLInputElement_GetReadOnly(This->nsinput, &b);
462 if (NS_FAILED(nsres)) {
463 ERR("Get ReadOnly Failed: %08x\n", nsres);
464 return E_FAIL;
466 *p = b ? VARIANT_TRUE : VARIANT_FALSE;
467 return S_OK;
470 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
472 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
473 FIXME("(%p)->(%p)\n", This, range);
474 return E_NOTIMPL;
477 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
479 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
480 FIXME("(%p)->(%x)\n", This, v);
481 return E_NOTIMPL;
484 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
486 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
487 FIXME("(%p)->(%p)\n", This, p);
488 return E_NOTIMPL;
491 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
493 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
494 nsresult nsres;
496 TRACE("(%p)->(%x)\n", This, v);
498 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
499 if(NS_FAILED(nsres)) {
500 ERR("SetDefaultChecked failed: %08x\n", nsres);
501 return E_FAIL;
504 return S_OK;
507 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
509 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
510 cpp_bool default_checked = FALSE;
511 nsresult nsres;
513 TRACE("(%p)->(%p)\n", This, p);
515 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
516 if(NS_FAILED(nsres)) {
517 ERR("GetDefaultChecked failed: %08x\n", nsres);
518 return E_FAIL;
521 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
522 return S_OK;
525 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
527 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
528 nsresult nsres;
530 TRACE("(%p)->(%x)\n", This, v);
532 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
533 if(NS_FAILED(nsres)) {
534 ERR("SetChecked failed: %08x\n", nsres);
535 return E_FAIL;
538 return S_OK;
541 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
543 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
544 cpp_bool checked;
545 nsresult nsres;
547 TRACE("(%p)->(%p)\n", This, p);
549 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
550 if(NS_FAILED(nsres)) {
551 ERR("GetChecked failed: %08x\n", nsres);
552 return E_FAIL;
555 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
556 TRACE("checked=%x\n", *p);
557 return S_OK;
560 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
562 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
563 FIXME("(%p)->()\n", This);
564 return E_NOTIMPL;
567 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
569 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
570 FIXME("(%p)->(%p)\n", This, p);
571 return E_NOTIMPL;
574 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
576 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
577 FIXME("(%p)->(%d)\n", This, v);
578 return E_NOTIMPL;
581 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
583 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
584 FIXME("(%p)->(%p)\n", This, p);
585 return E_NOTIMPL;
588 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
590 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
591 FIXME("(%p)->(%d)\n", This, v);
592 return E_NOTIMPL;
595 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
597 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
598 FIXME("(%p)->(%p)\n", This, p);
599 return E_NOTIMPL;
602 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
604 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
605 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
606 return E_NOTIMPL;
609 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
611 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
612 FIXME("(%p)->(%p)\n", This, p);
613 return E_NOTIMPL;
616 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
618 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
619 nsAString nsstr;
620 nsresult nsres;
622 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
624 nsAString_InitDepend(&nsstr, v);
625 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
626 nsAString_Finish(&nsstr);
627 if(NS_FAILED(nsres))
628 ERR("SetSrc failed: %08x\n", nsres);
630 return S_OK;
633 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
635 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
636 const PRUnichar *src;
637 nsAString src_str;
638 nsresult nsres;
639 HRESULT hres;
641 TRACE("(%p)->(%p)\n", This, p);
643 nsAString_Init(&src_str, NULL);
644 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
645 if(NS_FAILED(nsres)) {
646 ERR("GetSrc failed: %08x\n", nsres);
647 return E_FAIL;
650 nsAString_GetData(&src_str, &src);
651 hres = nsuri_to_url(src, FALSE, p);
652 nsAString_Finish(&src_str);
654 return hres;
657 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
659 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
660 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
661 return E_NOTIMPL;
664 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
666 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
667 FIXME("(%p)->(%p)\n", This, p);
668 return E_NOTIMPL;
671 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
673 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
674 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
675 return E_NOTIMPL;
678 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
680 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
681 FIXME("(%p)->(%p)\n", This, p);
682 return E_NOTIMPL;
685 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
687 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
688 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
689 return E_NOTIMPL;
692 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
694 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
695 FIXME("(%p)->(%p)\n", This, p);
696 return E_NOTIMPL;
699 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
701 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
702 FIXME("(%p)->(%p)\n", This, p);
703 return E_NOTIMPL;
706 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
708 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
709 FIXME("(%p)->(%p)\n", This, p);
710 return E_NOTIMPL;
713 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
715 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
716 FIXME("(%p)->()\n", This);
717 return E_NOTIMPL;
720 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
722 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
723 FIXME("(%p)->(%p)\n", This, p);
724 return E_NOTIMPL;
727 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
729 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
730 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
731 return E_NOTIMPL;
734 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
736 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
737 FIXME("(%p)->(%p)\n", This, p);
738 return E_NOTIMPL;
741 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
743 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
744 FIXME("(%p)->()\n", This);
745 return E_NOTIMPL;
748 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
750 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
751 FIXME("(%p)->(%p)\n", This, p);
752 return E_NOTIMPL;
755 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
757 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
758 FIXME("(%p)->()\n", This);
759 return E_NOTIMPL;
762 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
764 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
765 FIXME("(%p)->(%p)\n", This, p);
766 return E_NOTIMPL;
769 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
771 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
772 FIXME("(%p)->()\n", This);
773 return E_NOTIMPL;
776 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
778 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
779 FIXME("(%p)->(%p)\n", This, p);
780 return E_NOTIMPL;
783 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
785 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
786 FIXME("(%p)->(%d)\n", This, v);
787 return E_NOTIMPL;
790 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
792 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
793 FIXME("(%p)->(%p)\n", This, p);
794 return E_NOTIMPL;
797 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
799 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
800 FIXME("(%p)->(%d)\n", This, v);
801 return E_NOTIMPL;
804 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
806 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
807 FIXME("(%p)->(%p)\n", This, p);
808 return E_NOTIMPL;
811 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
813 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
814 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
815 return E_NOTIMPL;
818 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
820 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
821 FIXME("(%p)->(%p)\n", This, p);
822 return E_NOTIMPL;
825 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
826 HTMLInputElement_QueryInterface,
827 HTMLInputElement_AddRef,
828 HTMLInputElement_Release,
829 HTMLInputElement_GetTypeInfoCount,
830 HTMLInputElement_GetTypeInfo,
831 HTMLInputElement_GetIDsOfNames,
832 HTMLInputElement_Invoke,
833 HTMLInputElement_put_type,
834 HTMLInputElement_get_type,
835 HTMLInputElement_put_value,
836 HTMLInputElement_get_value,
837 HTMLInputElement_put_name,
838 HTMLInputElement_get_name,
839 HTMLInputElement_put_status,
840 HTMLInputElement_get_status,
841 HTMLInputElement_put_disabled,
842 HTMLInputElement_get_disabled,
843 HTMLInputElement_get_form,
844 HTMLInputElement_put_size,
845 HTMLInputElement_get_size,
846 HTMLInputElement_put_maxLength,
847 HTMLInputElement_get_maxLength,
848 HTMLInputElement_select,
849 HTMLInputElement_put_onchange,
850 HTMLInputElement_get_onchange,
851 HTMLInputElement_put_onselect,
852 HTMLInputElement_get_onselect,
853 HTMLInputElement_put_defaultValue,
854 HTMLInputElement_get_defaultValue,
855 HTMLInputElement_put_readOnly,
856 HTMLInputElement_get_readOnly,
857 HTMLInputElement_createTextRange,
858 HTMLInputElement_put_indeterminate,
859 HTMLInputElement_get_indeterminate,
860 HTMLInputElement_put_defaultChecked,
861 HTMLInputElement_get_defaultChecked,
862 HTMLInputElement_put_checked,
863 HTMLInputElement_get_checked,
864 HTMLInputElement_put_border,
865 HTMLInputElement_get_border,
866 HTMLInputElement_put_vspace,
867 HTMLInputElement_get_vspace,
868 HTMLInputElement_put_hspace,
869 HTMLInputElement_get_hspace,
870 HTMLInputElement_put_alt,
871 HTMLInputElement_get_alt,
872 HTMLInputElement_put_src,
873 HTMLInputElement_get_src,
874 HTMLInputElement_put_lowsrc,
875 HTMLInputElement_get_lowsrc,
876 HTMLInputElement_put_vrml,
877 HTMLInputElement_get_vrml,
878 HTMLInputElement_put_dynsrc,
879 HTMLInputElement_get_dynsrc,
880 HTMLInputElement_get_readyState,
881 HTMLInputElement_get_complete,
882 HTMLInputElement_put_loop,
883 HTMLInputElement_get_loop,
884 HTMLInputElement_put_align,
885 HTMLInputElement_get_align,
886 HTMLInputElement_put_onload,
887 HTMLInputElement_get_onload,
888 HTMLInputElement_put_onerror,
889 HTMLInputElement_get_onerror,
890 HTMLInputElement_put_onabort,
891 HTMLInputElement_get_onabort,
892 HTMLInputElement_put_width,
893 HTMLInputElement_get_width,
894 HTMLInputElement_put_height,
895 HTMLInputElement_get_height,
896 HTMLInputElement_put_start,
897 HTMLInputElement_get_start
900 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
901 REFIID riid, void **ppv)
903 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
905 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
908 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
910 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
912 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
915 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
917 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
919 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
922 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
924 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
925 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
928 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
929 LCID lcid, ITypeInfo **ppTInfo)
931 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
932 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
933 ppTInfo);
936 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
937 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
939 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
940 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
941 cNames, lcid, rgDispId);
944 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
945 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
946 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
948 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
949 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
950 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
953 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
955 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
957 TRACE("(%p)->(%p)\n", This, p);
959 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
962 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
964 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
966 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
968 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
971 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
973 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
975 TRACE("(%p)->(%p)\n", This, p);
977 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
980 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
982 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
984 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
986 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
989 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
991 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
993 TRACE("(%p)->(%p)\n", This, p);
995 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
998 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
1000 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1001 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1002 return E_NOTIMPL;
1005 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
1007 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1008 TRACE("(%p)->(%p)\n", This, p);
1009 return E_NOTIMPL;
1012 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1014 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1016 TRACE("(%p)->(%x)\n", This, v);
1018 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1021 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1023 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1025 TRACE("(%p)->(%p)\n", This, p);
1027 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1030 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
1032 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1034 TRACE("(%p)->(%p)\n", This, p);
1036 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
1039 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
1041 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1043 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1045 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
1048 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
1050 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1052 TRACE("(%p)->(%p)\n", This, p);
1054 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
1057 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
1059 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1061 TRACE("(%p)->(%d)\n", This, v);
1063 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
1066 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
1068 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1070 TRACE("(%p)->(%p)\n", This, p);
1072 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
1075 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
1077 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1079 TRACE("(%p)->(%d)\n", This, v);
1081 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1084 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1086 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1088 TRACE("(%p)->(%p)\n", This, p);
1090 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1093 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1095 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1097 TRACE("(%p)\n", This);
1099 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1102 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1104 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1106 TRACE("(%p)->()\n", This);
1108 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1111 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1113 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1115 TRACE("(%p)->(%p)\n", This, p);
1117 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1120 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1122 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1124 TRACE("(%p)->()\n", This);
1126 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1129 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1131 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1133 TRACE("(%p)->(%p)\n", This, p);
1135 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1138 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1140 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1142 TRACE("(%p)->(%x)\n", This, v);
1144 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1147 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1149 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1151 TRACE("(%p)->(%p)\n", This, p);
1153 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1156 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1158 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1160 TRACE("(%p)->(%p)\n", This, range);
1162 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1165 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1166 HTMLInputTextElement_QueryInterface,
1167 HTMLInputTextElement_AddRef,
1168 HTMLInputTextElement_Release,
1169 HTMLInputTextElement_GetTypeInfoCount,
1170 HTMLInputTextElement_GetTypeInfo,
1171 HTMLInputTextElement_GetIDsOfNames,
1172 HTMLInputTextElement_Invoke,
1173 HTMLInputTextElement_get_type,
1174 HTMLInputTextElement_put_value,
1175 HTMLInputTextElement_get_value,
1176 HTMLInputTextElement_put_name,
1177 HTMLInputTextElement_get_name,
1178 HTMLInputTextElement_put_status,
1179 HTMLInputTextElement_get_status,
1180 HTMLInputTextElement_put_disabled,
1181 HTMLInputTextElement_get_disabled,
1182 HTMLInputTextElement_get_form,
1183 HTMLInputTextElement_put_defaultValue,
1184 HTMLInputTextElement_get_defaultValue,
1185 HTMLInputTextElement_put_size,
1186 HTMLInputTextElement_get_size,
1187 HTMLInputTextElement_put_maxLength,
1188 HTMLInputTextElement_get_maxLength,
1189 HTMLInputTextElement_select,
1190 HTMLInputTextElement_put_onchange,
1191 HTMLInputTextElement_get_onchange,
1192 HTMLInputTextElement_put_onselect,
1193 HTMLInputTextElement_get_onselect,
1194 HTMLInputTextElement_put_readOnly,
1195 HTMLInputTextElement_get_readOnly,
1196 HTMLInputTextElement_createTextRange
1199 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1201 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1204 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1206 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1208 *ppv = NULL;
1210 if(IsEqualGUID(&IID_IUnknown, riid)) {
1211 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1212 *ppv = &This->IHTMLInputElement_iface;
1213 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1214 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1215 *ppv = &This->IHTMLInputElement_iface;
1216 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1217 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1218 *ppv = &This->IHTMLInputElement_iface;
1219 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1220 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1221 *ppv = &This->IHTMLInputTextElement_iface;
1224 if(*ppv) {
1225 IUnknown_AddRef((IUnknown*)*ppv);
1226 return S_OK;
1229 return HTMLElement_QI(&This->element.node, riid, ppv);
1232 static HRESULT HTMLInputElementImpl_fire_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1234 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1236 if(eid == EVENTID_CLICK) {
1237 nsresult nsres;
1239 *handled = TRUE;
1241 nsres = nsIDOMHTMLElement_Click(This->element.nselem);
1242 if(NS_FAILED(nsres)) {
1243 ERR("Click failed: %08x\n", nsres);
1244 return E_FAIL;
1248 return S_OK;
1251 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1253 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1254 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1257 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1259 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1260 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1263 static BOOL HTMLInputElement_is_text_edit(HTMLDOMNode *iface)
1265 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1266 const PRUnichar *type;
1267 nsAString nsstr;
1268 nsresult nsres;
1269 BOOL ret = FALSE;
1271 static const WCHAR buttonW[] = {'b','u','t','t','o','n',0};
1272 static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
1273 static const WCHAR passwordW[] = {'p','a','s','s','w','o','r','d',0};
1274 static const WCHAR resetW[] = {'r','e','s','e','t',0};
1275 static const WCHAR submitW[] = {'s','u','b','m','i','t',0};
1276 static const WCHAR textW[] = {'t','e','x','t',0};
1278 nsAString_Init(&nsstr, NULL);
1279 nsres = nsIDOMHTMLInputElement_GetType(This->nsinput, &nsstr);
1280 if(NS_SUCCEEDED(nsres)) {
1281 nsAString_GetData(&nsstr, &type);
1282 ret = !strcmpW(type, buttonW) || !strcmpW(type, hiddenW) || !strcmpW(type, passwordW)
1283 || !strcmpW(type, resetW) || !strcmpW(type, submitW) || !strcmpW(type, textW);
1285 nsAString_Finish(&nsstr);
1286 return ret;
1289 static void HTMLInputElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1291 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1293 if(This->nsinput)
1294 note_cc_edge((nsISupports*)This->nsinput, "This->nsinput", cb);
1297 static void HTMLInputElement_unlink(HTMLDOMNode *iface)
1299 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1301 if(This->nsinput) {
1302 nsIDOMHTMLInputElement *nsinput = This->nsinput;
1304 This->nsinput = NULL;
1305 nsIDOMHTMLInputElement_Release(nsinput);
1309 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1310 HTMLInputElement_QI,
1311 HTMLElement_destructor,
1312 HTMLElement_cpc,
1313 HTMLElement_clone,
1314 HTMLElement_handle_event,
1315 HTMLElement_get_attr_col,
1316 NULL,
1317 HTMLInputElementImpl_fire_event,
1318 HTMLInputElementImpl_put_disabled,
1319 HTMLInputElementImpl_get_disabled,
1320 NULL,
1321 NULL,
1322 NULL,
1323 NULL,
1324 NULL,
1325 HTMLInputElement_traverse,
1326 HTMLInputElement_unlink,
1327 HTMLInputElement_is_text_edit
1330 static const tid_t HTMLInputElement_iface_tids[] = {
1331 HTMLELEMENT_TIDS,
1332 IHTMLInputElement_tid,
1335 static dispex_static_data_t HTMLInputElement_dispex = {
1336 NULL,
1337 DispHTMLInputElement_tid,
1338 NULL,
1339 HTMLInputElement_iface_tids
1342 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1344 HTMLInputElement *ret;
1345 nsresult nsres;
1347 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1348 if(!ret)
1349 return E_OUTOFMEMORY;
1351 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1352 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1353 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1355 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1357 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1358 assert(nsres == NS_OK);
1360 *elem = &ret->element;
1361 return S_OK;
1364 typedef struct {
1365 HTMLElement element;
1367 IHTMLLabelElement IHTMLLabelElement_iface;
1368 } HTMLLabelElement;
1370 static inline HTMLLabelElement *impl_from_IHTMLLabelElement(IHTMLLabelElement *iface)
1372 return CONTAINING_RECORD(iface, HTMLLabelElement, IHTMLLabelElement_iface);
1375 static HRESULT WINAPI HTMLLabelElement_QueryInterface(IHTMLLabelElement *iface,
1376 REFIID riid, void **ppv)
1378 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1380 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1383 static ULONG WINAPI HTMLLabelElement_AddRef(IHTMLLabelElement *iface)
1385 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1387 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1390 static ULONG WINAPI HTMLLabelElement_Release(IHTMLLabelElement *iface)
1392 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1394 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1397 static HRESULT WINAPI HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement *iface, UINT *pctinfo)
1399 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1401 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1404 static HRESULT WINAPI HTMLLabelElement_GetTypeInfo(IHTMLLabelElement *iface, UINT iTInfo,
1405 LCID lcid, ITypeInfo **ppTInfo)
1407 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1409 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1412 static HRESULT WINAPI HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement *iface, REFIID riid,
1413 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1415 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1417 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1418 cNames, lcid, rgDispId);
1421 static HRESULT WINAPI HTMLLabelElement_Invoke(IHTMLLabelElement *iface, DISPID dispIdMember,
1422 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1423 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1425 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1427 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1428 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1431 static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BSTR v)
1433 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1434 nsAString for_str, val_str;
1435 nsresult nsres;
1437 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1439 nsAString_InitDepend(&for_str, forW);
1440 nsAString_InitDepend(&val_str, v);
1441 nsres = nsIDOMHTMLElement_SetAttribute(This->element.nselem, &for_str, &val_str);
1442 nsAString_Finish(&for_str);
1443 nsAString_Finish(&val_str);
1444 if(NS_FAILED(nsres)) {
1445 ERR("SetAttribute failed: %08x\n", nsres);
1446 return E_FAIL;
1449 return S_OK;
1452 static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
1454 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1456 TRACE("(%p)->(%p)\n", This, p);
1458 return elem_string_attr_getter(&This->element, forW, FALSE, p);
1461 static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
1463 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1464 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1465 return E_NOTIMPL;
1468 static HRESULT WINAPI HTMLLabelElement_get_accessKey(IHTMLLabelElement *iface, BSTR *p)
1470 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1471 FIXME("(%p)->(%p)\n", This, p);
1472 return E_NOTIMPL;
1475 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl = {
1476 HTMLLabelElement_QueryInterface,
1477 HTMLLabelElement_AddRef,
1478 HTMLLabelElement_Release,
1479 HTMLLabelElement_GetTypeInfoCount,
1480 HTMLLabelElement_GetTypeInfo,
1481 HTMLLabelElement_GetIDsOfNames,
1482 HTMLLabelElement_Invoke,
1483 HTMLLabelElement_put_htmlFor,
1484 HTMLLabelElement_get_htmlFor,
1485 HTMLLabelElement_put_accessKey,
1486 HTMLLabelElement_get_accessKey
1489 static inline HTMLLabelElement *label_from_HTMLDOMNode(HTMLDOMNode *iface)
1491 return CONTAINING_RECORD(iface, HTMLLabelElement, element.node);
1494 static HRESULT HTMLLabelElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1496 HTMLLabelElement *This = label_from_HTMLDOMNode(iface);
1498 *ppv = NULL;
1500 if(IsEqualGUID(&IID_IUnknown, riid)) {
1501 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1502 *ppv = &This->IHTMLLabelElement_iface;
1503 }else if(IsEqualGUID(&IID_IHTMLLabelElement, riid)) {
1504 TRACE("(%p)->(IID_IHTMLLabelElement %p)\n", This, ppv);
1505 *ppv = &This->IHTMLLabelElement_iface;
1506 }else {
1507 return HTMLElement_QI(&This->element.node, riid, ppv);
1510 IUnknown_AddRef((IUnknown*)*ppv);
1511 return S_OK;
1514 static const NodeImplVtbl HTMLLabelElementImplVtbl = {
1515 HTMLLabelElement_QI,
1516 HTMLElement_destructor,
1517 HTMLElement_cpc,
1518 HTMLElement_clone,
1519 HTMLElement_handle_event,
1520 HTMLElement_get_attr_col,
1523 static const tid_t HTMLLabelElement_iface_tids[] = {
1524 HTMLELEMENT_TIDS,
1525 IHTMLLabelElement_tid,
1529 static dispex_static_data_t HTMLLabelElement_dispex = {
1530 NULL,
1531 DispHTMLLabelElement_tid,
1532 NULL,
1533 HTMLLabelElement_iface_tids
1536 HRESULT HTMLLabelElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1538 HTMLLabelElement *ret;
1540 ret = heap_alloc_zero(sizeof(*ret));
1541 if(!ret)
1542 return E_OUTOFMEMORY;
1544 ret->IHTMLLabelElement_iface.lpVtbl = &HTMLLabelElementVtbl;
1545 ret->element.node.vtbl = &HTMLLabelElementImplVtbl;
1547 HTMLElement_Init(&ret->element, doc, nselem, &HTMLLabelElement_dispex);
1548 *elem = &ret->element;
1549 return S_OK;
1552 typedef struct {
1553 HTMLElement element;
1555 IHTMLButtonElement IHTMLButtonElement_iface;
1557 nsIDOMHTMLButtonElement *nsbutton;
1558 } HTMLButtonElement;
1560 static inline HTMLButtonElement *impl_from_IHTMLButtonElement(IHTMLButtonElement *iface)
1562 return CONTAINING_RECORD(iface, HTMLButtonElement, IHTMLButtonElement_iface);
1565 static HRESULT WINAPI HTMLButtonElement_QueryInterface(IHTMLButtonElement *iface,
1566 REFIID riid, void **ppv)
1568 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1570 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1573 static ULONG WINAPI HTMLButtonElement_AddRef(IHTMLButtonElement *iface)
1575 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1577 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1580 static ULONG WINAPI HTMLButtonElement_Release(IHTMLButtonElement *iface)
1582 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1584 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1587 static HRESULT WINAPI HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement *iface, UINT *pctinfo)
1589 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1591 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
1594 static HRESULT WINAPI HTMLButtonElement_GetTypeInfo(IHTMLButtonElement *iface, UINT iTInfo,
1595 LCID lcid, ITypeInfo **ppTInfo)
1597 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1599 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1602 static HRESULT WINAPI HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement *iface, REFIID riid,
1603 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1605 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1607 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
1608 cNames, lcid, rgDispId);
1611 static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID dispIdMember,
1612 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1613 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1615 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1617 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
1618 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1621 static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p)
1623 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1624 FIXME("(%p)->(%p)\n", This, p);
1625 return E_NOTIMPL;
1628 static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v)
1630 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1631 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1632 return E_NOTIMPL;
1635 static HRESULT WINAPI HTMLButtonElement_get_value(IHTMLButtonElement *iface, BSTR *p)
1637 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1638 FIXME("(%p)->(%p)\n", This, p);
1639 return E_NOTIMPL;
1642 static HRESULT WINAPI HTMLButtonElement_put_name(IHTMLButtonElement *iface, BSTR v)
1644 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1645 nsAString name_str;
1646 nsresult nsres;
1648 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1650 nsAString_InitDepend(&name_str, v);
1651 nsres = nsIDOMHTMLButtonElement_SetName(This->nsbutton, &name_str);
1652 nsAString_Finish(&name_str);
1653 if(NS_FAILED(nsres)) {
1654 ERR("SetName failed: %08x\n", nsres);
1655 return E_FAIL;
1658 return S_OK;
1661 static HRESULT WINAPI HTMLButtonElement_get_name(IHTMLButtonElement *iface, BSTR *p)
1663 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1664 nsAString name_str;
1665 nsresult nsres;
1667 TRACE("(%p)->(%p)\n", This, p);
1669 nsAString_Init(&name_str, NULL);
1670 nsres = nsIDOMHTMLButtonElement_GetName(This->nsbutton, &name_str);
1671 return return_nsstr(nsres, &name_str, p);
1674 static HRESULT WINAPI HTMLButtonElement_put_status(IHTMLButtonElement *iface, VARIANT v)
1676 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1677 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1678 return E_NOTIMPL;
1681 static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VARIANT *p)
1683 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1684 FIXME("(%p)->(%p)\n", This, p);
1685 return E_NOTIMPL;
1688 static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
1690 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1691 nsresult nsres;
1693 TRACE("(%p)->(%x)\n", This, v);
1695 nsres = nsIDOMHTMLButtonElement_SetDisabled(This->nsbutton, !!v);
1696 if(NS_FAILED(nsres)) {
1697 ERR("SetDisabled failed: %08x\n", nsres);
1698 return E_FAIL;
1701 return S_OK;
1704 static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
1706 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1707 cpp_bool disabled;
1708 nsresult nsres;
1710 TRACE("(%p)->(%p)\n", This, p);
1712 nsres = nsIDOMHTMLButtonElement_GetDisabled(This->nsbutton, &disabled);
1713 if(NS_FAILED(nsres)) {
1714 ERR("GetDisabled failed: %08x\n", nsres);
1715 return E_FAIL;
1718 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
1719 return S_OK;
1722 static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
1724 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1725 FIXME("(%p)->(%p)\n", This, p);
1726 return E_NOTIMPL;
1729 static HRESULT WINAPI HTMLButtonElement_createTextRange(IHTMLButtonElement *iface, IHTMLTxtRange **range)
1731 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1732 FIXME("(%p)->(%p)\n", This, range);
1733 return E_NOTIMPL;
1736 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = {
1737 HTMLButtonElement_QueryInterface,
1738 HTMLButtonElement_AddRef,
1739 HTMLButtonElement_Release,
1740 HTMLButtonElement_GetTypeInfoCount,
1741 HTMLButtonElement_GetTypeInfo,
1742 HTMLButtonElement_GetIDsOfNames,
1743 HTMLButtonElement_Invoke,
1744 HTMLButtonElement_get_type,
1745 HTMLButtonElement_put_value,
1746 HTMLButtonElement_get_value,
1747 HTMLButtonElement_put_name,
1748 HTMLButtonElement_get_name,
1749 HTMLButtonElement_put_status,
1750 HTMLButtonElement_get_status,
1751 HTMLButtonElement_put_disabled,
1752 HTMLButtonElement_get_disabled,
1753 HTMLButtonElement_get_form,
1754 HTMLButtonElement_createTextRange
1757 static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface)
1759 return CONTAINING_RECORD(iface, HTMLButtonElement, element.node);
1762 static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1764 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1766 *ppv = NULL;
1768 if(IsEqualGUID(&IID_IUnknown, riid)) {
1769 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1770 *ppv = &This->IHTMLButtonElement_iface;
1771 }else if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) {
1772 TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This, ppv);
1773 *ppv = &This->IHTMLButtonElement_iface;
1774 }else {
1775 return HTMLElement_QI(&This->element.node, riid, ppv);
1778 IUnknown_AddRef((IUnknown*)*ppv);
1779 return S_OK;
1782 static HRESULT HTMLButtonElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1784 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1785 return IHTMLButtonElement_put_disabled(&This->IHTMLButtonElement_iface, v);
1788 static HRESULT HTMLButtonElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1790 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1791 return IHTMLButtonElement_get_disabled(&This->IHTMLButtonElement_iface, p);
1794 static BOOL HTMLButtonElement_is_text_edit(HTMLDOMNode *iface)
1796 return TRUE;
1799 static void HTMLButtonElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1801 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1803 if(This->nsbutton)
1804 note_cc_edge((nsISupports*)This->nsbutton, "This->nsbutton", cb);
1807 static void HTMLButtonElement_unlink(HTMLDOMNode *iface)
1809 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1811 if(This->nsbutton) {
1812 nsIDOMHTMLButtonElement *nsbutton = This->nsbutton;
1814 This->nsbutton = NULL;
1815 nsIDOMHTMLButtonElement_Release(nsbutton);
1819 static const NodeImplVtbl HTMLButtonElementImplVtbl = {
1820 HTMLButtonElement_QI,
1821 HTMLElement_destructor,
1822 HTMLElement_cpc,
1823 HTMLElement_clone,
1824 HTMLElement_handle_event,
1825 HTMLElement_get_attr_col,
1826 NULL,
1827 NULL,
1828 HTMLButtonElementImpl_put_disabled,
1829 HTMLButtonElementImpl_get_disabled,
1830 NULL,
1831 NULL,
1832 NULL,
1833 NULL,
1834 NULL,
1835 HTMLButtonElement_traverse,
1836 HTMLButtonElement_unlink,
1837 HTMLButtonElement_is_text_edit
1840 static const tid_t HTMLButtonElement_iface_tids[] = {
1841 HTMLELEMENT_TIDS,
1842 IHTMLButtonElement_tid,
1846 static dispex_static_data_t HTMLButtonElement_dispex = {
1847 NULL,
1848 DispHTMLButtonElement_tid,
1849 NULL,
1850 HTMLButtonElement_iface_tids
1853 HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1855 HTMLButtonElement *ret;
1856 nsresult nsres;
1858 ret = heap_alloc_zero(sizeof(*ret));
1859 if(!ret)
1860 return E_OUTOFMEMORY;
1862 ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl;
1863 ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
1865 HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex);
1867 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLButtonElement, (void**)&ret->nsbutton);
1868 assert(nsres == NS_OK);
1870 *elem = &ret->element;
1871 return S_OK;