ReactOS 0.4.15-dev-7897-g78dc504
htmlform.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Andrew Eikum for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "mshtml_private.h"
20
23
24 IHTMLFormElement IHTMLFormElement_iface;
25
27};
28
30{
31 nsIDOMHTMLCollection *elements;
34 nsresult nsres;
36
37 nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
38 if(NS_FAILED(nsres)) {
39 FIXME("GetElements failed: 0x%08x\n", nsres);
40 return E_FAIL;
41 }
42
43 nsres = nsIDOMHTMLCollection_Item(elements, i, &item);
44 nsIDOMHTMLCollection_Release(elements);
45 if(NS_FAILED(nsres)) {
46 FIXME("Item failed: 0x%08x\n", nsres);
47 return E_FAIL;
48 }
49
50 if(item) {
51 hres = get_node(This->element.node.doc, item, TRUE, &node);
52 if(FAILED(hres))
53 return hres;
54
55 nsIDOMNode_Release(item);
56 *ret = (IDispatch*)&node->IHTMLDOMNode_iface;
57 }else {
58 *ret = NULL;
59 }
60
61 return S_OK;
62}
63
64static inline HTMLFormElement *impl_from_IHTMLFormElement(IHTMLFormElement *iface)
65{
66 return CONTAINING_RECORD(iface, HTMLFormElement, IHTMLFormElement_iface);
67}
68
69static HRESULT WINAPI HTMLFormElement_QueryInterface(IHTMLFormElement *iface,
70 REFIID riid, void **ppv)
71{
73
74 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
75}
76
77static ULONG WINAPI HTMLFormElement_AddRef(IHTMLFormElement *iface)
78{
80
81 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
82}
83
84static ULONG WINAPI HTMLFormElement_Release(IHTMLFormElement *iface)
85{
87
88 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
89}
90
91static HRESULT WINAPI HTMLFormElement_GetTypeInfoCount(IHTMLFormElement *iface, UINT *pctinfo)
92{
94 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
95}
96
97static HRESULT WINAPI HTMLFormElement_GetTypeInfo(IHTMLFormElement *iface, UINT iTInfo,
98 LCID lcid, ITypeInfo **ppTInfo)
99{
101 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
102 ppTInfo);
103}
104
106 LPOLESTR *rgszNames, UINT cNames,
107 LCID lcid, DISPID *rgDispId)
108{
110 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
111 cNames, lcid, rgDispId);
112}
113
114static HRESULT WINAPI HTMLFormElement_Invoke(IHTMLFormElement *iface, DISPID dispIdMember,
115 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
116 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
117{
119 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
120 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
121}
122
123static HRESULT WINAPI HTMLFormElement_put_action(IHTMLFormElement *iface, BSTR v)
124{
126 nsAString action_str;
127 nsresult nsres;
128
129 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
130
131 nsAString_InitDepend(&action_str, v);
132 nsres = nsIDOMHTMLFormElement_SetAction(This->nsform, &action_str);
133 nsAString_Finish(&action_str);
134 if(NS_FAILED(nsres)) {
135 ERR("SetAction failed: %08x\n", nsres);
136 return E_FAIL;
137 }
138
139 return S_OK;
140}
141
142static HRESULT WINAPI HTMLFormElement_get_action(IHTMLFormElement *iface, BSTR *p)
143{
145 nsAString action_str;
146 nsresult nsres;
148
149 TRACE("(%p)->(%p)\n", This, p);
150
151 nsAString_Init(&action_str, NULL);
152 nsres = nsIDOMHTMLFormElement_GetAction(This->nsform, &action_str);
153 if(NS_SUCCEEDED(nsres)) {
154 const PRUnichar *action;
155 nsAString_GetData(&action_str, &action);
157 }else {
158 ERR("GetAction failed: %08x\n", nsres);
159 hres = E_FAIL;
160 }
161
162 nsAString_Finish(&action_str);
163 return hres;
164}
165
166static HRESULT WINAPI HTMLFormElement_put_dir(IHTMLFormElement *iface, BSTR v)
167{
169 FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
170 return E_NOTIMPL;
171}
172
173static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
174{
176 FIXME("(%p)->(%p)\n", This, p);
177 return E_NOTIMPL;
178}
179
180static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v)
181{
182 static const WCHAR urlencodedW[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
183 'x','-','w','w','w','-','f','o','r','m','-','u','r','l','e','n','c','o','d','e','d',0};
184 static const WCHAR dataW[] = {'m','u','l','t','i','p','a','r','t','/',
185 'f','o','r','m','-','d','a','t','a',0};
186 static const WCHAR plainW[] = {'t','e','x','t','/','p','l','a','i','n',0};
187
189 nsAString encoding_str;
190 nsresult nsres;
191
192 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
193
194 if(lstrcmpiW(v, urlencodedW) && lstrcmpiW(v, dataW) && lstrcmpiW(v, plainW)) {
195 WARN("incorrect enctype\n");
196 return E_INVALIDARG;
197 }
198
199 nsAString_InitDepend(&encoding_str, v);
200 nsres = nsIDOMHTMLFormElement_SetEnctype(This->nsform, &encoding_str);
201 nsAString_Finish(&encoding_str);
202 if(NS_FAILED(nsres))
203 return E_FAIL;
204
205 return S_OK;
206}
207
208static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR *p)
209{
211 nsAString encoding_str;
212 nsresult nsres;
213
214 TRACE("(%p)->(%p)\n", This, p);
215
216 nsAString_Init(&encoding_str, NULL);
217 nsres = nsIDOMHTMLFormElement_GetEnctype(This->nsform, &encoding_str);
218 return return_nsstr(nsres, &encoding_str, p);
219}
220
221static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
222{
223 static const WCHAR postW[] = {'P','O','S','T',0};
224 static const WCHAR getW[] = {'G','E','T',0};
225
227 nsAString method_str;
228 nsresult nsres;
229
230 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
231
232 if(lstrcmpiW(v, postW) && lstrcmpiW(v, getW)) {
233 WARN("unrecognized method\n");
234 return E_INVALIDARG;
235 }
236
237 nsAString_InitDepend(&method_str, v);
238 nsres = nsIDOMHTMLFormElement_SetMethod(This->nsform, &method_str);
239 nsAString_Finish(&method_str);
240 if(NS_FAILED(nsres))
241 return E_FAIL;
242
243 return S_OK;
244}
245
246static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *p)
247{
249 nsAString method_str;
250 nsresult nsres;
251
252 TRACE("(%p)->(%p)\n", This, p);
253
254 nsAString_Init(&method_str, NULL);
255 nsres = nsIDOMHTMLFormElement_GetMethod(This->nsform, &method_str);
256 return return_nsstr(nsres, &method_str, p);
257}
258
259static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch **p)
260{
262
263 TRACE("(%p)->(%p)\n", This, p);
264
265 *p = (IDispatch*)&This->IHTMLFormElement_iface;
266 IDispatch_AddRef(*p);
267 return S_OK;
268}
269
270static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
271{
274 nsresult nsres;
275
276 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
277
279
280 nsres = nsIDOMHTMLFormElement_SetTarget(This->nsform, &str);
281
283 if (NS_FAILED(nsres)) {
284 ERR("Set Target(%s) failed: %08x\n", wine_dbgstr_w(v), nsres);
285 return E_FAIL;
286 }
287
288 return S_OK;
289}
290
291static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p)
292{
295 nsresult nsres;
296
297 TRACE("(%p)->(%p)\n", This, p);
298
300 nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &str);
301
302 return return_nsstr(nsres, &str, p);
303}
304
305static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v)
306{
308 nsAString name_str;
309 nsresult nsres;
310
311 TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
312
313 nsAString_InitDepend(&name_str, v);
314 nsres = nsIDOMHTMLFormElement_SetName(This->nsform, &name_str);
315 nsAString_Finish(&name_str);
316 if(NS_FAILED(nsres))
317 return E_FAIL;
318
319 return S_OK;
320}
321
322static HRESULT WINAPI HTMLFormElement_get_name(IHTMLFormElement *iface, BSTR *p)
323{
325 nsAString name_str;
326 nsresult nsres;
327
328 TRACE("(%p)->(%p)\n", This, p);
329
330 nsAString_Init(&name_str, NULL);
331 nsres = nsIDOMHTMLFormElement_GetName(This->nsform, &name_str);
332 return return_nsstr(nsres, &name_str, p);
333}
334
335static HRESULT WINAPI HTMLFormElement_put_onsubmit(IHTMLFormElement *iface, VARIANT v)
336{
338
339 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
340
341 return set_node_event(&This->element.node, EVENTID_SUBMIT, &v);
342}
343
344static HRESULT WINAPI HTMLFormElement_get_onsubmit(IHTMLFormElement *iface, VARIANT *p)
345{
347
348 TRACE("(%p)->(%p)\n", This, p);
349
350 return get_node_event(&This->element.node, EVENTID_SUBMIT, p);
351}
352
353static HRESULT WINAPI HTMLFormElement_put_onreset(IHTMLFormElement *iface, VARIANT v)
354{
356 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
357 return E_NOTIMPL;
358}
359
360static HRESULT WINAPI HTMLFormElement_get_onreset(IHTMLFormElement *iface, VARIANT *p)
361{
363 FIXME("(%p)->(%p)\n", This, p);
364 return E_NOTIMPL;
365}
366
367static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface)
368{
370 HTMLOuterWindow *window = NULL, *this_window = NULL;
371 nsAString action_uri_str, target_str, method_str;
372 nsIInputStream *post_stream;
373 BOOL is_post_submit = FALSE;
374 IUri *uri;
375 nsresult nsres;
377 BOOL use_new_window = FALSE;
378
379 TRACE("(%p)\n", This);
380
381 if(This->element.node.doc) {
382 HTMLDocumentNode *doc = This->element.node.doc;
383 if(doc->window && doc->window->base.outer_window)
384 this_window = doc->window->base.outer_window;
385 }
386 if(!this_window) {
387 TRACE("No outer window\n");
388 return S_OK;
389 }
390
391 nsAString_Init(&target_str, NULL);
392 nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &target_str);
393 if(NS_SUCCEEDED(nsres))
394 window = get_target_window(this_window, &target_str, &use_new_window);
395
396 if(!window && !use_new_window) {
397 nsAString_Finish(&target_str);
398 return S_OK;
399 }
400
401 nsAString_Init(&method_str, NULL);
402 nsres = nsIDOMHTMLFormElement_GetMethod(This->nsform, &method_str);
403 if(NS_SUCCEEDED(nsres)) {
404 const PRUnichar *method;
405
406 static const PRUnichar postW[] = {'p','o','s','t',0};
407
408 nsAString_GetData(&method_str, &method);
409 TRACE("method is %s\n", debugstr_w(method));
410 is_post_submit = !strcmpiW(method, postW);
411 }
412 nsAString_Finish(&method_str);
413
414 /*
415 * FIXME: We currently use our submit implementation for POST submit. We should always use it.
416 */
417 if(window && !is_post_submit) {
418 nsres = nsIDOMHTMLFormElement_Submit(This->nsform);
419 nsAString_Finish(&target_str);
420 IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
421 if(NS_FAILED(nsres)) {
422 ERR("Submit failed: %08x\n", nsres);
423 return E_FAIL;
424 }
425
426 return S_OK;
427 }
428
429 nsAString_Init(&action_uri_str, NULL);
430 nsres = nsIDOMHTMLFormElement_GetFormData(This->nsform, NULL, &action_uri_str, &post_stream);
431 if(NS_SUCCEEDED(nsres)) {
432 const PRUnichar *action_uri;
433
434 nsAString_GetData(&action_uri_str, &action_uri);
435 hres = create_uri(action_uri, 0, &uri);
436 }else {
437 ERR("GetFormData failed: %08x\n", nsres);
438 hres = E_FAIL;
439 }
440 nsAString_Finish(&action_uri_str);
441 if(SUCCEEDED(hres)) {
442 const PRUnichar *target;
443
444 nsAString_GetData(&target_str, &target);
445 hres = submit_form(window, target, uri, post_stream);
446 IUri_Release(uri);
447 }
448
449 nsAString_Finish(&target_str);
450 if(window)
451 IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
452 if(post_stream)
453 nsIInputStream_Release(post_stream);
454 return hres;
455}
456
457static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface)
458{
460 nsresult nsres;
461
462 TRACE("(%p)->()\n", This);
463 nsres = nsIDOMHTMLFormElement_Reset(This->nsform);
464 if (NS_FAILED(nsres)) {
465 ERR("Reset failed: %08x\n", nsres);
466 return E_FAIL;
467 }
468
469 return S_OK;
470}
471
472static HRESULT WINAPI HTMLFormElement_put_length(IHTMLFormElement *iface, LONG v)
473{
475 FIXME("(%p)->(%d)\n", This, v);
476 return E_NOTIMPL;
477}
478
479static HRESULT WINAPI HTMLFormElement_get_length(IHTMLFormElement *iface, LONG *p)
480{
482 nsresult nsres;
483
484 TRACE("(%p)->(%p)\n", This, p);
485
486 nsres = nsIDOMHTMLFormElement_GetLength(This->nsform, p);
487 if(NS_FAILED(nsres)) {
488 ERR("GetLength failed: %08x\n", nsres);
489 return E_FAIL;
490 }
491
492 return S_OK;
493}
494
495static HRESULT WINAPI HTMLFormElement__newEnum(IHTMLFormElement *iface, IUnknown **p)
496{
498 FIXME("(%p)->(%p)\n", This, p);
499 return E_NOTIMPL;
500}
501
502static HRESULT WINAPI HTMLFormElement_item(IHTMLFormElement *iface, VARIANT name,
503 VARIANT index, IDispatch **pdisp)
504{
506
507 TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&name), debugstr_variant(&index), pdisp);
508
509 if(!pdisp)
510 return E_INVALIDARG;
511 *pdisp = NULL;
512
513 if(V_VT(&name) == VT_I4) {
514 if(V_I4(&name) < 0)
515 return E_INVALIDARG;
516 return htmlform_item(This, V_I4(&name), pdisp);
517 }
518
519 FIXME("Unsupported args\n");
520 return E_NOTIMPL;
521}
522
523static HRESULT WINAPI HTMLFormElement_tags(IHTMLFormElement *iface, VARIANT tagName,
524 IDispatch **pdisp)
525{
527 FIXME("(%p)->(v %p)\n", This, pdisp);
528 return E_NOTIMPL;
529}
530
531static const IHTMLFormElementVtbl HTMLFormElementVtbl = {
563};
564
566{
567 return CONTAINING_RECORD(iface, HTMLFormElement, element.node);
568}
569
571{
573
574 *ppv = NULL;
575
577 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
578 *ppv = &This->IHTMLFormElement_iface;
579 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
580 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
581 *ppv = &This->IHTMLFormElement_iface;
582 }else if(IsEqualGUID(&IID_IHTMLFormElement, riid)) {
583 TRACE("(%p)->(IID_IHTMLFormElement %p)\n", This, ppv);
584 *ppv = &This->IHTMLFormElement_iface;
585 }else if(IsEqualGUID(&DIID_DispHTMLFormElement, riid)) {
586 TRACE("(%p)->(DIID_DispHTMLFormElement %p)\n", This, ppv);
587 *ppv = &This->IHTMLFormElement_iface;
588 }
589
590 if(*ppv) {
591 IUnknown_AddRef((IUnknown*)*ppv);
592 return S_OK;
593 }
594
595 return HTMLElement_QI(&This->element.node, riid, ppv);
596}
597
599 BSTR name, DWORD grfdex, DISPID *pid)
600{
602 nsIDOMHTMLCollection *elements;
603 nsAString nsstr, name_str;
604 UINT32 len, i;
605 nsresult nsres;
607
608 static const PRUnichar nameW[] = {'n','a','m','e',0};
609
610 TRACE("(%p)->(%s %x %p)\n", This, wine_dbgstr_w(name), grfdex, pid);
611
612 nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
613 if(NS_FAILED(nsres)) {
614 FIXME("GetElements failed: 0x%08x\n", nsres);
615 return E_FAIL;
616 }
617
618 nsres = nsIDOMHTMLCollection_GetLength(elements, &len);
619 if(NS_FAILED(nsres)) {
620 FIXME("GetLength failed: 0x%08x\n", nsres);
621 nsIDOMHTMLCollection_Release(elements);
622 return E_FAIL;
623 }
624
627
628 /* FIXME: Implement in more generic way */
629 if('0' <= *name && *name <= '9') {
630 WCHAR *end_ptr;
631
632 i = strtoulW(name, &end_ptr, 10);
633 if(!*end_ptr && i < len) {
635 return S_OK;
636 }
637 }
638
639 nsAString_Init(&nsstr, NULL);
640 for(i = 0; i < len; ++i) {
641 nsIDOMNode *nsitem;
642 nsIDOMHTMLElement *nshtml_elem;
643 const PRUnichar *str;
644
645 nsres = nsIDOMHTMLCollection_Item(elements, i, &nsitem);
646 if(NS_FAILED(nsres)) {
647 FIXME("Item failed: 0x%08x\n", nsres);
648 hres = E_FAIL;
649 break;
650 }
651
652 nsres = nsIDOMNode_QueryInterface(nsitem, &IID_nsIDOMHTMLElement, (void**)&nshtml_elem);
653 nsIDOMNode_Release(nsitem);
654 if(NS_FAILED(nsres)) {
655 FIXME("Failed to get nsIDOMHTMLNode interface: 0x%08x\n", nsres);
656 hres = E_FAIL;
657 break;
658 }
659
660 /* compare by id attr */
661 nsres = nsIDOMHTMLElement_GetId(nshtml_elem, &nsstr);
662 if(NS_FAILED(nsres)) {
663 FIXME("GetId failed: 0x%08x\n", nsres);
664 nsIDOMHTMLElement_Release(nshtml_elem);
665 hres = E_FAIL;
666 break;
667 }
668 nsAString_GetData(&nsstr, &str);
669 if(!strcmpiW(str, name)) {
670 nsIDOMHTMLElement_Release(nshtml_elem);
671 /* FIXME: using index for dispid */
673 hres = S_OK;
674 break;
675 }
676
677 /* compare by name attr */
678 nsres = get_elem_attr_value(nshtml_elem, nameW, &name_str, &str);
679 nsIDOMHTMLElement_Release(nshtml_elem);
680 if(NS_SUCCEEDED(nsres)) {
681 if(!strcmpiW(str, name)) {
682 nsAString_Finish(&name_str);
683 /* FIXME: using index for dispid */
685 hres = S_OK;
686 break;
687 }
688 nsAString_Finish(&name_str);
689 }
690 }
691
692 nsAString_Finish(&nsstr);
693 nsIDOMHTMLCollection_Release(elements);
694 return hres;
695}
696
698 DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res,
699 EXCEPINFO *ei, IServiceProvider *caller)
700{
702 IDispatch *ret;
704
705 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
706
708 if(FAILED(hres))
709 return hres;
710
711 if(ret) {
713 V_DISPATCH(res) = ret;
714 }else {
715 V_VT(res) = VT_NULL;
716 }
717 return S_OK;
718}
719
721{
723
724 if(eid == EVENTID_SUBMIT) {
725 *prevent_default = TRUE;
726 return IHTMLFormElement_submit(&This->IHTMLFormElement_iface);
727 }
728
729 return HTMLElement_handle_event(&This->element.node, eid, event, prevent_default);
730}
731
733{
735
736 if(This->nsform)
737 note_cc_edge((nsISupports*)This->nsform, "This->nsform", cb);
738}
739
741{
743
744 if(This->nsform) {
745 nsIDOMHTMLFormElement *nsform = This->nsform;
746
747 This->nsform = NULL;
748 nsIDOMHTMLFormElement_Release(nsform);
749 }
750}
751
759 NULL,
760 NULL,
761 NULL,
762 NULL,
763 NULL,
764 NULL,
767 NULL,
770};
771
774 IHTMLFormElement_tid,
775 0
776};
777
779 NULL,
780 DispHTMLFormElement_tid,
781 NULL,
783};
784
786{
788 nsresult nsres;
789
790 ret = heap_alloc_zero(sizeof(HTMLFormElement));
791 if(!ret)
792 return E_OUTOFMEMORY;
793
794 ret->IHTMLFormElement_iface.lpVtbl = &HTMLFormElementVtbl;
795 ret->element.node.vtbl = &HTMLFormElementImplVtbl;
796
797 HTMLElement_Init(&ret->element, doc, nselem, &HTMLFormElement_dispex);
798
799 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFormElement, (void**)&ret->nsform);
800 assert(nsres == NS_OK);
801
802 *elem = &ret->element;
803 return S_OK;
804}
unsigned int UINT32
static const WCHAR nameW[]
Definition: main.c:46
const GUID IID_IUnknown
HRESULT submit_form(HTMLOuterWindow *, const WCHAR *, IUri *, nsIInputStream *) DECLSPEC_HIDDEN
Definition: navigate.c:2361
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:158
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
OLECHAR * BSTR
Definition: compat.h:2293
@ VT_NULL
Definition: compat.h:2296
@ VT_I4
Definition: compat.h:2298
@ VT_DISPATCH
Definition: compat.h:2304
static const WCHAR getW[]
Definition: object.c:50
const WCHAR * action
Definition: action.c:7479
#define assert(x)
Definition: debug.h:53
method
Definition: dragdrop.c:54
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
const GLdouble * v
Definition: gl.h:2040
struct _cl_event * event
Definition: glext.h:7739
GLuint res
Definition: glext.h:9613
GLuint index
Definition: glext.h:6031
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLenum target
Definition: glext.h:7315
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HTMLOuterWindow * get_target_window(HTMLOuterWindow *window, nsAString *target_str, BOOL *use_new_window)
Definition: htmlanchor.c:45
nsresult get_elem_attr_value(nsIDOMHTMLElement *nselem, const WCHAR *name, nsAString *val_str, const PRUnichar **val)
Definition: htmlelem.c:143
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
@ EVENTID_SUBMIT
Definition: htmlevent.h:51
static HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
Definition: htmlevent.h:85
static HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
Definition: htmlevent.h:80
static HRESULT WINAPI HTMLFormElement_item(IHTMLFormElement *iface, VARIANT name, VARIANT index, IDispatch **pdisp)
Definition: htmlform.c:502
static HRESULT WINAPI HTMLFormElement_tags(IHTMLFormElement *iface, VARIANT tagName, IDispatch **pdisp)
Definition: htmlform.c:523
static HRESULT WINAPI HTMLFormElement_get_action(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:142
static HRESULT htmlform_item(HTMLFormElement *This, int i, IDispatch **ret)
Definition: htmlform.c:29
static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:180
static HRESULT WINAPI HTMLFormElement_put_onsubmit(IHTMLFormElement *iface, VARIANT v)
Definition: htmlform.c:335
static HRESULT WINAPI HTMLFormElement_put_onreset(IHTMLFormElement *iface, VARIANT v)
Definition: htmlform.c:353
static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface, BSTR name, DWORD grfdex, DISPID *pid)
Definition: htmlform.c:598
static const NodeImplVtbl HTMLFormElementImplVtbl
Definition: htmlform.c:752
static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:291
static HRESULT WINAPI HTMLFormElement_GetIDsOfNames(IHTMLFormElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlform.c:105
static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface)
Definition: htmlform.c:457
static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch **p)
Definition: htmlform.c:259
static void HTMLFormElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
Definition: htmlform.c:732
static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:270
static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:246
static HRESULT WINAPI HTMLFormElement_GetTypeInfoCount(IHTMLFormElement *iface, UINT *pctinfo)
Definition: htmlform.c:91
static HTMLFormElement * impl_from_IHTMLFormElement(IHTMLFormElement *iface)
Definition: htmlform.c:64
static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:221
static ULONG WINAPI HTMLFormElement_Release(IHTMLFormElement *iface)
Definition: htmlform.c:84
static HRESULT WINAPI HTMLFormElement_GetTypeInfo(IHTMLFormElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlform.c:97
static const tid_t HTMLFormElement_iface_tids[]
Definition: htmlform.c:772
static HRESULT WINAPI HTMLFormElement__newEnum(IHTMLFormElement *iface, IUnknown **p)
Definition: htmlform.c:495
static const IHTMLFormElementVtbl HTMLFormElementVtbl
Definition: htmlform.c:531
static HRESULT WINAPI HTMLFormElement_put_length(IHTMLFormElement *iface, LONG v)
Definition: htmlform.c:472
static HRESULT WINAPI HTMLFormElement_get_name(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:322
static dispex_static_data_t HTMLFormElement_dispex
Definition: htmlform.c:778
static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface)
Definition: htmlform.c:367
static HRESULT HTMLFormElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlform.c:570
static HRESULT WINAPI HTMLFormElement_get_onsubmit(IHTMLFormElement *iface, VARIANT *p)
Definition: htmlform.c:344
static HRESULT WINAPI HTMLFormElement_Invoke(IHTMLFormElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlform.c:114
static void HTMLFormElement_unlink(HTMLDOMNode *iface)
Definition: htmlform.c:740
static HRESULT WINAPI HTMLFormElement_put_dir(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:166
static HRESULT WINAPI HTMLFormElement_put_action(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:123
static ULONG WINAPI HTMLFormElement_AddRef(IHTMLFormElement *iface)
Definition: htmlform.c:77
static HRESULT WINAPI HTMLFormElement_QueryInterface(IHTMLFormElement *iface, REFIID riid, void **ppv)
Definition: htmlform.c:69
static HTMLFormElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlform.c:565
static HRESULT WINAPI HTMLFormElement_get_length(IHTMLFormElement *iface, LONG *p)
Definition: htmlform.c:479
static HRESULT HTMLFormElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlform.c:720
static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v)
Definition: htmlform.c:305
static HRESULT WINAPI HTMLFormElement_get_onreset(IHTMLFormElement *iface, VARIANT *p)
Definition: htmlform.c:360
static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:173
static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR *p)
Definition: htmlform.c:208
HRESULT HTMLFormElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlform.c:785
static HRESULT HTMLFormElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
Definition: htmlform.c:697
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
HRESULT hres
Definition: protocol.c:465
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static IHTMLWindow2 * window
Definition: events.c:77
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
const char * uri
Definition: sec_mgr.c:1588
static ATOM item
Definition: dde.c:856
#define NS_OK
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
#define MSHTML_CUSTOM_DISPID_CNT
#define HTMLELEMENT_TIDS
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
HRESULT nsuri_to_url(LPCWSTR, BOOL, BSTR *) DECLSPEC_HIDDEN
Definition: nsio.c:175
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
#define MSHTML_DISPID_CUSTOM_MIN
#define NS_SUCCEEDED(res)
#define NS_FAILED(res)
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
unsigned int UINT
Definition: ndis.h:50
WCHAR PRUnichar
Definition: nsiface.idl:48
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
const GUID IID_IDispatch
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define strcmpiW(s1, s2)
Definition: unicode.h:39
#define strtoulW(s1, s2, b)
Definition: unicode.h:41
const WCHAR * str
DWORD LCID
Definition: nls.h:13
#define TRACE(s)
Definition: solgame.cpp:4
HTMLInnerWindow * window
HTMLElement element
Definition: htmlform.c:22
nsIDOMHTMLFormElement * nsform
Definition: htmlform.c:26
IHTMLFormElement IHTMLFormElement_iface
Definition: htmlform.c:24
HTMLOuterWindow * outer_window
Definition: name.c:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
int ret
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define WINAPI
Definition: msvc.h:6
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static const WCHAR postW[]
__wchar_t WCHAR
Definition: xmlstorage.h:180