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);
112 TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
114 if(!This->doc_node->nsdoc) {
115 WARN("NULL nsdoc\n");
119 nsAString_InitDepend(&text_str, text);
120 nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
121 nsAString_Finish(&text_str);
122 if(NS_FAILED(nsres)) {
123 ERR("CreateTextNode failed: %08x\n", nsres);
127 node = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext);
128 nsIDOMElement_Release(nstext);
130 *newTextNode = HTMLDOMNODE(node);
131 IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
135 static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
137 HTMLDocument *This = HTMLDOC3_THIS(iface);
138 nsIDOMElement *nselem = NULL;
142 TRACE("(%p)->(%p)\n", This, p);
144 if(This->window->readystate == READYSTATE_UNINITIALIZED) {
149 if(!This->doc_node->nsdoc) {
150 WARN("NULL nsdoc\n");
154 nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
155 if(NS_FAILED(nsres)) {
156 ERR("GetDocumentElement failed: %08x\n", nsres);
161 node = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE);
162 nsIDOMElement_Release(nselem);
163 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
171 static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
173 HTMLDocument *This = HTMLDOC3_THIS(iface);
174 FIXME("(%p)->(%p)\n", This, p);
178 static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
179 IDispatch* pDisp, VARIANT_BOOL *pfResult)
181 HTMLDocument *This = HTMLDOC3_THIS(iface);
183 TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
185 return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult);
188 static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
191 HTMLDocument *This = HTMLDOC3_THIS(iface);
193 TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
195 return detach_event(This->doc_node->node.event_target, This, event, pDisp);
198 static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
200 HTMLDocument *This = HTMLDOC3_THIS(iface);
201 FIXME("(%p)->()\n", This);
205 static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
207 HTMLDocument *This = HTMLDOC3_THIS(iface);
208 FIXME("(%p)->(%p)\n", This, p);
212 static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
214 HTMLDocument *This = HTMLDOC3_THIS(iface);
215 FIXME("(%p)->()\n", This);
219 static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
221 HTMLDocument *This = HTMLDOC3_THIS(iface);
222 FIXME("(%p)->(%p)\n", This, p);
226 static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
228 HTMLDocument *This = HTMLDOC3_THIS(iface);
229 FIXME("(%p)->()\n", This);
233 static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
235 HTMLDocument *This = HTMLDOC3_THIS(iface);
236 FIXME("(%p)->(%p)\n", This, p);
240 static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
242 HTMLDocument *This = HTMLDOC3_THIS(iface);
243 FIXME("(%p)->()\n", This);
247 static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
249 HTMLDocument *This = HTMLDOC3_THIS(iface);
250 FIXME("(%p)->(%p)\n", This, p);
254 static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
256 HTMLDocument *This = HTMLDOC3_THIS(iface);
257 FIXME("(%p)->()\n", This);
261 static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
263 HTMLDocument *This = HTMLDOC3_THIS(iface);
264 FIXME("(%p)->(%p)\n", This, p);
268 static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
270 HTMLDocument *This = HTMLDOC3_THIS(iface);
271 FIXME("(%p)->()\n", This);
275 static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
277 HTMLDocument *This = HTMLDOC3_THIS(iface);
278 FIXME("(%p)->(%p)\n", This, p);
282 static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
284 HTMLDocument *This = HTMLDOC3_THIS(iface);
285 FIXME("(%p)->()\n", This);
289 static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
291 HTMLDocument *This = HTMLDOC3_THIS(iface);
292 FIXME("(%p)->(%p)\n", This, p);
296 static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
298 HTMLDocument *This = HTMLDOC3_THIS(iface);
299 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
303 static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
305 HTMLDocument *This = HTMLDOC3_THIS(iface);
306 FIXME("(%p)->(%p)\n", This, p);
310 static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
312 HTMLDocument *This = HTMLDOC3_THIS(iface);
314 TRACE("(%p)->()\n", This);
316 return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
319 static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
321 HTMLDocument *This = HTMLDOC3_THIS(iface);
323 TRACE("(%p)->(%p)\n", This, p);
325 return get_doc_event(This, EVENTID_CONTEXTMENU, p);
328 static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
330 HTMLDocument *This = HTMLDOC3_THIS(iface);
331 FIXME("(%p)->()\n", This);
335 static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
337 HTMLDocument *This = HTMLDOC3_THIS(iface);
338 FIXME("(%p)->(%p)\n", This, p);
342 static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
343 IHTMLDocument2 **ppNewDoc)
345 HTMLDocument *This = HTMLDOC3_THIS(iface);
346 nsIDOMDocumentFragment *doc_frag;
347 HTMLDocumentNode *docnode;
351 TRACE("(%p)->(%p)\n", This, ppNewDoc);
353 if(!This->doc_node->nsdoc) {
354 FIXME("NULL nsdoc\n");
358 nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
359 if(NS_FAILED(nsres)) {
360 ERR("CreateDocumentFragment failed: %08x\n", nsres);
364 hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
365 nsIDOMDocumentFragment_Release(doc_frag);
369 *ppNewDoc = HTMLDOC(&docnode->basedoc);
373 static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
376 HTMLDocument *This = HTMLDOC3_THIS(iface);
377 FIXME("(%p)->(%p)\n", This, p);
381 static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
384 HTMLDocument *This = HTMLDOC3_THIS(iface);
385 FIXME("(%p)->(%x)\n", This, v);
389 static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
392 HTMLDocument *This = HTMLDOC3_THIS(iface);
393 FIXME("(%p)->(%p)\n", This, p);
397 static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
399 HTMLDocument *This = HTMLDOC3_THIS(iface);
400 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
404 static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
406 HTMLDocument *This = HTMLDOC3_THIS(iface);
407 FIXME("(%p)->(%p)\n", This, p);
411 static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
413 HTMLDocument *This = HTMLDOC3_THIS(iface);
414 FIXME("(%p)->(%p)\n", This, p);
418 static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
421 HTMLDocument *This = HTMLDOC3_THIS(iface);
422 FIXME("(%p)->()\n", This);
426 static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
429 HTMLDocument *This = HTMLDOC3_THIS(iface);
430 FIXME("(%p)->(%p)\n", This, p);
434 static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
436 HTMLDocument *This = HTMLDOC3_THIS(iface);
437 FIXME("(%p)->()\n", This);
441 static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
443 HTMLDocument *This = HTMLDOC3_THIS(iface);
444 FIXME("(%p)->(%p)\n", This, p);
448 static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
449 IHTMLElementCollection **ppelColl)
451 HTMLDocument *This = HTMLDOC3_THIS(iface);
452 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
457 static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
460 HTMLDocument *This = HTMLDOC3_THIS(iface);
461 nsIDOMElement *nselem;
463 nsIDOMNode *nsnode, *nsnode_by_id, *nsnode_by_name;
464 nsIDOMNodeList *nsnode_list;
468 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
470 if(!This->doc_node->nsdoc) {
471 WARN("NULL nsdoc\n");
475 nsAString_InitDepend(&id_str, v);
476 /* get element by id attribute */
477 nsres = nsIDOMHTMLDocument_GetElementById(This->doc_node->nsdoc, &id_str, &nselem);
479 ERR("GetElementById failed: %08x\n", nsres);
480 nsAString_Finish(&id_str);
483 nsnode_by_id = (nsIDOMNode*)nselem;
485 /* get first element by name attribute */
486 nsres = nsIDOMHTMLDocument_GetElementsByName(This->doc_node->nsdoc, &id_str, &nsnode_list);
487 nsAString_Finish(&id_str);
489 ERR("getElementsByName failed: %08x\n", nsres);
491 nsIDOMNode_Release(nsnode_by_id);
494 nsIDOMNodeList_Item(nsnode_list, 0, &nsnode_by_name);
495 nsIDOMNodeList_Release(nsnode_list);
498 if(nsnode_by_name && nsnode_by_id) {
502 nsres = nsIDOMNode_QueryInterface(nsnode_by_name, &IID_nsIDOM3Node, (void**)&node3);
503 if(NS_FAILED(nsres)) {
504 FIXME("failed to get nsIDOM3Node interface: 0x%08x\n", nsres);
505 nsIDOMNode_Release(nsnode_by_name);
506 nsIDOMNode_Release(nsnode_by_id);
510 nsres = nsIDOM3Node_CompareDocumentPosition(node3, nsnode_by_id, &pos);
511 nsIDOM3Node_Release(node3);
512 if(NS_FAILED(nsres)) {
513 FIXME("nsIDOM3Node_CompareDocumentPosition failed: 0x%08x\n", nsres);
514 nsIDOMNode_Release(nsnode_by_name);
515 nsIDOMNode_Release(nsnode_by_id);
519 TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
520 if(pos & PRECEDING || pos & CONTAINS) {
521 nsnode = nsnode_by_id;
522 nsIDOMNode_Release(nsnode_by_name);
524 nsnode = nsnode_by_name;
525 nsIDOMNode_Release(nsnode_by_id);
528 nsnode = nsnode_by_name ? nsnode_by_name : nsnode_by_id;
531 node = get_node(This->doc_node, nsnode, TRUE);
532 nsIDOMNode_Release(nsnode);
534 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel);
543 static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
544 IHTMLElementCollection **pelColl)
546 HTMLDocument *This = HTMLDOC3_THIS(iface);
547 nsIDOMNodeList *nslist;
548 nsAString id_str, ns_str;
550 static const WCHAR str[] = {'*',0};
552 TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
554 if(!This->doc_node->nsdoc) {
555 WARN("NULL nsdoc\n");
559 nsAString_InitDepend(&id_str, v);
560 nsAString_InitDepend(&ns_str, str);
561 nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->doc_node->nsdoc, &ns_str, &id_str, &nslist);
562 nsAString_Finish(&id_str);
563 nsAString_Finish(&ns_str);
565 ERR("GetElementByName failed: %08x\n", nsres);
569 *pelColl = (IHTMLElementCollection*)create_collection_from_nodelist(This->doc_node, (IUnknown*)HTMLDOC3(This), nslist);
570 nsIDOMNodeList_Release(nslist);
577 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
578 HTMLDocument3_QueryInterface,
579 HTMLDocument3_AddRef,
580 HTMLDocument3_Release,
581 HTMLDocument3_GetTypeInfoCount,
582 HTMLDocument3_GetTypeInfo,
583 HTMLDocument3_GetIDsOfNames,
584 HTMLDocument3_Invoke,
585 HTMLDocument3_releaseCapture,
586 HTMLDocument3_recalc,
587 HTMLDocument3_createTextNode,
588 HTMLDocument3_get_documentElement,
589 HTMLDocument3_uniqueID,
590 HTMLDocument3_attachEvent,
591 HTMLDocument3_detachEvent,
592 HTMLDocument3_put_onrowsdelete,
593 HTMLDocument3_get_onrowsdelete,
594 HTMLDocument3_put_onrowsinserted,
595 HTMLDocument3_get_onrowsinserted,
596 HTMLDocument3_put_oncellchange,
597 HTMLDocument3_get_oncellchange,
598 HTMLDocument3_put_ondatasetchanged,
599 HTMLDocument3_get_ondatasetchanged,
600 HTMLDocument3_put_ondataavailable,
601 HTMLDocument3_get_ondataavailable,
602 HTMLDocument3_put_ondatasetcomplete,
603 HTMLDocument3_get_ondatasetcomplete,
604 HTMLDocument3_put_onpropertychange,
605 HTMLDocument3_get_onpropertychange,
606 HTMLDocument3_put_dir,
607 HTMLDocument3_get_dir,
608 HTMLDocument3_put_oncontextmenu,
609 HTMLDocument3_get_oncontextmenu,
610 HTMLDocument3_put_onstop,
611 HTMLDocument3_get_onstop,
612 HTMLDocument3_createDocumentFragment,
613 HTMLDocument3_get_parentDocument,
614 HTMLDocument3_put_enableDownload,
615 HTMLDocument3_get_enableDownload,
616 HTMLDocument3_put_baseUrl,
617 HTMLDocument3_get_baseUrl,
618 HTMLDocument3_get_childNodes,
619 HTMLDocument3_put_inheritStyleSheets,
620 HTMLDocument3_get_inheritStyleSheets,
621 HTMLDocument3_put_onbeforeeditfocus,
622 HTMLDocument3_get_onbeforeeditfocus,
623 HTMLDocument3_getElementsByName,
624 HTMLDocument3_getElementById,
625 HTMLDocument3_getElementsByTagName
628 #define HTMLDOC4_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument4, iface)
630 static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
631 REFIID riid, void **ppv)
633 HTMLDocument *This = HTMLDOC4_THIS(iface);
634 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
637 static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
639 HTMLDocument *This = HTMLDOC4_THIS(iface);
640 return IHTMLDocument2_AddRef(HTMLDOC(This));
643 static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
645 HTMLDocument *This = HTMLDOC4_THIS(iface);
646 return IHTMLDocument2_Release(HTMLDOC(This));
649 static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
651 HTMLDocument *This = HTMLDOC4_THIS(iface);
652 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
655 static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
656 LCID lcid, ITypeInfo **ppTInfo)
658 HTMLDocument *This = HTMLDOC4_THIS(iface);
659 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
662 static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
663 LPOLESTR *rgszNames, UINT cNames,
664 LCID lcid, DISPID *rgDispId)
666 HTMLDocument *This = HTMLDOC4_THIS(iface);
667 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
670 static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
671 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
672 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
674 HTMLDocument *This = HTMLDOC4_THIS(iface);
675 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
676 pVarResult, pExcepInfo, puArgErr);
679 static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
681 HTMLDocument *This = HTMLDOC4_THIS(iface);
682 nsIDOMNSHTMLElement *nselem;
683 nsIDOMHTMLElement *nsbody;
686 TRACE("(%p)->()\n", This);
688 nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
689 if(NS_FAILED(nsres) || !nsbody) {
690 ERR("GetBody failed: %08x\n", nsres);
694 nsres = nsIDOMHTMLElement_QueryInterface(nsbody, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
695 nsIDOMHTMLElement_Release(nsbody);
696 if(NS_FAILED(nsres)) {
697 ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres);
701 nsres = nsIDOMNSHTMLElement_Focus(nselem);
702 nsIDOMNSHTMLElement_Release(nselem);
703 if(NS_FAILED(nsres)) {
704 ERR("Focus failed: %08x\n", nsres);
711 static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
713 HTMLDocument *This = HTMLDOC4_THIS(iface);
714 FIXME("(%p)->(%p)\n", This, pfFocus);
718 static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
720 HTMLDocument *This = HTMLDOC4_THIS(iface);
721 FIXME("(%p)->(v)\n", This);
725 static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
727 HTMLDocument *This = HTMLDOC4_THIS(iface);
728 FIXME("(%p)->(%p)\n", This, p);
732 static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
734 HTMLDocument *This = HTMLDOC4_THIS(iface);
735 FIXME("(%p)->(%p)\n", This, p);
739 static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
740 BSTR bstrOptions, IHTMLDocument2 **newDoc)
742 HTMLDocument *This = HTMLDOC4_THIS(iface);
743 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
747 static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
749 HTMLDocument *This = HTMLDOC4_THIS(iface);
750 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
754 static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
756 HTMLDocument *This = HTMLDOC4_THIS(iface);
757 FIXME("(%p)->(%p)\n", This, p);
761 static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
762 VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
764 HTMLDocument *This = HTMLDOC4_THIS(iface);
765 FIXME("(%p)->(%p %p)\n", This, pvarEventObject, ppEventObj);
769 static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
770 VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
772 HTMLDocument *This = HTMLDOC4_THIS(iface);
773 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
777 static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
778 IHTMLRenderStyle **ppIHTMLRenderStyle)
780 HTMLDocument *This = HTMLDOC4_THIS(iface);
781 FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
785 static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
787 HTMLDocument *This = HTMLDOC4_THIS(iface);
788 FIXME("(%p)->(v)\n", This);
792 static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
794 HTMLDocument *This = HTMLDOC4_THIS(iface);
795 FIXME("(%p)->(%p)\n", This, p);
799 static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
801 HTMLDocument *This = HTMLDOC4_THIS(iface);
802 FIXME("(%p)->(%p)\n", This, p);
808 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
809 HTMLDocument4_QueryInterface,
810 HTMLDocument4_AddRef,
811 HTMLDocument4_Release,
812 HTMLDocument4_GetTypeInfoCount,
813 HTMLDocument4_GetTypeInfo,
814 HTMLDocument4_GetIDsOfNames,
815 HTMLDocument4_Invoke,
817 HTMLDocument4_hasFocus,
818 HTMLDocument4_put_onselectionchange,
819 HTMLDocument4_get_onselectionchange,
820 HTMLDocument4_get_namespace,
821 HTMLDocument4_createDocumentFromUrl,
822 HTMLDocument4_put_media,
823 HTMLDocument4_get_media,
824 HTMLDocument4_createEventObject,
825 HTMLDocument4_fireEvent,
826 HTMLDocument4_createRenderStyle,
827 HTMLDocument4_put_oncontrolselect,
828 HTMLDocument4_get_oncontrolselect,
829 HTMLDocument4_get_URLEncoded
832 void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
834 This->lpHTMLDocument3Vtbl = &HTMLDocument3Vtbl;
835 This->lpHTMLDocument4Vtbl = &HTMLDocument4Vtbl;