2 * Copyright 2005-2009 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
35 #include "wine/debug.h"
37 #include "mshtml_private.h"
38 #include "htmlevent.h"
39 #include "pluginhost.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
44 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*doc
, const WCHAR
*id
, HTMLElement
**ret
)
46 nsIDOMNodeList
*nsnode_list
;
47 nsIDOMElement
*nselem
;
58 nsAString_InitDepend(&id_str
, id
);
59 /* get element by id attribute */
60 nsres
= nsIDOMHTMLDocument_GetElementById(doc
->nsdoc
, &id_str
, &nselem
);
62 ERR("GetElementById failed: %08x\n", nsres
);
63 nsAString_Finish(&id_str
);
67 /* get first element by name attribute */
68 nsres
= nsIDOMHTMLDocument_GetElementsByName(doc
->nsdoc
, &id_str
, &nsnode_list
);
69 nsAString_Finish(&id_str
);
71 ERR("getElementsByName failed: %08x\n", nsres
);
73 nsIDOMElement_Release(nselem
);
77 nsres
= nsIDOMNodeList_Item(nsnode_list
, 0, &nsnode
);
78 nsIDOMNodeList_Release(nsnode_list
);
79 assert(nsres
== NS_OK
);
81 if(nsnode
&& nselem
) {
84 nsres
= nsIDOMNode_CompareDocumentPosition(nsnode
, (nsIDOMNode
*)nselem
, &pos
);
85 if(NS_FAILED(nsres
)) {
86 FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres
);
87 nsIDOMNode_Release(nsnode
);
88 nsIDOMElement_Release(nselem
);
92 TRACE("CompareDocumentPosition gave: 0x%x\n", pos
);
93 if(!(pos
& (DOCUMENT_POSITION_PRECEDING
| DOCUMENT_POSITION_CONTAINS
))) {
94 nsIDOMElement_Release(nselem
);
101 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMElement
, (void**)&nselem
);
102 assert(nsres
== NS_OK
);
104 nsIDOMNode_Release(nsnode
);
112 hres
= get_elem(doc
, nselem
, ret
);
113 nsIDOMElement_Release(nselem
);
117 static inline HTMLDocument
*impl_from_IHTMLDocument2(IHTMLDocument2
*iface
)
119 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument2_iface
);
122 static HRESULT WINAPI
HTMLDocument_QueryInterface(IHTMLDocument2
*iface
, REFIID riid
, void **ppv
)
124 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
126 return htmldoc_query_interface(This
, riid
, ppv
);
129 static ULONG WINAPI
HTMLDocument_AddRef(IHTMLDocument2
*iface
)
131 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
133 return htmldoc_addref(This
);
136 static ULONG WINAPI
HTMLDocument_Release(IHTMLDocument2
*iface
)
138 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
140 return htmldoc_release(This
);
143 static HRESULT WINAPI
HTMLDocument_GetTypeInfoCount(IHTMLDocument2
*iface
, UINT
*pctinfo
)
145 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
147 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
150 static HRESULT WINAPI
HTMLDocument_GetTypeInfo(IHTMLDocument2
*iface
, UINT iTInfo
,
151 LCID lcid
, ITypeInfo
**ppTInfo
)
153 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
155 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
158 static HRESULT WINAPI
HTMLDocument_GetIDsOfNames(IHTMLDocument2
*iface
, REFIID riid
,
159 LPOLESTR
*rgszNames
, UINT cNames
,
160 LCID lcid
, DISPID
*rgDispId
)
162 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
164 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
168 static HRESULT WINAPI
HTMLDocument_Invoke(IHTMLDocument2
*iface
, DISPID dispIdMember
,
169 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
170 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
172 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
174 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
175 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
178 static HRESULT WINAPI
HTMLDocument_get_Script(IHTMLDocument2
*iface
, IDispatch
**p
)
180 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
182 TRACE("(%p)->(%p)\n", This
, p
);
184 *p
= (IDispatch
*)&This
->window
->base
.IHTMLWindow2_iface
;
185 IDispatch_AddRef(*p
);
189 static HRESULT WINAPI
HTMLDocument_get_all(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
191 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
192 nsIDOMElement
*nselem
= NULL
;
197 TRACE("(%p)->(%p)\n", This
, p
);
199 if(!This
->doc_node
->nsdoc
) {
200 WARN("NULL nsdoc\n");
204 nsres
= nsIDOMHTMLDocument_GetDocumentElement(This
->doc_node
->nsdoc
, &nselem
);
205 if(NS_FAILED(nsres
)) {
206 ERR("GetDocumentElement failed: %08x\n", nsres
);
215 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
216 nsIDOMElement_Release(nselem
);
220 *p
= create_all_collection(node
, TRUE
);
225 static HRESULT WINAPI
HTMLDocument_get_body(IHTMLDocument2
*iface
, IHTMLElement
**p
)
227 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
228 nsIDOMHTMLElement
*nsbody
= NULL
;
232 TRACE("(%p)->(%p)\n", This
, p
);
234 if(This
->doc_node
->nsdoc
) {
237 nsres
= nsIDOMHTMLDocument_GetBody(This
->doc_node
->nsdoc
, &nsbody
);
238 if(NS_FAILED(nsres
)) {
239 TRACE("Could not get body: %08x\n", nsres
);
249 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nsbody
, TRUE
, &node
);
250 nsIDOMHTMLElement_Release(nsbody
);
254 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
259 static HRESULT WINAPI
HTMLDocument_get_activeElement(IHTMLDocument2
*iface
, IHTMLElement
**p
)
261 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
262 nsIDOMElement
*nselem
;
267 TRACE("(%p)->(%p)\n", This
, p
);
269 if(!This
->doc_node
->nsdoc
) {
275 * NOTE: Gecko may return an active element even if the document is not visible.
276 * IE returns NULL in this case.
278 nsres
= nsIDOMHTMLDocument_GetActiveElement(This
->doc_node
->nsdoc
, &nselem
);
279 if(NS_FAILED(nsres
)) {
280 ERR("GetActiveElement failed: %08x\n", nsres
);
284 hres
= get_elem(This
->doc_node
, nselem
, &elem
);
285 nsIDOMElement_Release(nselem
);
289 *p
= &elem
->IHTMLElement_iface
;
293 static HRESULT WINAPI
HTMLDocument_get_images(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
295 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
296 nsIDOMHTMLCollection
*nscoll
= NULL
;
299 TRACE("(%p)->(%p)\n", This
, p
);
306 if(!This
->doc_node
->nsdoc
) {
307 WARN("NULL nsdoc\n");
311 nsres
= nsIDOMHTMLDocument_GetImages(This
->doc_node
->nsdoc
, &nscoll
);
312 if(NS_FAILED(nsres
)) {
313 ERR("GetImages failed: %08x\n", nsres
);
318 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
319 nsIDOMHTMLCollection_Release(nscoll
);
325 static HRESULT WINAPI
HTMLDocument_get_applets(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
327 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
328 nsIDOMHTMLCollection
*nscoll
= NULL
;
331 TRACE("(%p)->(%p)\n", This
, p
);
338 if(!This
->doc_node
->nsdoc
) {
339 WARN("NULL nsdoc\n");
343 nsres
= nsIDOMHTMLDocument_GetApplets(This
->doc_node
->nsdoc
, &nscoll
);
344 if(NS_FAILED(nsres
)) {
345 ERR("GetApplets failed: %08x\n", nsres
);
350 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
351 nsIDOMHTMLCollection_Release(nscoll
);
357 static HRESULT WINAPI
HTMLDocument_get_links(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
359 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
360 nsIDOMHTMLCollection
*nscoll
= NULL
;
363 TRACE("(%p)->(%p)\n", This
, p
);
370 if(!This
->doc_node
->nsdoc
) {
371 WARN("NULL nsdoc\n");
375 nsres
= nsIDOMHTMLDocument_GetLinks(This
->doc_node
->nsdoc
, &nscoll
);
376 if(NS_FAILED(nsres
)) {
377 ERR("GetLinks failed: %08x\n", nsres
);
382 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
383 nsIDOMHTMLCollection_Release(nscoll
);
389 static HRESULT WINAPI
HTMLDocument_get_forms(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
391 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
392 nsIDOMHTMLCollection
*nscoll
= NULL
;
395 TRACE("(%p)->(%p)\n", This
, p
);
402 if(!This
->doc_node
->nsdoc
) {
403 WARN("NULL nsdoc\n");
407 nsres
= nsIDOMHTMLDocument_GetForms(This
->doc_node
->nsdoc
, &nscoll
);
408 if(NS_FAILED(nsres
)) {
409 ERR("GetForms failed: %08x\n", nsres
);
414 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
415 nsIDOMHTMLCollection_Release(nscoll
);
421 static HRESULT WINAPI
HTMLDocument_get_anchors(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
423 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
424 nsIDOMHTMLCollection
*nscoll
= NULL
;
427 TRACE("(%p)->(%p)\n", This
, p
);
434 if(!This
->doc_node
->nsdoc
) {
435 WARN("NULL nsdoc\n");
439 nsres
= nsIDOMHTMLDocument_GetAnchors(This
->doc_node
->nsdoc
, &nscoll
);
440 if(NS_FAILED(nsres
)) {
441 ERR("GetAnchors failed: %08x\n", nsres
);
446 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
447 nsIDOMHTMLCollection_Release(nscoll
);
453 static HRESULT WINAPI
HTMLDocument_put_title(IHTMLDocument2
*iface
, BSTR v
)
455 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
459 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
461 if(!This
->doc_node
->nsdoc
) {
462 WARN("NULL nsdoc\n");
466 nsAString_InitDepend(&nsstr
, v
);
467 nsres
= nsIDOMHTMLDocument_SetTitle(This
->doc_node
->nsdoc
, &nsstr
);
468 nsAString_Finish(&nsstr
);
470 ERR("SetTitle failed: %08x\n", nsres
);
475 static HRESULT WINAPI
HTMLDocument_get_title(IHTMLDocument2
*iface
, BSTR
*p
)
477 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
478 const PRUnichar
*ret
;
482 TRACE("(%p)->(%p)\n", This
, p
);
484 if(!This
->doc_node
->nsdoc
) {
485 WARN("NULL nsdoc\n");
490 nsAString_Init(&nsstr
, NULL
);
491 nsres
= nsIDOMHTMLDocument_GetTitle(This
->doc_node
->nsdoc
, &nsstr
);
492 if (NS_SUCCEEDED(nsres
)) {
493 nsAString_GetData(&nsstr
, &ret
);
494 *p
= SysAllocString(ret
);
496 nsAString_Finish(&nsstr
);
498 if(NS_FAILED(nsres
)) {
499 ERR("GetTitle failed: %08x\n", nsres
);
506 static HRESULT WINAPI
HTMLDocument_get_scripts(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
508 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
509 nsIDOMHTMLCollection
*nscoll
= NULL
;
512 TRACE("(%p)->(%p)\n", This
, p
);
519 if(!This
->doc_node
->nsdoc
) {
520 WARN("NULL nsdoc\n");
524 nsres
= nsIDOMHTMLDocument_GetScripts(This
->doc_node
->nsdoc
, &nscoll
);
525 if(NS_FAILED(nsres
)) {
526 ERR("GetImages failed: %08x\n", nsres
);
531 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
532 nsIDOMHTMLCollection_Release(nscoll
);
538 static HRESULT WINAPI
HTMLDocument_put_designMode(IHTMLDocument2
*iface
, BSTR v
)
540 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
543 static const WCHAR onW
[] = {'o','n',0};
545 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
547 if(strcmpiW(v
, onW
)) {
548 FIXME("Unsupported arg %s\n", debugstr_w(v
));
552 hres
= setup_edit_mode(This
->doc_obj
);
556 call_property_onchanged(&This
->cp_container
, DISPID_IHTMLDOCUMENT2_DESIGNMODE
);
560 static HRESULT WINAPI
HTMLDocument_get_designMode(IHTMLDocument2
*iface
, BSTR
*p
)
562 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
563 static const WCHAR szOff
[] = {'O','f','f',0};
564 FIXME("(%p)->(%p) always returning Off\n", This
, p
);
569 *p
= SysAllocString(szOff
);
574 static HRESULT WINAPI
HTMLDocument_get_selection(IHTMLDocument2
*iface
, IHTMLSelectionObject
**p
)
576 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
577 nsISelection
*nsselection
;
580 TRACE("(%p)->(%p)\n", This
, p
);
582 nsres
= nsIDOMWindow_GetSelection(This
->window
->nswindow
, &nsselection
);
583 if(NS_FAILED(nsres
)) {
584 ERR("GetSelection failed: %08x\n", nsres
);
588 return HTMLSelectionObject_Create(This
->doc_node
, nsselection
, p
);
591 static HRESULT WINAPI
HTMLDocument_get_readyState(IHTMLDocument2
*iface
, BSTR
*p
)
593 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
596 TRACE("(%p)->(%p)\n", iface
, p
);
601 return get_readystate_string(This
->window
->readystate
, p
);
604 static HRESULT WINAPI
HTMLDocument_get_frames(IHTMLDocument2
*iface
, IHTMLFramesCollection2
**p
)
606 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
608 TRACE("(%p)->(%p)\n", This
, p
);
610 return IHTMLWindow2_get_frames(&This
->window
->base
.IHTMLWindow2_iface
, p
);
613 static HRESULT WINAPI
HTMLDocument_get_embeds(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
615 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
616 FIXME("(%p)->(%p)\n", This
, p
);
620 static HRESULT WINAPI
HTMLDocument_get_plugins(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
622 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
623 FIXME("(%p)->(%p)\n", This
, p
);
627 static HRESULT WINAPI
HTMLDocument_put_alinkColor(IHTMLDocument2
*iface
, VARIANT v
)
629 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
630 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
634 static HRESULT WINAPI
HTMLDocument_get_alinkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
636 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
637 FIXME("(%p)->(%p)\n", This
, p
);
641 static HRESULT WINAPI
HTMLDocument_put_bgColor(IHTMLDocument2
*iface
, VARIANT v
)
643 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
644 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
648 static HRESULT WINAPI
HTMLDocument_get_bgColor(IHTMLDocument2
*iface
, VARIANT
*p
)
650 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
651 FIXME("(%p)->(%p)\n", This
, p
);
655 static HRESULT WINAPI
HTMLDocument_put_fgColor(IHTMLDocument2
*iface
, VARIANT v
)
657 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
658 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
662 static HRESULT WINAPI
HTMLDocument_get_fgColor(IHTMLDocument2
*iface
, VARIANT
*p
)
664 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
665 FIXME("(%p)->(%p)\n", This
, p
);
669 static HRESULT WINAPI
HTMLDocument_put_linkColor(IHTMLDocument2
*iface
, VARIANT v
)
671 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
672 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
676 static HRESULT WINAPI
HTMLDocument_get_linkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
678 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
679 FIXME("(%p)->(%p)\n", This
, p
);
683 static HRESULT WINAPI
HTMLDocument_put_vlinkColor(IHTMLDocument2
*iface
, VARIANT v
)
685 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
686 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
690 static HRESULT WINAPI
HTMLDocument_get_vlinkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
692 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
693 FIXME("(%p)->(%p)\n", This
, p
);
697 static HRESULT WINAPI
HTMLDocument_get_referrer(IHTMLDocument2
*iface
, BSTR
*p
)
699 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
701 FIXME("(%p)->(%p)\n", This
, p
);
707 static HRESULT WINAPI
HTMLDocument_get_location(IHTMLDocument2
*iface
, IHTMLLocation
**p
)
709 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
711 TRACE("(%p)->(%p)\n", This
, p
);
713 if(!This
->doc_node
->nsdoc
) {
714 WARN("NULL nsdoc\n");
718 return IHTMLWindow2_get_location(&This
->window
->base
.IHTMLWindow2_iface
, p
);
721 static HRESULT WINAPI
HTMLDocument_get_lastModified(IHTMLDocument2
*iface
, BSTR
*p
)
723 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
724 FIXME("(%p)->(%p)\n", This
, p
);
728 static HRESULT WINAPI
HTMLDocument_put_URL(IHTMLDocument2
*iface
, BSTR v
)
730 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
732 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
735 FIXME("No window available\n");
739 return navigate_url(This
->window
, v
, This
->window
->uri
, BINDING_NAVIGATED
);
742 static HRESULT WINAPI
HTMLDocument_get_URL(IHTMLDocument2
*iface
, BSTR
*p
)
744 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
746 static const WCHAR about_blank_url
[] =
747 {'a','b','o','u','t',':','b','l','a','n','k',0};
749 TRACE("(%p)->(%p)\n", iface
, p
);
751 *p
= SysAllocString(This
->window
->url
? This
->window
->url
: about_blank_url
);
752 return *p
? S_OK
: E_OUTOFMEMORY
;
755 static HRESULT WINAPI
HTMLDocument_put_domain(IHTMLDocument2
*iface
, BSTR v
)
757 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
758 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
762 static HRESULT WINAPI
HTMLDocument_get_domain(IHTMLDocument2
*iface
, BSTR
*p
)
764 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
767 TRACE("(%p)->(%p)\n", This
, p
);
769 if(!This
->window
|| !This
->window
->uri
) {
770 FIXME("No current URI\n");
774 hres
= IUri_GetHost(This
->window
->uri
, p
);
775 return FAILED(hres
) ? hres
: S_OK
;
778 static HRESULT WINAPI
HTMLDocument_put_cookie(IHTMLDocument2
*iface
, BSTR v
)
780 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
783 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
785 bret
= InternetSetCookieExW(This
->window
->url
, NULL
, v
, 0, 0);
787 FIXME("InternetSetCookieExW failed: %u\n", GetLastError());
788 return HRESULT_FROM_WIN32(GetLastError());
794 static HRESULT WINAPI
HTMLDocument_get_cookie(IHTMLDocument2
*iface
, BSTR
*p
)
796 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
800 TRACE("(%p)->(%p)\n", This
, p
);
803 bret
= InternetGetCookieExW(This
->window
->url
, NULL
, NULL
, &size
, 0, NULL
);
805 switch(GetLastError()) {
806 case ERROR_INSUFFICIENT_BUFFER
:
808 case ERROR_NO_MORE_ITEMS
:
812 FIXME("InternetGetCookieExW failed: %u\n", GetLastError());
813 return HRESULT_FROM_WIN32(GetLastError());
822 *p
= SysAllocStringLen(NULL
, size
/sizeof(WCHAR
)-1);
824 return E_OUTOFMEMORY
;
826 bret
= InternetGetCookieExW(This
->window
->url
, NULL
, *p
, &size
, 0, NULL
);
828 ERR("InternetGetCookieExW failed: %u\n", GetLastError());
835 static HRESULT WINAPI
HTMLDocument_put_expando(IHTMLDocument2
*iface
, VARIANT_BOOL v
)
837 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
838 FIXME("(%p)->(%x)\n", This
, v
);
842 static HRESULT WINAPI
HTMLDocument_get_expando(IHTMLDocument2
*iface
, VARIANT_BOOL
*p
)
844 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
845 FIXME("(%p)->(%p)\n", This
, p
);
849 static HRESULT WINAPI
HTMLDocument_put_charset(IHTMLDocument2
*iface
, BSTR v
)
851 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
852 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
856 static HRESULT WINAPI
HTMLDocument_get_charset(IHTMLDocument2
*iface
, BSTR
*p
)
858 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
859 nsAString charset_str
;
862 TRACE("(%p)->(%p)\n", This
, p
);
864 if(!This
->doc_node
->nsdoc
) {
865 FIXME("NULL nsdoc\n");
869 nsAString_Init(&charset_str
, NULL
);
870 nsres
= nsIDOMHTMLDocument_GetCharacterSet(This
->doc_node
->nsdoc
, &charset_str
);
871 return return_nsstr(nsres
, &charset_str
, p
);
874 static HRESULT WINAPI
HTMLDocument_put_defaultCharset(IHTMLDocument2
*iface
, BSTR v
)
876 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
877 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
881 static HRESULT WINAPI
HTMLDocument_get_defaultCharset(IHTMLDocument2
*iface
, BSTR
*p
)
883 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
884 FIXME("(%p)->(%p)\n", This
, p
);
888 static HRESULT WINAPI
HTMLDocument_get_mimeType(IHTMLDocument2
*iface
, BSTR
*p
)
890 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
891 FIXME("(%p)->(%p)\n", This
, p
);
895 static HRESULT WINAPI
HTMLDocument_get_fileSize(IHTMLDocument2
*iface
, BSTR
*p
)
897 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
898 FIXME("(%p)->(%p)\n", This
, p
);
902 static HRESULT WINAPI
HTMLDocument_get_fileCreatedDate(IHTMLDocument2
*iface
, BSTR
*p
)
904 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
905 FIXME("(%p)->(%p)\n", This
, p
);
909 static HRESULT WINAPI
HTMLDocument_get_fileModifiedDate(IHTMLDocument2
*iface
, BSTR
*p
)
911 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
912 FIXME("(%p)->(%p)\n", This
, p
);
916 static HRESULT WINAPI
HTMLDocument_get_fileUpdatedDate(IHTMLDocument2
*iface
, BSTR
*p
)
918 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
919 FIXME("(%p)->(%p)\n", This
, p
);
923 static HRESULT WINAPI
HTMLDocument_get_security(IHTMLDocument2
*iface
, BSTR
*p
)
925 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
926 FIXME("(%p)->(%p)\n", This
, p
);
930 static HRESULT WINAPI
HTMLDocument_get_protocol(IHTMLDocument2
*iface
, BSTR
*p
)
932 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
933 FIXME("(%p)->(%p)\n", This
, p
);
937 static HRESULT WINAPI
HTMLDocument_get_nameProp(IHTMLDocument2
*iface
, BSTR
*p
)
939 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
940 FIXME("(%p)->(%p)\n", This
, p
);
944 static HRESULT
document_write(HTMLDocument
*This
, SAFEARRAY
*psarray
, BOOL ln
)
953 if(!This
->doc_node
->nsdoc
) {
954 WARN("NULL nsdoc\n");
961 if(psarray
->cDims
!= 1) {
962 FIXME("cDims=%d\n", psarray
->cDims
);
966 hres
= SafeArrayAccessData(psarray
, (void**)&var
);
968 WARN("SafeArrayAccessData failed: %08x\n", hres
);
972 V_VT(&tmp
) = VT_EMPTY
;
974 jsctx
= get_context_from_document(This
->doc_node
->nsdoc
);
975 argc
= psarray
->rgsabound
[0].cElements
;
976 for(i
=0; i
< argc
; i
++) {
977 if(V_VT(var
+i
) == VT_BSTR
) {
978 nsAString_InitDepend(&nsstr
, V_BSTR(var
+i
));
980 hres
= VariantChangeTypeEx(&tmp
, var
+i
, MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, VT_BSTR
);
982 WARN("Could not convert %s to string\n", debugstr_variant(var
+i
));
985 nsAString_InitDepend(&nsstr
, V_BSTR(&tmp
));
988 if(!ln
|| i
!= argc
-1)
989 nsres
= nsIDOMHTMLDocument_Write(This
->doc_node
->nsdoc
, &nsstr
, jsctx
);
991 nsres
= nsIDOMHTMLDocument_Writeln(This
->doc_node
->nsdoc
, &nsstr
, jsctx
);
992 nsAString_Finish(&nsstr
);
993 if(V_VT(var
+i
) != VT_BSTR
)
995 if(NS_FAILED(nsres
)) {
996 ERR("Write failed: %08x\n", nsres
);
1002 SafeArrayUnaccessData(psarray
);
1007 static HRESULT WINAPI
HTMLDocument_write(IHTMLDocument2
*iface
, SAFEARRAY
*psarray
)
1009 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1011 TRACE("(%p)->(%p)\n", iface
, psarray
);
1013 return document_write(This
, psarray
, FALSE
);
1016 static HRESULT WINAPI
HTMLDocument_writeln(IHTMLDocument2
*iface
, SAFEARRAY
*psarray
)
1018 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1020 TRACE("(%p)->(%p)\n", This
, psarray
);
1022 return document_write(This
, psarray
, TRUE
);
1025 static HRESULT WINAPI
HTMLDocument_open(IHTMLDocument2
*iface
, BSTR url
, VARIANT name
,
1026 VARIANT features
, VARIANT replace
, IDispatch
**pomWindowResult
)
1028 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1032 static const WCHAR text_htmlW
[] = {'t','e','x','t','/','h','t','m','l',0};
1034 TRACE("(%p)->(%s %s %s %s %p)\n", This
, debugstr_w(url
), debugstr_variant(&name
),
1035 debugstr_variant(&features
), debugstr_variant(&replace
), pomWindowResult
);
1037 if(!This
->doc_node
->nsdoc
) {
1042 if(!url
|| strcmpW(url
, text_htmlW
) || V_VT(&name
) != VT_ERROR
1043 || V_VT(&features
) != VT_ERROR
|| V_VT(&replace
) != VT_ERROR
)
1044 FIXME("unsupported args\n");
1046 nsres
= nsIDOMHTMLDocument_Open(This
->doc_node
->nsdoc
, NULL
, NULL
, NULL
,
1047 get_context_from_document(This
->doc_node
->nsdoc
), 0, &tmp
);
1048 if(NS_FAILED(nsres
)) {
1049 ERR("Open failed: %08x\n", nsres
);
1054 nsISupports_Release(tmp
);
1056 *pomWindowResult
= (IDispatch
*)&This
->window
->base
.IHTMLWindow2_iface
;
1057 IHTMLWindow2_AddRef(&This
->window
->base
.IHTMLWindow2_iface
);
1061 static HRESULT WINAPI
HTMLDocument_close(IHTMLDocument2
*iface
)
1063 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1066 TRACE("(%p)\n", This
);
1068 if(!This
->doc_node
->nsdoc
) {
1073 nsres
= nsIDOMHTMLDocument_Close(This
->doc_node
->nsdoc
);
1074 if(NS_FAILED(nsres
)) {
1075 ERR("Close failed: %08x\n", nsres
);
1082 static HRESULT WINAPI
HTMLDocument_clear(IHTMLDocument2
*iface
)
1084 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1087 TRACE("(%p)\n", This
);
1089 nsres
= nsIDOMHTMLDocument_Clear(This
->doc_node
->nsdoc
);
1090 if(NS_FAILED(nsres
)) {
1091 ERR("Clear failed: %08x\n", nsres
);
1098 static HRESULT WINAPI
HTMLDocument_queryCommandSupported(IHTMLDocument2
*iface
, BSTR cmdID
,
1099 VARIANT_BOOL
*pfRet
)
1101 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1102 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1106 static HRESULT WINAPI
HTMLDocument_queryCommandEnabled(IHTMLDocument2
*iface
, BSTR cmdID
,
1107 VARIANT_BOOL
*pfRet
)
1109 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1110 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1114 static HRESULT WINAPI
HTMLDocument_queryCommandState(IHTMLDocument2
*iface
, BSTR cmdID
,
1115 VARIANT_BOOL
*pfRet
)
1117 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1118 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1122 static HRESULT WINAPI
HTMLDocument_queryCommandIndeterm(IHTMLDocument2
*iface
, BSTR cmdID
,
1123 VARIANT_BOOL
*pfRet
)
1125 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1126 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1130 static HRESULT WINAPI
HTMLDocument_queryCommandText(IHTMLDocument2
*iface
, BSTR cmdID
,
1133 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1134 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1138 static HRESULT WINAPI
HTMLDocument_queryCommandValue(IHTMLDocument2
*iface
, BSTR cmdID
,
1141 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1142 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1146 static HRESULT WINAPI
HTMLDocument_execCommand(IHTMLDocument2
*iface
, BSTR cmdID
,
1147 VARIANT_BOOL showUI
, VARIANT value
, VARIANT_BOOL
*pfRet
)
1149 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1150 FIXME("(%p)->(%s %x %s %p)\n", This
, debugstr_w(cmdID
), showUI
, debugstr_variant(&value
), pfRet
);
1154 static HRESULT WINAPI
HTMLDocument_execCommandShowHelp(IHTMLDocument2
*iface
, BSTR cmdID
,
1155 VARIANT_BOOL
*pfRet
)
1157 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1158 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1162 static HRESULT WINAPI
HTMLDocument_createElement(IHTMLDocument2
*iface
, BSTR eTag
,
1163 IHTMLElement
**newElem
)
1165 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1169 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(eTag
), newElem
);
1171 hres
= create_element(This
->doc_node
, eTag
, &elem
);
1175 *newElem
= &elem
->IHTMLElement_iface
;
1179 static HRESULT WINAPI
HTMLDocument_put_onhelp(IHTMLDocument2
*iface
, VARIANT v
)
1181 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1182 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1186 static HRESULT WINAPI
HTMLDocument_get_onhelp(IHTMLDocument2
*iface
, VARIANT
*p
)
1188 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1189 FIXME("(%p)->(%p)\n", This
, p
);
1193 static HRESULT WINAPI
HTMLDocument_put_onclick(IHTMLDocument2
*iface
, VARIANT v
)
1195 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1197 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1199 return set_doc_event(This
, EVENTID_CLICK
, &v
);
1202 static HRESULT WINAPI
HTMLDocument_get_onclick(IHTMLDocument2
*iface
, VARIANT
*p
)
1204 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1206 TRACE("(%p)->(%p)\n", This
, p
);
1208 return get_doc_event(This
, EVENTID_CLICK
, p
);
1211 static HRESULT WINAPI
HTMLDocument_put_ondblclick(IHTMLDocument2
*iface
, VARIANT v
)
1213 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1214 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1218 static HRESULT WINAPI
HTMLDocument_get_ondblclick(IHTMLDocument2
*iface
, VARIANT
*p
)
1220 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1221 FIXME("(%p)->(%p)\n", This
, p
);
1225 static HRESULT WINAPI
HTMLDocument_put_onkeyup(IHTMLDocument2
*iface
, VARIANT v
)
1227 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1229 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1231 return set_doc_event(This
, EVENTID_KEYUP
, &v
);
1234 static HRESULT WINAPI
HTMLDocument_get_onkeyup(IHTMLDocument2
*iface
, VARIANT
*p
)
1236 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1238 TRACE("(%p)->(%p)\n", This
, p
);
1240 return get_doc_event(This
, EVENTID_KEYUP
, p
);
1243 static HRESULT WINAPI
HTMLDocument_put_onkeydown(IHTMLDocument2
*iface
, VARIANT v
)
1245 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1247 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1249 return set_doc_event(This
, EVENTID_KEYDOWN
, &v
);
1252 static HRESULT WINAPI
HTMLDocument_get_onkeydown(IHTMLDocument2
*iface
, VARIANT
*p
)
1254 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1256 TRACE("(%p)->(%p)\n", This
, p
);
1258 return get_doc_event(This
, EVENTID_KEYDOWN
, p
);
1261 static HRESULT WINAPI
HTMLDocument_put_onkeypress(IHTMLDocument2
*iface
, VARIANT v
)
1263 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1265 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1267 return set_doc_event(This
, EVENTID_KEYPRESS
, &v
);
1270 static HRESULT WINAPI
HTMLDocument_get_onkeypress(IHTMLDocument2
*iface
, VARIANT
*p
)
1272 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1274 TRACE("(%p)->(%p)\n", This
, p
);
1276 return get_doc_event(This
, EVENTID_KEYPRESS
, p
);
1279 static HRESULT WINAPI
HTMLDocument_put_onmouseup(IHTMLDocument2
*iface
, VARIANT v
)
1281 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1283 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1285 return set_doc_event(This
, EVENTID_MOUSEUP
, &v
);
1288 static HRESULT WINAPI
HTMLDocument_get_onmouseup(IHTMLDocument2
*iface
, VARIANT
*p
)
1290 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1292 TRACE("(%p)->(%p)\n", This
, p
);
1294 return get_doc_event(This
, EVENTID_MOUSEUP
, p
);
1297 static HRESULT WINAPI
HTMLDocument_put_onmousedown(IHTMLDocument2
*iface
, VARIANT v
)
1299 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1301 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1303 return set_doc_event(This
, EVENTID_MOUSEDOWN
, &v
);
1306 static HRESULT WINAPI
HTMLDocument_get_onmousedown(IHTMLDocument2
*iface
, VARIANT
*p
)
1308 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1310 TRACE("(%p)->(%p)\n", This
, p
);
1312 return get_doc_event(This
, EVENTID_MOUSEDOWN
, p
);
1315 static HRESULT WINAPI
HTMLDocument_put_onmousemove(IHTMLDocument2
*iface
, VARIANT v
)
1317 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1319 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1321 return set_doc_event(This
, EVENTID_MOUSEMOVE
, &v
);
1324 static HRESULT WINAPI
HTMLDocument_get_onmousemove(IHTMLDocument2
*iface
, VARIANT
*p
)
1326 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1328 TRACE("(%p)->(%p)\n", This
, p
);
1330 return get_doc_event(This
, EVENTID_MOUSEMOVE
, p
);
1333 static HRESULT WINAPI
HTMLDocument_put_onmouseout(IHTMLDocument2
*iface
, VARIANT v
)
1335 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1337 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1339 return set_doc_event(This
, EVENTID_MOUSEOUT
, &v
);
1342 static HRESULT WINAPI
HTMLDocument_get_onmouseout(IHTMLDocument2
*iface
, VARIANT
*p
)
1344 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1346 TRACE("(%p)->(%p)\n", This
, p
);
1348 return get_doc_event(This
, EVENTID_MOUSEOUT
, p
);
1351 static HRESULT WINAPI
HTMLDocument_put_onmouseover(IHTMLDocument2
*iface
, VARIANT v
)
1353 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1355 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1357 return set_doc_event(This
, EVENTID_MOUSEOVER
, &v
);
1360 static HRESULT WINAPI
HTMLDocument_get_onmouseover(IHTMLDocument2
*iface
, VARIANT
*p
)
1362 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1364 TRACE("(%p)->(%p)\n", This
, p
);
1366 return get_doc_event(This
, EVENTID_MOUSEOVER
, p
);
1369 static HRESULT WINAPI
HTMLDocument_put_onreadystatechange(IHTMLDocument2
*iface
, VARIANT v
)
1371 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1373 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1375 return set_doc_event(This
, EVENTID_READYSTATECHANGE
, &v
);
1378 static HRESULT WINAPI
HTMLDocument_get_onreadystatechange(IHTMLDocument2
*iface
, VARIANT
*p
)
1380 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1382 TRACE("(%p)->(%p)\n", This
, p
);
1384 return get_doc_event(This
, EVENTID_READYSTATECHANGE
, p
);
1387 static HRESULT WINAPI
HTMLDocument_put_onafterupdate(IHTMLDocument2
*iface
, VARIANT v
)
1389 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1390 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1394 static HRESULT WINAPI
HTMLDocument_get_onafterupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1396 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1397 FIXME("(%p)->(%p)\n", This
, p
);
1401 static HRESULT WINAPI
HTMLDocument_put_onrowexit(IHTMLDocument2
*iface
, VARIANT v
)
1403 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1404 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1408 static HRESULT WINAPI
HTMLDocument_get_onrowexit(IHTMLDocument2
*iface
, VARIANT
*p
)
1410 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1411 FIXME("(%p)->(%p)\n", This
, p
);
1415 static HRESULT WINAPI
HTMLDocument_put_onrowenter(IHTMLDocument2
*iface
, VARIANT v
)
1417 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1418 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1422 static HRESULT WINAPI
HTMLDocument_get_onrowenter(IHTMLDocument2
*iface
, VARIANT
*p
)
1424 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1425 FIXME("(%p)->(%p)\n", This
, p
);
1429 static HRESULT WINAPI
HTMLDocument_put_ondragstart(IHTMLDocument2
*iface
, VARIANT v
)
1431 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1433 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1435 return set_doc_event(This
, EVENTID_DRAGSTART
, &v
);
1438 static HRESULT WINAPI
HTMLDocument_get_ondragstart(IHTMLDocument2
*iface
, VARIANT
*p
)
1440 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1442 TRACE("(%p)->(%p)\n", This
, p
);
1444 return get_doc_event(This
, EVENTID_DRAGSTART
, p
);
1447 static HRESULT WINAPI
HTMLDocument_put_onselectstart(IHTMLDocument2
*iface
, VARIANT v
)
1449 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1451 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1453 return set_doc_event(This
, EVENTID_SELECTSTART
, &v
);
1456 static HRESULT WINAPI
HTMLDocument_get_onselectstart(IHTMLDocument2
*iface
, VARIANT
*p
)
1458 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1460 TRACE("(%p)->(%p)\n", This
, p
);
1462 return get_doc_event(This
, EVENTID_SELECTSTART
, p
);
1465 static HRESULT WINAPI
HTMLDocument_elementFromPoint(IHTMLDocument2
*iface
, LONG x
, LONG y
,
1466 IHTMLElement
**elementHit
)
1468 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1469 nsIDOMElement
*nselem
;
1474 TRACE("(%p)->(%d %d %p)\n", This
, x
, y
, elementHit
);
1476 nsres
= nsIDOMHTMLDocument_ElementFromPoint(This
->doc_node
->nsdoc
, x
, y
, &nselem
);
1477 if(NS_FAILED(nsres
)) {
1478 ERR("ElementFromPoint failed: %08x\n", nsres
);
1487 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
1488 nsIDOMElement_Release(nselem
);
1492 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)elementHit
);
1497 static HRESULT WINAPI
HTMLDocument_get_parentWindow(IHTMLDocument2
*iface
, IHTMLWindow2
**p
)
1499 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1501 TRACE("(%p)->(%p)\n", This
, p
);
1503 *p
= &This
->window
->base
.IHTMLWindow2_iface
;
1504 IHTMLWindow2_AddRef(*p
);
1508 static HRESULT WINAPI
HTMLDocument_get_styleSheets(IHTMLDocument2
*iface
,
1509 IHTMLStyleSheetsCollection
**p
)
1511 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1512 nsIDOMStyleSheetList
*nsstylelist
;
1515 TRACE("(%p)->(%p)\n", This
, p
);
1519 if(!This
->doc_node
->nsdoc
) {
1520 WARN("NULL nsdoc\n");
1521 return E_UNEXPECTED
;
1524 nsres
= nsIDOMHTMLDocument_GetStyleSheets(This
->doc_node
->nsdoc
, &nsstylelist
);
1525 if(NS_FAILED(nsres
)) {
1526 ERR("GetStyleSheets failed: %08x\n", nsres
);
1530 *p
= HTMLStyleSheetsCollection_Create(nsstylelist
);
1531 nsIDOMStyleSheetList_Release(nsstylelist
);
1536 static HRESULT WINAPI
HTMLDocument_put_onbeforeupdate(IHTMLDocument2
*iface
, VARIANT v
)
1538 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1539 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1543 static HRESULT WINAPI
HTMLDocument_get_onbeforeupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1545 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1546 FIXME("(%p)->(%p)\n", This
, p
);
1550 static HRESULT WINAPI
HTMLDocument_put_onerrorupdate(IHTMLDocument2
*iface
, VARIANT v
)
1552 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1553 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1557 static HRESULT WINAPI
HTMLDocument_get_onerrorupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1559 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1560 FIXME("(%p)->(%p)\n", This
, p
);
1564 static HRESULT WINAPI
HTMLDocument_toString(IHTMLDocument2
*iface
, BSTR
*String
)
1566 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1568 static const WCHAR objectW
[] = {'[','o','b','j','e','c','t',']',0};
1570 TRACE("(%p)->(%p)\n", This
, String
);
1573 return E_INVALIDARG
;
1575 *String
= SysAllocString(objectW
);
1576 return *String
? S_OK
: E_OUTOFMEMORY
;
1580 static HRESULT WINAPI
HTMLDocument_createStyleSheet(IHTMLDocument2
*iface
, BSTR bstrHref
,
1581 LONG lIndex
, IHTMLStyleSheet
**ppnewStyleSheet
)
1583 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1584 nsIDOMHTMLHeadElement
*head_elem
;
1585 IHTMLStyleElement
*style_elem
;
1590 static const WCHAR styleW
[] = {'s','t','y','l','e',0};
1592 TRACE("(%p)->(%s %d %p)\n", This
, debugstr_w(bstrHref
), lIndex
, ppnewStyleSheet
);
1594 if(!This
->doc_node
->nsdoc
) {
1595 FIXME("not a real doc object\n");
1600 FIXME("Unsupported lIndex %d\n", lIndex
);
1603 FIXME("semi-stub for href %s\n", debugstr_w(bstrHref
));
1604 *ppnewStyleSheet
= HTMLStyleSheet_Create(NULL
);
1608 hres
= create_element(This
->doc_node
, styleW
, &elem
);
1612 nsres
= nsIDOMHTMLDocument_GetHead(This
->doc_node
->nsdoc
, &head_elem
);
1613 if(NS_SUCCEEDED(nsres
)) {
1614 nsIDOMNode
*head_node
, *tmp_node
;
1616 nsres
= nsIDOMHTMLHeadElement_QueryInterface(head_elem
, &IID_nsIDOMNode
, (void**)&head_node
);
1617 nsIDOMHTMLHeadElement_Release(head_elem
);
1618 assert(nsres
== NS_OK
);
1620 nsres
= nsIDOMNode_AppendChild(head_node
, elem
->node
.nsnode
, &tmp_node
);
1621 nsIDOMNode_Release(head_node
);
1622 if(NS_SUCCEEDED(nsres
) && tmp_node
)
1623 nsIDOMNode_Release(tmp_node
);
1625 if(NS_FAILED(nsres
)) {
1626 IHTMLElement_Release(&elem
->IHTMLElement_iface
);
1630 hres
= IHTMLElement_QueryInterface(&elem
->IHTMLElement_iface
, &IID_IHTMLStyleElement
, (void**)&style_elem
);
1631 assert(hres
== S_OK
);
1632 IHTMLElement_Release(&elem
->IHTMLElement_iface
);
1634 hres
= IHTMLStyleElement_get_styleSheet(style_elem
, ppnewStyleSheet
);
1635 IHTMLStyleElement_Release(style_elem
);
1639 static const IHTMLDocument2Vtbl HTMLDocumentVtbl
= {
1640 HTMLDocument_QueryInterface
,
1641 HTMLDocument_AddRef
,
1642 HTMLDocument_Release
,
1643 HTMLDocument_GetTypeInfoCount
,
1644 HTMLDocument_GetTypeInfo
,
1645 HTMLDocument_GetIDsOfNames
,
1646 HTMLDocument_Invoke
,
1647 HTMLDocument_get_Script
,
1648 HTMLDocument_get_all
,
1649 HTMLDocument_get_body
,
1650 HTMLDocument_get_activeElement
,
1651 HTMLDocument_get_images
,
1652 HTMLDocument_get_applets
,
1653 HTMLDocument_get_links
,
1654 HTMLDocument_get_forms
,
1655 HTMLDocument_get_anchors
,
1656 HTMLDocument_put_title
,
1657 HTMLDocument_get_title
,
1658 HTMLDocument_get_scripts
,
1659 HTMLDocument_put_designMode
,
1660 HTMLDocument_get_designMode
,
1661 HTMLDocument_get_selection
,
1662 HTMLDocument_get_readyState
,
1663 HTMLDocument_get_frames
,
1664 HTMLDocument_get_embeds
,
1665 HTMLDocument_get_plugins
,
1666 HTMLDocument_put_alinkColor
,
1667 HTMLDocument_get_alinkColor
,
1668 HTMLDocument_put_bgColor
,
1669 HTMLDocument_get_bgColor
,
1670 HTMLDocument_put_fgColor
,
1671 HTMLDocument_get_fgColor
,
1672 HTMLDocument_put_linkColor
,
1673 HTMLDocument_get_linkColor
,
1674 HTMLDocument_put_vlinkColor
,
1675 HTMLDocument_get_vlinkColor
,
1676 HTMLDocument_get_referrer
,
1677 HTMLDocument_get_location
,
1678 HTMLDocument_get_lastModified
,
1679 HTMLDocument_put_URL
,
1680 HTMLDocument_get_URL
,
1681 HTMLDocument_put_domain
,
1682 HTMLDocument_get_domain
,
1683 HTMLDocument_put_cookie
,
1684 HTMLDocument_get_cookie
,
1685 HTMLDocument_put_expando
,
1686 HTMLDocument_get_expando
,
1687 HTMLDocument_put_charset
,
1688 HTMLDocument_get_charset
,
1689 HTMLDocument_put_defaultCharset
,
1690 HTMLDocument_get_defaultCharset
,
1691 HTMLDocument_get_mimeType
,
1692 HTMLDocument_get_fileSize
,
1693 HTMLDocument_get_fileCreatedDate
,
1694 HTMLDocument_get_fileModifiedDate
,
1695 HTMLDocument_get_fileUpdatedDate
,
1696 HTMLDocument_get_security
,
1697 HTMLDocument_get_protocol
,
1698 HTMLDocument_get_nameProp
,
1700 HTMLDocument_writeln
,
1704 HTMLDocument_queryCommandSupported
,
1705 HTMLDocument_queryCommandEnabled
,
1706 HTMLDocument_queryCommandState
,
1707 HTMLDocument_queryCommandIndeterm
,
1708 HTMLDocument_queryCommandText
,
1709 HTMLDocument_queryCommandValue
,
1710 HTMLDocument_execCommand
,
1711 HTMLDocument_execCommandShowHelp
,
1712 HTMLDocument_createElement
,
1713 HTMLDocument_put_onhelp
,
1714 HTMLDocument_get_onhelp
,
1715 HTMLDocument_put_onclick
,
1716 HTMLDocument_get_onclick
,
1717 HTMLDocument_put_ondblclick
,
1718 HTMLDocument_get_ondblclick
,
1719 HTMLDocument_put_onkeyup
,
1720 HTMLDocument_get_onkeyup
,
1721 HTMLDocument_put_onkeydown
,
1722 HTMLDocument_get_onkeydown
,
1723 HTMLDocument_put_onkeypress
,
1724 HTMLDocument_get_onkeypress
,
1725 HTMLDocument_put_onmouseup
,
1726 HTMLDocument_get_onmouseup
,
1727 HTMLDocument_put_onmousedown
,
1728 HTMLDocument_get_onmousedown
,
1729 HTMLDocument_put_onmousemove
,
1730 HTMLDocument_get_onmousemove
,
1731 HTMLDocument_put_onmouseout
,
1732 HTMLDocument_get_onmouseout
,
1733 HTMLDocument_put_onmouseover
,
1734 HTMLDocument_get_onmouseover
,
1735 HTMLDocument_put_onreadystatechange
,
1736 HTMLDocument_get_onreadystatechange
,
1737 HTMLDocument_put_onafterupdate
,
1738 HTMLDocument_get_onafterupdate
,
1739 HTMLDocument_put_onrowexit
,
1740 HTMLDocument_get_onrowexit
,
1741 HTMLDocument_put_onrowenter
,
1742 HTMLDocument_get_onrowenter
,
1743 HTMLDocument_put_ondragstart
,
1744 HTMLDocument_get_ondragstart
,
1745 HTMLDocument_put_onselectstart
,
1746 HTMLDocument_get_onselectstart
,
1747 HTMLDocument_elementFromPoint
,
1748 HTMLDocument_get_parentWindow
,
1749 HTMLDocument_get_styleSheets
,
1750 HTMLDocument_put_onbeforeupdate
,
1751 HTMLDocument_get_onbeforeupdate
,
1752 HTMLDocument_put_onerrorupdate
,
1753 HTMLDocument_get_onerrorupdate
,
1754 HTMLDocument_toString
,
1755 HTMLDocument_createStyleSheet
1758 static inline HTMLDocument
*impl_from_IHTMLDocument3(IHTMLDocument3
*iface
)
1760 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument3_iface
);
1763 static HRESULT WINAPI
HTMLDocument3_QueryInterface(IHTMLDocument3
*iface
,
1764 REFIID riid
, void **ppv
)
1766 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1767 return htmldoc_query_interface(This
, riid
, ppv
);
1770 static ULONG WINAPI
HTMLDocument3_AddRef(IHTMLDocument3
*iface
)
1772 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1773 return htmldoc_addref(This
);
1776 static ULONG WINAPI
HTMLDocument3_Release(IHTMLDocument3
*iface
)
1778 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1779 return htmldoc_release(This
);
1782 static HRESULT WINAPI
HTMLDocument3_GetTypeInfoCount(IHTMLDocument3
*iface
, UINT
*pctinfo
)
1784 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1785 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
1788 static HRESULT WINAPI
HTMLDocument3_GetTypeInfo(IHTMLDocument3
*iface
, UINT iTInfo
,
1789 LCID lcid
, ITypeInfo
**ppTInfo
)
1791 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1792 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1795 static HRESULT WINAPI
HTMLDocument3_GetIDsOfNames(IHTMLDocument3
*iface
, REFIID riid
,
1796 LPOLESTR
*rgszNames
, UINT cNames
,
1797 LCID lcid
, DISPID
*rgDispId
)
1799 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1800 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
1804 static HRESULT WINAPI
HTMLDocument3_Invoke(IHTMLDocument3
*iface
, DISPID dispIdMember
,
1805 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1806 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1808 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1809 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
1810 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1813 static HRESULT WINAPI
HTMLDocument3_releaseCapture(IHTMLDocument3
*iface
)
1815 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1816 FIXME("(%p)\n", This
);
1820 static HRESULT WINAPI
HTMLDocument3_recalc(IHTMLDocument3
*iface
, VARIANT_BOOL fForce
)
1822 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1824 WARN("(%p)->(%x)\n", This
, fForce
);
1826 /* Doing nothing here should be fine for us. */
1830 static HRESULT WINAPI
HTMLDocument3_createTextNode(IHTMLDocument3
*iface
, BSTR text
,
1831 IHTMLDOMNode
**newTextNode
)
1833 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1840 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(text
), newTextNode
);
1842 if(!This
->doc_node
->nsdoc
) {
1843 WARN("NULL nsdoc\n");
1844 return E_UNEXPECTED
;
1847 nsAString_InitDepend(&text_str
, text
);
1848 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->doc_node
->nsdoc
, &text_str
, &nstext
);
1849 nsAString_Finish(&text_str
);
1850 if(NS_FAILED(nsres
)) {
1851 ERR("CreateTextNode failed: %08x\n", nsres
);
1855 hres
= HTMLDOMTextNode_Create(This
->doc_node
, (nsIDOMNode
*)nstext
, &node
);
1856 nsIDOMText_Release(nstext
);
1860 *newTextNode
= &node
->IHTMLDOMNode_iface
;
1864 static HRESULT WINAPI
HTMLDocument3_get_documentElement(IHTMLDocument3
*iface
, IHTMLElement
**p
)
1866 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1867 nsIDOMElement
*nselem
= NULL
;
1872 TRACE("(%p)->(%p)\n", This
, p
);
1874 if(This
->window
->readystate
== READYSTATE_UNINITIALIZED
) {
1879 if(!This
->doc_node
->nsdoc
) {
1880 WARN("NULL nsdoc\n");
1881 return E_UNEXPECTED
;
1884 nsres
= nsIDOMHTMLDocument_GetDocumentElement(This
->doc_node
->nsdoc
, &nselem
);
1885 if(NS_FAILED(nsres
)) {
1886 ERR("GetDocumentElement failed: %08x\n", nsres
);
1895 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
1896 nsIDOMElement_Release(nselem
);
1900 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
1905 static HRESULT WINAPI
HTMLDocument3_uniqueID(IHTMLDocument3
*iface
, BSTR
*p
)
1907 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1908 FIXME("(%p)->(%p)\n", This
, p
);
1912 static HRESULT WINAPI
HTMLDocument3_attachEvent(IHTMLDocument3
*iface
, BSTR event
,
1913 IDispatch
* pDisp
, VARIANT_BOOL
*pfResult
)
1915 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1917 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
1919 return attach_event(&This
->doc_node
->node
.event_target
, This
, event
, pDisp
, pfResult
);
1922 static HRESULT WINAPI
HTMLDocument3_detachEvent(IHTMLDocument3
*iface
, BSTR event
,
1925 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1927 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
1929 return detach_event(This
->doc_node
->node
.event_target
, This
, event
, pDisp
);
1932 static HRESULT WINAPI
HTMLDocument3_put_onrowsdelete(IHTMLDocument3
*iface
, VARIANT v
)
1934 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1935 FIXME("(%p)->()\n", This
);
1939 static HRESULT WINAPI
HTMLDocument3_get_onrowsdelete(IHTMLDocument3
*iface
, VARIANT
*p
)
1941 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1942 FIXME("(%p)->(%p)\n", This
, p
);
1946 static HRESULT WINAPI
HTMLDocument3_put_onrowsinserted(IHTMLDocument3
*iface
, VARIANT v
)
1948 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1949 FIXME("(%p)->()\n", This
);
1953 static HRESULT WINAPI
HTMLDocument3_get_onrowsinserted(IHTMLDocument3
*iface
, VARIANT
*p
)
1955 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1956 FIXME("(%p)->(%p)\n", This
, p
);
1960 static HRESULT WINAPI
HTMLDocument3_put_oncellchange(IHTMLDocument3
*iface
, VARIANT v
)
1962 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1963 FIXME("(%p)->()\n", This
);
1967 static HRESULT WINAPI
HTMLDocument3_get_oncellchange(IHTMLDocument3
*iface
, VARIANT
*p
)
1969 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1970 FIXME("(%p)->(%p)\n", This
, p
);
1974 static HRESULT WINAPI
HTMLDocument3_put_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT v
)
1976 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1977 FIXME("(%p)->()\n", This
);
1981 static HRESULT WINAPI
HTMLDocument3_get_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT
*p
)
1983 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1984 FIXME("(%p)->(%p)\n", This
, p
);
1988 static HRESULT WINAPI
HTMLDocument3_put_ondataavailable(IHTMLDocument3
*iface
, VARIANT v
)
1990 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1991 FIXME("(%p)->()\n", This
);
1995 static HRESULT WINAPI
HTMLDocument3_get_ondataavailable(IHTMLDocument3
*iface
, VARIANT
*p
)
1997 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1998 FIXME("(%p)->(%p)\n", This
, p
);
2002 static HRESULT WINAPI
HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT v
)
2004 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2005 FIXME("(%p)->()\n", This
);
2009 static HRESULT WINAPI
HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT
*p
)
2011 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2012 FIXME("(%p)->(%p)\n", This
, p
);
2016 static HRESULT WINAPI
HTMLDocument3_put_onpropertychange(IHTMLDocument3
*iface
, VARIANT v
)
2018 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2019 FIXME("(%p)->()\n", This
);
2023 static HRESULT WINAPI
HTMLDocument3_get_onpropertychange(IHTMLDocument3
*iface
, VARIANT
*p
)
2025 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2026 FIXME("(%p)->(%p)\n", This
, p
);
2030 static HRESULT WINAPI
HTMLDocument3_put_dir(IHTMLDocument3
*iface
, BSTR v
)
2032 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2033 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2037 static HRESULT WINAPI
HTMLDocument3_get_dir(IHTMLDocument3
*iface
, BSTR
*p
)
2039 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2040 FIXME("(%p)->(%p)\n", This
, p
);
2044 static HRESULT WINAPI
HTMLDocument3_put_oncontextmenu(IHTMLDocument3
*iface
, VARIANT v
)
2046 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2048 TRACE("(%p)->()\n", This
);
2050 return set_doc_event(This
, EVENTID_CONTEXTMENU
, &v
);
2053 static HRESULT WINAPI
HTMLDocument3_get_oncontextmenu(IHTMLDocument3
*iface
, VARIANT
*p
)
2055 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2057 TRACE("(%p)->(%p)\n", This
, p
);
2059 return get_doc_event(This
, EVENTID_CONTEXTMENU
, p
);
2062 static HRESULT WINAPI
HTMLDocument3_put_onstop(IHTMLDocument3
*iface
, VARIANT v
)
2064 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2065 FIXME("(%p)->()\n", This
);
2069 static HRESULT WINAPI
HTMLDocument3_get_onstop(IHTMLDocument3
*iface
, VARIANT
*p
)
2071 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2072 FIXME("(%p)->(%p)\n", This
, p
);
2076 static HRESULT WINAPI
HTMLDocument3_createDocumentFragment(IHTMLDocument3
*iface
,
2077 IHTMLDocument2
**ppNewDoc
)
2079 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2080 nsIDOMDocumentFragment
*doc_frag
;
2081 HTMLDocumentNode
*docnode
;
2085 TRACE("(%p)->(%p)\n", This
, ppNewDoc
);
2087 if(!This
->doc_node
->nsdoc
) {
2088 FIXME("NULL nsdoc\n");
2092 nsres
= nsIDOMHTMLDocument_CreateDocumentFragment(This
->doc_node
->nsdoc
, &doc_frag
);
2093 if(NS_FAILED(nsres
)) {
2094 ERR("CreateDocumentFragment failed: %08x\n", nsres
);
2098 hres
= create_document_fragment((nsIDOMNode
*)doc_frag
, This
->doc_node
, &docnode
);
2099 nsIDOMDocumentFragment_Release(doc_frag
);
2103 *ppNewDoc
= &docnode
->basedoc
.IHTMLDocument2_iface
;
2107 static HRESULT WINAPI
HTMLDocument3_get_parentDocument(IHTMLDocument3
*iface
,
2110 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2111 FIXME("(%p)->(%p)\n", This
, p
);
2115 static HRESULT WINAPI
HTMLDocument3_put_enableDownload(IHTMLDocument3
*iface
,
2118 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2119 FIXME("(%p)->(%x)\n", This
, v
);
2123 static HRESULT WINAPI
HTMLDocument3_get_enableDownload(IHTMLDocument3
*iface
,
2126 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2127 FIXME("(%p)->(%p)\n", This
, p
);
2131 static HRESULT WINAPI
HTMLDocument3_put_baseUrl(IHTMLDocument3
*iface
, BSTR v
)
2133 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2134 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2138 static HRESULT WINAPI
HTMLDocument3_get_baseUrl(IHTMLDocument3
*iface
, BSTR
*p
)
2140 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2141 FIXME("(%p)->(%p)\n", This
, p
);
2145 static HRESULT WINAPI
HTMLDocument3_get_childNodes(IHTMLDocument3
*iface
, IDispatch
**p
)
2147 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2149 TRACE("(%p)->(%p)\n", This
, p
);
2151 return IHTMLDOMNode_get_childNodes(&This
->doc_node
->node
.IHTMLDOMNode_iface
, p
);
2154 static HRESULT WINAPI
HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3
*iface
,
2157 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2158 FIXME("(%p)->()\n", This
);
2162 static HRESULT WINAPI
HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3
*iface
,
2165 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2166 FIXME("(%p)->(%p)\n", This
, p
);
2170 static HRESULT WINAPI
HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT v
)
2172 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2173 FIXME("(%p)->()\n", This
);
2177 static HRESULT WINAPI
HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT
*p
)
2179 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2180 FIXME("(%p)->(%p)\n", This
, p
);
2184 static HRESULT WINAPI
HTMLDocument3_getElementsByName(IHTMLDocument3
*iface
, BSTR v
,
2185 IHTMLElementCollection
**ppelColl
)
2187 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2188 nsIDOMNodeList
*node_list
;
2189 nsAString selector_str
;
2193 static const WCHAR formatW
[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
2195 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppelColl
);
2197 if(!This
->doc_node
|| !This
->doc_node
->nsdoc
) {
2198 /* We should probably return an empty collection. */
2199 FIXME("No nsdoc\n");
2203 selector
= heap_alloc(2*SysStringLen(v
)*sizeof(WCHAR
) + sizeof(formatW
));
2205 return E_OUTOFMEMORY
;
2206 sprintfW(selector
, formatW
, v
, v
);
2209 * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes.
2210 * That's why we use CSS selector instead. We should also use name only when it applies to given element
2211 * types and search should be case insensitive. Those are currently not supported properly.
2213 nsAString_InitDepend(&selector_str
, selector
);
2214 nsres
= nsIDOMNodeSelector_QuerySelectorAll(This
->doc_node
->nsnode_selector
, &selector_str
, &node_list
);
2215 nsAString_Finish(&selector_str
);
2216 heap_free(selector
);
2217 if(NS_FAILED(nsres
)) {
2218 ERR("QuerySelectorAll failed: %08x\n", nsres
);
2222 *ppelColl
= create_collection_from_nodelist(This
->doc_node
, node_list
);
2223 nsIDOMNodeList_Release(node_list
);
2228 static HRESULT WINAPI
HTMLDocument3_getElementById(IHTMLDocument3
*iface
, BSTR v
,
2231 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2235 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
2237 hres
= get_doc_elem_by_id(This
->doc_node
, v
, &elem
);
2238 if(FAILED(hres
) || !elem
) {
2243 *pel
= &elem
->IHTMLElement_iface
;
2248 static HRESULT WINAPI
HTMLDocument3_getElementsByTagName(IHTMLDocument3
*iface
, BSTR v
,
2249 IHTMLElementCollection
**pelColl
)
2251 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2252 nsIDOMNodeList
*nslist
;
2256 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
2258 if(!This
->doc_node
->nsdoc
) {
2259 WARN("NULL nsdoc\n");
2260 return E_UNEXPECTED
;
2263 nsAString_InitDepend(&id_str
, v
);
2264 nsres
= nsIDOMHTMLDocument_GetElementsByTagName(This
->doc_node
->nsdoc
, &id_str
, &nslist
);
2265 nsAString_Finish(&id_str
);
2267 ERR("GetElementByName failed: %08x\n", nsres
);
2271 *pelColl
= create_collection_from_nodelist(This
->doc_node
, nslist
);
2272 nsIDOMNodeList_Release(nslist
);
2277 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl
= {
2278 HTMLDocument3_QueryInterface
,
2279 HTMLDocument3_AddRef
,
2280 HTMLDocument3_Release
,
2281 HTMLDocument3_GetTypeInfoCount
,
2282 HTMLDocument3_GetTypeInfo
,
2283 HTMLDocument3_GetIDsOfNames
,
2284 HTMLDocument3_Invoke
,
2285 HTMLDocument3_releaseCapture
,
2286 HTMLDocument3_recalc
,
2287 HTMLDocument3_createTextNode
,
2288 HTMLDocument3_get_documentElement
,
2289 HTMLDocument3_uniqueID
,
2290 HTMLDocument3_attachEvent
,
2291 HTMLDocument3_detachEvent
,
2292 HTMLDocument3_put_onrowsdelete
,
2293 HTMLDocument3_get_onrowsdelete
,
2294 HTMLDocument3_put_onrowsinserted
,
2295 HTMLDocument3_get_onrowsinserted
,
2296 HTMLDocument3_put_oncellchange
,
2297 HTMLDocument3_get_oncellchange
,
2298 HTMLDocument3_put_ondatasetchanged
,
2299 HTMLDocument3_get_ondatasetchanged
,
2300 HTMLDocument3_put_ondataavailable
,
2301 HTMLDocument3_get_ondataavailable
,
2302 HTMLDocument3_put_ondatasetcomplete
,
2303 HTMLDocument3_get_ondatasetcomplete
,
2304 HTMLDocument3_put_onpropertychange
,
2305 HTMLDocument3_get_onpropertychange
,
2306 HTMLDocument3_put_dir
,
2307 HTMLDocument3_get_dir
,
2308 HTMLDocument3_put_oncontextmenu
,
2309 HTMLDocument3_get_oncontextmenu
,
2310 HTMLDocument3_put_onstop
,
2311 HTMLDocument3_get_onstop
,
2312 HTMLDocument3_createDocumentFragment
,
2313 HTMLDocument3_get_parentDocument
,
2314 HTMLDocument3_put_enableDownload
,
2315 HTMLDocument3_get_enableDownload
,
2316 HTMLDocument3_put_baseUrl
,
2317 HTMLDocument3_get_baseUrl
,
2318 HTMLDocument3_get_childNodes
,
2319 HTMLDocument3_put_inheritStyleSheets
,
2320 HTMLDocument3_get_inheritStyleSheets
,
2321 HTMLDocument3_put_onbeforeeditfocus
,
2322 HTMLDocument3_get_onbeforeeditfocus
,
2323 HTMLDocument3_getElementsByName
,
2324 HTMLDocument3_getElementById
,
2325 HTMLDocument3_getElementsByTagName
2328 static inline HTMLDocument
*impl_from_IHTMLDocument4(IHTMLDocument4
*iface
)
2330 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument4_iface
);
2333 static HRESULT WINAPI
HTMLDocument4_QueryInterface(IHTMLDocument4
*iface
,
2334 REFIID riid
, void **ppv
)
2336 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2337 return htmldoc_query_interface(This
, riid
, ppv
);
2340 static ULONG WINAPI
HTMLDocument4_AddRef(IHTMLDocument4
*iface
)
2342 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2343 return htmldoc_addref(This
);
2346 static ULONG WINAPI
HTMLDocument4_Release(IHTMLDocument4
*iface
)
2348 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2349 return htmldoc_release(This
);
2352 static HRESULT WINAPI
HTMLDocument4_GetTypeInfoCount(IHTMLDocument4
*iface
, UINT
*pctinfo
)
2354 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2355 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2358 static HRESULT WINAPI
HTMLDocument4_GetTypeInfo(IHTMLDocument4
*iface
, UINT iTInfo
,
2359 LCID lcid
, ITypeInfo
**ppTInfo
)
2361 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2362 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2365 static HRESULT WINAPI
HTMLDocument4_GetIDsOfNames(IHTMLDocument4
*iface
, REFIID riid
,
2366 LPOLESTR
*rgszNames
, UINT cNames
,
2367 LCID lcid
, DISPID
*rgDispId
)
2369 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2370 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2374 static HRESULT WINAPI
HTMLDocument4_Invoke(IHTMLDocument4
*iface
, DISPID dispIdMember
,
2375 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2376 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2378 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2379 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2380 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2383 static HRESULT WINAPI
HTMLDocument4_focus(IHTMLDocument4
*iface
)
2385 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2386 nsIDOMHTMLElement
*nsbody
;
2389 TRACE("(%p)->()\n", This
);
2391 nsres
= nsIDOMHTMLDocument_GetBody(This
->doc_node
->nsdoc
, &nsbody
);
2392 if(NS_FAILED(nsres
) || !nsbody
) {
2393 ERR("GetBody failed: %08x\n", nsres
);
2397 nsres
= nsIDOMHTMLElement_Focus(nsbody
);
2398 nsIDOMHTMLElement_Release(nsbody
);
2399 if(NS_FAILED(nsres
)) {
2400 ERR("Focus failed: %08x\n", nsres
);
2407 static HRESULT WINAPI
HTMLDocument4_hasFocus(IHTMLDocument4
*iface
, VARIANT_BOOL
*pfFocus
)
2409 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2410 FIXME("(%p)->(%p)\n", This
, pfFocus
);
2414 static HRESULT WINAPI
HTMLDocument4_put_onselectionchange(IHTMLDocument4
*iface
, VARIANT v
)
2416 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2417 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2421 static HRESULT WINAPI
HTMLDocument4_get_onselectionchange(IHTMLDocument4
*iface
, VARIANT
*p
)
2423 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2424 FIXME("(%p)->(%p)\n", This
, p
);
2428 static HRESULT WINAPI
HTMLDocument4_get_namespace(IHTMLDocument4
*iface
, IDispatch
**p
)
2430 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2431 FIXME("(%p)->(%p)\n", This
, p
);
2435 static HRESULT WINAPI
HTMLDocument4_createDocumentFromUrl(IHTMLDocument4
*iface
, BSTR bstrUrl
,
2436 BSTR bstrOptions
, IHTMLDocument2
**newDoc
)
2438 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2439 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrUrl
), debugstr_w(bstrOptions
), newDoc
);
2443 static HRESULT WINAPI
HTMLDocument4_put_media(IHTMLDocument4
*iface
, BSTR v
)
2445 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2446 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2450 static HRESULT WINAPI
HTMLDocument4_get_media(IHTMLDocument4
*iface
, BSTR
*p
)
2452 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2453 FIXME("(%p)->(%p)\n", This
, p
);
2457 static HRESULT WINAPI
HTMLDocument4_createEventObject(IHTMLDocument4
*iface
,
2458 VARIANT
*pvarEventObject
, IHTMLEventObj
**ppEventObj
)
2460 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2462 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(pvarEventObject
), ppEventObj
);
2464 if(pvarEventObject
&& V_VT(pvarEventObject
) != VT_ERROR
&& V_VT(pvarEventObject
) != VT_EMPTY
) {
2465 FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject
));
2469 return create_event_obj(ppEventObj
);
2472 static HRESULT WINAPI
HTMLDocument4_fireEvent(IHTMLDocument4
*iface
, BSTR bstrEventName
,
2473 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCanceled
)
2475 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2477 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrEventName
), pvarEventObject
, pfCanceled
);
2479 return dispatch_event(&This
->doc_node
->node
, bstrEventName
, pvarEventObject
, pfCanceled
);
2482 static HRESULT WINAPI
HTMLDocument4_createRenderStyle(IHTMLDocument4
*iface
, BSTR v
,
2483 IHTMLRenderStyle
**ppIHTMLRenderStyle
)
2485 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2486 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppIHTMLRenderStyle
);
2490 static HRESULT WINAPI
HTMLDocument4_put_oncontrolselect(IHTMLDocument4
*iface
, VARIANT v
)
2492 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2493 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2497 static HRESULT WINAPI
HTMLDocument4_get_oncontrolselect(IHTMLDocument4
*iface
, VARIANT
*p
)
2499 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2500 FIXME("(%p)->(%p)\n", This
, p
);
2504 static HRESULT WINAPI
HTMLDocument4_get_URLEncoded(IHTMLDocument4
*iface
, BSTR
*p
)
2506 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2507 FIXME("(%p)->(%p)\n", This
, p
);
2511 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl
= {
2512 HTMLDocument4_QueryInterface
,
2513 HTMLDocument4_AddRef
,
2514 HTMLDocument4_Release
,
2515 HTMLDocument4_GetTypeInfoCount
,
2516 HTMLDocument4_GetTypeInfo
,
2517 HTMLDocument4_GetIDsOfNames
,
2518 HTMLDocument4_Invoke
,
2519 HTMLDocument4_focus
,
2520 HTMLDocument4_hasFocus
,
2521 HTMLDocument4_put_onselectionchange
,
2522 HTMLDocument4_get_onselectionchange
,
2523 HTMLDocument4_get_namespace
,
2524 HTMLDocument4_createDocumentFromUrl
,
2525 HTMLDocument4_put_media
,
2526 HTMLDocument4_get_media
,
2527 HTMLDocument4_createEventObject
,
2528 HTMLDocument4_fireEvent
,
2529 HTMLDocument4_createRenderStyle
,
2530 HTMLDocument4_put_oncontrolselect
,
2531 HTMLDocument4_get_oncontrolselect
,
2532 HTMLDocument4_get_URLEncoded
2535 static inline HTMLDocument
*impl_from_IHTMLDocument5(IHTMLDocument5
*iface
)
2537 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument5_iface
);
2540 static HRESULT WINAPI
HTMLDocument5_QueryInterface(IHTMLDocument5
*iface
,
2541 REFIID riid
, void **ppv
)
2543 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2544 return htmldoc_query_interface(This
, riid
, ppv
);
2547 static ULONG WINAPI
HTMLDocument5_AddRef(IHTMLDocument5
*iface
)
2549 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2550 return htmldoc_addref(This
);
2553 static ULONG WINAPI
HTMLDocument5_Release(IHTMLDocument5
*iface
)
2555 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2556 return htmldoc_release(This
);
2559 static HRESULT WINAPI
HTMLDocument5_GetTypeInfoCount(IHTMLDocument5
*iface
, UINT
*pctinfo
)
2561 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2562 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2565 static HRESULT WINAPI
HTMLDocument5_GetTypeInfo(IHTMLDocument5
*iface
, UINT iTInfo
,
2566 LCID lcid
, ITypeInfo
**ppTInfo
)
2568 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2569 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2572 static HRESULT WINAPI
HTMLDocument5_GetIDsOfNames(IHTMLDocument5
*iface
, REFIID riid
,
2573 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2575 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2576 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2580 static HRESULT WINAPI
HTMLDocument5_Invoke(IHTMLDocument5
*iface
, DISPID dispIdMember
,
2581 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2582 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2584 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2585 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2586 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2589 static HRESULT WINAPI
HTMLDocument5_put_onmousewheel(IHTMLDocument5
*iface
, VARIANT v
)
2591 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2592 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2596 static HRESULT WINAPI
HTMLDocument5_get_onmousewheel(IHTMLDocument5
*iface
, VARIANT
*p
)
2598 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2599 FIXME("(%p)->(%p)\n", This
, p
);
2603 static HRESULT WINAPI
HTMLDocument5_get_doctype(IHTMLDocument5
*iface
, IHTMLDOMNode
**p
)
2605 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2606 FIXME("(%p)->(%p)\n", This
, p
);
2610 static HRESULT WINAPI
HTMLDocument5_get_implementation(IHTMLDocument5
*iface
, IHTMLDOMImplementation
**p
)
2612 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2613 HTMLDocumentNode
*doc_node
= This
->doc_node
;
2615 TRACE("(%p)->(%p)\n", This
, p
);
2617 if(!doc_node
->dom_implementation
) {
2620 hres
= create_dom_implementation(&doc_node
->dom_implementation
);
2625 IHTMLDOMImplementation_AddRef(doc_node
->dom_implementation
);
2626 *p
= doc_node
->dom_implementation
;
2630 static HRESULT WINAPI
HTMLDocument5_createAttribute(IHTMLDocument5
*iface
, BSTR bstrattrName
,
2631 IHTMLDOMAttribute
**ppattribute
)
2633 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2634 HTMLDOMAttribute
*attr
;
2637 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrattrName
), ppattribute
);
2639 hres
= HTMLDOMAttribute_Create(bstrattrName
, NULL
, 0, &attr
);
2643 *ppattribute
= &attr
->IHTMLDOMAttribute_iface
;
2647 static HRESULT WINAPI
HTMLDocument5_createComment(IHTMLDocument5
*iface
, BSTR bstrdata
,
2648 IHTMLDOMNode
**ppRetNode
)
2650 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2651 nsIDOMComment
*nscomment
;
2657 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrdata
), ppRetNode
);
2659 if(!This
->doc_node
->nsdoc
) {
2660 WARN("NULL nsdoc\n");
2661 return E_UNEXPECTED
;
2664 nsAString_InitDepend(&str
, bstrdata
);
2665 nsres
= nsIDOMHTMLDocument_CreateComment(This
->doc_node
->nsdoc
, &str
, &nscomment
);
2666 nsAString_Finish(&str
);
2667 if(NS_FAILED(nsres
)) {
2668 ERR("CreateTextNode failed: %08x\n", nsres
);
2672 hres
= HTMLCommentElement_Create(This
->doc_node
, (nsIDOMNode
*)nscomment
, &elem
);
2673 nsIDOMComment_Release(nscomment
);
2677 *ppRetNode
= &elem
->node
.IHTMLDOMNode_iface
;
2681 static HRESULT WINAPI
HTMLDocument5_put_onfocusin(IHTMLDocument5
*iface
, VARIANT v
)
2683 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2684 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2688 static HRESULT WINAPI
HTMLDocument5_get_onfocusin(IHTMLDocument5
*iface
, VARIANT
*p
)
2690 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2691 FIXME("(%p)->(%p)\n", This
, p
);
2695 static HRESULT WINAPI
HTMLDocument5_put_onfocusout(IHTMLDocument5
*iface
, VARIANT v
)
2697 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2698 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2702 static HRESULT WINAPI
HTMLDocument5_get_onfocusout(IHTMLDocument5
*iface
, VARIANT
*p
)
2704 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2705 FIXME("(%p)->(%p)\n", This
, p
);
2709 static HRESULT WINAPI
HTMLDocument5_put_onactivate(IHTMLDocument5
*iface
, VARIANT v
)
2711 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2712 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2716 static HRESULT WINAPI
HTMLDocument5_get_onactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2718 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2719 FIXME("(%p)->(%p)\n", This
, p
);
2723 static HRESULT WINAPI
HTMLDocument5_put_ondeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2725 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2726 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2730 static HRESULT WINAPI
HTMLDocument5_get_ondeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2732 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2733 FIXME("(%p)->(%p)\n", This
, p
);
2737 static HRESULT WINAPI
HTMLDocument5_put_onbeforeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2739 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2740 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2744 static HRESULT WINAPI
HTMLDocument5_get_onbeforeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2746 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2747 FIXME("(%p)->(%p)\n", This
, p
);
2751 static HRESULT WINAPI
HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2753 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2754 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2758 static HRESULT WINAPI
HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2760 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2761 FIXME("(%p)->(%p)\n", This
, p
);
2765 static HRESULT WINAPI
HTMLDocument5_get_compatMode(IHTMLDocument5
*iface
, BSTR
*p
)
2767 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2769 const PRUnichar
*mode
;
2771 TRACE("(%p)->(%p)\n", This
, p
);
2773 if(!This
->doc_node
->nsdoc
) {
2774 WARN("NULL nsdoc\n");
2775 return E_UNEXPECTED
;
2778 nsAString_Init(&mode_str
, NULL
);
2779 nsIDOMHTMLDocument_GetCompatMode(This
->doc_node
->nsdoc
, &mode_str
);
2781 nsAString_GetData(&mode_str
, &mode
);
2782 *p
= SysAllocString(mode
);
2783 nsAString_Finish(&mode_str
);
2788 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl
= {
2789 HTMLDocument5_QueryInterface
,
2790 HTMLDocument5_AddRef
,
2791 HTMLDocument5_Release
,
2792 HTMLDocument5_GetTypeInfoCount
,
2793 HTMLDocument5_GetTypeInfo
,
2794 HTMLDocument5_GetIDsOfNames
,
2795 HTMLDocument5_Invoke
,
2796 HTMLDocument5_put_onmousewheel
,
2797 HTMLDocument5_get_onmousewheel
,
2798 HTMLDocument5_get_doctype
,
2799 HTMLDocument5_get_implementation
,
2800 HTMLDocument5_createAttribute
,
2801 HTMLDocument5_createComment
,
2802 HTMLDocument5_put_onfocusin
,
2803 HTMLDocument5_get_onfocusin
,
2804 HTMLDocument5_put_onfocusout
,
2805 HTMLDocument5_get_onfocusout
,
2806 HTMLDocument5_put_onactivate
,
2807 HTMLDocument5_get_onactivate
,
2808 HTMLDocument5_put_ondeactivate
,
2809 HTMLDocument5_get_ondeactivate
,
2810 HTMLDocument5_put_onbeforeactivate
,
2811 HTMLDocument5_get_onbeforeactivate
,
2812 HTMLDocument5_put_onbeforedeactivate
,
2813 HTMLDocument5_get_onbeforedeactivate
,
2814 HTMLDocument5_get_compatMode
2817 static inline HTMLDocument
*impl_from_IHTMLDocument6(IHTMLDocument6
*iface
)
2819 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument6_iface
);
2822 static HRESULT WINAPI
HTMLDocument6_QueryInterface(IHTMLDocument6
*iface
,
2823 REFIID riid
, void **ppv
)
2825 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2826 return htmldoc_query_interface(This
, riid
, ppv
);
2829 static ULONG WINAPI
HTMLDocument6_AddRef(IHTMLDocument6
*iface
)
2831 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2832 return htmldoc_addref(This
);
2835 static ULONG WINAPI
HTMLDocument6_Release(IHTMLDocument6
*iface
)
2837 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2838 return htmldoc_release(This
);
2841 static HRESULT WINAPI
HTMLDocument6_GetTypeInfoCount(IHTMLDocument6
*iface
, UINT
*pctinfo
)
2843 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2844 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2847 static HRESULT WINAPI
HTMLDocument6_GetTypeInfo(IHTMLDocument6
*iface
, UINT iTInfo
,
2848 LCID lcid
, ITypeInfo
**ppTInfo
)
2850 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2851 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2854 static HRESULT WINAPI
HTMLDocument6_GetIDsOfNames(IHTMLDocument6
*iface
, REFIID riid
,
2855 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2857 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2858 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2862 static HRESULT WINAPI
HTMLDocument6_Invoke(IHTMLDocument6
*iface
, DISPID dispIdMember
,
2863 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2864 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2866 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2867 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2868 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2871 static HRESULT WINAPI
HTMLDocument6_get_compatible(IHTMLDocument6
*iface
,
2872 IHTMLDocumentCompatibleInfoCollection
**p
)
2874 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2875 FIXME("(%p)->(%p)\n", This
, p
);
2879 static HRESULT WINAPI
HTMLDocument6_get_documentMode(IHTMLDocument6
*iface
,
2882 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2883 FIXME("(%p)->(%p)\n", This
, p
);
2887 static HRESULT WINAPI
HTMLDocument6_get_onstorage(IHTMLDocument6
*iface
,
2890 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2891 FIXME("(%p)->(%p)\n", This
, p
);
2895 static HRESULT WINAPI
HTMLDocument6_put_onstorage(IHTMLDocument6
*iface
, VARIANT v
)
2897 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2898 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2902 static HRESULT WINAPI
HTMLDocument6_get_onstoragecommit(IHTMLDocument6
*iface
,
2905 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2906 FIXME("(%p)->(%p)\n", This
, p
);
2910 static HRESULT WINAPI
HTMLDocument6_put_onstoragecommit(IHTMLDocument6
*iface
, VARIANT v
)
2912 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2913 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2917 static HRESULT WINAPI
HTMLDocument6_getElementById(IHTMLDocument6
*iface
,
2918 BSTR bstrId
, IHTMLElement2
**p
)
2920 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2921 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrId
), p
);
2925 static HRESULT WINAPI
HTMLDocument6_updateSettings(IHTMLDocument6
*iface
)
2927 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2928 FIXME("(%p)->()\n", This
);
2932 static const IHTMLDocument6Vtbl HTMLDocument6Vtbl
= {
2933 HTMLDocument6_QueryInterface
,
2934 HTMLDocument6_AddRef
,
2935 HTMLDocument6_Release
,
2936 HTMLDocument6_GetTypeInfoCount
,
2937 HTMLDocument6_GetTypeInfo
,
2938 HTMLDocument6_GetIDsOfNames
,
2939 HTMLDocument6_Invoke
,
2940 HTMLDocument6_get_compatible
,
2941 HTMLDocument6_get_documentMode
,
2942 HTMLDocument6_put_onstorage
,
2943 HTMLDocument6_get_onstorage
,
2944 HTMLDocument6_put_onstoragecommit
,
2945 HTMLDocument6_get_onstoragecommit
,
2946 HTMLDocument6_getElementById
,
2947 HTMLDocument6_updateSettings
2950 static inline HTMLDocument
*impl_from_IHTMLDocument7(IHTMLDocument7
*iface
)
2952 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument7_iface
);
2955 static HRESULT WINAPI
HTMLDocument7_QueryInterface(IHTMLDocument7
*iface
, REFIID riid
, void **ppv
)
2957 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2958 return htmldoc_query_interface(This
, riid
, ppv
);
2961 static ULONG WINAPI
HTMLDocument7_AddRef(IHTMLDocument7
*iface
)
2963 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2964 return htmldoc_addref(This
);
2967 static ULONG WINAPI
HTMLDocument7_Release(IHTMLDocument7
*iface
)
2969 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2970 return htmldoc_release(This
);
2973 static HRESULT WINAPI
HTMLDocument7_GetTypeInfoCount(IHTMLDocument7
*iface
, UINT
*pctinfo
)
2975 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2976 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2979 static HRESULT WINAPI
HTMLDocument7_GetTypeInfo(IHTMLDocument7
*iface
, UINT iTInfo
,
2980 LCID lcid
, ITypeInfo
**ppTInfo
)
2982 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2983 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2986 static HRESULT WINAPI
HTMLDocument7_GetIDsOfNames(IHTMLDocument7
*iface
, REFIID riid
,
2987 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2989 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2990 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2994 static HRESULT WINAPI
HTMLDocument7_Invoke(IHTMLDocument7
*iface
, DISPID dispIdMember
,
2995 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2996 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2998 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
2999 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
3000 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3003 static HRESULT WINAPI
HTMLDocument7_get_defaultView(IHTMLDocument7
*iface
, IHTMLWindow2
**p
)
3005 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3006 FIXME("(%p)->(%p)\n", This
, p
);
3010 static HRESULT WINAPI
HTMLDocument7_createCDATASection(IHTMLDocument7
*iface
, BSTR text
, IHTMLDOMNode
**newCDATASectionNode
)
3012 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3013 FIXME("(%p)->(%p)\n", This
, newCDATASectionNode
);
3017 static HRESULT WINAPI
HTMLDocument7_getSelection(IHTMLDocument7
*iface
, IHTMLSelection
**ppIHTMLSelection
)
3019 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3020 FIXME("(%p)->(%p)\n", This
, ppIHTMLSelection
);
3024 static HRESULT WINAPI
HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
,
3025 BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
3027 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3028 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrLocalName
), pelColl
);
3032 static HRESULT WINAPI
HTMLDocument7_createElementNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
, BSTR bstrTag
, IHTMLElement
**newElem
)
3034 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3035 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrTag
), newElem
);
3039 static HRESULT WINAPI
HTMLDocument7_createAttributeNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
,
3040 BSTR bstrAttrName
, IHTMLDOMAttribute
**ppAttribute
)
3042 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3043 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrAttrName
), ppAttribute
);
3047 static HRESULT WINAPI
HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7
*iface
, VARIANT v
)
3049 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3050 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3054 static HRESULT WINAPI
HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7
*iface
, VARIANT
*p
)
3056 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3057 FIXME("(%p)->(%p)\n", This
, p
);
3061 static HRESULT WINAPI
HTMLDocument7_get_characterSet(IHTMLDocument7
*iface
, BSTR
*p
)
3063 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3064 FIXME("(%p)->(%p)\n", This
, p
);
3068 static HRESULT WINAPI
HTMLDocument7_createElement(IHTMLDocument7
*iface
, BSTR bstrTag
, IHTMLElement
**newElem
)
3070 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3071 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrTag
), newElem
);
3075 static HRESULT WINAPI
HTMLDocument7_createAttribute(IHTMLDocument7
*iface
, BSTR bstrAttrName
, IHTMLDOMAttribute
**ppAttribute
)
3077 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3078 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrAttrName
), ppAttribute
);
3082 static HRESULT WINAPI
HTMLDocument7_getElementByClassName(IHTMLDocument7
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
3084 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3085 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
3089 static HRESULT WINAPI
HTMLDocument7_createProcessingInstruction(IHTMLDocument7
*iface
, BSTR target
,
3090 BSTR data
, IDOMProcessingInstruction
**newProcessingInstruction
)
3092 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3093 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(target
), debugstr_w(data
), newProcessingInstruction
);
3097 static HRESULT WINAPI
HTMLDocument7_adoptNode(IHTMLDocument7
*iface
, IHTMLDOMNode
*pNodeSource
, IHTMLDOMNode3
**ppNodeDest
)
3099 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3100 FIXME("(%p)->(%p %p)\n", This
, pNodeSource
, ppNodeDest
);
3104 static HRESULT WINAPI
HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7
*iface
, VARIANT v
)
3106 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3107 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3111 static HRESULT WINAPI
HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7
*iface
, VARIANT
*p
)
3113 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3114 FIXME("(%p)->(%p)\n", This
, p
);
3118 static HRESULT WINAPI
HTMLDocument7_get_all(IHTMLDocument7
*iface
, IHTMLElementCollection
**p
)
3120 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3121 FIXME("(%p)->(%p)\n", This
, p
);
3125 static HRESULT WINAPI
HTMLDocument7_get_inputEncoding(IHTMLDocument7
*iface
, BSTR
*p
)
3127 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3128 FIXME("(%p)->(%p)\n", This
, p
);
3132 static HRESULT WINAPI
HTMLDocument7_get_xmlEncoding(IHTMLDocument7
*iface
, BSTR
*p
)
3134 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3135 FIXME("(%p)->(%p)\n", This
, p
);
3139 static HRESULT WINAPI
HTMLDocument7_put_xmlStandalone(IHTMLDocument7
*iface
, VARIANT_BOOL v
)
3141 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3142 FIXME("(%p)->(%x)\n", This
, v
);
3146 static HRESULT WINAPI
HTMLDocument7_get_xmlStandalone(IHTMLDocument7
*iface
, VARIANT_BOOL
*p
)
3148 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3149 FIXME("(%p)->(%p)\n", This
, p
);
3153 static HRESULT WINAPI
HTMLDocument7_put_xmlVersion(IHTMLDocument7
*iface
, BSTR v
)
3155 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3156 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3160 static HRESULT WINAPI
HTMLDocument7_get_xmlVersion(IHTMLDocument7
*iface
, BSTR
*p
)
3162 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3163 FIXME("(%p)->(%p)\n", This
, p
);
3167 static HRESULT WINAPI
HTMLDocument7_hasAttributes(IHTMLDocument7
*iface
, VARIANT_BOOL
*pfHasAttributes
)
3169 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3170 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
3174 static HRESULT WINAPI
HTMLDocument7_put_onabort(IHTMLDocument7
*iface
, VARIANT v
)
3176 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3177 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3181 static HRESULT WINAPI
HTMLDocument7_get_onabort(IHTMLDocument7
*iface
, VARIANT
*p
)
3183 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3184 FIXME("(%p)->(%p)\n", This
, p
);
3188 static HRESULT WINAPI
HTMLDocument7_put_onblur(IHTMLDocument7
*iface
, VARIANT v
)
3190 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3191 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3195 static HRESULT WINAPI
HTMLDocument7_get_onblur(IHTMLDocument7
*iface
, VARIANT
*p
)
3197 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3198 FIXME("(%p)->(%p)\n", This
, p
);
3202 static HRESULT WINAPI
HTMLDocument7_put_oncanplay(IHTMLDocument7
*iface
, VARIANT v
)
3204 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3205 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3209 static HRESULT WINAPI
HTMLDocument7_get_oncanplay(IHTMLDocument7
*iface
, VARIANT
*p
)
3211 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3212 FIXME("(%p)->(%p)\n", This
, p
);
3216 static HRESULT WINAPI
HTMLDocument7_put_oncanplaythrough(IHTMLDocument7
*iface
, VARIANT v
)
3218 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3219 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3223 static HRESULT WINAPI
HTMLDocument7_get_oncanplaythrough(IHTMLDocument7
*iface
, VARIANT
*p
)
3225 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3226 FIXME("(%p)->(%p)\n", This
, p
);
3230 static HRESULT WINAPI
HTMLDocument7_put_onchange(IHTMLDocument7
*iface
, VARIANT v
)
3232 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3233 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3237 static HRESULT WINAPI
HTMLDocument7_get_onchange(IHTMLDocument7
*iface
, VARIANT
*p
)
3239 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3240 FIXME("(%p)->(%p)\n", This
, p
);
3244 static HRESULT WINAPI
HTMLDocument7_put_ondrag(IHTMLDocument7
*iface
, VARIANT v
)
3246 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3247 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3251 static HRESULT WINAPI
HTMLDocument7_get_ondrag(IHTMLDocument7
*iface
, VARIANT
*p
)
3253 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3254 FIXME("(%p)->(%p)\n", This
, p
);
3258 static HRESULT WINAPI
HTMLDocument7_put_ondragend(IHTMLDocument7
*iface
, VARIANT v
)
3260 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3261 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3265 static HRESULT WINAPI
HTMLDocument7_get_ondragend(IHTMLDocument7
*iface
, VARIANT
*p
)
3267 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3268 FIXME("(%p)->(%p)\n", This
, p
);
3272 static HRESULT WINAPI
HTMLDocument7_put_ondragenter(IHTMLDocument7
*iface
, VARIANT v
)
3274 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3275 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3279 static HRESULT WINAPI
HTMLDocument7_get_ondragenter(IHTMLDocument7
*iface
, VARIANT
*p
)
3281 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3282 FIXME("(%p)->(%p)\n", This
, p
);
3286 static HRESULT WINAPI
HTMLDocument7_put_ondragleave(IHTMLDocument7
*iface
, VARIANT v
)
3288 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3289 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3293 static HRESULT WINAPI
HTMLDocument7_get_ondragleave(IHTMLDocument7
*iface
, VARIANT
*p
)
3295 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3296 FIXME("(%p)->(%p)\n", This
, p
);
3300 static HRESULT WINAPI
HTMLDocument7_put_ondragover(IHTMLDocument7
*iface
, VARIANT v
)
3302 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3303 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3307 static HRESULT WINAPI
HTMLDocument7_get_ondragover(IHTMLDocument7
*iface
, VARIANT
*p
)
3309 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3310 FIXME("(%p)->(%p)\n", This
, p
);
3314 static HRESULT WINAPI
HTMLDocument7_put_ondrop(IHTMLDocument7
*iface
, VARIANT v
)
3316 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3317 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3321 static HRESULT WINAPI
HTMLDocument7_get_ondrop(IHTMLDocument7
*iface
, VARIANT
*p
)
3323 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3324 FIXME("(%p)->(%p)\n", This
, p
);
3328 static HRESULT WINAPI
HTMLDocument7_put_ondurationchange(IHTMLDocument7
*iface
, VARIANT v
)
3330 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3331 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3335 static HRESULT WINAPI
HTMLDocument7_get_ondurationchange(IHTMLDocument7
*iface
, VARIANT
*p
)
3337 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3338 FIXME("(%p)->(%p)\n", This
, p
);
3342 static HRESULT WINAPI
HTMLDocument7_put_onemptied(IHTMLDocument7
*iface
, VARIANT v
)
3344 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3345 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3349 static HRESULT WINAPI
HTMLDocument7_get_onemptied(IHTMLDocument7
*iface
, VARIANT
*p
)
3351 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3352 FIXME("(%p)->(%p)\n", This
, p
);
3356 static HRESULT WINAPI
HTMLDocument7_put_onended(IHTMLDocument7
*iface
, VARIANT v
)
3358 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3359 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3363 static HRESULT WINAPI
HTMLDocument7_get_onended(IHTMLDocument7
*iface
, VARIANT
*p
)
3365 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3366 FIXME("(%p)->(%p)\n", This
, p
);
3370 static HRESULT WINAPI
HTMLDocument7_put_onerror(IHTMLDocument7
*iface
, VARIANT v
)
3372 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3373 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3377 static HRESULT WINAPI
HTMLDocument7_get_onerror(IHTMLDocument7
*iface
, VARIANT
*p
)
3379 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3380 FIXME("(%p)->(%p)\n", This
, p
);
3384 static HRESULT WINAPI
HTMLDocument7_put_onfocus(IHTMLDocument7
*iface
, VARIANT v
)
3386 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3387 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3391 static HRESULT WINAPI
HTMLDocument7_get_onfocus(IHTMLDocument7
*iface
, VARIANT
*p
)
3393 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3394 FIXME("(%p)->(%p)\n", This
, p
);
3398 static HRESULT WINAPI
HTMLDocument7_put_oninput(IHTMLDocument7
*iface
, VARIANT v
)
3400 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3401 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3405 static HRESULT WINAPI
HTMLDocument7_get_oninput(IHTMLDocument7
*iface
, VARIANT
*p
)
3407 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3408 FIXME("(%p)->(%p)\n", This
, p
);
3412 static HRESULT WINAPI
HTMLDocument7_put_onload(IHTMLDocument7
*iface
, VARIANT v
)
3414 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3415 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3419 static HRESULT WINAPI
HTMLDocument7_get_onload(IHTMLDocument7
*iface
, VARIANT
*p
)
3421 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3422 FIXME("(%p)->(%p)\n", This
, p
);
3426 static HRESULT WINAPI
HTMLDocument7_put_onloadeddata(IHTMLDocument7
*iface
, VARIANT v
)
3428 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3429 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3433 static HRESULT WINAPI
HTMLDocument7_get_onloadeddata(IHTMLDocument7
*iface
, VARIANT
*p
)
3435 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3436 FIXME("(%p)->(%p)\n", This
, p
);
3440 static HRESULT WINAPI
HTMLDocument7_put_onloadedmetadata(IHTMLDocument7
*iface
, VARIANT v
)
3442 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3443 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3447 static HRESULT WINAPI
HTMLDocument7_get_onloadedmetadata(IHTMLDocument7
*iface
, VARIANT
*p
)
3449 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3450 FIXME("(%p)->(%p)\n", This
, p
);
3454 static HRESULT WINAPI
HTMLDocument7_put_onloadstart(IHTMLDocument7
*iface
, VARIANT v
)
3456 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3457 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3461 static HRESULT WINAPI
HTMLDocument7_get_onloadstart(IHTMLDocument7
*iface
, VARIANT
*p
)
3463 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3464 FIXME("(%p)->(%p)\n", This
, p
);
3468 static HRESULT WINAPI
HTMLDocument7_put_onpause(IHTMLDocument7
*iface
, VARIANT v
)
3470 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3471 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3475 static HRESULT WINAPI
HTMLDocument7_get_onpause(IHTMLDocument7
*iface
, VARIANT
*p
)
3477 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3478 FIXME("(%p)->(%p)\n", This
, p
);
3482 static HRESULT WINAPI
HTMLDocument7_put_onplay(IHTMLDocument7
*iface
, VARIANT v
)
3484 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3485 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3489 static HRESULT WINAPI
HTMLDocument7_get_onplay(IHTMLDocument7
*iface
, VARIANT
*p
)
3491 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3492 FIXME("(%p)->(%p)\n", This
, p
);
3496 static HRESULT WINAPI
HTMLDocument7_put_onplaying(IHTMLDocument7
*iface
, VARIANT v
)
3498 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3499 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3503 static HRESULT WINAPI
HTMLDocument7_get_onplaying(IHTMLDocument7
*iface
, VARIANT
*p
)
3505 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3506 FIXME("(%p)->(%p)\n", This
, p
);
3510 static HRESULT WINAPI
HTMLDocument7_put_onprogress(IHTMLDocument7
*iface
, VARIANT v
)
3512 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3513 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3517 static HRESULT WINAPI
HTMLDocument7_get_onprogress(IHTMLDocument7
*iface
, VARIANT
*p
)
3519 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3520 FIXME("(%p)->(%p)\n", This
, p
);
3524 static HRESULT WINAPI
HTMLDocument7_put_onratechange(IHTMLDocument7
*iface
, VARIANT v
)
3526 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3527 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3531 static HRESULT WINAPI
HTMLDocument7_get_onratechange(IHTMLDocument7
*iface
, VARIANT
*p
)
3533 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3534 FIXME("(%p)->(%p)\n", This
, p
);
3538 static HRESULT WINAPI
HTMLDocument7_put_onreset(IHTMLDocument7
*iface
, VARIANT v
)
3540 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3541 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3545 static HRESULT WINAPI
HTMLDocument7_get_onreset(IHTMLDocument7
*iface
, VARIANT
*p
)
3547 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3548 FIXME("(%p)->(%p)\n", This
, p
);
3552 static HRESULT WINAPI
HTMLDocument7_put_onscroll(IHTMLDocument7
*iface
, VARIANT v
)
3554 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3555 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3559 static HRESULT WINAPI
HTMLDocument7_get_onscroll(IHTMLDocument7
*iface
, VARIANT
*p
)
3561 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3562 FIXME("(%p)->(%p)\n", This
, p
);
3566 static HRESULT WINAPI
HTMLDocument7_put_onseekend(IHTMLDocument7
*iface
, VARIANT v
)
3568 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3569 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3573 static HRESULT WINAPI
HTMLDocument7_get_onseekend(IHTMLDocument7
*iface
, VARIANT
*p
)
3575 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3576 FIXME("(%p)->(%p)\n", This
, p
);
3580 static HRESULT WINAPI
HTMLDocument7_put_onseeking(IHTMLDocument7
*iface
, VARIANT v
)
3582 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3583 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3587 static HRESULT WINAPI
HTMLDocument7_get_onseeking(IHTMLDocument7
*iface
, VARIANT
*p
)
3589 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3590 FIXME("(%p)->(%p)\n", This
, p
);
3594 static HRESULT WINAPI
HTMLDocument7_put_onselect(IHTMLDocument7
*iface
, VARIANT v
)
3596 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3597 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3601 static HRESULT WINAPI
HTMLDocument7_get_onselect(IHTMLDocument7
*iface
, VARIANT
*p
)
3603 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3604 FIXME("(%p)->(%p)\n", This
, p
);
3608 static HRESULT WINAPI
HTMLDocument7_put_onstalled(IHTMLDocument7
*iface
, VARIANT v
)
3610 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3611 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3615 static HRESULT WINAPI
HTMLDocument7_get_onstalled(IHTMLDocument7
*iface
, VARIANT
*p
)
3617 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3618 FIXME("(%p)->(%p)\n", This
, p
);
3622 static HRESULT WINAPI
HTMLDocument7_put_onsubmit(IHTMLDocument7
*iface
, VARIANT v
)
3624 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3625 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3629 static HRESULT WINAPI
HTMLDocument7_get_onsubmit(IHTMLDocument7
*iface
, VARIANT
*p
)
3631 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3632 FIXME("(%p)->(%p)\n", This
, p
);
3636 static HRESULT WINAPI
HTMLDocument7_put_onsuspend(IHTMLDocument7
*iface
, VARIANT v
)
3638 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3639 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3643 static HRESULT WINAPI
HTMLDocument7_get_onsuspend(IHTMLDocument7
*iface
, VARIANT
*p
)
3645 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3646 FIXME("(%p)->(%p)\n", This
, p
);
3650 static HRESULT WINAPI
HTMLDocument7_put_ontimeupdate(IHTMLDocument7
*iface
, VARIANT v
)
3652 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3653 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3657 static HRESULT WINAPI
HTMLDocument7_get_ontimeupdate(IHTMLDocument7
*iface
, VARIANT
*p
)
3659 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3660 FIXME("(%p)->(%p)\n", This
, p
);
3664 static HRESULT WINAPI
HTMLDocument7_put_onvolumechange(IHTMLDocument7
*iface
, VARIANT v
)
3666 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3667 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3671 static HRESULT WINAPI
HTMLDocument7_get_onvolumechange(IHTMLDocument7
*iface
, VARIANT
*p
)
3673 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3674 FIXME("(%p)->(%p)\n", This
, p
);
3678 static HRESULT WINAPI
HTMLDocument7_put_onwaiting(IHTMLDocument7
*iface
, VARIANT v
)
3680 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3681 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3685 static HRESULT WINAPI
HTMLDocument7_get_onwaiting(IHTMLDocument7
*iface
, VARIANT
*p
)
3687 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3688 FIXME("(%p)->(%p)\n", This
, p
);
3692 static HRESULT WINAPI
HTMLDocument7_normalize(IHTMLDocument7
*iface
)
3694 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3695 FIXME("(%p)\n", This
);
3699 static HRESULT WINAPI
HTMLDocument7_importNode(IHTMLDocument7
*iface
, IHTMLDOMNode
*pNodeSource
,
3700 VARIANT_BOOL fDeep
, IHTMLDOMNode3
**ppNodeDest
)
3702 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3703 FIXME("(%p)->(%p %x %p)\n", This
, pNodeSource
, fDeep
, ppNodeDest
);
3707 static HRESULT WINAPI
HTMLDocument7_get_parentWindow(IHTMLDocument7
*iface
, IHTMLWindow2
**p
)
3709 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3710 FIXME("(%p)->(%p)\n", This
, p
);
3714 static HRESULT WINAPI
HTMLDocument7_put_body(IHTMLDocument7
*iface
, IHTMLElement
*v
)
3716 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3717 FIXME("(%p)->(%p)\n", This
, v
);
3721 static HRESULT WINAPI
HTMLDocument7_get_body(IHTMLDocument7
*iface
, IHTMLElement
**p
)
3723 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3724 FIXME("(%p)->(%p)\n", This
, p
);
3728 static HRESULT WINAPI
HTMLDocument7_get_head(IHTMLDocument7
*iface
, IHTMLElement
**p
)
3730 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3731 FIXME("(%p)->(%p)\n", This
, p
);
3735 static const IHTMLDocument7Vtbl HTMLDocument7Vtbl
= {
3736 HTMLDocument7_QueryInterface
,
3737 HTMLDocument7_AddRef
,
3738 HTMLDocument7_Release
,
3739 HTMLDocument7_GetTypeInfoCount
,
3740 HTMLDocument7_GetTypeInfo
,
3741 HTMLDocument7_GetIDsOfNames
,
3742 HTMLDocument7_Invoke
,
3743 HTMLDocument7_get_defaultView
,
3744 HTMLDocument7_createCDATASection
,
3745 HTMLDocument7_getSelection
,
3746 HTMLDocument7_getElementsByTagNameNS
,
3747 HTMLDocument7_createElementNS
,
3748 HTMLDocument7_createAttributeNS
,
3749 HTMLDocument7_put_onmsthumbnailclick
,
3750 HTMLDocument7_get_onmsthumbnailclick
,
3751 HTMLDocument7_get_characterSet
,
3752 HTMLDocument7_createElement
,
3753 HTMLDocument7_createAttribute
,
3754 HTMLDocument7_getElementByClassName
,
3755 HTMLDocument7_createProcessingInstruction
,
3756 HTMLDocument7_adoptNode
,
3757 HTMLDocument7_put_onmssitemodejumplistitemremoved
,
3758 HTMLDocument7_get_onmssitemodejumplistitemremoved
,
3759 HTMLDocument7_get_all
,
3760 HTMLDocument7_get_inputEncoding
,
3761 HTMLDocument7_get_xmlEncoding
,
3762 HTMLDocument7_put_xmlStandalone
,
3763 HTMLDocument7_get_xmlStandalone
,
3764 HTMLDocument7_put_xmlVersion
,
3765 HTMLDocument7_get_xmlVersion
,
3766 HTMLDocument7_hasAttributes
,
3767 HTMLDocument7_put_onabort
,
3768 HTMLDocument7_get_onabort
,
3769 HTMLDocument7_put_onblur
,
3770 HTMLDocument7_get_onblur
,
3771 HTMLDocument7_put_oncanplay
,
3772 HTMLDocument7_get_oncanplay
,
3773 HTMLDocument7_put_oncanplaythrough
,
3774 HTMLDocument7_get_oncanplaythrough
,
3775 HTMLDocument7_put_onchange
,
3776 HTMLDocument7_get_onchange
,
3777 HTMLDocument7_put_ondrag
,
3778 HTMLDocument7_get_ondrag
,
3779 HTMLDocument7_put_ondragend
,
3780 HTMLDocument7_get_ondragend
,
3781 HTMLDocument7_put_ondragenter
,
3782 HTMLDocument7_get_ondragenter
,
3783 HTMLDocument7_put_ondragleave
,
3784 HTMLDocument7_get_ondragleave
,
3785 HTMLDocument7_put_ondragover
,
3786 HTMLDocument7_get_ondragover
,
3787 HTMLDocument7_put_ondrop
,
3788 HTMLDocument7_get_ondrop
,
3789 HTMLDocument7_put_ondurationchange
,
3790 HTMLDocument7_get_ondurationchange
,
3791 HTMLDocument7_put_onemptied
,
3792 HTMLDocument7_get_onemptied
,
3793 HTMLDocument7_put_onended
,
3794 HTMLDocument7_get_onended
,
3795 HTMLDocument7_put_onerror
,
3796 HTMLDocument7_get_onerror
,
3797 HTMLDocument7_put_onfocus
,
3798 HTMLDocument7_get_onfocus
,
3799 HTMLDocument7_put_oninput
,
3800 HTMLDocument7_get_oninput
,
3801 HTMLDocument7_put_onload
,
3802 HTMLDocument7_get_onload
,
3803 HTMLDocument7_put_onloadeddata
,
3804 HTMLDocument7_get_onloadeddata
,
3805 HTMLDocument7_put_onloadedmetadata
,
3806 HTMLDocument7_get_onloadedmetadata
,
3807 HTMLDocument7_put_onloadstart
,
3808 HTMLDocument7_get_onloadstart
,
3809 HTMLDocument7_put_onpause
,
3810 HTMLDocument7_get_onpause
,
3811 HTMLDocument7_put_onplay
,
3812 HTMLDocument7_get_onplay
,
3813 HTMLDocument7_put_onplaying
,
3814 HTMLDocument7_get_onplaying
,
3815 HTMLDocument7_put_onprogress
,
3816 HTMLDocument7_get_onprogress
,
3817 HTMLDocument7_put_onratechange
,
3818 HTMLDocument7_get_onratechange
,
3819 HTMLDocument7_put_onreset
,
3820 HTMLDocument7_get_onreset
,
3821 HTMLDocument7_put_onscroll
,
3822 HTMLDocument7_get_onscroll
,
3823 HTMLDocument7_put_onseekend
,
3824 HTMLDocument7_get_onseekend
,
3825 HTMLDocument7_put_onseeking
,
3826 HTMLDocument7_get_onseeking
,
3827 HTMLDocument7_put_onselect
,
3828 HTMLDocument7_get_onselect
,
3829 HTMLDocument7_put_onstalled
,
3830 HTMLDocument7_get_onstalled
,
3831 HTMLDocument7_put_onsubmit
,
3832 HTMLDocument7_get_onsubmit
,
3833 HTMLDocument7_put_onsuspend
,
3834 HTMLDocument7_get_onsuspend
,
3835 HTMLDocument7_put_ontimeupdate
,
3836 HTMLDocument7_get_ontimeupdate
,
3837 HTMLDocument7_put_onvolumechange
,
3838 HTMLDocument7_get_onvolumechange
,
3839 HTMLDocument7_put_onwaiting
,
3840 HTMLDocument7_get_onwaiting
,
3841 HTMLDocument7_normalize
,
3842 HTMLDocument7_importNode
,
3843 HTMLDocument7_get_parentWindow
,
3844 HTMLDocument7_put_body
,
3845 HTMLDocument7_get_body
,
3846 HTMLDocument7_get_head
3849 static void HTMLDocument_on_advise(IUnknown
*iface
, cp_static_data_t
*cp
)
3851 HTMLDocument
*This
= impl_from_IHTMLDocument2((IHTMLDocument2
*)iface
);
3854 update_cp_events(This
->window
->base
.inner_window
, &This
->doc_node
->node
.event_target
, cp
);
3857 static inline HTMLDocument
*impl_from_ISupportErrorInfo(ISupportErrorInfo
*iface
)
3859 return CONTAINING_RECORD(iface
, HTMLDocument
, ISupportErrorInfo_iface
);
3862 static HRESULT WINAPI
SupportErrorInfo_QueryInterface(ISupportErrorInfo
*iface
, REFIID riid
, void **ppv
)
3864 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3865 return htmldoc_query_interface(This
, riid
, ppv
);
3868 static ULONG WINAPI
SupportErrorInfo_AddRef(ISupportErrorInfo
*iface
)
3870 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3871 return htmldoc_addref(This
);
3874 static ULONG WINAPI
SupportErrorInfo_Release(ISupportErrorInfo
*iface
)
3876 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3877 return htmldoc_release(This
);
3880 static HRESULT WINAPI
SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo
*iface
, REFIID riid
)
3882 FIXME("(%p)->(%s)\n", iface
, debugstr_mshtml_guid(riid
));
3886 static const ISupportErrorInfoVtbl SupportErrorInfoVtbl
= {
3887 SupportErrorInfo_QueryInterface
,
3888 SupportErrorInfo_AddRef
,
3889 SupportErrorInfo_Release
,
3890 SupportErrorInfo_InterfaceSupportsErrorInfo
3893 static inline HTMLDocument
*impl_from_IDispatchEx(IDispatchEx
*iface
)
3895 return CONTAINING_RECORD(iface
, HTMLDocument
, IDispatchEx_iface
);
3898 static HRESULT
dispid_from_elem_name(HTMLDocumentNode
*This
, BSTR name
, DISPID
*dispid
)
3900 nsIDOMNodeList
*node_list
;
3907 return DISP_E_UNKNOWNNAME
;
3909 nsAString_InitDepend(&name_str
, name
);
3910 nsres
= nsIDOMHTMLDocument_GetElementsByName(This
->nsdoc
, &name_str
, &node_list
);
3911 nsAString_Finish(&name_str
);
3912 if(NS_FAILED(nsres
))
3915 nsres
= nsIDOMNodeList_GetLength(node_list
, &len
);
3916 nsIDOMNodeList_Release(node_list
);
3917 if(NS_FAILED(nsres
))
3921 return DISP_E_UNKNOWNNAME
;
3923 for(i
=0; i
< This
->elem_vars_cnt
; i
++) {
3924 if(!strcmpW(name
, This
->elem_vars
[i
])) {
3925 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+i
;
3930 if(This
->elem_vars_cnt
== This
->elem_vars_size
) {
3933 if(This
->elem_vars_size
) {
3934 new_vars
= heap_realloc(This
->elem_vars
, This
->elem_vars_size
*2*sizeof(WCHAR
*));
3936 return E_OUTOFMEMORY
;
3937 This
->elem_vars_size
*= 2;
3939 new_vars
= heap_alloc(16*sizeof(WCHAR
*));
3941 return E_OUTOFMEMORY
;
3942 This
->elem_vars_size
= 16;
3945 This
->elem_vars
= new_vars
;
3948 This
->elem_vars
[This
->elem_vars_cnt
] = heap_strdupW(name
);
3949 if(!This
->elem_vars
[This
->elem_vars_cnt
])
3950 return E_OUTOFMEMORY
;
3952 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+This
->elem_vars_cnt
++;
3956 static HRESULT WINAPI
DocDispatchEx_QueryInterface(IDispatchEx
*iface
, REFIID riid
, void **ppv
)
3958 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3960 return htmldoc_query_interface(This
, riid
, ppv
);
3963 static ULONG WINAPI
DocDispatchEx_AddRef(IDispatchEx
*iface
)
3965 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3967 return htmldoc_addref(This
);
3970 static ULONG WINAPI
DocDispatchEx_Release(IDispatchEx
*iface
)
3972 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3974 return htmldoc_release(This
);
3977 static HRESULT WINAPI
DocDispatchEx_GetTypeInfoCount(IDispatchEx
*iface
, UINT
*pctinfo
)
3979 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3981 return IDispatchEx_GetTypeInfoCount(This
->dispex
, pctinfo
);
3984 static HRESULT WINAPI
DocDispatchEx_GetTypeInfo(IDispatchEx
*iface
, UINT iTInfo
,
3985 LCID lcid
, ITypeInfo
**ppTInfo
)
3987 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3989 return IDispatchEx_GetTypeInfo(This
->dispex
, iTInfo
, lcid
, ppTInfo
);
3992 static HRESULT WINAPI
DocDispatchEx_GetIDsOfNames(IDispatchEx
*iface
, REFIID riid
,
3993 LPOLESTR
*rgszNames
, UINT cNames
,
3994 LCID lcid
, DISPID
*rgDispId
)
3996 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
3998 return IDispatchEx_GetIDsOfNames(This
->dispex
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4001 static HRESULT WINAPI
DocDispatchEx_Invoke(IDispatchEx
*iface
, DISPID dispIdMember
,
4002 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4003 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4005 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4007 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
4008 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4010 switch(dispIdMember
) {
4011 case DISPID_READYSTATE
:
4012 TRACE("DISPID_READYSTATE\n");
4014 if(!(wFlags
& DISPATCH_PROPERTYGET
))
4015 return E_INVALIDARG
;
4017 V_VT(pVarResult
) = VT_I4
;
4018 V_I4(pVarResult
) = This
->window
->readystate
;
4022 return IDispatchEx_Invoke(This
->dispex
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
4023 pVarResult
, pExcepInfo
, puArgErr
);
4026 static HRESULT WINAPI
DocDispatchEx_GetDispID(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
, DISPID
*pid
)
4028 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4031 hres
= IDispatchEx_GetDispID(This
->dispex
, bstrName
, grfdex
, pid
);
4032 if(hres
!= DISP_E_UNKNOWNNAME
)
4035 return dispid_from_elem_name(This
->doc_node
, bstrName
, pid
);
4038 static HRESULT WINAPI
DocDispatchEx_InvokeEx(IDispatchEx
*iface
, DISPID id
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pdp
,
4039 VARIANT
*pvarRes
, EXCEPINFO
*pei
, IServiceProvider
*pspCaller
)
4041 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4043 if(This
->window
&& id
== DISPID_IHTMLDOCUMENT2_LOCATION
&& (wFlags
& DISPATCH_PROPERTYPUT
))
4044 return IDispatchEx_InvokeEx(&This
->window
->base
.IDispatchEx_iface
, DISPID_IHTMLWINDOW2_LOCATION
,
4045 lcid
, wFlags
, pdp
, pvarRes
, pei
, pspCaller
);
4048 return IDispatchEx_InvokeEx(This
->dispex
, id
, lcid
, wFlags
, pdp
, pvarRes
, pei
, pspCaller
);
4051 static HRESULT WINAPI
DocDispatchEx_DeleteMemberByName(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
)
4053 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4055 return IDispatchEx_DeleteMemberByName(This
->dispex
, bstrName
, grfdex
);
4058 static HRESULT WINAPI
DocDispatchEx_DeleteMemberByDispID(IDispatchEx
*iface
, DISPID id
)
4060 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4062 return IDispatchEx_DeleteMemberByDispID(This
->dispex
, id
);
4065 static HRESULT WINAPI
DocDispatchEx_GetMemberProperties(IDispatchEx
*iface
, DISPID id
, DWORD grfdexFetch
, DWORD
*pgrfdex
)
4067 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4069 return IDispatchEx_GetMemberProperties(This
->dispex
, id
, grfdexFetch
, pgrfdex
);
4072 static HRESULT WINAPI
DocDispatchEx_GetMemberName(IDispatchEx
*iface
, DISPID id
, BSTR
*pbstrName
)
4074 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4076 return IDispatchEx_GetMemberName(This
->dispex
, id
, pbstrName
);
4079 static HRESULT WINAPI
DocDispatchEx_GetNextDispID(IDispatchEx
*iface
, DWORD grfdex
, DISPID id
, DISPID
*pid
)
4081 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4083 return IDispatchEx_GetNextDispID(This
->dispex
, grfdex
, id
, pid
);
4086 static HRESULT WINAPI
DocDispatchEx_GetNameSpaceParent(IDispatchEx
*iface
, IUnknown
**ppunk
)
4088 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4090 return IDispatchEx_GetNameSpaceParent(This
->dispex
, ppunk
);
4093 static const IDispatchExVtbl DocDispatchExVtbl
= {
4094 DocDispatchEx_QueryInterface
,
4095 DocDispatchEx_AddRef
,
4096 DocDispatchEx_Release
,
4097 DocDispatchEx_GetTypeInfoCount
,
4098 DocDispatchEx_GetTypeInfo
,
4099 DocDispatchEx_GetIDsOfNames
,
4100 DocDispatchEx_Invoke
,
4101 DocDispatchEx_GetDispID
,
4102 DocDispatchEx_InvokeEx
,
4103 DocDispatchEx_DeleteMemberByName
,
4104 DocDispatchEx_DeleteMemberByDispID
,
4105 DocDispatchEx_GetMemberProperties
,
4106 DocDispatchEx_GetMemberName
,
4107 DocDispatchEx_GetNextDispID
,
4108 DocDispatchEx_GetNameSpaceParent
4111 static inline HTMLDocument
*impl_from_IProvideClassInfo(IProvideClassInfo
*iface
)
4113 return CONTAINING_RECORD(iface
, HTMLDocument
, IProvideClassInfo_iface
);
4116 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideClassInfo
*iface
,
4117 REFIID riid
, void **ppv
)
4119 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4120 return htmldoc_query_interface(This
, riid
, ppv
);
4123 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideClassInfo
*iface
)
4125 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4126 return htmldoc_addref(This
);
4129 static ULONG WINAPI
ProvideClassInfo_Release(IProvideClassInfo
*iface
)
4131 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4132 return htmldoc_release(This
);
4135 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideClassInfo
* iface
,
4138 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4139 TRACE("(%p)->(%p)\n", This
, ppTI
);
4140 return get_htmldoc_classinfo(ppTI
);
4143 static const IProvideClassInfoVtbl ProvideClassInfoVtbl
= {
4144 ProvideClassInfo_QueryInterface
,
4145 ProvideClassInfo_AddRef
,
4146 ProvideClassInfo_Release
,
4147 ProvideClassInfo_GetClassInfo
4150 static BOOL
htmldoc_qi(HTMLDocument
*This
, REFIID riid
, void **ppv
)
4154 if(IsEqualGUID(&IID_IUnknown
, riid
))
4155 *ppv
= &This
->IHTMLDocument2_iface
;
4156 else if(IsEqualGUID(&IID_IDispatch
, riid
))
4157 *ppv
= &This
->IDispatchEx_iface
;
4158 else if(IsEqualGUID(&IID_IDispatchEx
, riid
))
4159 *ppv
= &This
->IDispatchEx_iface
;
4160 else if(IsEqualGUID(&IID_IHTMLDocument
, riid
))
4161 *ppv
= &This
->IHTMLDocument2_iface
;
4162 else if(IsEqualGUID(&IID_IHTMLDocument2
, riid
))
4163 *ppv
= &This
->IHTMLDocument2_iface
;
4164 else if(IsEqualGUID(&IID_IHTMLDocument3
, riid
))
4165 *ppv
= &This
->IHTMLDocument3_iface
;
4166 else if(IsEqualGUID(&IID_IHTMLDocument4
, riid
))
4167 *ppv
= &This
->IHTMLDocument4_iface
;
4168 else if(IsEqualGUID(&IID_IHTMLDocument5
, riid
))
4169 *ppv
= &This
->IHTMLDocument5_iface
;
4170 else if(IsEqualGUID(&IID_IHTMLDocument6
, riid
))
4171 *ppv
= &This
->IHTMLDocument6_iface
;
4172 else if(IsEqualGUID(&IID_IHTMLDocument7
, riid
))
4173 *ppv
= &This
->IHTMLDocument7_iface
;
4174 else if(IsEqualGUID(&IID_IPersist
, riid
))
4175 *ppv
= &This
->IPersistFile_iface
;
4176 else if(IsEqualGUID(&IID_IPersistMoniker
, riid
))
4177 *ppv
= &This
->IPersistMoniker_iface
;
4178 else if(IsEqualGUID(&IID_IPersistFile
, riid
))
4179 *ppv
= &This
->IPersistFile_iface
;
4180 else if(IsEqualGUID(&IID_IMonikerProp
, riid
))
4181 *ppv
= &This
->IMonikerProp_iface
;
4182 else if(IsEqualGUID(&IID_IOleObject
, riid
))
4183 *ppv
= &This
->IOleObject_iface
;
4184 else if(IsEqualGUID(&IID_IOleDocument
, riid
))
4185 *ppv
= &This
->IOleDocument_iface
;
4186 else if(IsEqualGUID(&IID_IOleDocumentView
, riid
))
4187 *ppv
= &This
->IOleDocumentView_iface
;
4188 else if(IsEqualGUID(&IID_IOleInPlaceActiveObject
, riid
))
4189 *ppv
= &This
->IOleInPlaceActiveObject_iface
;
4190 else if(IsEqualGUID(&IID_IViewObject
, riid
))
4191 *ppv
= &This
->IViewObjectEx_iface
;
4192 else if(IsEqualGUID(&IID_IViewObject2
, riid
))
4193 *ppv
= &This
->IViewObjectEx_iface
;
4194 else if(IsEqualGUID(&IID_IViewObjectEx
, riid
))
4195 *ppv
= &This
->IViewObjectEx_iface
;
4196 else if(IsEqualGUID(&IID_IOleWindow
, riid
))
4197 *ppv
= &This
->IOleInPlaceActiveObject_iface
;
4198 else if(IsEqualGUID(&IID_IOleInPlaceObject
, riid
))
4199 *ppv
= &This
->IOleInPlaceObjectWindowless_iface
;
4200 else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless
, riid
))
4201 *ppv
= &This
->IOleInPlaceObjectWindowless_iface
;
4202 else if(IsEqualGUID(&IID_IServiceProvider
, riid
))
4203 *ppv
= &This
->IServiceProvider_iface
;
4204 else if(IsEqualGUID(&IID_IOleCommandTarget
, riid
))
4205 *ppv
= &This
->IOleCommandTarget_iface
;
4206 else if(IsEqualGUID(&IID_IOleControl
, riid
))
4207 *ppv
= &This
->IOleControl_iface
;
4208 else if(IsEqualGUID(&IID_IHlinkTarget
, riid
))
4209 *ppv
= &This
->IHlinkTarget_iface
;
4210 else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
))
4211 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
4212 else if(IsEqualGUID(&IID_IPersistStreamInit
, riid
))
4213 *ppv
= &This
->IPersistStreamInit_iface
;
4214 else if(IsEqualGUID(&DIID_DispHTMLDocument
, riid
))
4215 *ppv
= &This
->IHTMLDocument2_iface
;
4216 else if(IsEqualGUID(&IID_ISupportErrorInfo
, riid
))
4217 *ppv
= &This
->ISupportErrorInfo_iface
;
4218 else if(IsEqualGUID(&IID_IPersistHistory
, riid
))
4219 *ppv
= &This
->IPersistHistory_iface
;
4220 else if(IsEqualGUID(&IID_IObjectWithSite
, riid
))
4221 *ppv
= &This
->IObjectWithSite_iface
;
4222 else if(IsEqualGUID(&IID_IOleContainer
, riid
))
4223 *ppv
= &This
->IOleContainer_iface
;
4224 else if(IsEqualGUID(&IID_IObjectSafety
, riid
))
4225 *ppv
= &This
->IObjectSafety_iface
;
4226 else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
))
4227 *ppv
= &This
->IProvideClassInfo_iface
;
4228 else if(IsEqualGUID(&CLSID_CMarkup
, riid
)) {
4229 FIXME("(%p)->(CLSID_CMarkup %p)\n", This
, ppv
);
4231 }else if(IsEqualGUID(&IID_IRunnableObject
, riid
)) {
4232 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This
, ppv
);
4234 }else if(IsEqualGUID(&IID_IPersistPropertyBag
, riid
)) {
4235 TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This
, ppv
);
4237 }else if(IsEqualGUID(&IID_IMarshal
, riid
)) {
4238 TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This
, ppv
);
4240 }else if(IsEqualGUID(&IID_IExternalConnection
, riid
)) {
4241 TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This
, ppv
);
4243 }else if(IsEqualGUID(&IID_IStdMarshalInfo
, riid
)) {
4244 TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This
, ppv
);
4251 IUnknown_AddRef((IUnknown
*)*ppv
);
4255 static cp_static_data_t HTMLDocumentEvents_data
= { HTMLDocumentEvents_tid
, HTMLDocument_on_advise
};
4257 static const cpc_entry_t HTMLDocument_cpc
[] = {
4258 {&IID_IDispatch
, &HTMLDocumentEvents_data
},
4259 {&IID_IPropertyNotifySink
},
4260 {&DIID_HTMLDocumentEvents
, &HTMLDocumentEvents_data
},
4261 {&DIID_HTMLDocumentEvents2
},
4265 static void init_doc(HTMLDocument
*doc
, IUnknown
*unk_impl
, IDispatchEx
*dispex
)
4267 doc
->IHTMLDocument2_iface
.lpVtbl
= &HTMLDocumentVtbl
;
4268 doc
->IHTMLDocument3_iface
.lpVtbl
= &HTMLDocument3Vtbl
;
4269 doc
->IHTMLDocument4_iface
.lpVtbl
= &HTMLDocument4Vtbl
;
4270 doc
->IHTMLDocument5_iface
.lpVtbl
= &HTMLDocument5Vtbl
;
4271 doc
->IHTMLDocument6_iface
.lpVtbl
= &HTMLDocument6Vtbl
;
4272 doc
->IHTMLDocument7_iface
.lpVtbl
= &HTMLDocument7Vtbl
;
4273 doc
->IDispatchEx_iface
.lpVtbl
= &DocDispatchExVtbl
;
4274 doc
->ISupportErrorInfo_iface
.lpVtbl
= &SupportErrorInfoVtbl
;
4275 doc
->IProvideClassInfo_iface
.lpVtbl
= &ProvideClassInfoVtbl
;
4277 doc
->unk_impl
= unk_impl
;
4278 doc
->dispex
= dispex
;
4279 doc
->task_magic
= get_task_target_magic();
4281 HTMLDocument_Persist_Init(doc
);
4282 HTMLDocument_OleCmd_Init(doc
);
4283 HTMLDocument_OleObj_Init(doc
);
4284 HTMLDocument_View_Init(doc
);
4285 HTMLDocument_Window_Init(doc
);
4286 HTMLDocument_Service_Init(doc
);
4287 HTMLDocument_Hlink_Init(doc
);
4289 ConnectionPointContainer_Init(&doc
->cp_container
, (IUnknown
*)&doc
->IHTMLDocument2_iface
, HTMLDocument_cpc
);
4292 static void destroy_htmldoc(HTMLDocument
*This
)
4294 remove_target_tasks(This
->task_magic
);
4296 ConnectionPointContainer_Destroy(&This
->cp_container
);
4299 static inline HTMLDocumentNode
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
4301 return CONTAINING_RECORD(iface
, HTMLDocumentNode
, node
);
4304 static HRESULT
HTMLDocumentNode_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
4306 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4308 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
4310 if(htmldoc_qi(&This
->basedoc
, riid
, ppv
))
4311 return *ppv
? S_OK
: E_NOINTERFACE
;
4313 if(IsEqualGUID(&IID_IInternetHostSecurityManager
, riid
))
4314 *ppv
= &This
->IInternetHostSecurityManager_iface
;
4316 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
4318 IUnknown_AddRef((IUnknown
*)*ppv
);
4322 static void HTMLDocumentNode_destructor(HTMLDOMNode
*iface
)
4324 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4327 for(i
=0; i
< This
->elem_vars_cnt
; i
++)
4328 heap_free(This
->elem_vars
[i
]);
4329 heap_free(This
->elem_vars
);
4331 detach_events(This
);
4332 if(This
->body_event_target
)
4333 release_event_target(This
->body_event_target
);
4335 ICatInformation_Release(This
->catmgr
);
4337 detach_selection(This
);
4338 detach_ranges(This
);
4340 while(!list_empty(&This
->plugin_hosts
))
4341 detach_plugin_host(LIST_ENTRY(list_head(&This
->plugin_hosts
), PluginHost
, entry
));
4343 if(This
->nsnode_selector
) {
4344 nsIDOMNodeSelector_Release(This
->nsnode_selector
);
4345 This
->nsnode_selector
= NULL
;
4348 if(!This
->nsdoc
&& This
->window
) {
4349 /* document fragments own reference to inner window */
4350 IHTMLWindow2_Release(&This
->window
->base
.IHTMLWindow2_iface
);
4351 This
->window
= NULL
;
4354 heap_free(This
->event_vector
);
4355 destroy_htmldoc(&This
->basedoc
);
4358 static HRESULT
HTMLDocumentNode_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
4360 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4361 FIXME("%p\n", This
);
4365 static void HTMLDocumentNode_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
4367 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4369 if(This
->nsnode_selector
)
4370 note_cc_edge((nsISupports
*)This
->nsnode_selector
, "This->nsnode_selector", cb
);
4372 note_cc_edge((nsISupports
*)This
->nsdoc
, "This->nsdoc", cb
);
4375 static void HTMLDocumentNode_unlink(HTMLDOMNode
*iface
)
4377 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4379 if(This
->nsnode_selector
) {
4380 nsIDOMNodeSelector_Release(This
->nsnode_selector
);
4381 This
->nsnode_selector
= NULL
;
4385 nsIDOMHTMLDocument
*nsdoc
= This
->nsdoc
;
4387 release_document_mutation(This
);
4389 nsIDOMHTMLDocument_Release(nsdoc
);
4390 This
->window
= NULL
;
4394 static const NodeImplVtbl HTMLDocumentNodeImplVtbl
= {
4395 HTMLDocumentNode_QI
,
4396 HTMLDocumentNode_destructor
,
4398 HTMLDocumentNode_clone
,
4410 HTMLDocumentNode_traverse
,
4411 HTMLDocumentNode_unlink
4414 static HRESULT
HTMLDocumentFragment_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
4416 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4417 HTMLDocumentNode
*new_node
;
4420 hres
= create_document_fragment(nsnode
, This
->node
.doc
, &new_node
);
4424 *ret
= &new_node
->node
;
4428 static inline HTMLDocumentNode
*impl_from_DispatchEx(DispatchEx
*iface
)
4430 return CONTAINING_RECORD(iface
, HTMLDocumentNode
, node
.dispex
);
4433 static HRESULT
HTMLDocumentNode_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
4434 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
4436 HTMLDocumentNode
*This
= impl_from_DispatchEx(dispex
);
4437 nsIDOMNodeList
*node_list
;
4445 if(flags
!= DISPATCH_PROPERTYGET
&& flags
!= (DISPATCH_METHOD
|DISPATCH_PROPERTYGET
)) {
4446 FIXME("unsupported flags %x\n", flags
);
4450 i
= id
- MSHTML_DISPID_CUSTOM_MIN
;
4452 if(!This
->nsdoc
|| i
>= This
->elem_vars_cnt
)
4453 return DISP_E_UNKNOWNNAME
;
4455 nsAString_InitDepend(&name_str
, This
->elem_vars
[i
]);
4456 nsres
= nsIDOMHTMLDocument_GetElementsByName(This
->nsdoc
, &name_str
, &node_list
);
4457 nsAString_Finish(&name_str
);
4458 if(NS_FAILED(nsres
))
4461 nsres
= nsIDOMNodeList_Item(node_list
, 0, &nsnode
);
4462 nsIDOMNodeList_Release(node_list
);
4463 if(NS_FAILED(nsres
) || !nsnode
)
4464 return DISP_E_UNKNOWNNAME
;
4466 hres
= get_node(This
, nsnode
, TRUE
, &node
);
4470 V_VT(res
) = VT_DISPATCH
;
4471 V_DISPATCH(res
) = (IDispatch
*)&node
->IHTMLDOMNode_iface
;
4476 static const dispex_static_data_vtbl_t HTMLDocumentNode_dispex_vtbl
= {
4479 HTMLDocumentNode_invoke
,
4483 static const NodeImplVtbl HTMLDocumentFragmentImplVtbl
= {
4484 HTMLDocumentNode_QI
,
4485 HTMLDocumentNode_destructor
,
4487 HTMLDocumentFragment_clone
4490 static const tid_t HTMLDocumentNode_iface_tids
[] = {
4500 static dispex_static_data_t HTMLDocumentNode_dispex
= {
4501 &HTMLDocumentNode_dispex_vtbl
,
4502 DispHTMLDocument_tid
,
4504 HTMLDocumentNode_iface_tids
4507 static HTMLDocumentNode
*alloc_doc_node(HTMLDocumentObj
*doc_obj
, HTMLInnerWindow
*window
)
4509 HTMLDocumentNode
*doc
;
4511 doc
= heap_alloc_zero(sizeof(HTMLDocumentNode
));
4516 doc
->basedoc
.doc_node
= doc
;
4517 doc
->basedoc
.doc_obj
= doc_obj
;
4518 doc
->basedoc
.window
= window
->base
.outer_window
;
4519 doc
->window
= window
;
4521 init_dispex(&doc
->node
.dispex
, (IUnknown
*)&doc
->node
.IHTMLDOMNode_iface
,
4522 &HTMLDocumentNode_dispex
);
4523 init_doc(&doc
->basedoc
, (IUnknown
*)&doc
->node
.IHTMLDOMNode_iface
,
4524 &doc
->node
.dispex
.IDispatchEx_iface
);
4525 HTMLDocumentNode_SecMgr_Init(doc
);
4527 list_init(&doc
->selection_list
);
4528 list_init(&doc
->range_list
);
4529 list_init(&doc
->plugin_hosts
);
4534 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*nsdoc
, HTMLDocumentObj
*doc_obj
, HTMLInnerWindow
*window
, HTMLDocumentNode
**ret
)
4536 HTMLDocumentNode
*doc
;
4539 doc
= alloc_doc_node(doc_obj
, window
);
4541 return E_OUTOFMEMORY
;
4543 if(!doc_obj
->basedoc
.window
|| window
->base
.outer_window
== doc_obj
->basedoc
.window
)
4544 doc
->basedoc
.cp_container
.forward_container
= &doc_obj
->basedoc
.cp_container
;
4546 HTMLDOMNode_Init(doc
, &doc
->node
, (nsIDOMNode
*)nsdoc
);
4548 nsIDOMHTMLDocument_AddRef(nsdoc
);
4551 nsres
= nsIDOMHTMLDocument_QueryInterface(nsdoc
, &IID_nsIDOMNodeSelector
, (void**)&doc
->nsnode_selector
);
4552 assert(nsres
== NS_OK
);
4554 init_document_mutation(doc
);
4555 doc_init_events(doc
);
4557 doc
->node
.vtbl
= &HTMLDocumentNodeImplVtbl
;
4558 doc
->node
.cp_container
= &doc
->basedoc
.cp_container
;
4564 HRESULT
create_document_fragment(nsIDOMNode
*nsnode
, HTMLDocumentNode
*doc_node
, HTMLDocumentNode
**ret
)
4566 HTMLDocumentNode
*doc_frag
;
4568 doc_frag
= alloc_doc_node(doc_node
->basedoc
.doc_obj
, doc_node
->window
);
4570 return E_OUTOFMEMORY
;
4572 IHTMLWindow2_AddRef(&doc_frag
->window
->base
.IHTMLWindow2_iface
);
4574 HTMLDOMNode_Init(doc_node
, &doc_frag
->node
, nsnode
);
4575 doc_frag
->node
.vtbl
= &HTMLDocumentFragmentImplVtbl
;
4576 doc_frag
->node
.cp_container
= &doc_frag
->basedoc
.cp_container
;
4582 /**********************************************************
4583 * ICustomDoc implementation
4586 static inline HTMLDocumentObj
*impl_from_ICustomDoc(ICustomDoc
*iface
)
4588 return CONTAINING_RECORD(iface
, HTMLDocumentObj
, ICustomDoc_iface
);
4591 static HRESULT WINAPI
CustomDoc_QueryInterface(ICustomDoc
*iface
, REFIID riid
, void **ppv
)
4593 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4595 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
4597 if(htmldoc_qi(&This
->basedoc
, riid
, ppv
))
4598 return *ppv
? S_OK
: E_NOINTERFACE
;
4600 if(IsEqualGUID(&IID_ICustomDoc
, riid
)) {
4601 *ppv
= &This
->ICustomDoc_iface
;
4602 }else if(IsEqualGUID(&IID_ITargetContainer
, riid
)) {
4603 *ppv
= &This
->ITargetContainer_iface
;
4604 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
4605 return *ppv
? S_OK
: E_NOINTERFACE
;
4607 FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid
));
4609 return E_NOINTERFACE
;
4612 IUnknown_AddRef((IUnknown
*)*ppv
);
4616 static ULONG WINAPI
CustomDoc_AddRef(ICustomDoc
*iface
)
4618 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4619 ULONG ref
= InterlockedIncrement(&This
->ref
);
4621 TRACE("(%p) ref = %u\n", This
, ref
);
4626 static ULONG WINAPI
CustomDoc_Release(ICustomDoc
*iface
)
4628 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4629 ULONG ref
= InterlockedDecrement(&This
->ref
);
4631 TRACE("(%p) ref = %u\n", This
, ref
);
4634 nsIDOMWindowUtils
*window_utils
= NULL
;
4636 if(This
->basedoc
.window
&& This
->basedoc
.window
->nswindow
)
4637 get_nsinterface((nsISupports
*)This
->basedoc
.window
->nswindow
, &IID_nsIDOMWindowUtils
, (void**)&window_utils
);
4639 if(This
->basedoc
.doc_node
) {
4640 This
->basedoc
.doc_node
->basedoc
.doc_obj
= NULL
;
4641 htmldoc_release(&This
->basedoc
.doc_node
->basedoc
);
4643 if(This
->basedoc
.window
) {
4644 This
->basedoc
.window
->doc_obj
= NULL
;
4645 IHTMLWindow2_Release(&This
->basedoc
.window
->base
.IHTMLWindow2_iface
);
4647 if(This
->basedoc
.advise_holder
)
4648 IOleAdviseHolder_Release(This
->basedoc
.advise_holder
);
4651 IAdviseSink_Release(This
->view_sink
);
4653 IOleObject_SetClientSite(&This
->basedoc
.IOleObject_iface
, NULL
);
4655 ICustomDoc_SetUIHandler(&This
->ICustomDoc_iface
, NULL
);
4656 if(This
->in_place_active
)
4657 IOleInPlaceObjectWindowless_InPlaceDeactivate(&This
->basedoc
.IOleInPlaceObjectWindowless_iface
);
4659 IOleDocumentView_SetInPlaceSite(&This
->basedoc
.IOleDocumentView_iface
, NULL
);
4661 IOleUndoManager_Release(This
->undomgr
);
4662 if(This
->tooltips_hwnd
)
4663 DestroyWindow(This
->tooltips_hwnd
);
4666 DestroyWindow(This
->hwnd
);
4667 heap_free(This
->mime
);
4669 destroy_htmldoc(&This
->basedoc
);
4670 release_dispex(&This
->dispex
);
4672 if(This
->nscontainer
)
4673 NSContainer_Release(This
->nscontainer
);
4676 /* Force cycle collection */
4678 nsIDOMWindowUtils_CycleCollect(window_utils
, NULL
, 0);
4679 nsIDOMWindowUtils_Release(window_utils
);
4686 static HRESULT WINAPI
CustomDoc_SetUIHandler(ICustomDoc
*iface
, IDocHostUIHandler
*pUIHandler
)
4688 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4689 IOleCommandTarget
*cmdtrg
;
4692 TRACE("(%p)->(%p)\n", This
, pUIHandler
);
4694 if(This
->custom_hostui
&& This
->hostui
== pUIHandler
)
4697 This
->custom_hostui
= TRUE
;
4700 IDocHostUIHandler_Release(This
->hostui
);
4702 IDocHostUIHandler_AddRef(pUIHandler
);
4703 This
->hostui
= pUIHandler
;
4707 hres
= IDocHostUIHandler_QueryInterface(pUIHandler
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
4708 if(SUCCEEDED(hres
)) {
4709 FIXME("custom UI handler supports IOleCommandTarget\n");
4710 IOleCommandTarget_Release(cmdtrg
);
4716 static const ICustomDocVtbl CustomDocVtbl
= {
4717 CustomDoc_QueryInterface
,
4720 CustomDoc_SetUIHandler
4723 static const tid_t HTMLDocumentObj_iface_tids
[] = {
4730 static dispex_static_data_t HTMLDocumentObj_dispex
= {
4732 DispHTMLDocument_tid
,
4734 HTMLDocumentObj_iface_tids
4737 HRESULT
HTMLDocument_Create(IUnknown
*pUnkOuter
, REFIID riid
, void** ppvObject
)
4739 HTMLDocumentObj
*doc
;
4740 nsIDOMWindow
*nswindow
= NULL
;
4744 TRACE("(%p %s %p)\n", pUnkOuter
, debugstr_mshtml_guid(riid
), ppvObject
);
4746 doc
= heap_alloc_zero(sizeof(HTMLDocumentObj
));
4748 return E_OUTOFMEMORY
;
4750 init_dispex(&doc
->dispex
, (IUnknown
*)&doc
->ICustomDoc_iface
, &HTMLDocumentObj_dispex
);
4751 init_doc(&doc
->basedoc
, (IUnknown
*)&doc
->ICustomDoc_iface
, &doc
->dispex
.IDispatchEx_iface
);
4752 TargetContainer_Init(doc
);
4754 doc
->ICustomDoc_iface
.lpVtbl
= &CustomDocVtbl
;
4756 doc
->basedoc
.doc_obj
= doc
;
4758 doc
->usermode
= UNKNOWN_USERMODE
;
4760 init_binding_ui(doc
);
4762 hres
= create_nscontainer(doc
, &doc
->nscontainer
);
4764 ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n");
4765 htmldoc_release(&doc
->basedoc
);
4769 hres
= htmldoc_query_interface(&doc
->basedoc
, riid
, ppvObject
);
4770 htmldoc_release(&doc
->basedoc
);
4774 nsres
= nsIWebBrowser_GetContentDOMWindow(doc
->nscontainer
->webbrowser
, &nswindow
);
4775 if(NS_FAILED(nsres
))
4776 ERR("GetContentDOMWindow failed: %08x\n", nsres
);
4778 hres
= HTMLOuterWindow_Create(doc
, nswindow
, NULL
/* FIXME */, &doc
->basedoc
.window
);
4780 nsIDOMWindow_Release(nswindow
);
4782 htmldoc_release(&doc
->basedoc
);
4786 if(!doc
->basedoc
.doc_node
&& doc
->basedoc
.window
->base
.inner_window
->doc
) {
4787 doc
->basedoc
.doc_node
= doc
->basedoc
.window
->base
.inner_window
->doc
;
4788 htmldoc_addref(&doc
->basedoc
.doc_node
->basedoc
);