ReactOS 0.4.15-dev-8131-g4988de4
htmldoc.c
Go to the documentation of this file.
1/*
2 * Copyright 2005-2009 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "mshtml_private.h"
20
22
24{
25 nsIDOMNodeList *nsnode_list;
26 nsIDOMElement *nselem;
27 nsIDOMNode *nsnode;
28 nsAString id_str;
29 nsresult nsres;
31
32 if(!doc->nsdoc) {
33 WARN("NULL nsdoc\n");
34 return E_UNEXPECTED;
35 }
36
37 nsAString_InitDepend(&id_str, id);
38 /* get element by id attribute */
39 nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem);
40 if(FAILED(nsres)) {
41 ERR("GetElementById failed: %08x\n", nsres);
42 nsAString_Finish(&id_str);
43 return E_FAIL;
44 }
45
46 /* get first element by name attribute */
47 nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list);
48 nsAString_Finish(&id_str);
49 if(FAILED(nsres)) {
50 ERR("getElementsByName failed: %08x\n", nsres);
51 if(nselem)
52 nsIDOMElement_Release(nselem);
53 return E_FAIL;
54 }
55
56 nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
57 nsIDOMNodeList_Release(nsnode_list);
58 assert(nsres == NS_OK);
59
60 if(nsnode && nselem) {
61 UINT16 pos;
62
63 nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos);
64 if(NS_FAILED(nsres)) {
65 FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres);
66 nsIDOMNode_Release(nsnode);
67 nsIDOMElement_Release(nselem);
68 return E_FAIL;
69 }
70
71 TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
72 if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
73 nsIDOMElement_Release(nselem);
74 nselem = NULL;
75 }
76 }
77
78 if(nsnode) {
79 if(!nselem) {
80 nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
81 assert(nsres == NS_OK);
82 }
83 nsIDOMNode_Release(nsnode);
84 }
85
86 if(!nselem) {
87 *ret = NULL;
88 return S_OK;
89 }
90
91 hres = get_elem(doc, nselem, ret);
92 nsIDOMElement_Release(nselem);
93 return hres;
94}
95
97{
98 nsAString charset_str;
99 UINT ret = 0;
100 nsresult nsres;
101
102 if(doc->charset)
103 return doc->charset;
104
105 nsAString_Init(&charset_str, NULL);
106 nsres = nsIDOMHTMLDocument_GetCharacterSet(doc->nsdoc, &charset_str);
107 if(NS_SUCCEEDED(nsres)) {
108 const PRUnichar *charset;
109
110 nsAString_GetData(&charset_str, &charset);
111
112 if(*charset) {
116 }
117 }else {
118 ERR("GetCharset failed: %08x\n", nsres);
119 }
120 nsAString_Finish(&charset_str);
121
122 if(!ret)
123 return CP_UTF8;
124
125 return doc->charset = ret;
126}
127
128static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface)
129{
130 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument2_iface);
131}
132
133static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppv)
134{
136
138}
139
140static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface)
141{
143
144 return htmldoc_addref(This);
145}
146
147static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
148{
150
151 return htmldoc_release(This);
152}
153
154static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo)
155{
157
158 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
159}
160
161static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo,
162 LCID lcid, ITypeInfo **ppTInfo)
163{
165
166 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
167}
168
170 LPOLESTR *rgszNames, UINT cNames,
171 LCID lcid, DISPID *rgDispId)
172{
174
175 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
176 rgDispId);
177}
178
179static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember,
180 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
181 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
182{
184
185 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
186 pDispParams, pVarResult, pExcepInfo, puArgErr);
187}
188
189static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
190{
192
193 TRACE("(%p)->(%p)\n", This, p);
194
195 *p = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
196 IDispatch_AddRef(*p);
197 return S_OK;
198}
199
200static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
201{
203 nsIDOMElement *nselem = NULL;
205 nsresult nsres;
207
208 TRACE("(%p)->(%p)\n", This, p);
209
210 if(!This->doc_node->nsdoc) {
211 WARN("NULL nsdoc\n");
212 return E_UNEXPECTED;
213 }
214
215 nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
216 if(NS_FAILED(nsres)) {
217 ERR("GetDocumentElement failed: %08x\n", nsres);
218 return E_FAIL;
219 }
220
221 if(!nselem) {
222 *p = NULL;
223 return S_OK;
224 }
225
226 hres = get_node(This->doc_node, (nsIDOMNode*)nselem, TRUE, &node);
227 nsIDOMElement_Release(nselem);
228 if(FAILED(hres))
229 return hres;
230
233 return hres;
234}
235
236static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
237{
239 nsIDOMHTMLElement *nsbody = NULL;
242
243 TRACE("(%p)->(%p)\n", This, p);
244
245 if(This->doc_node->nsdoc) {
246 nsresult nsres;
247
248 nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
249 if(NS_FAILED(nsres)) {
250 TRACE("Could not get body: %08x\n", nsres);
251 return E_UNEXPECTED;
252 }
253 }
254
255 if(!nsbody) {
256 *p = NULL;
257 return S_OK;
258 }
259
260 hres = get_node(This->doc_node, (nsIDOMNode*)nsbody, TRUE, &node);
261 nsIDOMHTMLElement_Release(nsbody);
262 if(FAILED(hres))
263 return hres;
264
265 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
267 return hres;
268}
269
270static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
271{
273 nsIDOMElement *nselem;
275 nsresult nsres;
277
278 TRACE("(%p)->(%p)\n", This, p);
279
280 if(!This->doc_node->nsdoc) {
281 *p = NULL;
282 return S_OK;
283 }
284
285 /*
286 * NOTE: Gecko may return an active element even if the document is not visible.
287 * IE returns NULL in this case.
288 */
289 nsres = nsIDOMHTMLDocument_GetActiveElement(This->doc_node->nsdoc, &nselem);
290 if(NS_FAILED(nsres)) {
291 ERR("GetActiveElement failed: %08x\n", nsres);
292 return E_FAIL;
293 }
294
295 if(!nselem) {
296 *p = NULL;
297 return S_OK;
298 }
299
300 hres = get_elem(This->doc_node, nselem, &elem);
301 nsIDOMElement_Release(nselem);
302 if(FAILED(hres))
303 return hres;
304
305 *p = &elem->IHTMLElement_iface;
306 return S_OK;
307}
308
309static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
310{
312 nsIDOMHTMLCollection *nscoll = NULL;
313 nsresult nsres;
314
315 TRACE("(%p)->(%p)\n", This, p);
316
317 if(!p)
318 return E_INVALIDARG;
319
320 *p = NULL;
321
322 if(!This->doc_node->nsdoc) {
323 WARN("NULL nsdoc\n");
324 return E_UNEXPECTED;
325 }
326
327 nsres = nsIDOMHTMLDocument_GetImages(This->doc_node->nsdoc, &nscoll);
328 if(NS_FAILED(nsres)) {
329 ERR("GetImages failed: %08x\n", nsres);
330 return E_FAIL;
331 }
332
333 if(nscoll) {
334 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
335 nsIDOMHTMLCollection_Release(nscoll);
336 }
337
338 return S_OK;
339}
340
341static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
342{
344 nsIDOMHTMLCollection *nscoll = NULL;
345 nsresult nsres;
346
347 TRACE("(%p)->(%p)\n", This, p);
348
349 if(!p)
350 return E_INVALIDARG;
351
352 *p = NULL;
353
354 if(!This->doc_node->nsdoc) {
355 WARN("NULL nsdoc\n");
356 return E_UNEXPECTED;
357 }
358
359 nsres = nsIDOMHTMLDocument_GetApplets(This->doc_node->nsdoc, &nscoll);
360 if(NS_FAILED(nsres)) {
361 ERR("GetApplets failed: %08x\n", nsres);
362 return E_FAIL;
363 }
364
365 if(nscoll) {
366 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
367 nsIDOMHTMLCollection_Release(nscoll);
368 }
369
370 return S_OK;
371}
372
373static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
374{
376 nsIDOMHTMLCollection *nscoll = NULL;
377 nsresult nsres;
378
379 TRACE("(%p)->(%p)\n", This, p);
380
381 if(!p)
382 return E_INVALIDARG;
383
384 *p = NULL;
385
386 if(!This->doc_node->nsdoc) {
387 WARN("NULL nsdoc\n");
388 return E_UNEXPECTED;
389 }
390
391 nsres = nsIDOMHTMLDocument_GetLinks(This->doc_node->nsdoc, &nscoll);
392 if(NS_FAILED(nsres)) {
393 ERR("GetLinks failed: %08x\n", nsres);
394 return E_FAIL;
395 }
396
397 if(nscoll) {
398 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
399 nsIDOMHTMLCollection_Release(nscoll);
400 }
401
402 return S_OK;
403}
404
405static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
406{
408 nsIDOMHTMLCollection *nscoll = NULL;
409 nsresult nsres;
410
411 TRACE("(%p)->(%p)\n", This, p);
412
413 if(!p)
414 return E_INVALIDARG;
415
416 *p = NULL;
417
418 if(!This->doc_node->nsdoc) {
419 WARN("NULL nsdoc\n");
420 return E_UNEXPECTED;
421 }
422
423 nsres = nsIDOMHTMLDocument_GetForms(This->doc_node->nsdoc, &nscoll);
424 if(NS_FAILED(nsres)) {
425 ERR("GetForms failed: %08x\n", nsres);
426 return E_FAIL;
427 }
428
429 if(nscoll) {
430 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
431 nsIDOMHTMLCollection_Release(nscoll);
432 }
433
434 return S_OK;
435}
436
437static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
438{
440 nsIDOMHTMLCollection *nscoll = NULL;
441 nsresult nsres;
442
443 TRACE("(%p)->(%p)\n", This, p);
444
445 if(!p)
446 return E_INVALIDARG;
447
448 *p = NULL;
449
450 if(!This->doc_node->nsdoc) {
451 WARN("NULL nsdoc\n");
452 return E_UNEXPECTED;
453 }
454
455 nsres = nsIDOMHTMLDocument_GetAnchors(This->doc_node->nsdoc, &nscoll);
456 if(NS_FAILED(nsres)) {
457 ERR("GetAnchors failed: %08x\n", nsres);
458 return E_FAIL;
459 }
460
461 if(nscoll) {
462 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
463 nsIDOMHTMLCollection_Release(nscoll);
464 }
465
466 return S_OK;
467}
468
469static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
470{
472 nsAString nsstr;
473 nsresult nsres;
474
475 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
476
477 if(!This->doc_node->nsdoc) {
478 WARN("NULL nsdoc\n");
479 return E_UNEXPECTED;
480 }
481
482 nsAString_InitDepend(&nsstr, v);
483 nsres = nsIDOMHTMLDocument_SetTitle(This->doc_node->nsdoc, &nsstr);
484 nsAString_Finish(&nsstr);
485 if(NS_FAILED(nsres))
486 ERR("SetTitle failed: %08x\n", nsres);
487
488 return S_OK;
489}
490
491static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
492{
494 const PRUnichar *ret;
495 nsAString nsstr;
496 nsresult nsres;
497
498 TRACE("(%p)->(%p)\n", This, p);
499
500 if(!This->doc_node->nsdoc) {
501 WARN("NULL nsdoc\n");
502 return E_UNEXPECTED;
503 }
504
505
506 nsAString_Init(&nsstr, NULL);
507 nsres = nsIDOMHTMLDocument_GetTitle(This->doc_node->nsdoc, &nsstr);
508 if (NS_SUCCEEDED(nsres)) {
509 nsAString_GetData(&nsstr, &ret);
510 *p = SysAllocString(ret);
511 }
512 nsAString_Finish(&nsstr);
513
514 if(NS_FAILED(nsres)) {
515 ERR("GetTitle failed: %08x\n", nsres);
516 return E_FAIL;
517 }
518
519 return S_OK;
520}
521
522static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
523{
525 nsIDOMHTMLCollection *nscoll = NULL;
526 nsresult nsres;
527
528 TRACE("(%p)->(%p)\n", This, p);
529
530 if(!p)
531 return E_INVALIDARG;
532
533 *p = NULL;
534
535 if(!This->doc_node->nsdoc) {
536 WARN("NULL nsdoc\n");
537 return E_UNEXPECTED;
538 }
539
540 nsres = nsIDOMHTMLDocument_GetScripts(This->doc_node->nsdoc, &nscoll);
541 if(NS_FAILED(nsres)) {
542 ERR("GetImages failed: %08x\n", nsres);
543 return E_FAIL;
544 }
545
546 if(nscoll) {
547 *p = create_collection_from_htmlcol(This->doc_node, nscoll);
548 nsIDOMHTMLCollection_Release(nscoll);
549 }
550
551 return S_OK;
552}
553
554static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
555{
558
559 static const WCHAR onW[] = {'o','n',0};
560
561 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
562
563 if(strcmpiW(v, onW)) {
564 FIXME("Unsupported arg %s\n", debugstr_w(v));
565 return E_NOTIMPL;
566 }
567
568 hres = setup_edit_mode(This->doc_obj);
569 if(FAILED(hres))
570 return hres;
571
573 return S_OK;
574}
575
576static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
577{
579 static const WCHAR szOff[] = {'O','f','f',0};
580 FIXME("(%p)->(%p) always returning Off\n", This, p);
581
582 if(!p)
583 return E_INVALIDARG;
584
585 *p = SysAllocString(szOff);
586
587 return S_OK;
588}
589
590static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
591{
593 nsISelection *nsselection;
594 nsresult nsres;
595
596 TRACE("(%p)->(%p)\n", This, p);
597
598 nsres = nsIDOMWindow_GetSelection(This->window->nswindow, &nsselection);
599 if(NS_FAILED(nsres)) {
600 ERR("GetSelection failed: %08x\n", nsres);
601 return E_FAIL;
602 }
603
604 return HTMLSelectionObject_Create(This->doc_node, nsselection, p);
605}
606
607static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p)
608{
610
611
612 TRACE("(%p)->(%p)\n", iface, p);
613
614 if(!p)
615 return E_POINTER;
616
617 return get_readystate_string(This->window->readystate, p);
618}
619
620static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
621{
623
624 TRACE("(%p)->(%p)\n", This, p);
625
626 return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p);
627}
628
629static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
630{
632 FIXME("(%p)->(%p)\n", This, p);
633 return E_NOTIMPL;
634}
635
636static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p)
637{
639 FIXME("(%p)->(%p)\n", This, p);
640 return E_NOTIMPL;
641}
642
643static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v)
644{
646 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
647 return E_NOTIMPL;
648}
649
650static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p)
651{
653 FIXME("(%p)->(%p)\n", This, p);
654 return E_NOTIMPL;
655}
656
657static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
658{
660 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
661#ifdef __REACTOS__
662 return S_OK;
663#else
664 return E_NOTIMPL;
665#endif
666}
667
668static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p)
669{
671 FIXME("(%p)->(%p)\n", This, p);
672 return E_NOTIMPL;
673}
674
675static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v)
676{
678 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
679 return E_NOTIMPL;
680}
681
682static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p)
683{
685 FIXME("(%p)->(%p)\n", This, p);
686 return E_NOTIMPL;
687}
688
689static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v)
690{
692 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
693 return E_NOTIMPL;
694}
695
696static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p)
697{
699 FIXME("(%p)->(%p)\n", This, p);
700 return E_NOTIMPL;
701}
702
703static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v)
704{
706 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
707 return E_NOTIMPL;
708}
709
710static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p)
711{
713 FIXME("(%p)->(%p)\n", This, p);
714 return E_NOTIMPL;
715}
716
717static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
718{
720
721 FIXME("(%p)->(%p)\n", This, p);
722
723 *p = NULL;
724 return S_OK;
725 }
726
727static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
728{
730
731 TRACE("(%p)->(%p)\n", This, p);
732
733 if(!This->doc_node->nsdoc) {
734 WARN("NULL nsdoc\n");
735 return E_UNEXPECTED;
736 }
737
738 return IHTMLWindow2_get_location(&This->window->base.IHTMLWindow2_iface, p);
739}
740
741static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
742{
744 FIXME("(%p)->(%p)\n", This, p);
745 return E_NOTIMPL;
746}
747
748static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
749{
751
752 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
753
754 if(!This->window) {
755 FIXME("No window available\n");
756 return E_FAIL;
757 }
758
759 return navigate_url(This->window, v, This->window->uri, BINDING_NAVIGATED);
760}
761
762static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
763{
765
766 static const WCHAR about_blank_url[] =
767 {'a','b','o','u','t',':','b','l','a','n','k',0};
768
769 TRACE("(%p)->(%p)\n", iface, p);
770
771 *p = SysAllocString(This->window->url ? This->window->url : about_blank_url);
772 return *p ? S_OK : E_OUTOFMEMORY;
773}
774
775static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
776{
778 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
779 return E_NOTIMPL;
780}
781
782static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
783{
786
787 TRACE("(%p)->(%p)\n", This, p);
788
789 if(!This->window || !This->window->uri) {
790 FIXME("No current URI\n");
791 return E_FAIL;
792 }
793
794 hres = IUri_GetHost(This->window->uri, p);
795 return FAILED(hres) ? hres : S_OK;
796}
797
798static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
799{
801 BOOL bret;
802
803 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
804
805 bret = InternetSetCookieExW(This->window->url, NULL, v, 0, 0);
806 if(!bret) {
807 FIXME("InternetSetCookieExW failed: %u\n", GetLastError());
809 }
810
811 return S_OK;
812}
813
814static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
815{
817 DWORD size;
818 BOOL bret;
819
820 TRACE("(%p)->(%p)\n", This, p);
821
822 size = 0;
823 bret = InternetGetCookieExW(This->window->url, NULL, NULL, &size, 0, NULL);
824 if(!bret) {
825 switch(GetLastError()) {
827 break;
829 *p = NULL;
830 return S_OK;
831 default:
832 FIXME("InternetGetCookieExW failed: %u\n", GetLastError());
834 }
835 }
836
837 if(!size) {
838 *p = NULL;
839 return S_OK;
840 }
841
842 *p = SysAllocStringLen(NULL, size/sizeof(WCHAR)-1);
843 if(!*p)
844 return E_OUTOFMEMORY;
845
846 bret = InternetGetCookieExW(This->window->url, NULL, *p, &size, 0, NULL);
847 if(!bret) {
848 ERR("InternetGetCookieExW failed: %u\n", GetLastError());
849 return E_FAIL;
850 }
851
852 return S_OK;
853}
854
856{
858 FIXME("(%p)->(%x)\n", This, v);
859 return E_NOTIMPL;
860}
861
862static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p)
863{
865 FIXME("(%p)->(%p)\n", This, p);
866 return E_NOTIMPL;
867}
868
869static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v)
870{
872 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
873 return E_NOTIMPL;
874}
875
876static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
877{
879 nsAString charset_str;
880 nsresult nsres;
881
882 TRACE("(%p)->(%p)\n", This, p);
883
884 if(!This->doc_node->nsdoc) {
885 FIXME("NULL nsdoc\n");
886 return E_FAIL;
887 }
888
889 nsAString_Init(&charset_str, NULL);
890 nsres = nsIDOMHTMLDocument_GetCharacterSet(This->doc_node->nsdoc, &charset_str);
891 return return_nsstr(nsres, &charset_str, p);
892}
893
895{
897 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
898 return E_NOTIMPL;
899}
900
901static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p)
902{
904 FIXME("(%p)->(%p)\n", This, p);
905 return E_NOTIMPL;
906}
907
908static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p)
909{
911 FIXME("(%p)->(%p)\n", This, p);
912 return E_NOTIMPL;
913}
914
915static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p)
916{
918 FIXME("(%p)->(%p)\n", This, p);
919 return E_NOTIMPL;
920}
921
922static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p)
923{
925 FIXME("(%p)->(%p)\n", This, p);
926 return E_NOTIMPL;
927}
928
930{
932 FIXME("(%p)->(%p)\n", This, p);
933 return E_NOTIMPL;
934}
935
936static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p)
937{
939 FIXME("(%p)->(%p)\n", This, p);
940 return E_NOTIMPL;
941}
942
943static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p)
944{
946 FIXME("(%p)->(%p)\n", This, p);
947 return E_NOTIMPL;
948}
949
950static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p)
951{
953 FIXME("(%p)->(%p)\n", This, p);
954 return E_NOTIMPL;
955}
956
957static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
958{
960 FIXME("(%p)->(%p)\n", This, p);
961 return E_NOTIMPL;
962}
963
965{
966 VARIANT *var, tmp;
967 JSContext *jsctx;
968 nsAString nsstr;
969 ULONG i, argc;
970 nsresult nsres;
972
973 if(!This->doc_node->nsdoc) {
974 WARN("NULL nsdoc\n");
975 return E_UNEXPECTED;
976 }
977
978 if (!psarray)
979 return S_OK;
980
981 if(psarray->cDims != 1) {
982 FIXME("cDims=%d\n", psarray->cDims);
983 return E_INVALIDARG;
984 }
985
986 hres = SafeArrayAccessData(psarray, (void**)&var);
987 if(FAILED(hres)) {
988 WARN("SafeArrayAccessData failed: %08x\n", hres);
989 return hres;
990 }
991
992 V_VT(&tmp) = VT_EMPTY;
993
994 jsctx = get_context_from_document(This->doc_node->nsdoc);
995 argc = psarray->rgsabound[0].cElements;
996 for(i=0; i < argc; i++) {
997 if(V_VT(var+i) == VT_BSTR) {
999 }else {
1001 if(FAILED(hres)) {
1002 WARN("Could not convert %s to string\n", debugstr_variant(var+i));
1003 break;
1004 }
1005 nsAString_InitDepend(&nsstr, V_BSTR(&tmp));
1006 }
1007
1008 if(!ln || i != argc-1)
1009 nsres = nsIDOMHTMLDocument_Write(This->doc_node->nsdoc, &nsstr, jsctx);
1010 else
1011 nsres = nsIDOMHTMLDocument_Writeln(This->doc_node->nsdoc, &nsstr, jsctx);
1012 nsAString_Finish(&nsstr);
1013 if(V_VT(var+i) != VT_BSTR)
1014 VariantClear(&tmp);
1015 if(NS_FAILED(nsres)) {
1016 ERR("Write failed: %08x\n", nsres);
1017 hres = E_FAIL;
1018 break;
1019 }
1020 }
1021
1022 SafeArrayUnaccessData(psarray);
1023
1024 return hres;
1025}
1026
1027static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
1028{
1030
1031 TRACE("(%p)->(%p)\n", iface, psarray);
1032
1033 return document_write(This, psarray, FALSE);
1034}
1035
1036static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray)
1037{
1039
1040 TRACE("(%p)->(%p)\n", This, psarray);
1041
1042 return document_write(This, psarray, TRUE);
1043}
1044
1045static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name,
1046 VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
1047{
1049 nsISupports *tmp;
1050 nsresult nsres;
1051
1052 static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
1053
1054 TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name),
1055 debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult);
1056
1057 if(!This->doc_node->nsdoc) {
1058 ERR("!nsdoc\n");
1059 return E_NOTIMPL;
1060 }
1061
1062 if(!url || strcmpW(url, text_htmlW) || V_VT(&name) != VT_ERROR
1063 || V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR)
1064 FIXME("unsupported args\n");
1065
1066 nsres = nsIDOMHTMLDocument_Open(This->doc_node->nsdoc, NULL, NULL, NULL,
1067 get_context_from_document(This->doc_node->nsdoc), 0, &tmp);
1068 if(NS_FAILED(nsres)) {
1069 ERR("Open failed: %08x\n", nsres);
1070 return E_FAIL;
1071 }
1072
1073 if(tmp)
1074 nsISupports_Release(tmp);
1075
1076 *pomWindowResult = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
1077 IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
1078 return S_OK;
1079}
1080
1081static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
1082{
1084 nsresult nsres;
1085
1086 TRACE("(%p)\n", This);
1087
1088 if(!This->doc_node->nsdoc) {
1089 ERR("!nsdoc\n");
1090 return E_NOTIMPL;
1091 }
1092
1093 nsres = nsIDOMHTMLDocument_Close(This->doc_node->nsdoc);
1094 if(NS_FAILED(nsres)) {
1095 ERR("Close failed: %08x\n", nsres);
1096 return E_FAIL;
1097 }
1098
1099 return S_OK;
1100}
1101
1102static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
1103{
1105 nsresult nsres;
1106
1107 TRACE("(%p)\n", This);
1108
1109 nsres = nsIDOMHTMLDocument_Clear(This->doc_node->nsdoc);
1110 if(NS_FAILED(nsres)) {
1111 ERR("Clear failed: %08x\n", nsres);
1112 return E_FAIL;
1113 }
1114
1115 return S_OK;
1116}
1117
1118static const WCHAR copyW[] =
1119 {'c','o','p','y',0};
1120static const WCHAR cutW[] =
1121 {'c','u','t',0};
1122static const WCHAR fontnameW[] =
1123 {'f','o','n','t','n','a','m','e',0};
1124static const WCHAR fontsizeW[] =
1125 {'f','o','n','t','s','i','z','e',0};
1126static const WCHAR indentW[] =
1127 {'i','n','d','e','n','t',0};
1129 {'i','n','s','e','r','t','o','r','d','e','r','e','d','l','i','s','t',0};
1131 {'i','n','s','e','r','t','u','n','o','r','d','e','r','e','d','l','i','s','t',0};
1132static const WCHAR outdentW[] =
1133 {'o','u','t','d','e','n','t',0};
1134static const WCHAR pasteW[] =
1135 {'p','a','s','t','e',0};
1137 {'r','e','s','p','e','c','t','v','i','s','i','b','i','l','i','t','y','i','n','d','e','s','i','g','n',0};
1138
1139static const struct {
1140 const WCHAR *name;
1141 OLECMDID id;
1142}command_names[] = {
1143 {copyW, IDM_COPY},
1144 {cutW, IDM_CUT},
1151 {pasteW, IDM_PASTE},
1154
1155static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid)
1156{
1157 int i;
1158
1159 for(i = 0; i < sizeof(command_names)/sizeof(*command_names); i++) {
1160 if(!strcmpiW(command_names[i].name, str)) {
1161 *cmdid = command_names[i].id;
1162 return TRUE;
1163 }
1164 }
1165
1166 FIXME("Unknown command %s\n", debugstr_w(str));
1167 return FALSE;
1168}
1169
1170static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,
1171 VARIANT_BOOL *pfRet)
1172{
1174 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1175 return E_NOTIMPL;
1176}
1177
1178static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID,
1179 VARIANT_BOOL *pfRet)
1180{
1182 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1183 return E_NOTIMPL;
1184}
1185
1186static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID,
1187 VARIANT_BOOL *pfRet)
1188{
1190 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1191 return E_NOTIMPL;
1192}
1193
1194static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID,
1195 VARIANT_BOOL *pfRet)
1196{
1198 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1199 return E_NOTIMPL;
1200}
1201
1202static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID,
1203 BSTR *pfRet)
1204{
1206 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1207 return E_NOTIMPL;
1208}
1209
1210static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID,
1211 VARIANT *pfRet)
1212{
1214 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1215 return E_NOTIMPL;
1216}
1217
1218static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID,
1219 VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet)
1220{
1222 OLECMDID cmdid;
1223 VARIANT ret;
1224 HRESULT hres;
1225
1226 TRACE("(%p)->(%s %x %s %p)\n", This, debugstr_w(cmdID), showUI, debugstr_variant(&value), pfRet);
1227
1228 if(!cmdid_from_string(cmdID, &cmdid))
1229 return OLECMDERR_E_NOTSUPPORTED;
1230
1231 V_VT(&ret) = VT_EMPTY;
1232 hres = IOleCommandTarget_Exec(&This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid,
1233 showUI ? 0 : OLECMDEXECOPT_DONTPROMPTUSER, &value, &ret);
1234 if(FAILED(hres))
1235 return hres;
1236
1237 if(V_VT(&ret) != VT_EMPTY) {
1238 FIXME("Handle ret %s\n", debugstr_variant(&ret));
1239 VariantClear(&ret);
1240 }
1241
1242 *pfRet = VARIANT_TRUE;
1243 return S_OK;
1244}
1245
1246static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID,
1247 VARIANT_BOOL *pfRet)
1248{
1250 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
1251 return E_NOTIMPL;
1252}
1253
1254static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag,
1255 IHTMLElement **newElem)
1256{
1259 HRESULT hres;
1260
1261 TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
1262
1263 hres = create_element(This->doc_node, eTag, &elem);
1264 if(FAILED(hres))
1265 return hres;
1266
1267 *newElem = &elem->IHTMLElement_iface;
1268 return S_OK;
1269}
1270
1271static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)
1272{
1274 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1275 return E_NOTIMPL;
1276}
1277
1278static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p)
1279{
1281 FIXME("(%p)->(%p)\n", This, p);
1282 return E_NOTIMPL;
1283}
1284
1285static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
1286{
1288
1289 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1290
1291 return set_doc_event(This, EVENTID_CLICK, &v);
1292}
1293
1294static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p)
1295{
1297
1298 TRACE("(%p)->(%p)\n", This, p);
1299
1301}
1302
1304{
1306
1307 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1308
1310}
1311
1312static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p)
1313{
1315
1316 TRACE("(%p)->(%p)\n", This, p);
1317
1319}
1320
1321static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
1322{
1324
1325 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1326
1327 return set_doc_event(This, EVENTID_KEYUP, &v);
1328}
1329
1330static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
1331{
1333
1334 TRACE("(%p)->(%p)\n", This, p);
1335
1337}
1338
1339static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
1340{
1342
1343 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1344
1346}
1347
1348static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
1349{
1351
1352 TRACE("(%p)->(%p)\n", This, p);
1353
1355}
1356
1358{
1360
1361 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1362
1364}
1365
1366static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p)
1367{
1369
1370 TRACE("(%p)->(%p)\n", This, p);
1371
1373}
1374
1375static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v)
1376{
1378
1379 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1380
1382}
1383
1384static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p)
1385{
1387
1388 TRACE("(%p)->(%p)\n", This, p);
1389
1391}
1392
1394{
1396
1397 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1398
1400}
1401
1402static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p)
1403{
1405
1406 TRACE("(%p)->(%p)\n", This, p);
1407
1409}
1410
1412{
1414
1415 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1416
1418}
1419
1420static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p)
1421{
1423
1424 TRACE("(%p)->(%p)\n", This, p);
1425
1427}
1428
1430{
1432
1433 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1434
1436}
1437
1438static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p)
1439{
1441
1442 TRACE("(%p)->(%p)\n", This, p);
1443
1445}
1446
1448{
1450
1451 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1452
1454}
1455
1456static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
1457{
1459
1460 TRACE("(%p)->(%p)\n", This, p);
1461
1463}
1464
1466{
1468
1469 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1470
1472}
1473
1475{
1477
1478 TRACE("(%p)->(%p)\n", This, p);
1479
1481}
1482
1484{
1486 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1487 return E_NOTIMPL;
1488}
1489
1491{
1493 FIXME("(%p)->(%p)\n", This, p);
1494 return E_NOTIMPL;
1495}
1496
1497static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v)
1498{
1500 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1501 return E_NOTIMPL;
1502}
1503
1504static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p)
1505{
1507 FIXME("(%p)->(%p)\n", This, p);
1508 return E_NOTIMPL;
1509}
1510
1512{
1514 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1515 return E_NOTIMPL;
1516}
1517
1518static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p)
1519{
1521 FIXME("(%p)->(%p)\n", This, p);
1522 return E_NOTIMPL;
1523}
1524
1526{
1528
1529 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1530
1532}
1533
1534static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
1535{
1537
1538 TRACE("(%p)->(%p)\n", This, p);
1539
1541}
1542
1544{
1546
1547 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
1548
1550}
1551
1553{
1555
1556 TRACE("(%p)->(%p)\n", This, p);
1557
1559}
1560
1561static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y,
1562 IHTMLElement **elementHit)
1563{
1565 nsIDOMElement *nselem;
1567 nsresult nsres;
1568 HRESULT hres;
1569
1570 TRACE("(%p)->(%d %d %p)\n", This, x, y, elementHit);
1571
1572 nsres = nsIDOMHTMLDocument_ElementFromPoint(This->doc_node->nsdoc, x, y, &nselem);
1573 if(NS_FAILED(nsres)) {
1574 ERR("ElementFromPoint failed: %08x\n", nsres);
1575 return E_FAIL;
1576 }
1577
1578 if(!nselem) {
1579 *elementHit = NULL;
1580 return S_OK;
1581 }
1582
1583 hres = get_node(This->doc_node, (nsIDOMNode*)nselem, TRUE, &node);
1584 nsIDOMElement_Release(nselem);
1585 if(FAILED(hres))
1586 return hres;
1587
1588 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)elementHit);
1590 return hres;
1591}
1592
1594{
1596
1597 TRACE("(%p)->(%p)\n", This, p);
1598
1599 *p = &This->window->base.IHTMLWindow2_iface;
1600 IHTMLWindow2_AddRef(*p);
1601 return S_OK;
1602}
1603
1604static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
1605 IHTMLStyleSheetsCollection **p)
1606{
1608 nsIDOMStyleSheetList *nsstylelist;
1609 nsresult nsres;
1610
1611 TRACE("(%p)->(%p)\n", This, p);
1612
1613 *p = NULL;
1614
1615 if(!This->doc_node->nsdoc) {
1616 WARN("NULL nsdoc\n");
1617 return E_UNEXPECTED;
1618 }
1619
1620 nsres = nsIDOMHTMLDocument_GetStyleSheets(This->doc_node->nsdoc, &nsstylelist);
1621 if(NS_FAILED(nsres)) {
1622 ERR("GetStyleSheets failed: %08x\n", nsres);
1623 return E_FAIL;
1624 }
1625
1626 *p = HTMLStyleSheetsCollection_Create(nsstylelist);
1627 nsIDOMStyleSheetList_Release(nsstylelist);
1628
1629 return S_OK;
1630}
1631
1633{
1635 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1636 return E_NOTIMPL;
1637}
1638
1640{
1642 FIXME("(%p)->(%p)\n", This, p);
1643 return E_NOTIMPL;
1644}
1645
1647{
1649 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
1650 return E_NOTIMPL;
1651}
1652
1654{
1656 FIXME("(%p)->(%p)\n", This, p);
1657 return E_NOTIMPL;
1658}
1659
1660static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
1661{
1663
1664 static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
1665
1666 TRACE("(%p)->(%p)\n", This, String);
1667
1668 if(!String)
1669 return E_INVALIDARG;
1670
1672 return *String ? S_OK : E_OUTOFMEMORY;
1673
1674}
1675
1676static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
1677 LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet)
1678{
1680 nsIDOMHTMLHeadElement *head_elem;
1681 IHTMLStyleElement *style_elem;
1683 nsresult nsres;
1684 HRESULT hres;
1685
1686 static const WCHAR styleW[] = {'s','t','y','l','e',0};
1687
1688 TRACE("(%p)->(%s %d %p)\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
1689
1690 if(!This->doc_node->nsdoc) {
1691 FIXME("not a real doc object\n");
1692 return E_NOTIMPL;
1693 }
1694
1695 if(lIndex != -1)
1696 FIXME("Unsupported lIndex %d\n", lIndex);
1697
1698 if(bstrHref && *bstrHref) {
1699 FIXME("semi-stub for href %s\n", debugstr_w(bstrHref));
1700 *ppnewStyleSheet = HTMLStyleSheet_Create(NULL);
1701 return S_OK;
1702 }
1703
1704 hres = create_element(This->doc_node, styleW, &elem);
1705 if(FAILED(hres))
1706 return hres;
1707
1708 nsres = nsIDOMHTMLDocument_GetHead(This->doc_node->nsdoc, &head_elem);
1709 if(NS_SUCCEEDED(nsres)) {
1710 nsIDOMNode *head_node, *tmp_node;
1711
1712 nsres = nsIDOMHTMLHeadElement_QueryInterface(head_elem, &IID_nsIDOMNode, (void**)&head_node);
1713 nsIDOMHTMLHeadElement_Release(head_elem);
1714 assert(nsres == NS_OK);
1715
1716 nsres = nsIDOMNode_AppendChild(head_node, elem->node.nsnode, &tmp_node);
1717 nsIDOMNode_Release(head_node);
1718 if(NS_SUCCEEDED(nsres) && tmp_node)
1719 nsIDOMNode_Release(tmp_node);
1720 }
1721 if(NS_FAILED(nsres)) {
1722 IHTMLElement_Release(&elem->IHTMLElement_iface);
1723 return E_FAIL;
1724 }
1725
1726 hres = IHTMLElement_QueryInterface(&elem->IHTMLElement_iface, &IID_IHTMLStyleElement, (void**)&style_elem);
1727 assert(hres == S_OK);
1728 IHTMLElement_Release(&elem->IHTMLElement_iface);
1729
1730 hres = IHTMLStyleElement_get_styleSheet(style_elem, ppnewStyleSheet);
1731 IHTMLStyleElement_Release(style_elem);
1732 return hres;
1733}
1734
1735static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
1852};
1853
1854static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
1855{
1856 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
1857}
1858
1859static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
1860 REFIID riid, void **ppv)
1861{
1864}
1865
1866static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
1867{
1869 return htmldoc_addref(This);
1870}
1871
1872static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
1873{
1875 return htmldoc_release(This);
1876}
1877
1878static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
1879{
1881 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
1882}
1883
1884static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
1885 LCID lcid, ITypeInfo **ppTInfo)
1886{
1888 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1889}
1890
1892 LPOLESTR *rgszNames, UINT cNames,
1893 LCID lcid, DISPID *rgDispId)
1894{
1896 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
1897 rgDispId);
1898}
1899
1900static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
1901 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1902 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1903{
1905 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
1906 pDispParams, pVarResult, pExcepInfo, puArgErr);
1907}
1908
1909static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
1910{
1912 FIXME("(%p)\n", This);
1913 return E_NOTIMPL;
1914}
1915
1916static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
1917{
1919
1920 WARN("(%p)->(%x)\n", This, fForce);
1921
1922 /* Doing nothing here should be fine for us. */
1923 return S_OK;
1924}
1925
1927 IHTMLDOMNode **newTextNode)
1928{
1930 nsIDOMText *nstext;
1932 nsAString text_str;
1933 nsresult nsres;
1934 HRESULT hres;
1935
1936 TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
1937
1938 if(!This->doc_node->nsdoc) {
1939 WARN("NULL nsdoc\n");
1940 return E_UNEXPECTED;
1941 }
1942
1943 nsAString_InitDepend(&text_str, text);
1944 nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
1945 nsAString_Finish(&text_str);
1946 if(NS_FAILED(nsres)) {
1947 ERR("CreateTextNode failed: %08x\n", nsres);
1948 return E_FAIL;
1949 }
1950
1951 hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
1952 nsIDOMText_Release(nstext);
1953 if(FAILED(hres))
1954 return hres;
1955
1956 *newTextNode = &node->IHTMLDOMNode_iface;
1957 return S_OK;
1958}
1959
1960static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
1961{
1963 nsIDOMElement *nselem = NULL;
1965 nsresult nsres;
1966 HRESULT hres;
1967
1968 TRACE("(%p)->(%p)\n", This, p);
1969
1970 if(This->window->readystate == READYSTATE_UNINITIALIZED) {
1971 *p = NULL;
1972 return S_OK;
1973 }
1974
1975 if(!This->doc_node->nsdoc) {
1976 WARN("NULL nsdoc\n");
1977 return E_UNEXPECTED;
1978 }
1979
1980 nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
1981 if(NS_FAILED(nsres)) {
1982 ERR("GetDocumentElement failed: %08x\n", nsres);
1983 return E_FAIL;
1984 }
1985
1986 if(!nselem) {
1987 *p = NULL;
1988 return S_OK;
1989 }
1990
1991 hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
1992 nsIDOMElement_Release(nselem);
1993 if(FAILED(hres))
1994 return hres;
1995
1996 hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
1998 return hres;
1999}
2000
2001static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
2002{
2004 FIXME("(%p)->(%p)\n", This, p);
2005 return E_NOTIMPL;
2006}
2007
2008static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
2009 IDispatch* pDisp, VARIANT_BOOL *pfResult)
2010{
2012
2013 TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
2014
2015 return attach_event(&This->doc_node->node.event_target, event, pDisp, pfResult);
2016}
2017
2018static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
2019 IDispatch *pDisp)
2020{
2022
2023 TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
2024
2025 return detach_event(&This->doc_node->node.event_target, event, pDisp);
2026}
2027
2029{
2031 FIXME("(%p)->()\n", This);
2032 return E_NOTIMPL;
2033}
2034
2036{
2038 FIXME("(%p)->(%p)\n", This, p);
2039 return E_NOTIMPL;
2040}
2041
2043{
2045 FIXME("(%p)->()\n", This);
2046 return E_NOTIMPL;
2047}
2048
2050{
2052 FIXME("(%p)->(%p)\n", This, p);
2053 return E_NOTIMPL;
2054}
2055
2057{
2059 FIXME("(%p)->()\n", This);
2060 return E_NOTIMPL;
2061}
2062
2064{
2066 FIXME("(%p)->(%p)\n", This, p);
2067 return E_NOTIMPL;
2068}
2069
2071{
2073 FIXME("(%p)->()\n", This);
2074 return E_NOTIMPL;
2075}
2076
2078{
2080 FIXME("(%p)->(%p)\n", This, p);
2081 return E_NOTIMPL;
2082}
2083
2085{
2087 FIXME("(%p)->()\n", This);
2088 return E_NOTIMPL;
2089}
2090
2092{
2094 FIXME("(%p)->(%p)\n", This, p);
2095 return E_NOTIMPL;
2096}
2097
2099{
2101 FIXME("(%p)->()\n", This);
2102 return E_NOTIMPL;
2103}
2104
2106{
2108 FIXME("(%p)->(%p)\n", This, p);
2109 return E_NOTIMPL;
2110}
2111
2113{
2115 FIXME("(%p)->()\n", This);
2116 return E_NOTIMPL;
2117}
2118
2120{
2122 FIXME("(%p)->(%p)\n", This, p);
2123 return E_NOTIMPL;
2124}
2125
2126static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
2127{
2129 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2130 return E_NOTIMPL;
2131}
2132
2133static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
2134{
2136 FIXME("(%p)->(%p)\n", This, p);
2137 return E_NOTIMPL;
2138}
2139
2141{
2143
2144 TRACE("(%p)->()\n", This);
2145
2147}
2148
2150{
2152
2153 TRACE("(%p)->(%p)\n", This, p);
2154
2156}
2157
2158static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
2159{
2161 FIXME("(%p)->()\n", This);
2162 return E_NOTIMPL;
2163}
2164
2165static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
2166{
2168 FIXME("(%p)->(%p)\n", This, p);
2169 return E_NOTIMPL;
2170}
2171
2173 IHTMLDocument2 **ppNewDoc)
2174{
2176 nsIDOMDocumentFragment *doc_frag;
2177 HTMLDocumentNode *docnode;
2178 nsresult nsres;
2179 HRESULT hres;
2180
2181 TRACE("(%p)->(%p)\n", This, ppNewDoc);
2182
2183 if(!This->doc_node->nsdoc) {
2184 FIXME("NULL nsdoc\n");
2185 return E_NOTIMPL;
2186 }
2187
2188 nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
2189 if(NS_FAILED(nsres)) {
2190 ERR("CreateDocumentFragment failed: %08x\n", nsres);
2191 return E_FAIL;
2192 }
2193
2194 hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
2195 nsIDOMDocumentFragment_Release(doc_frag);
2196 if(FAILED(hres))
2197 return hres;
2198
2199 *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
2200 return S_OK;
2201}
2202
2204 IHTMLDocument2 **p)
2205{
2207 FIXME("(%p)->(%p)\n", This, p);
2208 return E_NOTIMPL;
2209}
2210
2213{
2215 FIXME("(%p)->(%x)\n", This, v);
2216 return E_NOTIMPL;
2217}
2218
2220 VARIANT_BOOL *p)
2221{
2223 FIXME("(%p)->(%p)\n", This, p);
2224 return E_NOTIMPL;
2225}
2226
2227static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
2228{
2230 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2231 return E_NOTIMPL;
2232}
2233
2234static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
2235{
2237 FIXME("(%p)->(%p)\n", This, p);
2238 return E_NOTIMPL;
2239}
2240
2242{
2244
2245 TRACE("(%p)->(%p)\n", This, p);
2246
2247 return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
2248}
2249
2252{
2254 FIXME("(%p)->()\n", This);
2255 return E_NOTIMPL;
2256}
2257
2259 VARIANT_BOOL *p)
2260{
2262 FIXME("(%p)->(%p)\n", This, p);
2263 return E_NOTIMPL;
2264}
2265
2267{
2269 FIXME("(%p)->()\n", This);
2270 return E_NOTIMPL;
2271}
2272
2274{
2276 FIXME("(%p)->(%p)\n", This, p);
2277 return E_NOTIMPL;
2278}
2279
2281 IHTMLElementCollection **ppelColl)
2282{
2284 nsIDOMNodeList *node_list;
2285 nsAString selector_str;
2286 WCHAR *selector;
2287 nsresult nsres;
2288
2289 static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
2290
2291 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
2292
2293 if(!This->doc_node || !This->doc_node->nsdoc) {
2294 /* We should probably return an empty collection. */
2295 FIXME("No nsdoc\n");
2296 return E_NOTIMPL;
2297 }
2298
2299 selector = heap_alloc(2*SysStringLen(v)*sizeof(WCHAR) + sizeof(formatW));
2300 if(!selector)
2301 return E_OUTOFMEMORY;
2302 sprintfW(selector, formatW, v, v);
2303
2304 /*
2305 * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes.
2306 * That's why we use CSS selector instead. We should also use name only when it applies to given element
2307 * types and search should be case insensitive. Those are currently not supported properly.
2308 */
2309 nsAString_InitDepend(&selector_str, selector);
2310 nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &selector_str, &node_list);
2311 nsAString_Finish(&selector_str);
2312 heap_free(selector);
2313 if(NS_FAILED(nsres)) {
2314 ERR("QuerySelectorAll failed: %08x\n", nsres);
2315 return E_FAIL;
2316 }
2317
2318 *ppelColl = create_collection_from_nodelist(This->doc_node, node_list);
2319 nsIDOMNodeList_Release(node_list);
2320 return S_OK;
2321}
2322
2323
2324static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
2325 IHTMLElement **pel)
2326{
2329 HRESULT hres;
2330
2331 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
2332
2333 hres = get_doc_elem_by_id(This->doc_node, v, &elem);
2334 if(FAILED(hres) || !elem) {
2335 *pel = NULL;
2336 return hres;
2337 }
2338
2339 *pel = &elem->IHTMLElement_iface;
2340 return S_OK;
2341}
2342
2343
2345 IHTMLElementCollection **pelColl)
2346{
2348 nsIDOMNodeList *nslist;
2349 nsAString id_str;
2350 nsresult nsres;
2351
2352 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
2353
2354 if(!This->doc_node->nsdoc) {
2355 WARN("NULL nsdoc\n");
2356 return E_UNEXPECTED;
2357 }
2358
2359 nsAString_InitDepend(&id_str, v);
2360 nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
2361 nsAString_Finish(&id_str);
2362 if(FAILED(nsres)) {
2363 ERR("GetElementByName failed: %08x\n", nsres);
2364 return E_FAIL;
2365 }
2366
2367 *pelColl = create_collection_from_nodelist(This->doc_node, nslist);
2368 nsIDOMNodeList_Release(nslist);
2369
2370 return S_OK;
2371}
2372
2373static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
2422};
2423
2424static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
2425{
2426 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
2427}
2428
2429static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
2430 REFIID riid, void **ppv)
2431{
2434}
2435
2436static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
2437{
2439 return htmldoc_addref(This);
2440}
2441
2442static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
2443{
2445 return htmldoc_release(This);
2446}
2447
2448static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
2449{
2451 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
2452}
2453
2454static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
2455 LCID lcid, ITypeInfo **ppTInfo)
2456{
2458 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2459}
2460
2462 LPOLESTR *rgszNames, UINT cNames,
2463 LCID lcid, DISPID *rgDispId)
2464{
2466 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
2467 rgDispId);
2468}
2469
2470static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
2471 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
2472 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
2473{
2475 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
2476 pDispParams, pVarResult, pExcepInfo, puArgErr);
2477}
2478
2479static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
2480{
2482 nsIDOMHTMLElement *nsbody;
2483 nsresult nsres;
2484
2485 TRACE("(%p)->()\n", This);
2486
2487 nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
2488 if(NS_FAILED(nsres) || !nsbody) {
2489 ERR("GetBody failed: %08x\n", nsres);
2490 return E_FAIL;
2491 }
2492
2493 nsres = nsIDOMHTMLElement_Focus(nsbody);
2494 nsIDOMHTMLElement_Release(nsbody);
2495 if(NS_FAILED(nsres)) {
2496 ERR("Focus failed: %08x\n", nsres);
2497 return E_FAIL;
2498 }
2499
2500 return S_OK;
2501}
2502
2503static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
2504{
2506 FIXME("(%p)->(%p)\n", This, pfFocus);
2507 return E_NOTIMPL;
2508}
2509
2511{
2513 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2514 return E_NOTIMPL;
2515}
2516
2518{
2520 FIXME("(%p)->(%p)\n", This, p);
2521 return E_NOTIMPL;
2522}
2523
2524static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
2525{
2527 FIXME("(%p)->(%p)\n", This, p);
2528 return E_NOTIMPL;
2529}
2530
2531static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
2532 BSTR bstrOptions, IHTMLDocument2 **newDoc)
2533{
2535 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
2536 return E_NOTIMPL;
2537}
2538
2539static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
2540{
2542 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
2543 return E_NOTIMPL;
2544}
2545
2546static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
2547{
2549 FIXME("(%p)->(%p)\n", This, p);
2550 return E_NOTIMPL;
2551}
2552
2554 VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
2555{
2557
2558 TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
2559
2560 if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) {
2561 FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject));
2562 return E_NOTIMPL;
2563 }
2564
2565 return create_event_obj(ppEventObj);
2566}
2567
2568static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
2569 VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
2570{
2572
2573 TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
2574
2575 return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
2576}
2577
2579 IHTMLRenderStyle **ppIHTMLRenderStyle)
2580{
2582 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
2583 return E_NOTIMPL;
2584}
2585
2587{
2589 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2590 return E_NOTIMPL;
2591}
2592
2594{
2596 FIXME("(%p)->(%p)\n", This, p);
2597 return E_NOTIMPL;
2598}
2599
2600static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
2601{
2603 FIXME("(%p)->(%p)\n", This, p);
2604 return E_NOTIMPL;
2605}
2606
2607static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
2629};
2630
2631static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
2632{
2633 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
2634}
2635
2636static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
2637 REFIID riid, void **ppv)
2638{
2641}
2642
2643static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
2644{
2646 return htmldoc_addref(This);
2647}
2648
2649static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
2650{
2652 return htmldoc_release(This);
2653}
2654
2655static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
2656{
2658 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
2659}
2660
2661static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
2662 LCID lcid, ITypeInfo **ppTInfo)
2663{
2665 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2666}
2667
2669 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
2670{
2672 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
2673 rgDispId);
2674}
2675
2676static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
2677 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
2678 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
2679{
2681 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
2682 pDispParams, pVarResult, pExcepInfo, puArgErr);
2683}
2684
2686{
2688 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2689 return E_NOTIMPL;
2690}
2691
2693{
2695 FIXME("(%p)->(%p)\n", This, p);
2696 return E_NOTIMPL;
2697}
2698
2699static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
2700{
2702 FIXME("(%p)->(%p)\n", This, p);
2703 return E_NOTIMPL;
2704}
2705
2706static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
2707{
2709 HTMLDocumentNode *doc_node = This->doc_node;
2710
2711 TRACE("(%p)->(%p)\n", This, p);
2712
2713 if(!doc_node->dom_implementation) {
2714 HRESULT hres;
2715
2717 if(FAILED(hres))
2718 return hres;
2719 }
2720
2721 IHTMLDOMImplementation_AddRef(doc_node->dom_implementation);
2722 *p = doc_node->dom_implementation;
2723 return S_OK;
2724}
2725
2726static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
2727 IHTMLDOMAttribute **ppattribute)
2728{
2731 HRESULT hres;
2732
2733 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
2734
2735 hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr);
2736 if(FAILED(hres))
2737 return hres;
2738
2739 *ppattribute = &attr->IHTMLDOMAttribute_iface;
2740 return S_OK;
2741}
2742
2743static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
2744 IHTMLDOMNode **ppRetNode)
2745{
2747 nsIDOMComment *nscomment;
2749 nsAString str;
2750 nsresult nsres;
2751 HRESULT hres;
2752
2753 TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
2754
2755 if(!This->doc_node->nsdoc) {
2756 WARN("NULL nsdoc\n");
2757 return E_UNEXPECTED;
2758 }
2759
2760 nsAString_InitDepend(&str, bstrdata);
2761 nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
2763 if(NS_FAILED(nsres)) {
2764 ERR("CreateTextNode failed: %08x\n", nsres);
2765 return E_FAIL;
2766 }
2767
2768 hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
2769 nsIDOMComment_Release(nscomment);
2770 if(FAILED(hres))
2771 return hres;
2772
2773 *ppRetNode = &elem->node.IHTMLDOMNode_iface;
2774 return S_OK;
2775}
2776
2778{
2780 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2781 return E_NOTIMPL;
2782}
2783
2784static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
2785{
2787 FIXME("(%p)->(%p)\n", This, p);
2788 return E_NOTIMPL;
2789}
2790
2792{
2794 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2795 return E_NOTIMPL;
2796}
2797
2798static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
2799{
2801 FIXME("(%p)->(%p)\n", This, p);
2802 return E_NOTIMPL;
2803}
2804
2806{
2808 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2809 return E_NOTIMPL;
2810}
2811
2812static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
2813{
2815 FIXME("(%p)->(%p)\n", This, p);
2816 return E_NOTIMPL;
2817}
2818
2820{
2822 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2823 return E_NOTIMPL;
2824}
2825
2827{
2829 FIXME("(%p)->(%p)\n", This, p);
2830 return E_NOTIMPL;
2831}
2832
2834{
2836 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2837 return E_NOTIMPL;
2838}
2839
2841{
2843 FIXME("(%p)->(%p)\n", This, p);
2844 return E_NOTIMPL;
2845}
2846
2848{
2850 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2851 return E_NOTIMPL;
2852}
2853
2855{
2857 FIXME("(%p)->(%p)\n", This, p);
2858 return E_NOTIMPL;
2859}
2860
2861static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
2862{
2864 nsAString mode_str;
2865 nsresult nsres;
2866
2867 TRACE("(%p)->(%p)\n", This, p);
2868
2869 if(!This->doc_node->nsdoc) {
2870 WARN("NULL nsdoc\n");
2871 return E_UNEXPECTED;
2872 }
2873
2874 nsAString_Init(&mode_str, NULL);
2875 nsres = nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
2876 return return_nsstr(nsres, &mode_str, p);
2877}
2878
2879static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
2906};
2907
2908static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
2909{
2910 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
2911}
2912
2913static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
2914 REFIID riid, void **ppv)
2915{
2918}
2919
2920static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
2921{
2923 return htmldoc_addref(This);
2924}
2925
2926static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
2927{
2929 return htmldoc_release(This);
2930}
2931
2932static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
2933{
2935 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
2936}
2937
2938static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
2939 LCID lcid, ITypeInfo **ppTInfo)
2940{
2942 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2943}
2944
2946 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
2947{
2949 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
2950 rgDispId);
2951}
2952
2953static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
2954 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
2955 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
2956{
2958 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
2959 pDispParams, pVarResult, pExcepInfo, puArgErr);
2960}
2961
2962static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
2963 IHTMLDocumentCompatibleInfoCollection **p)
2964{
2966 FIXME("(%p)->(%p)\n", This, p);
2967 return E_NOTIMPL;
2968}
2969
2970static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
2971 VARIANT *p)
2972{
2974 FIXME("(%p)->(%p)\n", This, p);
2975 return E_NOTIMPL;
2976}
2977
2978static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
2979 VARIANT *p)
2980{
2982 FIXME("(%p)->(%p)\n", This, p);
2983 return E_NOTIMPL;
2984}
2985
2987{
2989 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
2990 return E_NOTIMPL;
2991}
2992
2994 VARIANT *p)
2995{
2997 FIXME("(%p)->(%p)\n", This, p);
2998 return E_NOTIMPL;
2999}
3000
3002{
3004 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3005 return E_NOTIMPL;
3006}
3007
3008static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
3009 BSTR bstrId, IHTMLElement2 **p)
3010{
3012 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
3013 return E_NOTIMPL;
3014}
3015
3016static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
3017{
3019 FIXME("(%p)->()\n", This);
3020 return E_NOTIMPL;
3021}
3022
3023static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
3039};
3040
3041static inline HTMLDocument *impl_from_IHTMLDocument7(IHTMLDocument7 *iface)
3042{
3043 return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument7_iface);
3044}
3045
3046static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv)
3047{
3050}
3051
3052static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface)
3053{
3055 return htmldoc_addref(This);
3056}
3057
3058static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface)
3059{
3061 return htmldoc_release(This);
3062}
3063
3064static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo)
3065{
3067 return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
3068}
3069
3070static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo,
3071 LCID lcid, ITypeInfo **ppTInfo)
3072{
3074 return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3075}
3076
3078 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
3079{
3081 return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
3082 rgDispId);
3083}
3084
3085static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember,
3086 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
3087 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
3088{
3090 return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
3091 pDispParams, pVarResult, pExcepInfo, puArgErr);
3092}
3093
3095{
3097 FIXME("(%p)->(%p)\n", This, p);
3098 return E_NOTIMPL;
3099}
3100
3101static HRESULT WINAPI HTMLDocument7_createCDATASection(IHTMLDocument7 *iface, BSTR text, IHTMLDOMNode **newCDATASectionNode)
3102{
3104 FIXME("(%p)->(%p)\n", This, newCDATASectionNode);
3105 return E_NOTIMPL;
3106}
3107
3108static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSelection **ppIHTMLSelection)
3109{
3111 FIXME("(%p)->(%p)\n", This, ppIHTMLSelection);
3112 return E_NOTIMPL;
3113}
3114
3115static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
3116 BSTR bstrLocalName, IHTMLElementCollection **pelColl)
3117{
3119 FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrLocalName), pelColl);
3120 return E_NOTIMPL;
3121}
3122
3123static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrTag, IHTMLElement **newElem)
3124{
3126 FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrTag), newElem);
3127 return E_NOTIMPL;
3128}
3129
3130static HRESULT WINAPI HTMLDocument7_createAttributeNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
3131 BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
3132{
3134 FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrAttrName), ppAttribute);
3135 return E_NOTIMPL;
3136}
3137
3139{
3141 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3142 return E_NOTIMPL;
3143}
3144
3146{
3148 FIXME("(%p)->(%p)\n", This, p);
3149 return E_NOTIMPL;
3150}
3151
3152static HRESULT WINAPI HTMLDocument7_get_characterSet(IHTMLDocument7 *iface, BSTR *p)
3153{
3155 FIXME("(%p)->(%p)\n", This, p);
3156 return E_NOTIMPL;
3157}
3158
3159static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bstrTag, IHTMLElement **newElem)
3160{
3162 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem);
3163 return E_NOTIMPL;
3164}
3165
3166static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
3167{
3169 FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
3170 return E_NOTIMPL;
3171}
3172
3173static HRESULT WINAPI HTMLDocument7_getElementByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel)
3174{
3176 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
3177 return E_NOTIMPL;
3178}
3179
3181 BSTR data, IDOMProcessingInstruction **newProcessingInstruction)
3182{
3184 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), newProcessingInstruction);
3185 return E_NOTIMPL;
3186}
3187
3188static HRESULT WINAPI HTMLDocument7_adoptNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, IHTMLDOMNode3 **ppNodeDest)
3189{
3191 FIXME("(%p)->(%p %p)\n", This, pNodeSource, ppNodeDest);
3192 return E_NOTIMPL;
3193}
3194
3196{
3198 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3199 return E_NOTIMPL;
3200}
3201
3203{
3205 FIXME("(%p)->(%p)\n", This, p);
3206 return E_NOTIMPL;
3207}
3208
3209static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementCollection **p)
3210{
3212 FIXME("(%p)->(%p)\n", This, p);
3213 return E_NOTIMPL;
3214}
3215
3216static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p)
3217{
3219 FIXME("(%p)->(%p)\n", This, p);
3220 return E_NOTIMPL;
3221}
3222
3223static HRESULT WINAPI HTMLDocument7_get_xmlEncoding(IHTMLDocument7 *iface, BSTR *p)
3224{
3226 FIXME("(%p)->(%p)\n", This, p);
3227 return E_NOTIMPL;
3228}
3229
3231{
3233 FIXME("(%p)->(%x)\n", This, v);
3234 return E_NOTIMPL;
3235}
3236
3238{
3240 FIXME("(%p)->(%p)\n", This, p);
3241 return E_NOTIMPL;
3242}
3243
3244static HRESULT WINAPI HTMLDocument7_put_xmlVersion(IHTMLDocument7 *iface, BSTR v)
3245{
3247 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
3248 return E_NOTIMPL;
3249}
3250
3251static HRESULT WINAPI HTMLDocument7_get_xmlVersion(IHTMLDocument7 *iface, BSTR *p)
3252{
3254 FIXME("(%p)->(%p)\n", This, p);
3255 return E_NOTIMPL;
3256}
3257
3258static HRESULT WINAPI HTMLDocument7_hasAttributes(IHTMLDocument7 *iface, VARIANT_BOOL *pfHasAttributes)
3259{
3261 FIXME("(%p)->(%p)\n", This, pfHasAttributes);
3262 return E_NOTIMPL;
3263}
3264
3265static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v)
3266{
3268 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3269 return E_NOTIMPL;
3270}
3271
3272static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *p)
3273{
3275 FIXME("(%p)->(%p)\n", This, p);
3276 return E_NOTIMPL;
3277}
3278
3279static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v)
3280{
3282 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3283 return E_NOTIMPL;
3284}
3285
3286static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p)
3287{
3289 FIXME("(%p)->(%p)\n", This, p);
3290 return E_NOTIMPL;
3291}
3292
3294{
3296 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3297 return E_NOTIMPL;
3298}
3299
3300static HRESULT WINAPI HTMLDocument7_get_oncanplay(IHTMLDocument7 *iface, VARIANT *p)
3301{
3303 FIXME("(%p)->(%p)\n", This, p);
3304 return E_NOTIMPL;
3305}
3306
3308{
3310 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3311 return E_NOTIMPL;
3312}
3313
3315{
3317 FIXME("(%p)->(%p)\n", This, p);
3318 return E_NOTIMPL;
3319}
3320
3321static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT v)
3322{
3324 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3325 return E_NOTIMPL;
3326}
3327
3328static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT *p)
3329{
3331 FIXME("(%p)->(%p)\n", This, p);
3332 return E_NOTIMPL;
3333}
3334
3335static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v)
3336{
3338 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3339 return E_NOTIMPL;
3340}
3341
3342static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p)
3343{
3345 FIXME("(%p)->(%p)\n", This, p);
3346 return E_NOTIMPL;
3347}
3348
3350{
3352 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3353 return E_NOTIMPL;
3354}
3355
3356static HRESULT WINAPI HTMLDocument7_get_ondragend(IHTMLDocument7 *iface, VARIANT *p)
3357{
3359 FIXME("(%p)->(%p)\n", This, p);
3360 return E_NOTIMPL;
3361}
3362
3364{
3366 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3367 return E_NOTIMPL;
3368}
3369
3371{
3373 FIXME("(%p)->(%p)\n", This, p);
3374 return E_NOTIMPL;
3375}
3376
3378{
3380 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3381 return E_NOTIMPL;
3382}
3383
3385{
3387 FIXME("(%p)->(%p)\n", This, p);
3388 return E_NOTIMPL;
3389}
3390
3392{
3394 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3395 return E_NOTIMPL;
3396}
3397
3398static HRESULT WINAPI HTMLDocument7_get_ondragover(IHTMLDocument7 *iface, VARIANT *p)
3399{
3401 FIXME("(%p)->(%p)\n", This, p);
3402 return E_NOTIMPL;
3403}
3404
3405static HRESULT WINAPI HTMLDocument7_put_ondrop(IHTMLDocument7 *iface, VARIANT v)
3406{
3408 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3409 return E_NOTIMPL;
3410}
3411
3412static HRESULT WINAPI HTMLDocument7_get_ondrop(IHTMLDocument7 *iface, VARIANT *p)
3413{
3415 FIXME("(%p)->(%p)\n", This, p);
3416 return E_NOTIMPL;
3417}
3418
3420{
3422 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3423 return E_NOTIMPL;
3424}
3425
3427{
3429 FIXME("(%p)->(%p)\n", This, p);
3430 return E_NOTIMPL;
3431}
3432
3434{
3436 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3437 return E_NOTIMPL;
3438}
3439
3440static HRESULT WINAPI HTMLDocument7_get_onemptied(IHTMLDocument7 *iface, VARIANT *p)
3441{
3443 FIXME("(%p)->(%p)\n", This, p);
3444 return E_NOTIMPL;
3445}
3446
3447static HRESULT WINAPI HTMLDocument7_put_onended(IHTMLDocument7 *iface, VARIANT v)
3448{
3450 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3451 return E_NOTIMPL;
3452}
3453
3454static HRESULT WINAPI HTMLDocument7_get_onended(IHTMLDocument7 *iface, VARIANT *p)
3455{
3457 FIXME("(%p)->(%p)\n", This, p);
3458 return E_NOTIMPL;
3459}
3460
3461static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v)
3462{
3464 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3465 return E_NOTIMPL;
3466}
3467
3468static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *p)
3469{
3471 FIXME("(%p)->(%p)\n", This, p);
3472 return E_NOTIMPL;
3473}
3474
3475static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v)
3476{
3478 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3479 return E_NOTIMPL;
3480}
3481
3482static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *p)
3483{
3485 FIXME("(%p)->(%p)\n", This, p);
3486 return E_NOTIMPL;
3487}
3488
3489static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v)
3490{
3492 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3493 return E_NOTIMPL;
3494}
3495
3496static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *p)
3497{
3499 FIXME("(%p)->(%p)\n", This, p);
3500 return E_NOTIMPL;
3501}
3502
3503static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v)
3504{
3506 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3507 return E_NOTIMPL;
3508}
3509
3510static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p)
3511{
3513 FIXME("(%p)->(%p)\n", This, p);
3514 return E_NOTIMPL;
3515}
3516
3518{
3520 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3521 return E_NOTIMPL;
3522}
3523
3525{
3527 FIXME("(%p)->(%p)\n", This, p);
3528 return E_NOTIMPL;
3529}
3530
3532{
3534 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3535 return E_NOTIMPL;
3536}
3537
3539{
3541 FIXME("(%p)->(%p)\n", This, p);
3542 return E_NOTIMPL;
3543}
3544
3546{
3548 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3549 return E_NOTIMPL;
3550}
3551
3553{
3555 FIXME("(%p)->(%p)\n", This, p);
3556 return E_NOTIMPL;
3557}
3558
3559static HRESULT WINAPI HTMLDocument7_put_onpause(IHTMLDocument7 *iface, VARIANT v)
3560{
3562 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3563 return E_NOTIMPL;
3564}
3565
3566static HRESULT WINAPI HTMLDocument7_get_onpause(IHTMLDocument7 *iface, VARIANT *p)
3567{
3569 FIXME("(%p)->(%p)\n", This, p);
3570 return E_NOTIMPL;
3571}
3572
3573static HRESULT WINAPI HTMLDocument7_put_onplay(IHTMLDocument7 *iface, VARIANT v)
3574{
3576 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3577 return E_NOTIMPL;
3578}
3579
3580static HRESULT WINAPI HTMLDocument7_get_onplay(IHTMLDocument7 *iface, VARIANT *p)
3581{
3583 FIXME("(%p)->(%p)\n", This, p);
3584 return E_NOTIMPL;
3585}
3586
3588{
3590 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3591 return E_NOTIMPL;
3592}
3593
3594static HRESULT WINAPI HTMLDocument7_get_onplaying(IHTMLDocument7 *iface, VARIANT *p)
3595{
3597 FIXME("(%p)->(%p)\n", This, p);
3598 return E_NOTIMPL;
3599}
3600
3602{
3604 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3605 return E_NOTIMPL;
3606}
3607
3608static HRESULT WINAPI HTMLDocument7_get_onprogress(IHTMLDocument7 *iface, VARIANT *p)
3609{
3611 FIXME("(%p)->(%p)\n", This, p);
3612 return E_NOTIMPL;
3613}
3614
3616{
3618 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3619 return E_NOTIMPL;
3620}
3621
3623{
3625 FIXME("(%p)->(%p)\n", This, p);
3626 return E_NOTIMPL;
3627}
3628
3629static HRESULT WINAPI HTMLDocument7_put_onreset(IHTMLDocument7 *iface, VARIANT v)
3630{
3632 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3633 return E_NOTIMPL;
3634}
3635
3636static HRESULT WINAPI HTMLDocument7_get_onreset(IHTMLDocument7 *iface, VARIANT *p)
3637{
3639 FIXME("(%p)->(%p)\n", This, p);
3640 return E_NOTIMPL;
3641}
3642
3643static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT v)
3644{
3646 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
3647 return E_NOTIMPL;
3648}
3649
3650static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT *