d3d8: Get rid of the format switching code in d3d8_device_CopyRects().
[wine.git] / dlls / mshtml / htmlinput.c
blobe568f4b5f8f7507838b9289d86c3a3a01670777d
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.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.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.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.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 HTMLDOMNode *node;
260 HRESULT hres;
261 nsresult nsres;
263 TRACE("(%p)->(%p)\n", This, p);
265 nsres = nsIDOMHTMLInputElement_GetForm(This->nsinput, &nsform);
266 if (NS_FAILED(nsres) || nsform == NULL) {
267 ERR("GetForm failed: %08x, nsform: %p\n", nsres, nsform);
268 *p = NULL;
269 return E_FAIL;
272 hres = get_node(This->element.node.doc, (nsIDOMNode*)nsform, TRUE, &node);
273 nsIDOMHTMLFormElement_Release(nsform);
274 if (FAILED(hres))
275 return hres;
277 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
279 node_release(node);
280 return hres;
283 static HRESULT WINAPI HTMLInputElement_put_size(IHTMLInputElement *iface, LONG v)
285 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
286 UINT32 val = v;
287 nsresult nsres;
289 TRACE("(%p)->(%d)\n", This, v);
290 if (v <= 0)
291 return CTL_E_INVALIDPROPERTYVALUE;
293 nsres = nsIDOMHTMLInputElement_SetSize(This->nsinput, val);
294 if (NS_FAILED(nsres)) {
295 ERR("Set Size(%u) failed: %08x\n", val, nsres);
296 return E_FAIL;
298 return S_OK;
301 static HRESULT WINAPI HTMLInputElement_get_size(IHTMLInputElement *iface, LONG *p)
303 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
304 UINT32 val;
305 nsresult nsres;
307 TRACE("(%p)->(%p)\n", This, p);
308 if (p == NULL)
309 return E_INVALIDARG;
311 nsres = nsIDOMHTMLInputElement_GetSize(This->nsinput, &val);
312 if (NS_FAILED(nsres)) {
313 ERR("Get Size failed: %08x\n", nsres);
314 return E_FAIL;
316 *p = val;
317 return S_OK;
320 static HRESULT WINAPI HTMLInputElement_put_maxLength(IHTMLInputElement *iface, LONG v)
322 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
323 nsresult nsres;
325 TRACE("(%p)->(%d)\n", This, v);
327 nsres = nsIDOMHTMLInputElement_SetMaxLength(This->nsinput, v);
328 if(NS_FAILED(nsres)) {
329 /* FIXME: Gecko throws an error on negative values, while MSHTML should accept them */
330 FIXME("SetMaxLength failed\n");
331 return E_FAIL;
334 return S_OK;
337 static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, LONG *p)
339 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
340 LONG max_length;
341 nsresult nsres;
343 TRACE("(%p)->(%p)\n", This, p);
345 nsres = nsIDOMHTMLInputElement_GetMaxLength(This->nsinput, &max_length);
346 assert(nsres == NS_OK);
348 /* Gecko reports -1 as default value, while MSHTML uses INT_MAX */
349 *p = max_length == -1 ? INT_MAX : max_length;
350 return S_OK;
353 static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
355 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
356 nsresult nsres;
358 TRACE("(%p)\n", This);
360 nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
361 if(NS_FAILED(nsres)) {
362 ERR("Select failed: %08x\n", nsres);
363 return E_FAIL;
366 return S_OK;
369 static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
371 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
373 TRACE("(%p)->()\n", This);
375 return set_node_event(&This->element.node, EVENTID_CHANGE, &v);
378 static HRESULT WINAPI HTMLInputElement_get_onchange(IHTMLInputElement *iface, VARIANT *p)
380 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
382 TRACE("(%p)->(%p)\n", This, p);
384 return get_node_event(&This->element.node, EVENTID_CHANGE, p);
387 static HRESULT WINAPI HTMLInputElement_put_onselect(IHTMLInputElement *iface, VARIANT v)
389 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
390 FIXME("(%p)->()\n", This);
391 return E_NOTIMPL;
394 static HRESULT WINAPI HTMLInputElement_get_onselect(IHTMLInputElement *iface, VARIANT *p)
396 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
397 FIXME("(%p)->(%p)\n", This, p);
398 return E_NOTIMPL;
401 static HRESULT WINAPI HTMLInputElement_put_defaultValue(IHTMLInputElement *iface, BSTR v)
403 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
404 nsAString nsstr;
405 nsresult nsres;
407 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
409 nsAString_InitDepend(&nsstr, v);
410 nsres = nsIDOMHTMLInputElement_SetDefaultValue(This->nsinput, &nsstr);
411 nsAString_Finish(&nsstr);
412 if(NS_FAILED(nsres)) {
413 ERR("SetValue failed: %08x\n", nsres);
414 return E_FAIL;
417 return S_OK;
420 static HRESULT WINAPI HTMLInputElement_get_defaultValue(IHTMLInputElement *iface, BSTR *p)
422 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
423 nsAString nsstr;
424 nsresult nsres;
426 TRACE("(%p)->(%p)\n", This, p);
428 nsAString_Init(&nsstr, NULL);
429 nsres = nsIDOMHTMLInputElement_GetDefaultValue(This->nsinput, &nsstr);
430 return return_nsstr(nsres, &nsstr, p);
433 static HRESULT WINAPI HTMLInputElement_put_readOnly(IHTMLInputElement *iface, VARIANT_BOOL v)
435 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
436 nsresult nsres;
438 TRACE("(%p)->(%x)\n", This, v);
440 nsres = nsIDOMHTMLInputElement_SetReadOnly(This->nsinput, v != VARIANT_FALSE);
441 if (NS_FAILED(nsres)) {
442 ERR("Set ReadOnly Failed: %08x\n", nsres);
443 return E_FAIL;
445 return S_OK;
448 static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VARIANT_BOOL *p)
450 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
451 nsresult nsres;
452 cpp_bool b;
454 TRACE("(%p)->(%p)\n", This, p);
456 nsres = nsIDOMHTMLInputElement_GetReadOnly(This->nsinput, &b);
457 if (NS_FAILED(nsres)) {
458 ERR("Get ReadOnly Failed: %08x\n", nsres);
459 return E_FAIL;
461 *p = b ? VARIANT_TRUE : VARIANT_FALSE;
462 return S_OK;
465 static HRESULT WINAPI HTMLInputElement_createTextRange(IHTMLInputElement *iface, IHTMLTxtRange **range)
467 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
468 FIXME("(%p)->(%p)\n", This, range);
469 return E_NOTIMPL;
472 static HRESULT WINAPI HTMLInputElement_put_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL v)
474 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
475 FIXME("(%p)->(%x)\n", This, v);
476 return E_NOTIMPL;
479 static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *iface, VARIANT_BOOL *p)
481 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
482 FIXME("(%p)->(%p)\n", This, p);
483 return E_NOTIMPL;
486 static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
488 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
489 nsresult nsres;
491 TRACE("(%p)->(%x)\n", This, v);
493 nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
494 if(NS_FAILED(nsres)) {
495 ERR("SetDefaultChecked failed: %08x\n", nsres);
496 return E_FAIL;
499 return S_OK;
502 static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
504 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
505 cpp_bool default_checked = FALSE;
506 nsresult nsres;
508 TRACE("(%p)->(%p)\n", This, p);
510 nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
511 if(NS_FAILED(nsres)) {
512 ERR("GetDefaultChecked failed: %08x\n", nsres);
513 return E_FAIL;
516 *p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
517 return S_OK;
520 static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
522 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
523 nsresult nsres;
525 TRACE("(%p)->(%x)\n", This, v);
527 nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
528 if(NS_FAILED(nsres)) {
529 ERR("SetChecked failed: %08x\n", nsres);
530 return E_FAIL;
533 return S_OK;
536 static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
538 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
539 cpp_bool checked;
540 nsresult nsres;
542 TRACE("(%p)->(%p)\n", This, p);
544 nsres = nsIDOMHTMLInputElement_GetChecked(This->nsinput, &checked);
545 if(NS_FAILED(nsres)) {
546 ERR("GetChecked failed: %08x\n", nsres);
547 return E_FAIL;
550 *p = checked ? VARIANT_TRUE : VARIANT_FALSE;
551 TRACE("checked=%x\n", *p);
552 return S_OK;
555 static HRESULT WINAPI HTMLInputElement_put_border(IHTMLInputElement *iface, VARIANT v)
557 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
558 FIXME("(%p)->()\n", This);
559 return E_NOTIMPL;
562 static HRESULT WINAPI HTMLInputElement_get_border(IHTMLInputElement *iface, VARIANT *p)
564 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
565 FIXME("(%p)->(%p)\n", This, p);
566 return E_NOTIMPL;
569 static HRESULT WINAPI HTMLInputElement_put_vspace(IHTMLInputElement *iface, LONG v)
571 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
572 FIXME("(%p)->(%d)\n", This, v);
573 return E_NOTIMPL;
576 static HRESULT WINAPI HTMLInputElement_get_vspace(IHTMLInputElement *iface, LONG *p)
578 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
579 FIXME("(%p)->(%p)\n", This, p);
580 return E_NOTIMPL;
583 static HRESULT WINAPI HTMLInputElement_put_hspace(IHTMLInputElement *iface, LONG v)
585 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
586 FIXME("(%p)->(%d)\n", This, v);
587 return E_NOTIMPL;
590 static HRESULT WINAPI HTMLInputElement_get_hspace(IHTMLInputElement *iface, LONG *p)
592 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
593 FIXME("(%p)->(%p)\n", This, p);
594 return E_NOTIMPL;
597 static HRESULT WINAPI HTMLInputElement_put_alt(IHTMLInputElement *iface, BSTR v)
599 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
600 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
601 return E_NOTIMPL;
604 static HRESULT WINAPI HTMLInputElement_get_alt(IHTMLInputElement *iface, BSTR *p)
606 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
607 FIXME("(%p)->(%p)\n", This, p);
608 return E_NOTIMPL;
611 static HRESULT WINAPI HTMLInputElement_put_src(IHTMLInputElement *iface, BSTR v)
613 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
614 nsAString nsstr;
615 nsresult nsres;
617 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
619 nsAString_InitDepend(&nsstr, v);
620 nsres = nsIDOMHTMLInputElement_SetSrc(This->nsinput, &nsstr);
621 nsAString_Finish(&nsstr);
622 if(NS_FAILED(nsres))
623 ERR("SetSrc failed: %08x\n", nsres);
625 return S_OK;
628 static HRESULT WINAPI HTMLInputElement_get_src(IHTMLInputElement *iface, BSTR *p)
630 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
631 const PRUnichar *src;
632 nsAString src_str;
633 nsresult nsres;
634 HRESULT hres;
636 TRACE("(%p)->(%p)\n", This, p);
638 nsAString_Init(&src_str, NULL);
639 nsres = nsIDOMHTMLInputElement_GetSrc(This->nsinput, &src_str);
640 if(NS_FAILED(nsres)) {
641 ERR("GetSrc failed: %08x\n", nsres);
642 return E_FAIL;
645 nsAString_GetData(&src_str, &src);
646 hres = nsuri_to_url(src, FALSE, p);
647 nsAString_Finish(&src_str);
649 return hres;
652 static HRESULT WINAPI HTMLInputElement_put_lowsrc(IHTMLInputElement *iface, BSTR v)
654 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
655 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
656 return E_NOTIMPL;
659 static HRESULT WINAPI HTMLInputElement_get_lowsrc(IHTMLInputElement *iface, BSTR *p)
661 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
662 FIXME("(%p)->(%p)\n", This, p);
663 return E_NOTIMPL;
666 static HRESULT WINAPI HTMLInputElement_put_vrml(IHTMLInputElement *iface, BSTR v)
668 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
669 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
670 return E_NOTIMPL;
673 static HRESULT WINAPI HTMLInputElement_get_vrml(IHTMLInputElement *iface, BSTR *p)
675 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
676 FIXME("(%p)->(%p)\n", This, p);
677 return E_NOTIMPL;
680 static HRESULT WINAPI HTMLInputElement_put_dynsrc(IHTMLInputElement *iface, BSTR v)
682 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
683 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
684 return E_NOTIMPL;
687 static HRESULT WINAPI HTMLInputElement_get_dynsrc(IHTMLInputElement *iface, BSTR *p)
689 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
690 FIXME("(%p)->(%p)\n", This, p);
691 return E_NOTIMPL;
694 static HRESULT WINAPI HTMLInputElement_get_readyState(IHTMLInputElement *iface, BSTR *p)
696 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
697 FIXME("(%p)->(%p)\n", This, p);
698 return E_NOTIMPL;
701 static HRESULT WINAPI HTMLInputElement_get_complete(IHTMLInputElement *iface, VARIANT_BOOL *p)
703 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
704 FIXME("(%p)->(%p)\n", This, p);
705 return E_NOTIMPL;
708 static HRESULT WINAPI HTMLInputElement_put_loop(IHTMLInputElement *iface, VARIANT v)
710 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
711 FIXME("(%p)->()\n", This);
712 return E_NOTIMPL;
715 static HRESULT WINAPI HTMLInputElement_get_loop(IHTMLInputElement *iface, VARIANT *p)
717 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
718 FIXME("(%p)->(%p)\n", This, p);
719 return E_NOTIMPL;
722 static HRESULT WINAPI HTMLInputElement_put_align(IHTMLInputElement *iface, BSTR v)
724 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
725 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
726 return E_NOTIMPL;
729 static HRESULT WINAPI HTMLInputElement_get_align(IHTMLInputElement *iface, BSTR *p)
731 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
732 FIXME("(%p)->(%p)\n", This, p);
733 return E_NOTIMPL;
736 static HRESULT WINAPI HTMLInputElement_put_onload(IHTMLInputElement *iface, VARIANT v)
738 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
739 FIXME("(%p)->()\n", This);
740 return E_NOTIMPL;
743 static HRESULT WINAPI HTMLInputElement_get_onload(IHTMLInputElement *iface, VARIANT *p)
745 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
746 FIXME("(%p)->(%p)\n", This, p);
747 return E_NOTIMPL;
750 static HRESULT WINAPI HTMLInputElement_put_onerror(IHTMLInputElement *iface, VARIANT v)
752 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
753 FIXME("(%p)->()\n", This);
754 return E_NOTIMPL;
757 static HRESULT WINAPI HTMLInputElement_get_onerror(IHTMLInputElement *iface, VARIANT *p)
759 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
760 FIXME("(%p)->(%p)\n", This, p);
761 return E_NOTIMPL;
764 static HRESULT WINAPI HTMLInputElement_put_onabort(IHTMLInputElement *iface, VARIANT v)
766 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
767 FIXME("(%p)->()\n", This);
768 return E_NOTIMPL;
771 static HRESULT WINAPI HTMLInputElement_get_onabort(IHTMLInputElement *iface, VARIANT *p)
773 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
774 FIXME("(%p)->(%p)\n", This, p);
775 return E_NOTIMPL;
778 static HRESULT WINAPI HTMLInputElement_put_width(IHTMLInputElement *iface, LONG v)
780 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
781 FIXME("(%p)->(%d)\n", This, v);
782 return E_NOTIMPL;
785 static HRESULT WINAPI HTMLInputElement_get_width(IHTMLInputElement *iface, LONG *p)
787 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
788 FIXME("(%p)->(%p)\n", This, p);
789 return E_NOTIMPL;
792 static HRESULT WINAPI HTMLInputElement_put_height(IHTMLInputElement *iface, LONG v)
794 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
795 FIXME("(%p)->(%d)\n", This, v);
796 return E_NOTIMPL;
799 static HRESULT WINAPI HTMLInputElement_get_height(IHTMLInputElement *iface, LONG *p)
801 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
802 FIXME("(%p)->(%p)\n", This, p);
803 return E_NOTIMPL;
806 static HRESULT WINAPI HTMLInputElement_put_start(IHTMLInputElement *iface, BSTR v)
808 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
809 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
810 return E_NOTIMPL;
813 static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR *p)
815 HTMLInputElement *This = impl_from_IHTMLInputElement(iface);
816 FIXME("(%p)->(%p)\n", This, p);
817 return E_NOTIMPL;
820 static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
821 HTMLInputElement_QueryInterface,
822 HTMLInputElement_AddRef,
823 HTMLInputElement_Release,
824 HTMLInputElement_GetTypeInfoCount,
825 HTMLInputElement_GetTypeInfo,
826 HTMLInputElement_GetIDsOfNames,
827 HTMLInputElement_Invoke,
828 HTMLInputElement_put_type,
829 HTMLInputElement_get_type,
830 HTMLInputElement_put_value,
831 HTMLInputElement_get_value,
832 HTMLInputElement_put_name,
833 HTMLInputElement_get_name,
834 HTMLInputElement_put_status,
835 HTMLInputElement_get_status,
836 HTMLInputElement_put_disabled,
837 HTMLInputElement_get_disabled,
838 HTMLInputElement_get_form,
839 HTMLInputElement_put_size,
840 HTMLInputElement_get_size,
841 HTMLInputElement_put_maxLength,
842 HTMLInputElement_get_maxLength,
843 HTMLInputElement_select,
844 HTMLInputElement_put_onchange,
845 HTMLInputElement_get_onchange,
846 HTMLInputElement_put_onselect,
847 HTMLInputElement_get_onselect,
848 HTMLInputElement_put_defaultValue,
849 HTMLInputElement_get_defaultValue,
850 HTMLInputElement_put_readOnly,
851 HTMLInputElement_get_readOnly,
852 HTMLInputElement_createTextRange,
853 HTMLInputElement_put_indeterminate,
854 HTMLInputElement_get_indeterminate,
855 HTMLInputElement_put_defaultChecked,
856 HTMLInputElement_get_defaultChecked,
857 HTMLInputElement_put_checked,
858 HTMLInputElement_get_checked,
859 HTMLInputElement_put_border,
860 HTMLInputElement_get_border,
861 HTMLInputElement_put_vspace,
862 HTMLInputElement_get_vspace,
863 HTMLInputElement_put_hspace,
864 HTMLInputElement_get_hspace,
865 HTMLInputElement_put_alt,
866 HTMLInputElement_get_alt,
867 HTMLInputElement_put_src,
868 HTMLInputElement_get_src,
869 HTMLInputElement_put_lowsrc,
870 HTMLInputElement_get_lowsrc,
871 HTMLInputElement_put_vrml,
872 HTMLInputElement_get_vrml,
873 HTMLInputElement_put_dynsrc,
874 HTMLInputElement_get_dynsrc,
875 HTMLInputElement_get_readyState,
876 HTMLInputElement_get_complete,
877 HTMLInputElement_put_loop,
878 HTMLInputElement_get_loop,
879 HTMLInputElement_put_align,
880 HTMLInputElement_get_align,
881 HTMLInputElement_put_onload,
882 HTMLInputElement_get_onload,
883 HTMLInputElement_put_onerror,
884 HTMLInputElement_get_onerror,
885 HTMLInputElement_put_onabort,
886 HTMLInputElement_get_onabort,
887 HTMLInputElement_put_width,
888 HTMLInputElement_get_width,
889 HTMLInputElement_put_height,
890 HTMLInputElement_get_height,
891 HTMLInputElement_put_start,
892 HTMLInputElement_get_start
895 static HRESULT WINAPI HTMLInputTextElement_QueryInterface(IHTMLInputTextElement *iface,
896 REFIID riid, void **ppv)
898 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
900 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
903 static ULONG WINAPI HTMLInputTextElement_AddRef(IHTMLInputTextElement *iface)
905 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
907 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
910 static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
912 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
914 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
917 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
919 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
920 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
923 static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
924 LCID lcid, ITypeInfo **ppTInfo)
926 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
927 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
928 ppTInfo);
931 static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
932 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
934 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
935 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
936 cNames, lcid, rgDispId);
939 static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
940 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
941 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
943 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
944 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
945 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
948 static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
950 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
952 TRACE("(%p)->(%p)\n", This, p);
954 return IHTMLInputElement_get_type(&This->IHTMLInputElement_iface, p);
957 static HRESULT WINAPI HTMLInputTextElement_put_value(IHTMLInputTextElement *iface, BSTR v)
959 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
961 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
963 return IHTMLInputElement_put_value(&This->IHTMLInputElement_iface, v);
966 static HRESULT WINAPI HTMLInputTextElement_get_value(IHTMLInputTextElement *iface, BSTR *p)
968 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
970 TRACE("(%p)->(%p)\n", This, p);
972 return IHTMLInputElement_get_value(&This->IHTMLInputElement_iface, p);
975 static HRESULT WINAPI HTMLInputTextElement_put_name(IHTMLInputTextElement *iface, BSTR v)
977 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
979 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
981 return IHTMLInputElement_put_name(&This->IHTMLInputElement_iface, v);
984 static HRESULT WINAPI HTMLInputTextElement_get_name(IHTMLInputTextElement *iface, BSTR *p)
986 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
988 TRACE("(%p)->(%p)\n", This, p);
990 return IHTMLInputElement_get_name(&This->IHTMLInputElement_iface, p);
993 static HRESULT WINAPI HTMLInputTextElement_put_status(IHTMLInputTextElement *iface, VARIANT v)
995 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
996 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
997 return E_NOTIMPL;
1000 static HRESULT WINAPI HTMLInputTextElement_get_status(IHTMLInputTextElement *iface, VARIANT *p)
1002 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1003 TRACE("(%p)->(%p)\n", This, p);
1004 return E_NOTIMPL;
1007 static HRESULT WINAPI HTMLInputTextElement_put_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1009 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1011 TRACE("(%p)->(%x)\n", This, v);
1013 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1016 static HRESULT WINAPI HTMLInputTextElement_get_disabled(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1018 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1020 TRACE("(%p)->(%p)\n", This, p);
1022 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1025 static HRESULT WINAPI HTMLInputTextElement_get_form(IHTMLInputTextElement *iface, IHTMLFormElement **p)
1027 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1029 TRACE("(%p)->(%p)\n", This, p);
1031 return IHTMLInputElement_get_form(&This->IHTMLInputElement_iface, p);
1034 static HRESULT WINAPI HTMLInputTextElement_put_defaultValue(IHTMLInputTextElement *iface, BSTR v)
1036 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1038 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1040 return IHTMLInputElement_put_defaultValue(&This->IHTMLInputElement_iface, v);
1043 static HRESULT WINAPI HTMLInputTextElement_get_defaultValue(IHTMLInputTextElement *iface, BSTR *p)
1045 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1047 TRACE("(%p)->(%p)\n", This, p);
1049 return IHTMLInputElement_get_defaultValue(&This->IHTMLInputElement_iface, p);
1052 static HRESULT WINAPI HTMLInputTextElement_put_size(IHTMLInputTextElement *iface, LONG v)
1054 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1056 TRACE("(%p)->(%d)\n", This, v);
1058 return IHTMLInputElement_put_size(&This->IHTMLInputElement_iface, v);
1061 static HRESULT WINAPI HTMLInputTextElement_get_size(IHTMLInputTextElement *iface, LONG *p)
1063 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1065 TRACE("(%p)->(%p)\n", This, p);
1067 return IHTMLInputElement_get_size(&This->IHTMLInputElement_iface, p);
1070 static HRESULT WINAPI HTMLInputTextElement_put_maxLength(IHTMLInputTextElement *iface, LONG v)
1072 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1074 TRACE("(%p)->(%d)\n", This, v);
1076 return IHTMLInputElement_put_maxLength(&This->IHTMLInputElement_iface, v);
1079 static HRESULT WINAPI HTMLInputTextElement_get_maxLength(IHTMLInputTextElement *iface, LONG *p)
1081 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1083 TRACE("(%p)->(%p)\n", This, p);
1085 return IHTMLInputElement_get_maxLength(&This->IHTMLInputElement_iface, p);
1088 static HRESULT WINAPI HTMLInputTextElement_select(IHTMLInputTextElement *iface)
1090 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1092 TRACE("(%p)\n", This);
1094 return IHTMLInputElement_select(&This->IHTMLInputElement_iface);
1097 static HRESULT WINAPI HTMLInputTextElement_put_onchange(IHTMLInputTextElement *iface, VARIANT v)
1099 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1101 TRACE("(%p)->()\n", This);
1103 return IHTMLInputElement_put_onchange(&This->IHTMLInputElement_iface, v);
1106 static HRESULT WINAPI HTMLInputTextElement_get_onchange(IHTMLInputTextElement *iface, VARIANT *p)
1108 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1110 TRACE("(%p)->(%p)\n", This, p);
1112 return IHTMLInputElement_get_onchange(&This->IHTMLInputElement_iface, p);
1115 static HRESULT WINAPI HTMLInputTextElement_put_onselect(IHTMLInputTextElement *iface, VARIANT v)
1117 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1119 TRACE("(%p)->()\n", This);
1121 return IHTMLInputElement_put_onselect(&This->IHTMLInputElement_iface, v);
1124 static HRESULT WINAPI HTMLInputTextElement_get_onselect(IHTMLInputTextElement *iface, VARIANT *p)
1126 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1128 TRACE("(%p)->(%p)\n", This, p);
1130 return IHTMLInputElement_get_onselect(&This->IHTMLInputElement_iface, p);
1133 static HRESULT WINAPI HTMLInputTextElement_put_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL v)
1135 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1137 TRACE("(%p)->(%x)\n", This, v);
1139 return IHTMLInputElement_put_readOnly(&This->IHTMLInputElement_iface, v);
1142 static HRESULT WINAPI HTMLInputTextElement_get_readOnly(IHTMLInputTextElement *iface, VARIANT_BOOL *p)
1144 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1146 TRACE("(%p)->(%p)\n", This, p);
1148 return IHTMLInputElement_get_readOnly(&This->IHTMLInputElement_iface, p);
1151 static HRESULT WINAPI HTMLInputTextElement_createTextRange(IHTMLInputTextElement *iface, IHTMLTxtRange **range)
1153 HTMLInputElement *This = impl_from_IHTMLInputTextElement(iface);
1155 TRACE("(%p)->(%p)\n", This, range);
1157 return IHTMLInputElement_createTextRange(&This->IHTMLInputElement_iface, range);
1160 static const IHTMLInputTextElementVtbl HTMLInputTextElementVtbl = {
1161 HTMLInputTextElement_QueryInterface,
1162 HTMLInputTextElement_AddRef,
1163 HTMLInputTextElement_Release,
1164 HTMLInputTextElement_GetTypeInfoCount,
1165 HTMLInputTextElement_GetTypeInfo,
1166 HTMLInputTextElement_GetIDsOfNames,
1167 HTMLInputTextElement_Invoke,
1168 HTMLInputTextElement_get_type,
1169 HTMLInputTextElement_put_value,
1170 HTMLInputTextElement_get_value,
1171 HTMLInputTextElement_put_name,
1172 HTMLInputTextElement_get_name,
1173 HTMLInputTextElement_put_status,
1174 HTMLInputTextElement_get_status,
1175 HTMLInputTextElement_put_disabled,
1176 HTMLInputTextElement_get_disabled,
1177 HTMLInputTextElement_get_form,
1178 HTMLInputTextElement_put_defaultValue,
1179 HTMLInputTextElement_get_defaultValue,
1180 HTMLInputTextElement_put_size,
1181 HTMLInputTextElement_get_size,
1182 HTMLInputTextElement_put_maxLength,
1183 HTMLInputTextElement_get_maxLength,
1184 HTMLInputTextElement_select,
1185 HTMLInputTextElement_put_onchange,
1186 HTMLInputTextElement_get_onchange,
1187 HTMLInputTextElement_put_onselect,
1188 HTMLInputTextElement_get_onselect,
1189 HTMLInputTextElement_put_readOnly,
1190 HTMLInputTextElement_get_readOnly,
1191 HTMLInputTextElement_createTextRange
1194 static inline HTMLInputElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
1196 return CONTAINING_RECORD(iface, HTMLInputElement, element.node);
1199 static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1201 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1203 *ppv = NULL;
1205 if(IsEqualGUID(&IID_IUnknown, riid)) {
1206 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1207 *ppv = &This->IHTMLInputElement_iface;
1208 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
1209 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
1210 *ppv = &This->IHTMLInputElement_iface;
1211 }else if(IsEqualGUID(&IID_IHTMLInputElement, riid)) {
1212 TRACE("(%p)->(IID_IHTMLInputElement %p)\n", This, ppv);
1213 *ppv = &This->IHTMLInputElement_iface;
1214 }else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
1215 TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
1216 *ppv = &This->IHTMLInputTextElement_iface;
1219 if(*ppv) {
1220 IUnknown_AddRef((IUnknown*)*ppv);
1221 return S_OK;
1224 return HTMLElement_QI(&This->element.node, riid, ppv);
1227 static HRESULT HTMLInputElementImpl_fire_event(HTMLDOMNode *iface, eventid_t eid, BOOL *handled)
1229 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1231 if(eid == EVENTID_CLICK) {
1232 nsresult nsres;
1234 *handled = TRUE;
1236 nsres = nsIDOMHTMLInputElement_Click(This->nsinput);
1237 if(NS_FAILED(nsres)) {
1238 ERR("Click failed: %08x\n", nsres);
1239 return E_FAIL;
1243 return S_OK;
1246 static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1248 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1249 return IHTMLInputElement_put_disabled(&This->IHTMLInputElement_iface, v);
1252 static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1254 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1255 return IHTMLInputElement_get_disabled(&This->IHTMLInputElement_iface, p);
1258 static void HTMLInputElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1260 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1262 if(This->nsinput)
1263 note_cc_edge((nsISupports*)This->nsinput, "This->nsinput", cb);
1266 static void HTMLInputElement_unlink(HTMLDOMNode *iface)
1268 HTMLInputElement *This = impl_from_HTMLDOMNode(iface);
1270 if(This->nsinput) {
1271 nsIDOMHTMLInputElement *nsinput = This->nsinput;
1273 This->nsinput = NULL;
1274 nsIDOMHTMLInputElement_Release(nsinput);
1278 static const NodeImplVtbl HTMLInputElementImplVtbl = {
1279 HTMLInputElement_QI,
1280 HTMLElement_destructor,
1281 HTMLElement_cpc,
1282 HTMLElement_clone,
1283 HTMLElement_handle_event,
1284 HTMLElement_get_attr_col,
1285 NULL,
1286 HTMLInputElementImpl_fire_event,
1287 HTMLInputElementImpl_put_disabled,
1288 HTMLInputElementImpl_get_disabled,
1289 NULL,
1290 NULL,
1291 NULL,
1292 NULL,
1293 NULL,
1294 HTMLInputElement_traverse,
1295 HTMLInputElement_unlink
1298 static const tid_t HTMLInputElement_iface_tids[] = {
1299 HTMLELEMENT_TIDS,
1300 IHTMLInputElement_tid,
1303 static dispex_static_data_t HTMLInputElement_dispex = {
1304 NULL,
1305 DispHTMLInputElement_tid,
1306 NULL,
1307 HTMLInputElement_iface_tids
1310 HRESULT HTMLInputElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1312 HTMLInputElement *ret;
1313 nsresult nsres;
1315 ret = heap_alloc_zero(sizeof(HTMLInputElement));
1316 if(!ret)
1317 return E_OUTOFMEMORY;
1319 ret->IHTMLInputElement_iface.lpVtbl = &HTMLInputElementVtbl;
1320 ret->IHTMLInputTextElement_iface.lpVtbl = &HTMLInputTextElementVtbl;
1321 ret->element.node.vtbl = &HTMLInputElementImplVtbl;
1323 HTMLElement_Init(&ret->element, doc, nselem, &HTMLInputElement_dispex);
1325 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, (void**)&ret->nsinput);
1326 assert(nsres == NS_OK);
1328 *elem = &ret->element;
1329 return S_OK;
1332 typedef struct {
1333 HTMLElement element;
1335 IHTMLLabelElement IHTMLLabelElement_iface;
1336 } HTMLLabelElement;
1338 static inline HTMLLabelElement *impl_from_IHTMLLabelElement(IHTMLLabelElement *iface)
1340 return CONTAINING_RECORD(iface, HTMLLabelElement, IHTMLLabelElement_iface);
1343 static HRESULT WINAPI HTMLLabelElement_QueryInterface(IHTMLLabelElement *iface,
1344 REFIID riid, void **ppv)
1346 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1348 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1351 static ULONG WINAPI HTMLLabelElement_AddRef(IHTMLLabelElement *iface)
1353 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1355 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1358 static ULONG WINAPI HTMLLabelElement_Release(IHTMLLabelElement *iface)
1360 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1362 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1365 static HRESULT WINAPI HTMLLabelElement_GetTypeInfoCount(IHTMLLabelElement *iface, UINT *pctinfo)
1367 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1369 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
1372 static HRESULT WINAPI HTMLLabelElement_GetTypeInfo(IHTMLLabelElement *iface, UINT iTInfo,
1373 LCID lcid, ITypeInfo **ppTInfo)
1375 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1377 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1380 static HRESULT WINAPI HTMLLabelElement_GetIDsOfNames(IHTMLLabelElement *iface, REFIID riid,
1381 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1383 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1385 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
1386 cNames, lcid, rgDispId);
1389 static HRESULT WINAPI HTMLLabelElement_Invoke(IHTMLLabelElement *iface, DISPID dispIdMember,
1390 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1391 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1393 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1395 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
1396 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1399 static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BSTR v)
1401 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1402 nsAString for_str, val_str;
1403 nsresult nsres;
1405 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1407 nsAString_InitDepend(&for_str, forW);
1408 nsAString_InitDepend(&val_str, v);
1409 nsres = nsIDOMHTMLElement_SetAttribute(This->element.nselem, &for_str, &val_str);
1410 nsAString_Finish(&for_str);
1411 nsAString_Finish(&val_str);
1412 if(NS_FAILED(nsres)) {
1413 ERR("SetAttribute failed: %08x\n", nsres);
1414 return E_FAIL;
1417 return S_OK;
1420 static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
1422 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1424 TRACE("(%p)->(%p)\n", This, p);
1426 return elem_string_attr_getter(&This->element, forW, FALSE, p);
1429 static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
1431 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1432 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1433 return E_NOTIMPL;
1436 static HRESULT WINAPI HTMLLabelElement_get_accessKey(IHTMLLabelElement *iface, BSTR *p)
1438 HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
1439 FIXME("(%p)->(%p)\n", This, p);
1440 return E_NOTIMPL;
1443 static const IHTMLLabelElementVtbl HTMLLabelElementVtbl = {
1444 HTMLLabelElement_QueryInterface,
1445 HTMLLabelElement_AddRef,
1446 HTMLLabelElement_Release,
1447 HTMLLabelElement_GetTypeInfoCount,
1448 HTMLLabelElement_GetTypeInfo,
1449 HTMLLabelElement_GetIDsOfNames,
1450 HTMLLabelElement_Invoke,
1451 HTMLLabelElement_put_htmlFor,
1452 HTMLLabelElement_get_htmlFor,
1453 HTMLLabelElement_put_accessKey,
1454 HTMLLabelElement_get_accessKey
1457 static inline HTMLLabelElement *label_from_HTMLDOMNode(HTMLDOMNode *iface)
1459 return CONTAINING_RECORD(iface, HTMLLabelElement, element.node);
1462 static HRESULT HTMLLabelElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1464 HTMLLabelElement *This = label_from_HTMLDOMNode(iface);
1466 *ppv = NULL;
1468 if(IsEqualGUID(&IID_IUnknown, riid)) {
1469 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1470 *ppv = &This->IHTMLLabelElement_iface;
1471 }else if(IsEqualGUID(&IID_IHTMLLabelElement, riid)) {
1472 TRACE("(%p)->(IID_IHTMLLabelElement %p)\n", This, ppv);
1473 *ppv = &This->IHTMLLabelElement_iface;
1474 }else {
1475 return HTMLElement_QI(&This->element.node, riid, ppv);
1478 IUnknown_AddRef((IUnknown*)*ppv);
1479 return S_OK;
1482 static const NodeImplVtbl HTMLLabelElementImplVtbl = {
1483 HTMLLabelElement_QI,
1484 HTMLElement_destructor,
1485 HTMLElement_cpc,
1486 HTMLElement_clone,
1487 HTMLElement_handle_event,
1488 HTMLElement_get_attr_col,
1491 static const tid_t HTMLLabelElement_iface_tids[] = {
1492 HTMLELEMENT_TIDS,
1493 IHTMLLabelElement_tid,
1497 static dispex_static_data_t HTMLLabelElement_dispex = {
1498 NULL,
1499 DispHTMLLabelElement_tid,
1500 NULL,
1501 HTMLLabelElement_iface_tids
1504 HRESULT HTMLLabelElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1506 HTMLLabelElement *ret;
1508 ret = heap_alloc_zero(sizeof(*ret));
1509 if(!ret)
1510 return E_OUTOFMEMORY;
1512 ret->IHTMLLabelElement_iface.lpVtbl = &HTMLLabelElementVtbl;
1513 ret->element.node.vtbl = &HTMLLabelElementImplVtbl;
1515 HTMLElement_Init(&ret->element, doc, nselem, &HTMLLabelElement_dispex);
1516 *elem = &ret->element;
1517 return S_OK;
1520 typedef struct {
1521 HTMLElement element;
1523 IHTMLButtonElement IHTMLButtonElement_iface;
1525 nsIDOMHTMLButtonElement *nsbutton;
1526 } HTMLButtonElement;
1528 static inline HTMLButtonElement *impl_from_IHTMLButtonElement(IHTMLButtonElement *iface)
1530 return CONTAINING_RECORD(iface, HTMLButtonElement, IHTMLButtonElement_iface);
1533 static HRESULT WINAPI HTMLButtonElement_QueryInterface(IHTMLButtonElement *iface,
1534 REFIID riid, void **ppv)
1536 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1538 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
1541 static ULONG WINAPI HTMLButtonElement_AddRef(IHTMLButtonElement *iface)
1543 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1545 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
1548 static ULONG WINAPI HTMLButtonElement_Release(IHTMLButtonElement *iface)
1550 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1552 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
1555 static HRESULT WINAPI HTMLButtonElement_GetTypeInfoCount(IHTMLButtonElement *iface, UINT *pctinfo)
1557 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1559 return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
1562 static HRESULT WINAPI HTMLButtonElement_GetTypeInfo(IHTMLButtonElement *iface, UINT iTInfo,
1563 LCID lcid, ITypeInfo **ppTInfo)
1565 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1567 return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1570 static HRESULT WINAPI HTMLButtonElement_GetIDsOfNames(IHTMLButtonElement *iface, REFIID riid,
1571 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
1573 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1575 return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
1576 cNames, lcid, rgDispId);
1579 static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID dispIdMember,
1580 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1581 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1583 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1585 return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
1586 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1589 static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p)
1591 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1592 FIXME("(%p)->(%p)\n", This, p);
1593 return E_NOTIMPL;
1596 static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v)
1598 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1599 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
1600 return E_NOTIMPL;
1603 static HRESULT WINAPI HTMLButtonElement_get_value(IHTMLButtonElement *iface, BSTR *p)
1605 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1606 FIXME("(%p)->(%p)\n", This, p);
1607 return E_NOTIMPL;
1610 static HRESULT WINAPI HTMLButtonElement_put_name(IHTMLButtonElement *iface, BSTR v)
1612 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1613 nsAString name_str;
1614 nsresult nsres;
1616 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
1618 nsAString_InitDepend(&name_str, v);
1619 nsres = nsIDOMHTMLButtonElement_SetName(This->nsbutton, &name_str);
1620 nsAString_Finish(&name_str);
1621 if(NS_FAILED(nsres)) {
1622 ERR("SetName failed: %08x\n", nsres);
1623 return E_FAIL;
1626 return S_OK;
1629 static HRESULT WINAPI HTMLButtonElement_get_name(IHTMLButtonElement *iface, BSTR *p)
1631 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1632 nsAString name_str;
1633 nsresult nsres;
1635 TRACE("(%p)->(%p)\n", This, p);
1637 nsAString_Init(&name_str, NULL);
1638 nsres = nsIDOMHTMLButtonElement_GetName(This->nsbutton, &name_str);
1639 return return_nsstr(nsres, &name_str, p);
1642 static HRESULT WINAPI HTMLButtonElement_put_status(IHTMLButtonElement *iface, VARIANT v)
1644 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1645 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1646 return E_NOTIMPL;
1649 static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VARIANT *p)
1651 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1652 FIXME("(%p)->(%p)\n", This, p);
1653 return E_NOTIMPL;
1656 static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
1658 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1659 nsresult nsres;
1661 TRACE("(%p)->(%x)\n", This, v);
1663 nsres = nsIDOMHTMLButtonElement_SetDisabled(This->nsbutton, !!v);
1664 if(NS_FAILED(nsres)) {
1665 ERR("SetDisabled failed: %08x\n", nsres);
1666 return E_FAIL;
1669 return S_OK;
1672 static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
1674 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1675 cpp_bool disabled;
1676 nsresult nsres;
1678 TRACE("(%p)->(%p)\n", This, p);
1680 nsres = nsIDOMHTMLButtonElement_GetDisabled(This->nsbutton, &disabled);
1681 if(NS_FAILED(nsres)) {
1682 ERR("GetDisabled failed: %08x\n", nsres);
1683 return E_FAIL;
1686 *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
1687 return S_OK;
1690 static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
1692 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1693 FIXME("(%p)->(%p)\n", This, p);
1694 return E_NOTIMPL;
1697 static HRESULT WINAPI HTMLButtonElement_createTextRange(IHTMLButtonElement *iface, IHTMLTxtRange **range)
1699 HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
1700 FIXME("(%p)->(%p)\n", This, range);
1701 return E_NOTIMPL;
1704 static const IHTMLButtonElementVtbl HTMLButtonElementVtbl = {
1705 HTMLButtonElement_QueryInterface,
1706 HTMLButtonElement_AddRef,
1707 HTMLButtonElement_Release,
1708 HTMLButtonElement_GetTypeInfoCount,
1709 HTMLButtonElement_GetTypeInfo,
1710 HTMLButtonElement_GetIDsOfNames,
1711 HTMLButtonElement_Invoke,
1712 HTMLButtonElement_get_type,
1713 HTMLButtonElement_put_value,
1714 HTMLButtonElement_get_value,
1715 HTMLButtonElement_put_name,
1716 HTMLButtonElement_get_name,
1717 HTMLButtonElement_put_status,
1718 HTMLButtonElement_get_status,
1719 HTMLButtonElement_put_disabled,
1720 HTMLButtonElement_get_disabled,
1721 HTMLButtonElement_get_form,
1722 HTMLButtonElement_createTextRange
1725 static inline HTMLButtonElement *button_from_HTMLDOMNode(HTMLDOMNode *iface)
1727 return CONTAINING_RECORD(iface, HTMLButtonElement, element.node);
1730 static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
1732 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1734 *ppv = NULL;
1736 if(IsEqualGUID(&IID_IUnknown, riid)) {
1737 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1738 *ppv = &This->IHTMLButtonElement_iface;
1739 }else if(IsEqualGUID(&IID_IHTMLButtonElement, riid)) {
1740 TRACE("(%p)->(IID_IHTMLButtonElement %p)\n", This, ppv);
1741 *ppv = &This->IHTMLButtonElement_iface;
1742 }else {
1743 return HTMLElement_QI(&This->element.node, riid, ppv);
1746 IUnknown_AddRef((IUnknown*)*ppv);
1747 return S_OK;
1750 static HRESULT HTMLButtonElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
1752 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1753 return IHTMLButtonElement_put_disabled(&This->IHTMLButtonElement_iface, v);
1756 static HRESULT HTMLButtonElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
1758 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1759 return IHTMLButtonElement_get_disabled(&This->IHTMLButtonElement_iface, p);
1762 static void HTMLButtonElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
1764 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1766 if(This->nsbutton)
1767 note_cc_edge((nsISupports*)This->nsbutton, "This->nsbutton", cb);
1770 static void HTMLButtonElement_unlink(HTMLDOMNode *iface)
1772 HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
1774 if(This->nsbutton) {
1775 nsIDOMHTMLButtonElement *nsbutton = This->nsbutton;
1777 This->nsbutton = NULL;
1778 nsIDOMHTMLButtonElement_Release(nsbutton);
1782 static const NodeImplVtbl HTMLButtonElementImplVtbl = {
1783 HTMLButtonElement_QI,
1784 HTMLElement_destructor,
1785 HTMLElement_cpc,
1786 HTMLElement_clone,
1787 HTMLElement_handle_event,
1788 HTMLElement_get_attr_col,
1789 NULL,
1790 NULL,
1791 HTMLButtonElementImpl_put_disabled,
1792 HTMLButtonElementImpl_get_disabled,
1793 NULL,
1794 NULL,
1795 NULL,
1796 NULL,
1797 NULL,
1798 HTMLButtonElement_traverse,
1799 HTMLButtonElement_unlink
1802 static const tid_t HTMLButtonElement_iface_tids[] = {
1803 HTMLELEMENT_TIDS,
1804 IHTMLButtonElement_tid,
1808 static dispex_static_data_t HTMLButtonElement_dispex = {
1809 NULL,
1810 DispHTMLButtonElement_tid,
1811 NULL,
1812 HTMLButtonElement_iface_tids
1815 HRESULT HTMLButtonElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
1817 HTMLButtonElement *ret;
1818 nsresult nsres;
1820 ret = heap_alloc_zero(sizeof(*ret));
1821 if(!ret)
1822 return E_OUTOFMEMORY;
1824 ret->IHTMLButtonElement_iface.lpVtbl = &HTMLButtonElementVtbl;
1825 ret->element.node.vtbl = &HTMLButtonElementImplVtbl;
1827 HTMLElement_Init(&ret->element, doc, nselem, &HTMLButtonElement_dispex);
1829 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLButtonElement, (void**)&ret->nsbutton);
1830 assert(nsres == NS_OK);
1832 *elem = &ret->element;
1833 return S_OK;