2 * Copyright 2005 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
34 #include "htmlevent.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 #define HTMLDOC3_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument3, iface)
40 static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
41 REFIID riid, void **ppv)
43 HTMLDocument *This = HTMLDOC3_THIS(iface);
44 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
47 static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
49 HTMLDocument *This = HTMLDOC3_THIS(iface);
50 return IHTMLDocument2_AddRef(HTMLDOC(This));
53 static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
55 HTMLDocument *This = HTMLDOC3_THIS(iface);
56 return IHTMLDocument2_Release(HTMLDOC(This));
59 static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
61 HTMLDocument *This = HTMLDOC3_THIS(iface);
62 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
65 static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
66 LCID lcid, ITypeInfo **ppTInfo)
68 HTMLDocument *This = HTMLDOC3_THIS(iface);
69 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
72 static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
73 LPOLESTR *rgszNames, UINT cNames,
74 LCID lcid, DISPID *rgDispId)
76 HTMLDocument *This = HTMLDOC3_THIS(iface);
77 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
80 static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
81 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
82 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
84 HTMLDocument *This = HTMLDOC3_THIS(iface);
85 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
86 pVarResult, pExcepInfo, puArgErr);
89 static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
91 HTMLDocument *This = HTMLDOC3_THIS(iface);
92 FIXME("(%p)\n", This);
96 static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
98 HTMLDocument *This = HTMLDOC3_THIS(iface);
99 FIXME("(%p)->(%x)\n", This, fForce);
103 static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
104 IHTMLDOMNode **newTextNode)
106 HTMLDocument *This = HTMLDOC3_THIS(iface);
113 TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
115 if(!This->doc_node->nsdoc) {
116 WARN("NULL nsdoc\n");
120 nsAString_InitDepend(&text_str, text);
121 nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
122 nsAString_Finish(&text_str);
123 if(NS_FAILED(nsres)) {
124 ERR("CreateTextNode failed: %08x\n", nsres);
128 hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
129 nsIDOMElement_Release(nstext);
133 *newTextNode = HTMLDOMNODE(node);
134 IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
138 static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
140 HTMLDocument *This = HTMLDOC3_THIS(iface);
141 nsIDOMElement *nselem = NULL;
146 TRACE("(%p)->(%p)\n", This, p);
148 if(This->window->readystate == READYSTATE_UNINITIALIZED) {
153 if(!This->doc_node->nsdoc) {
154 WARN("NULL nsdoc\n");
158 nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
159 if(NS_FAILED(nsres)) {
160 ERR("GetDocumentElement failed: %08x\n", nsres);
169 hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
170 nsIDOMElement_Release(nselem);
174 return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
177 static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
179 HTMLDocument *This = HTMLDOC3_THIS(iface);
180 FIXME("(%p)->(%p)\n", This, p);
184 static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
185 IDispatch* pDisp, VARIANT_BOOL *pfResult)
187 HTMLDocument *This = HTMLDOC3_THIS(iface);
189 TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
191 return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult);
194 static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
197 HTMLDocument *This = HTMLDOC3_THIS(iface);
199 TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
201 return detach_event(This->doc_node->node.event_target, This, event, pDisp);
204 static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
206 HTMLDocument *This = HTMLDOC3_THIS(iface);
207 FIXME("(%p)->()\n", This);
211 static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
213 HTMLDocument *This = HTMLDOC3_THIS(iface);
214 FIXME("(%p)->(%p)\n", This, p);
218 static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
220 HTMLDocument *This = HTMLDOC3_THIS(iface);
221 FIXME("(%p)->()\n", This);
225 static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
227 HTMLDocument *This = HTMLDOC3_THIS(iface);
228 FIXME("(%p)->(%p)\n", This, p);
232 static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
234 HTMLDocument *This = HTMLDOC3_THIS(iface);
235 FIXME("(%p)->()\n", This);
239 static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
241 HTMLDocument *This = HTMLDOC3_THIS(iface);
242 FIXME("(%p)->(%p)\n", This, p);
246 static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
248 HTMLDocument *This = HTMLDOC3_THIS(iface);
249 FIXME("(%p)->()\n", This);
253 static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
255 HTMLDocument *This = HTMLDOC3_THIS(iface);
256 FIXME("(%p)->(%p)\n", This, p);
260 static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
262 HTMLDocument *This = HTMLDOC3_THIS(iface);
263 FIXME("(%p)->()\n", This);
267 static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
269 HTMLDocument *This = HTMLDOC3_THIS(iface);
270 FIXME("(%p)->(%p)\n", This, p);
274 static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
276 HTMLDocument *This = HTMLDOC3_THIS(iface);
277 FIXME("(%p)->()\n", This);
281 static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
283 HTMLDocument *This = HTMLDOC3_THIS(iface);
284 FIXME("(%p)->(%p)\n", This, p);
288 static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
290 HTMLDocument *This = HTMLDOC3_THIS(iface);
291 FIXME("(%p)->()\n", This);
295 static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
297 HTMLDocument *This = HTMLDOC3_THIS(iface);
298 FIXME("(%p)->(%p)\n", This, p);
302 static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
304 HTMLDocument *This = HTMLDOC3_THIS(iface);
305 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
309 static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
311 HTMLDocument *This = HTMLDOC3_THIS(iface);
312 FIXME("(%p)->(%p)\n", This, p);
316 static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
318 HTMLDocument *This = HTMLDOC3_THIS(iface);
320 TRACE("(%p)->()\n", This);
322 return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
325 static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
327 HTMLDocument *This = HTMLDOC3_THIS(iface);
329 TRACE("(%p)->(%p)\n", This, p);
331 return get_doc_event(This, EVENTID_CONTEXTMENU, p);
334 static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
336 HTMLDocument *This = HTMLDOC3_THIS(iface);
337 FIXME("(%p)->()\n", This);
341 static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
343 HTMLDocument *This = HTMLDOC3_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, p);
348 static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
349 IHTMLDocument2 **ppNewDoc)
351 HTMLDocument *This = HTMLDOC3_THIS(iface);
352 nsIDOMDocumentFragment *doc_frag;
353 HTMLDocumentNode *docnode;
357 TRACE("(%p)->(%p)\n", This, ppNewDoc);
359 if(!This->doc_node->nsdoc) {
360 FIXME("NULL nsdoc\n");
364 nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
365 if(NS_FAILED(nsres)) {
366 ERR("CreateDocumentFragment failed: %08x\n", nsres);
370 hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
371 nsIDOMDocumentFragment_Release(doc_frag);
375 *ppNewDoc = HTMLDOC(&docnode->basedoc);
379 static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
382 HTMLDocument *This = HTMLDOC3_THIS(iface);
383 FIXME("(%p)->(%p)\n", This, p);
387 static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
390 HTMLDocument *This = HTMLDOC3_THIS(iface);
391 FIXME("(%p)->(%x)\n", This, v);
395 static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
398 HTMLDocument *This = HTMLDOC3_THIS(iface);
399 FIXME("(%p)->(%p)\n", This, p);
403 static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
405 HTMLDocument *This = HTMLDOC3_THIS(iface);
406 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
410 static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
412 HTMLDocument *This = HTMLDOC3_THIS(iface);
413 FIXME("(%p)->(%p)\n", This, p);
417 static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
419 HTMLDocument *This = HTMLDOC3_THIS(iface);
420 FIXME("(%p)->(%p)\n", This, p);
424 static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
427 HTMLDocument *This = HTMLDOC3_THIS(iface);
428 FIXME("(%p)->()\n", This);
432 static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
435 HTMLDocument *This = HTMLDOC3_THIS(iface);
436 FIXME("(%p)->(%p)\n", This, p);
440 static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
442 HTMLDocument *This = HTMLDOC3_THIS(iface);
443 FIXME("(%p)->()\n", This);
447 static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
449 HTMLDocument *This = HTMLDOC3_THIS(iface);
450 FIXME("(%p)->(%p)\n", This, p);
454 static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
455 IHTMLElementCollection **ppelColl)
457 HTMLDocument *This = HTMLDOC3_THIS(iface);
458 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
463 static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
466 HTMLDocument *This = HTMLDOC3_THIS(iface);
467 nsIDOMElement *nselem;
469 nsIDOMNode *nsnode, *nsnode_by_id, *nsnode_by_name;
470 nsIDOMNodeList *nsnode_list;
475 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
477 if(!This->doc_node->nsdoc) {
478 WARN("NULL nsdoc\n");
482 nsAString_InitDepend(&id_str, v);
483 /* get element by id attribute */
484 nsres = nsIDOMHTMLDocument_GetElementById(This->doc_node->nsdoc, &id_str, &nselem);
486 ERR("GetElementById failed: %08x\n", nsres);
487 nsAString_Finish(&id_str);
490 nsnode_by_id = (nsIDOMNode*)nselem;
492 /* get first element by name attribute */
493 nsres = nsIDOMHTMLDocument_GetElementsByName(This->doc_node->nsdoc, &id_str, &nsnode_list);
494 nsAString_Finish(&id_str);
496 ERR("getElementsByName failed: %08x\n", nsres);
498 nsIDOMNode_Release(nsnode_by_id);
501 nsIDOMNodeList_Item(nsnode_list, 0, &nsnode_by_name);
502 nsIDOMNodeList_Release(nsnode_list);
505 if(nsnode_by_name && nsnode_by_id) {
509 nsres = nsIDOMNode_QueryInterface(nsnode_by_name, &IID_nsIDOM3Node, (void**)&node3);
510 if(NS_FAILED(nsres)) {
511 FIXME("failed to get nsIDOM3Node interface: 0x%08x\n", nsres);
512 nsIDOMNode_Release(nsnode_by_name);
513 nsIDOMNode_Release(nsnode_by_id);
517 nsres = nsIDOM3Node_CompareDocumentPosition(node3, nsnode_by_id, &pos);
518 nsIDOM3Node_Release(node3);
519 if(NS_FAILED(nsres)) {
520 FIXME("nsIDOM3Node_CompareDocumentPosition failed: 0x%08x\n", nsres);
521 nsIDOMNode_Release(nsnode_by_name);
522 nsIDOMNode_Release(nsnode_by_id);
526 TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
527 if(pos & PRECEDING || pos & CONTAINS) {
528 nsnode = nsnode_by_id;
529 nsIDOMNode_Release(nsnode_by_name);
531 nsnode = nsnode_by_name;
532 nsIDOMNode_Release(nsnode_by_id);
535 nsnode = nsnode_by_name ? nsnode_by_name : nsnode_by_id;
538 hres = get_node(This->doc_node, nsnode, TRUE, &node);
539 nsIDOMNode_Release(nsnode);
542 hres = IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel);
552 static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
553 IHTMLElementCollection **pelColl)
555 HTMLDocument *This = HTMLDOC3_THIS(iface);
556 nsIDOMNodeList *nslist;
557 nsAString id_str, ns_str;
559 static const WCHAR str[] = {'*',0};
561 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
563 if(!This->doc_node->nsdoc) {
564 WARN("NULL nsdoc\n");
568 nsAString_InitDepend(&id_str, v);
569 nsAString_InitDepend(&ns_str, str);
570 nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->doc_node->nsdoc, &ns_str, &id_str, &nslist);
571 nsAString_Finish(&id_str);
572 nsAString_Finish(&ns_str);
574 ERR("GetElementByName failed: %08x\n", nsres);
578 *pelColl = (IHTMLElementCollection*)create_collection_from_nodelist(This->doc_node, (IUnknown*)HTMLDOC3(This), nslist);
579 nsIDOMNodeList_Release(nslist);
586 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
587 HTMLDocument3_QueryInterface,
588 HTMLDocument3_AddRef,
589 HTMLDocument3_Release,
590 HTMLDocument3_GetTypeInfoCount,
591 HTMLDocument3_GetTypeInfo,
592 HTMLDocument3_GetIDsOfNames,
593 HTMLDocument3_Invoke,
594 HTMLDocument3_releaseCapture,
595 HTMLDocument3_recalc,
596 HTMLDocument3_createTextNode,
597 HTMLDocument3_get_documentElement,
598 HTMLDocument3_uniqueID,
599 HTMLDocument3_attachEvent,
600 HTMLDocument3_detachEvent,
601 HTMLDocument3_put_onrowsdelete,
602 HTMLDocument3_get_onrowsdelete,
603 HTMLDocument3_put_onrowsinserted,
604 HTMLDocument3_get_onrowsinserted,
605 HTMLDocument3_put_oncellchange,
606 HTMLDocument3_get_oncellchange,
607 HTMLDocument3_put_ondatasetchanged,
608 HTMLDocument3_get_ondatasetchanged,
609 HTMLDocument3_put_ondataavailable,
610 HTMLDocument3_get_ondataavailable,
611 HTMLDocument3_put_ondatasetcomplete,
612 HTMLDocument3_get_ondatasetcomplete,
613 HTMLDocument3_put_onpropertychange,
614 HTMLDocument3_get_onpropertychange,
615 HTMLDocument3_put_dir,
616 HTMLDocument3_get_dir,
617 HTMLDocument3_put_oncontextmenu,
618 HTMLDocument3_get_oncontextmenu,
619 HTMLDocument3_put_onstop,
620 HTMLDocument3_get_onstop,
621 HTMLDocument3_createDocumentFragment,
622 HTMLDocument3_get_parentDocument,
623 HTMLDocument3_put_enableDownload,
624 HTMLDocument3_get_enableDownload,
625 HTMLDocument3_put_baseUrl,
626 HTMLDocument3_get_baseUrl,
627 HTMLDocument3_get_childNodes,
628 HTMLDocument3_put_inheritStyleSheets,
629 HTMLDocument3_get_inheritStyleSheets,
630 HTMLDocument3_put_onbeforeeditfocus,
631 HTMLDocument3_get_onbeforeeditfocus,
632 HTMLDocument3_getElementsByName,
633 HTMLDocument3_getElementById,
634 HTMLDocument3_getElementsByTagName
637 #define HTMLDOC4_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument4, iface)
639 static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
640 REFIID riid, void **ppv)
642 HTMLDocument *This = HTMLDOC4_THIS(iface);
643 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
646 static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
648 HTMLDocument *This = HTMLDOC4_THIS(iface);
649 return IHTMLDocument2_AddRef(HTMLDOC(This));
652 static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
654 HTMLDocument *This = HTMLDOC4_THIS(iface);
655 return IHTMLDocument2_Release(HTMLDOC(This));
658 static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
660 HTMLDocument *This = HTMLDOC4_THIS(iface);
661 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
664 static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
665 LCID lcid, ITypeInfo **ppTInfo)
667 HTMLDocument *This = HTMLDOC4_THIS(iface);
668 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
671 static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
672 LPOLESTR *rgszNames, UINT cNames,
673 LCID lcid, DISPID *rgDispId)
675 HTMLDocument *This = HTMLDOC4_THIS(iface);
676 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
679 static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
680 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
681 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
683 HTMLDocument *This = HTMLDOC4_THIS(iface);
684 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
685 pVarResult, pExcepInfo, puArgErr);
688 static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
690 HTMLDocument *This = HTMLDOC4_THIS(iface);
691 nsIDOMNSHTMLElement *nselem;
692 nsIDOMHTMLElement *nsbody;
695 TRACE("(%p)->()\n", This);
697 nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
698 if(NS_FAILED(nsres) || !nsbody) {
699 ERR("GetBody failed: %08x\n", nsres);
703 nsres = nsIDOMHTMLElement_QueryInterface(nsbody, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
704 nsIDOMHTMLElement_Release(nsbody);
705 if(NS_FAILED(nsres)) {
706 ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres);
710 nsres = nsIDOMNSHTMLElement_Focus(nselem);
711 nsIDOMNSHTMLElement_Release(nselem);
712 if(NS_FAILED(nsres)) {
713 ERR("Focus failed: %08x\n", nsres);
720 static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
722 HTMLDocument *This = HTMLDOC4_THIS(iface);
723 FIXME("(%p)->(%p)\n", This, pfFocus);
727 static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
729 HTMLDocument *This = HTMLDOC4_THIS(iface);
730 FIXME("(%p)->(v)\n", This);
734 static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
736 HTMLDocument *This = HTMLDOC4_THIS(iface);
737 FIXME("(%p)->(%p)\n", This, p);
741 static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
743 HTMLDocument *This = HTMLDOC4_THIS(iface);
744 FIXME("(%p)->(%p)\n", This, p);
748 static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
749 BSTR bstrOptions, IHTMLDocument2 **newDoc)
751 HTMLDocument *This = HTMLDOC4_THIS(iface);
752 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
756 static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
758 HTMLDocument *This = HTMLDOC4_THIS(iface);
759 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
763 static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
765 HTMLDocument *This = HTMLDOC4_THIS(iface);
766 FIXME("(%p)->(%p)\n", This, p);
770 static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
771 VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
773 HTMLDocument *This = HTMLDOC4_THIS(iface);
774 FIXME("(%p)->(%p %p)\n", This, pvarEventObject, ppEventObj);
778 static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
779 VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
781 HTMLDocument *This = HTMLDOC4_THIS(iface);
782 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
786 static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
787 IHTMLRenderStyle **ppIHTMLRenderStyle)
789 HTMLDocument *This = HTMLDOC4_THIS(iface);
790 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
794 static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
796 HTMLDocument *This = HTMLDOC4_THIS(iface);
797 FIXME("(%p)->(v)\n", This);
801 static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
803 HTMLDocument *This = HTMLDOC4_THIS(iface);
804 FIXME("(%p)->(%p)\n", This, p);
808 static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
810 HTMLDocument *This = HTMLDOC4_THIS(iface);
811 FIXME("(%p)->(%p)\n", This, p);
817 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
818 HTMLDocument4_QueryInterface,
819 HTMLDocument4_AddRef,
820 HTMLDocument4_Release,
821 HTMLDocument4_GetTypeInfoCount,
822 HTMLDocument4_GetTypeInfo,
823 HTMLDocument4_GetIDsOfNames,
824 HTMLDocument4_Invoke,
826 HTMLDocument4_hasFocus,
827 HTMLDocument4_put_onselectionchange,
828 HTMLDocument4_get_onselectionchange,
829 HTMLDocument4_get_namespace,
830 HTMLDocument4_createDocumentFromUrl,
831 HTMLDocument4_put_media,
832 HTMLDocument4_get_media,
833 HTMLDocument4_createEventObject,
834 HTMLDocument4_fireEvent,
835 HTMLDocument4_createRenderStyle,
836 HTMLDocument4_put_oncontrolselect,
837 HTMLDocument4_get_oncontrolselect,
838 HTMLDocument4_get_URLEncoded
841 void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
843 This->lpHTMLDocument3Vtbl = &HTMLDocument3Vtbl;
844 This->lpHTMLDocument4Vtbl = &HTMLDocument4Vtbl;