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
19 #include "mshtml_private.h"
21 static HRESULT
create_document_fragment(nsIDOMNode
*nsnode
, HTMLDocumentNode
*doc_node
, HTMLDocumentNode
**ret
);
23 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*doc
, const WCHAR
*id
, HTMLElement
**ret
)
25 nsIDOMNodeList
*nsnode_list
;
26 nsIDOMElement
*nselem
;
37 nsAString_InitDepend(&id_str
, id
);
38 /* get element by id attribute */
39 nsres
= nsIDOMHTMLDocument_GetElementById(doc
->nsdoc
, &id_str
, &nselem
);
41 ERR("GetElementById failed: %08x\n", nsres
);
42 nsAString_Finish(&id_str
);
46 /* get first element by name attribute */
47 nsres
= nsIDOMHTMLDocument_GetElementsByName(doc
->nsdoc
, &id_str
, &nsnode_list
);
48 nsAString_Finish(&id_str
);
50 ERR("getElementsByName failed: %08x\n", nsres
);
52 nsIDOMElement_Release(nselem
);
56 nsres
= nsIDOMNodeList_Item(nsnode_list
, 0, &nsnode
);
57 nsIDOMNodeList_Release(nsnode_list
);
58 assert(nsres
== NS_OK
);
60 if(nsnode
&& nselem
) {
63 nsres
= nsIDOMNode_CompareDocumentPosition(nsnode
, (nsIDOMNode
*)nselem
, &pos
);
64 if(NS_FAILED(nsres
)) {
65 FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres
);
66 nsIDOMNode_Release(nsnode
);
67 nsIDOMElement_Release(nselem
);
71 TRACE("CompareDocumentPosition gave: 0x%x\n", pos
);
72 if(!(pos
& (DOCUMENT_POSITION_PRECEDING
| DOCUMENT_POSITION_CONTAINS
))) {
73 nsIDOMElement_Release(nselem
);
80 nsres
= nsIDOMNode_QueryInterface(nsnode
, &IID_nsIDOMElement
, (void**)&nselem
);
81 assert(nsres
== NS_OK
);
83 nsIDOMNode_Release(nsnode
);
91 hres
= get_elem(doc
, nselem
, ret
);
92 nsIDOMElement_Release(nselem
);
96 UINT
get_document_charset(HTMLDocumentNode
*doc
)
98 nsAString charset_str
;
105 nsAString_Init(&charset_str
, NULL
);
106 nsres
= nsIDOMHTMLDocument_GetCharacterSet(doc
->nsdoc
, &charset_str
);
107 if(NS_SUCCEEDED(nsres
)) {
108 const PRUnichar
*charset
;
110 nsAString_GetData(&charset_str
, &charset
);
113 BSTR str
= SysAllocString(charset
);
114 ret
= cp_from_charset_string(str
);
118 ERR("GetCharset failed: %08x\n", nsres
);
120 nsAString_Finish(&charset_str
);
125 return doc
->charset
= ret
;
128 static inline HTMLDocument
*impl_from_IHTMLDocument2(IHTMLDocument2
*iface
)
130 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument2_iface
);
133 static HRESULT WINAPI
HTMLDocument_QueryInterface(IHTMLDocument2
*iface
, REFIID riid
, void **ppv
)
135 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
137 return htmldoc_query_interface(This
, riid
, ppv
);
140 static ULONG WINAPI
HTMLDocument_AddRef(IHTMLDocument2
*iface
)
142 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
144 return htmldoc_addref(This
);
147 static ULONG WINAPI
HTMLDocument_Release(IHTMLDocument2
*iface
)
149 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
151 return htmldoc_release(This
);
154 static HRESULT WINAPI
HTMLDocument_GetTypeInfoCount(IHTMLDocument2
*iface
, UINT
*pctinfo
)
156 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
158 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
161 static HRESULT WINAPI
HTMLDocument_GetTypeInfo(IHTMLDocument2
*iface
, UINT iTInfo
,
162 LCID lcid
, ITypeInfo
**ppTInfo
)
164 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
166 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
169 static HRESULT WINAPI
HTMLDocument_GetIDsOfNames(IHTMLDocument2
*iface
, REFIID riid
,
170 LPOLESTR
*rgszNames
, UINT cNames
,
171 LCID lcid
, DISPID
*rgDispId
)
173 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
175 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
179 static HRESULT WINAPI
HTMLDocument_Invoke(IHTMLDocument2
*iface
, DISPID dispIdMember
,
180 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
181 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
183 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
185 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
186 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
189 static HRESULT WINAPI
HTMLDocument_get_Script(IHTMLDocument2
*iface
, IDispatch
**p
)
191 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
193 TRACE("(%p)->(%p)\n", This
, p
);
195 *p
= (IDispatch
*)&This
->window
->base
.IHTMLWindow2_iface
;
196 IDispatch_AddRef(*p
);
200 static HRESULT WINAPI
HTMLDocument_get_all(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
202 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
203 nsIDOMElement
*nselem
= NULL
;
208 TRACE("(%p)->(%p)\n", This
, p
);
210 if(!This
->doc_node
->nsdoc
) {
211 WARN("NULL nsdoc\n");
215 nsres
= nsIDOMHTMLDocument_GetDocumentElement(This
->doc_node
->nsdoc
, &nselem
);
216 if(NS_FAILED(nsres
)) {
217 ERR("GetDocumentElement failed: %08x\n", nsres
);
226 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
227 nsIDOMElement_Release(nselem
);
231 *p
= create_all_collection(node
, TRUE
);
236 static HRESULT WINAPI
HTMLDocument_get_body(IHTMLDocument2
*iface
, IHTMLElement
**p
)
238 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
239 nsIDOMHTMLElement
*nsbody
= NULL
;
243 TRACE("(%p)->(%p)\n", This
, p
);
245 if(This
->doc_node
->nsdoc
) {
248 nsres
= nsIDOMHTMLDocument_GetBody(This
->doc_node
->nsdoc
, &nsbody
);
249 if(NS_FAILED(nsres
)) {
250 TRACE("Could not get body: %08x\n", nsres
);
260 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nsbody
, TRUE
, &node
);
261 nsIDOMHTMLElement_Release(nsbody
);
265 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
270 static HRESULT WINAPI
HTMLDocument_get_activeElement(IHTMLDocument2
*iface
, IHTMLElement
**p
)
272 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
273 nsIDOMElement
*nselem
;
278 TRACE("(%p)->(%p)\n", This
, p
);
280 if(!This
->doc_node
->nsdoc
) {
286 * NOTE: Gecko may return an active element even if the document is not visible.
287 * IE returns NULL in this case.
289 nsres
= nsIDOMHTMLDocument_GetActiveElement(This
->doc_node
->nsdoc
, &nselem
);
290 if(NS_FAILED(nsres
)) {
291 ERR("GetActiveElement failed: %08x\n", nsres
);
300 hres
= get_elem(This
->doc_node
, nselem
, &elem
);
301 nsIDOMElement_Release(nselem
);
305 *p
= &elem
->IHTMLElement_iface
;
309 static HRESULT WINAPI
HTMLDocument_get_images(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
311 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
312 nsIDOMHTMLCollection
*nscoll
= NULL
;
315 TRACE("(%p)->(%p)\n", This
, p
);
322 if(!This
->doc_node
->nsdoc
) {
323 WARN("NULL nsdoc\n");
327 nsres
= nsIDOMHTMLDocument_GetImages(This
->doc_node
->nsdoc
, &nscoll
);
328 if(NS_FAILED(nsres
)) {
329 ERR("GetImages failed: %08x\n", nsres
);
334 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
335 nsIDOMHTMLCollection_Release(nscoll
);
341 static HRESULT WINAPI
HTMLDocument_get_applets(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
343 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
344 nsIDOMHTMLCollection
*nscoll
= NULL
;
347 TRACE("(%p)->(%p)\n", This
, p
);
354 if(!This
->doc_node
->nsdoc
) {
355 WARN("NULL nsdoc\n");
359 nsres
= nsIDOMHTMLDocument_GetApplets(This
->doc_node
->nsdoc
, &nscoll
);
360 if(NS_FAILED(nsres
)) {
361 ERR("GetApplets failed: %08x\n", nsres
);
366 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
367 nsIDOMHTMLCollection_Release(nscoll
);
373 static HRESULT WINAPI
HTMLDocument_get_links(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
375 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
376 nsIDOMHTMLCollection
*nscoll
= NULL
;
379 TRACE("(%p)->(%p)\n", This
, p
);
386 if(!This
->doc_node
->nsdoc
) {
387 WARN("NULL nsdoc\n");
391 nsres
= nsIDOMHTMLDocument_GetLinks(This
->doc_node
->nsdoc
, &nscoll
);
392 if(NS_FAILED(nsres
)) {
393 ERR("GetLinks failed: %08x\n", nsres
);
398 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
399 nsIDOMHTMLCollection_Release(nscoll
);
405 static HRESULT WINAPI
HTMLDocument_get_forms(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
407 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
408 nsIDOMHTMLCollection
*nscoll
= NULL
;
411 TRACE("(%p)->(%p)\n", This
, p
);
418 if(!This
->doc_node
->nsdoc
) {
419 WARN("NULL nsdoc\n");
423 nsres
= nsIDOMHTMLDocument_GetForms(This
->doc_node
->nsdoc
, &nscoll
);
424 if(NS_FAILED(nsres
)) {
425 ERR("GetForms failed: %08x\n", nsres
);
430 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
431 nsIDOMHTMLCollection_Release(nscoll
);
437 static HRESULT WINAPI
HTMLDocument_get_anchors(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
439 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
440 nsIDOMHTMLCollection
*nscoll
= NULL
;
443 TRACE("(%p)->(%p)\n", This
, p
);
450 if(!This
->doc_node
->nsdoc
) {
451 WARN("NULL nsdoc\n");
455 nsres
= nsIDOMHTMLDocument_GetAnchors(This
->doc_node
->nsdoc
, &nscoll
);
456 if(NS_FAILED(nsres
)) {
457 ERR("GetAnchors failed: %08x\n", nsres
);
462 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
463 nsIDOMHTMLCollection_Release(nscoll
);
469 static HRESULT WINAPI
HTMLDocument_put_title(IHTMLDocument2
*iface
, BSTR v
)
471 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
475 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
477 if(!This
->doc_node
->nsdoc
) {
478 WARN("NULL nsdoc\n");
482 nsAString_InitDepend(&nsstr
, v
);
483 nsres
= nsIDOMHTMLDocument_SetTitle(This
->doc_node
->nsdoc
, &nsstr
);
484 nsAString_Finish(&nsstr
);
486 ERR("SetTitle failed: %08x\n", nsres
);
491 static HRESULT WINAPI
HTMLDocument_get_title(IHTMLDocument2
*iface
, BSTR
*p
)
493 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
494 const PRUnichar
*ret
;
498 TRACE("(%p)->(%p)\n", This
, p
);
500 if(!This
->doc_node
->nsdoc
) {
501 WARN("NULL nsdoc\n");
506 nsAString_Init(&nsstr
, NULL
);
507 nsres
= nsIDOMHTMLDocument_GetTitle(This
->doc_node
->nsdoc
, &nsstr
);
508 if (NS_SUCCEEDED(nsres
)) {
509 nsAString_GetData(&nsstr
, &ret
);
510 *p
= SysAllocString(ret
);
512 nsAString_Finish(&nsstr
);
514 if(NS_FAILED(nsres
)) {
515 ERR("GetTitle failed: %08x\n", nsres
);
522 static HRESULT WINAPI
HTMLDocument_get_scripts(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
524 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
525 nsIDOMHTMLCollection
*nscoll
= NULL
;
528 TRACE("(%p)->(%p)\n", This
, p
);
535 if(!This
->doc_node
->nsdoc
) {
536 WARN("NULL nsdoc\n");
540 nsres
= nsIDOMHTMLDocument_GetScripts(This
->doc_node
->nsdoc
, &nscoll
);
541 if(NS_FAILED(nsres
)) {
542 ERR("GetImages failed: %08x\n", nsres
);
547 *p
= create_collection_from_htmlcol(This
->doc_node
, nscoll
);
548 nsIDOMHTMLCollection_Release(nscoll
);
554 static HRESULT WINAPI
HTMLDocument_put_designMode(IHTMLDocument2
*iface
, BSTR v
)
556 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
559 static const WCHAR onW
[] = {'o','n',0};
561 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
563 if(strcmpiW(v
, onW
)) {
564 FIXME("Unsupported arg %s\n", debugstr_w(v
));
568 hres
= setup_edit_mode(This
->doc_obj
);
572 call_property_onchanged(&This
->cp_container
, DISPID_IHTMLDOCUMENT2_DESIGNMODE
);
576 static HRESULT WINAPI
HTMLDocument_get_designMode(IHTMLDocument2
*iface
, BSTR
*p
)
578 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
579 static const WCHAR szOff
[] = {'O','f','f',0};
580 FIXME("(%p)->(%p) always returning Off\n", This
, p
);
585 *p
= SysAllocString(szOff
);
590 static HRESULT WINAPI
HTMLDocument_get_selection(IHTMLDocument2
*iface
, IHTMLSelectionObject
**p
)
592 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
593 nsISelection
*nsselection
;
596 TRACE("(%p)->(%p)\n", This
, p
);
598 nsres
= nsIDOMWindow_GetSelection(This
->window
->nswindow
, &nsselection
);
599 if(NS_FAILED(nsres
)) {
600 ERR("GetSelection failed: %08x\n", nsres
);
604 return HTMLSelectionObject_Create(This
->doc_node
, nsselection
, p
);
607 static HRESULT WINAPI
HTMLDocument_get_readyState(IHTMLDocument2
*iface
, BSTR
*p
)
609 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
612 TRACE("(%p)->(%p)\n", iface
, p
);
617 return get_readystate_string(This
->window
->readystate
, p
);
620 static HRESULT WINAPI
HTMLDocument_get_frames(IHTMLDocument2
*iface
, IHTMLFramesCollection2
**p
)
622 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
624 TRACE("(%p)->(%p)\n", This
, p
);
626 return IHTMLWindow2_get_frames(&This
->window
->base
.IHTMLWindow2_iface
, p
);
629 static HRESULT WINAPI
HTMLDocument_get_embeds(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
631 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
632 FIXME("(%p)->(%p)\n", This
, p
);
636 static HRESULT WINAPI
HTMLDocument_get_plugins(IHTMLDocument2
*iface
, IHTMLElementCollection
**p
)
638 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
639 FIXME("(%p)->(%p)\n", This
, p
);
643 static HRESULT WINAPI
HTMLDocument_put_alinkColor(IHTMLDocument2
*iface
, VARIANT v
)
645 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
646 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
650 static HRESULT WINAPI
HTMLDocument_get_alinkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
652 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
653 FIXME("(%p)->(%p)\n", This
, p
);
657 static HRESULT WINAPI
HTMLDocument_put_bgColor(IHTMLDocument2
*iface
, VARIANT v
)
659 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
660 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
664 static HRESULT WINAPI
HTMLDocument_get_bgColor(IHTMLDocument2
*iface
, VARIANT
*p
)
666 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
667 FIXME("(%p)->(%p)\n", This
, p
);
671 static HRESULT WINAPI
HTMLDocument_put_fgColor(IHTMLDocument2
*iface
, VARIANT v
)
673 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
674 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
678 static HRESULT WINAPI
HTMLDocument_get_fgColor(IHTMLDocument2
*iface
, VARIANT
*p
)
680 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
681 FIXME("(%p)->(%p)\n", This
, p
);
685 static HRESULT WINAPI
HTMLDocument_put_linkColor(IHTMLDocument2
*iface
, VARIANT v
)
687 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
688 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
692 static HRESULT WINAPI
HTMLDocument_get_linkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
694 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
695 FIXME("(%p)->(%p)\n", This
, p
);
699 static HRESULT WINAPI
HTMLDocument_put_vlinkColor(IHTMLDocument2
*iface
, VARIANT v
)
701 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
702 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
706 static HRESULT WINAPI
HTMLDocument_get_vlinkColor(IHTMLDocument2
*iface
, VARIANT
*p
)
708 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
709 FIXME("(%p)->(%p)\n", This
, p
);
713 static HRESULT WINAPI
HTMLDocument_get_referrer(IHTMLDocument2
*iface
, BSTR
*p
)
715 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
717 FIXME("(%p)->(%p)\n", This
, p
);
723 static HRESULT WINAPI
HTMLDocument_get_location(IHTMLDocument2
*iface
, IHTMLLocation
**p
)
725 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
727 TRACE("(%p)->(%p)\n", This
, p
);
729 if(!This
->doc_node
->nsdoc
) {
730 WARN("NULL nsdoc\n");
734 return IHTMLWindow2_get_location(&This
->window
->base
.IHTMLWindow2_iface
, p
);
737 static HRESULT WINAPI
HTMLDocument_get_lastModified(IHTMLDocument2
*iface
, BSTR
*p
)
739 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
740 FIXME("(%p)->(%p)\n", This
, p
);
744 static HRESULT WINAPI
HTMLDocument_put_URL(IHTMLDocument2
*iface
, BSTR v
)
746 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
748 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
751 FIXME("No window available\n");
755 return navigate_url(This
->window
, v
, This
->window
->uri
, BINDING_NAVIGATED
);
758 static HRESULT WINAPI
HTMLDocument_get_URL(IHTMLDocument2
*iface
, BSTR
*p
)
760 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
762 static const WCHAR about_blank_url
[] =
763 {'a','b','o','u','t',':','b','l','a','n','k',0};
765 TRACE("(%p)->(%p)\n", iface
, p
);
767 *p
= SysAllocString(This
->window
->url
? This
->window
->url
: about_blank_url
);
768 return *p
? S_OK
: E_OUTOFMEMORY
;
771 static HRESULT WINAPI
HTMLDocument_put_domain(IHTMLDocument2
*iface
, BSTR v
)
773 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
774 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
778 static HRESULT WINAPI
HTMLDocument_get_domain(IHTMLDocument2
*iface
, BSTR
*p
)
780 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
783 TRACE("(%p)->(%p)\n", This
, p
);
785 if(!This
->window
|| !This
->window
->uri
) {
786 FIXME("No current URI\n");
790 hres
= IUri_GetHost(This
->window
->uri
, p
);
791 return FAILED(hres
) ? hres
: S_OK
;
794 static HRESULT WINAPI
HTMLDocument_put_cookie(IHTMLDocument2
*iface
, BSTR v
)
796 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
799 TRACE("(%p)->(%s)\n", This
, debugstr_w(v
));
801 bret
= InternetSetCookieExW(This
->window
->url
, NULL
, v
, 0, 0);
803 FIXME("InternetSetCookieExW failed: %u\n", GetLastError());
804 return HRESULT_FROM_WIN32(GetLastError());
810 static HRESULT WINAPI
HTMLDocument_get_cookie(IHTMLDocument2
*iface
, BSTR
*p
)
812 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
816 TRACE("(%p)->(%p)\n", This
, p
);
819 bret
= InternetGetCookieExW(This
->window
->url
, NULL
, NULL
, &size
, 0, NULL
);
821 switch(GetLastError()) {
822 case ERROR_INSUFFICIENT_BUFFER
:
824 case ERROR_NO_MORE_ITEMS
:
828 FIXME("InternetGetCookieExW failed: %u\n", GetLastError());
829 return HRESULT_FROM_WIN32(GetLastError());
838 *p
= SysAllocStringLen(NULL
, size
/sizeof(WCHAR
)-1);
840 return E_OUTOFMEMORY
;
842 bret
= InternetGetCookieExW(This
->window
->url
, NULL
, *p
, &size
, 0, NULL
);
844 ERR("InternetGetCookieExW failed: %u\n", GetLastError());
851 static HRESULT WINAPI
HTMLDocument_put_expando(IHTMLDocument2
*iface
, VARIANT_BOOL v
)
853 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
854 FIXME("(%p)->(%x)\n", This
, v
);
858 static HRESULT WINAPI
HTMLDocument_get_expando(IHTMLDocument2
*iface
, VARIANT_BOOL
*p
)
860 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
861 FIXME("(%p)->(%p)\n", This
, p
);
865 static HRESULT WINAPI
HTMLDocument_put_charset(IHTMLDocument2
*iface
, BSTR v
)
867 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
868 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
872 static HRESULT WINAPI
HTMLDocument_get_charset(IHTMLDocument2
*iface
, BSTR
*p
)
874 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
875 nsAString charset_str
;
878 TRACE("(%p)->(%p)\n", This
, p
);
880 if(!This
->doc_node
->nsdoc
) {
881 FIXME("NULL nsdoc\n");
885 nsAString_Init(&charset_str
, NULL
);
886 nsres
= nsIDOMHTMLDocument_GetCharacterSet(This
->doc_node
->nsdoc
, &charset_str
);
887 return return_nsstr(nsres
, &charset_str
, p
);
890 static HRESULT WINAPI
HTMLDocument_put_defaultCharset(IHTMLDocument2
*iface
, BSTR v
)
892 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
893 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
897 static HRESULT WINAPI
HTMLDocument_get_defaultCharset(IHTMLDocument2
*iface
, BSTR
*p
)
899 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
900 FIXME("(%p)->(%p)\n", This
, p
);
904 static HRESULT WINAPI
HTMLDocument_get_mimeType(IHTMLDocument2
*iface
, BSTR
*p
)
906 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
907 FIXME("(%p)->(%p)\n", This
, p
);
911 static HRESULT WINAPI
HTMLDocument_get_fileSize(IHTMLDocument2
*iface
, BSTR
*p
)
913 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
914 FIXME("(%p)->(%p)\n", This
, p
);
918 static HRESULT WINAPI
HTMLDocument_get_fileCreatedDate(IHTMLDocument2
*iface
, BSTR
*p
)
920 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
921 FIXME("(%p)->(%p)\n", This
, p
);
925 static HRESULT WINAPI
HTMLDocument_get_fileModifiedDate(IHTMLDocument2
*iface
, BSTR
*p
)
927 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
928 FIXME("(%p)->(%p)\n", This
, p
);
932 static HRESULT WINAPI
HTMLDocument_get_fileUpdatedDate(IHTMLDocument2
*iface
, BSTR
*p
)
934 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
935 FIXME("(%p)->(%p)\n", This
, p
);
939 static HRESULT WINAPI
HTMLDocument_get_security(IHTMLDocument2
*iface
, BSTR
*p
)
941 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
942 FIXME("(%p)->(%p)\n", This
, p
);
946 static HRESULT WINAPI
HTMLDocument_get_protocol(IHTMLDocument2
*iface
, BSTR
*p
)
948 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
949 FIXME("(%p)->(%p)\n", This
, p
);
953 static HRESULT WINAPI
HTMLDocument_get_nameProp(IHTMLDocument2
*iface
, BSTR
*p
)
955 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
956 FIXME("(%p)->(%p)\n", This
, p
);
960 static HRESULT
document_write(HTMLDocument
*This
, SAFEARRAY
*psarray
, BOOL ln
)
969 if(!This
->doc_node
->nsdoc
) {
970 WARN("NULL nsdoc\n");
977 if(psarray
->cDims
!= 1) {
978 FIXME("cDims=%d\n", psarray
->cDims
);
982 hres
= SafeArrayAccessData(psarray
, (void**)&var
);
984 WARN("SafeArrayAccessData failed: %08x\n", hres
);
988 V_VT(&tmp
) = VT_EMPTY
;
990 jsctx
= get_context_from_document(This
->doc_node
->nsdoc
);
991 argc
= psarray
->rgsabound
[0].cElements
;
992 for(i
=0; i
< argc
; i
++) {
993 if(V_VT(var
+i
) == VT_BSTR
) {
994 nsAString_InitDepend(&nsstr
, V_BSTR(var
+i
));
996 hres
= VariantChangeTypeEx(&tmp
, var
+i
, MAKELCID(MAKELANGID(LANG_ENGLISH
,SUBLANG_ENGLISH_US
),SORT_DEFAULT
), 0, VT_BSTR
);
998 WARN("Could not convert %s to string\n", debugstr_variant(var
+i
));
1001 nsAString_InitDepend(&nsstr
, V_BSTR(&tmp
));
1004 if(!ln
|| i
!= argc
-1)
1005 nsres
= nsIDOMHTMLDocument_Write(This
->doc_node
->nsdoc
, &nsstr
, jsctx
);
1007 nsres
= nsIDOMHTMLDocument_Writeln(This
->doc_node
->nsdoc
, &nsstr
, jsctx
);
1008 nsAString_Finish(&nsstr
);
1009 if(V_VT(var
+i
) != VT_BSTR
)
1011 if(NS_FAILED(nsres
)) {
1012 ERR("Write failed: %08x\n", nsres
);
1018 SafeArrayUnaccessData(psarray
);
1023 static HRESULT WINAPI
HTMLDocument_write(IHTMLDocument2
*iface
, SAFEARRAY
*psarray
)
1025 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1027 TRACE("(%p)->(%p)\n", iface
, psarray
);
1029 return document_write(This
, psarray
, FALSE
);
1032 static HRESULT WINAPI
HTMLDocument_writeln(IHTMLDocument2
*iface
, SAFEARRAY
*psarray
)
1034 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1036 TRACE("(%p)->(%p)\n", This
, psarray
);
1038 return document_write(This
, psarray
, TRUE
);
1041 static HRESULT WINAPI
HTMLDocument_open(IHTMLDocument2
*iface
, BSTR url
, VARIANT name
,
1042 VARIANT features
, VARIANT replace
, IDispatch
**pomWindowResult
)
1044 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1048 static const WCHAR text_htmlW
[] = {'t','e','x','t','/','h','t','m','l',0};
1050 TRACE("(%p)->(%s %s %s %s %p)\n", This
, debugstr_w(url
), debugstr_variant(&name
),
1051 debugstr_variant(&features
), debugstr_variant(&replace
), pomWindowResult
);
1053 if(!This
->doc_node
->nsdoc
) {
1058 if(!url
|| strcmpW(url
, text_htmlW
) || V_VT(&name
) != VT_ERROR
1059 || V_VT(&features
) != VT_ERROR
|| V_VT(&replace
) != VT_ERROR
)
1060 FIXME("unsupported args\n");
1062 nsres
= nsIDOMHTMLDocument_Open(This
->doc_node
->nsdoc
, NULL
, NULL
, NULL
,
1063 get_context_from_document(This
->doc_node
->nsdoc
), 0, &tmp
);
1064 if(NS_FAILED(nsres
)) {
1065 ERR("Open failed: %08x\n", nsres
);
1070 nsISupports_Release(tmp
);
1072 *pomWindowResult
= (IDispatch
*)&This
->window
->base
.IHTMLWindow2_iface
;
1073 IHTMLWindow2_AddRef(&This
->window
->base
.IHTMLWindow2_iface
);
1077 static HRESULT WINAPI
HTMLDocument_close(IHTMLDocument2
*iface
)
1079 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1082 TRACE("(%p)\n", This
);
1084 if(!This
->doc_node
->nsdoc
) {
1089 nsres
= nsIDOMHTMLDocument_Close(This
->doc_node
->nsdoc
);
1090 if(NS_FAILED(nsres
)) {
1091 ERR("Close failed: %08x\n", nsres
);
1098 static HRESULT WINAPI
HTMLDocument_clear(IHTMLDocument2
*iface
)
1100 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1103 TRACE("(%p)\n", This
);
1105 nsres
= nsIDOMHTMLDocument_Clear(This
->doc_node
->nsdoc
);
1106 if(NS_FAILED(nsres
)) {
1107 ERR("Clear failed: %08x\n", nsres
);
1114 static const WCHAR copyW
[] =
1115 {'c','o','p','y',0};
1116 static const WCHAR cutW
[] =
1118 static const WCHAR fontnameW
[] =
1119 {'f','o','n','t','n','a','m','e',0};
1120 static const WCHAR fontsizeW
[] =
1121 {'f','o','n','t','s','i','z','e',0};
1122 static const WCHAR indentW
[] =
1123 {'i','n','d','e','n','t',0};
1124 static const WCHAR insertorderedlistW
[] =
1125 {'i','n','s','e','r','t','o','r','d','e','r','e','d','l','i','s','t',0};
1126 static const WCHAR insertunorderedlistW
[] =
1127 {'i','n','s','e','r','t','u','n','o','r','d','e','r','e','d','l','i','s','t',0};
1128 static const WCHAR outdentW
[] =
1129 {'o','u','t','d','e','n','t',0};
1130 static const WCHAR pasteW
[] =
1131 {'p','a','s','t','e',0};
1132 static const WCHAR respectvisibilityindesignW
[] =
1133 {'r','e','s','p','e','c','t','v','i','s','i','b','i','l','i','t','y','i','n','d','e','s','i','g','n',0};
1135 static const struct {
1138 }command_names
[] = {
1141 {fontnameW
, IDM_FONTNAME
},
1142 {fontsizeW
, IDM_FONTSIZE
},
1143 {indentW
, IDM_INDENT
},
1144 {insertorderedlistW
, IDM_ORDERLIST
},
1145 {insertunorderedlistW
, IDM_UNORDERLIST
},
1146 {outdentW
, IDM_OUTDENT
},
1147 {pasteW
, IDM_PASTE
},
1148 {respectvisibilityindesignW
, IDM_RESPECTVISIBILITY_INDESIGN
}
1151 static BOOL
cmdid_from_string(const WCHAR
*str
, OLECMDID
*cmdid
)
1155 for(i
= 0; i
< sizeof(command_names
)/sizeof(*command_names
); i
++) {
1156 if(!strcmpiW(command_names
[i
].name
, str
)) {
1157 *cmdid
= command_names
[i
].id
;
1162 FIXME("Unknown command %s\n", debugstr_w(str
));
1166 static HRESULT WINAPI
HTMLDocument_queryCommandSupported(IHTMLDocument2
*iface
, BSTR cmdID
,
1167 VARIANT_BOOL
*pfRet
)
1169 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1170 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1174 static HRESULT WINAPI
HTMLDocument_queryCommandEnabled(IHTMLDocument2
*iface
, BSTR cmdID
,
1175 VARIANT_BOOL
*pfRet
)
1177 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1178 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1182 static HRESULT WINAPI
HTMLDocument_queryCommandState(IHTMLDocument2
*iface
, BSTR cmdID
,
1183 VARIANT_BOOL
*pfRet
)
1185 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1186 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1190 static HRESULT WINAPI
HTMLDocument_queryCommandIndeterm(IHTMLDocument2
*iface
, BSTR cmdID
,
1191 VARIANT_BOOL
*pfRet
)
1193 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1194 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1198 static HRESULT WINAPI
HTMLDocument_queryCommandText(IHTMLDocument2
*iface
, BSTR cmdID
,
1201 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1202 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1206 static HRESULT WINAPI
HTMLDocument_queryCommandValue(IHTMLDocument2
*iface
, BSTR cmdID
,
1209 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1210 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1214 static HRESULT WINAPI
HTMLDocument_execCommand(IHTMLDocument2
*iface
, BSTR cmdID
,
1215 VARIANT_BOOL showUI
, VARIANT value
, VARIANT_BOOL
*pfRet
)
1217 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1222 TRACE("(%p)->(%s %x %s %p)\n", This
, debugstr_w(cmdID
), showUI
, debugstr_variant(&value
), pfRet
);
1224 if(!cmdid_from_string(cmdID
, &cmdid
))
1225 return OLECMDERR_E_NOTSUPPORTED
;
1227 V_VT(&ret
) = VT_EMPTY
;
1228 hres
= IOleCommandTarget_Exec(&This
->IOleCommandTarget_iface
, &CGID_MSHTML
, cmdid
,
1229 showUI
? 0 : OLECMDEXECOPT_DONTPROMPTUSER
, &value
, &ret
);
1233 if(V_VT(&ret
) != VT_EMPTY
) {
1234 FIXME("Handle ret %s\n", debugstr_variant(&ret
));
1238 *pfRet
= VARIANT_TRUE
;
1242 static HRESULT WINAPI
HTMLDocument_execCommandShowHelp(IHTMLDocument2
*iface
, BSTR cmdID
,
1243 VARIANT_BOOL
*pfRet
)
1245 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1246 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(cmdID
), pfRet
);
1250 static HRESULT WINAPI
HTMLDocument_createElement(IHTMLDocument2
*iface
, BSTR eTag
,
1251 IHTMLElement
**newElem
)
1253 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1257 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(eTag
), newElem
);
1259 hres
= create_element(This
->doc_node
, eTag
, &elem
);
1263 *newElem
= &elem
->IHTMLElement_iface
;
1267 static HRESULT WINAPI
HTMLDocument_put_onhelp(IHTMLDocument2
*iface
, VARIANT v
)
1269 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1270 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1274 static HRESULT WINAPI
HTMLDocument_get_onhelp(IHTMLDocument2
*iface
, VARIANT
*p
)
1276 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1277 FIXME("(%p)->(%p)\n", This
, p
);
1281 static HRESULT WINAPI
HTMLDocument_put_onclick(IHTMLDocument2
*iface
, VARIANT v
)
1283 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1285 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1287 return set_doc_event(This
, EVENTID_CLICK
, &v
);
1290 static HRESULT WINAPI
HTMLDocument_get_onclick(IHTMLDocument2
*iface
, VARIANT
*p
)
1292 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1294 TRACE("(%p)->(%p)\n", This
, p
);
1296 return get_doc_event(This
, EVENTID_CLICK
, p
);
1299 static HRESULT WINAPI
HTMLDocument_put_ondblclick(IHTMLDocument2
*iface
, VARIANT v
)
1301 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1303 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1305 return set_doc_event(This
, EVENTID_DBLCLICK
, &v
);
1308 static HRESULT WINAPI
HTMLDocument_get_ondblclick(IHTMLDocument2
*iface
, VARIANT
*p
)
1310 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1312 TRACE("(%p)->(%p)\n", This
, p
);
1314 return get_doc_event(This
, EVENTID_DBLCLICK
, p
);
1317 static HRESULT WINAPI
HTMLDocument_put_onkeyup(IHTMLDocument2
*iface
, VARIANT v
)
1319 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1321 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1323 return set_doc_event(This
, EVENTID_KEYUP
, &v
);
1326 static HRESULT WINAPI
HTMLDocument_get_onkeyup(IHTMLDocument2
*iface
, VARIANT
*p
)
1328 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1330 TRACE("(%p)->(%p)\n", This
, p
);
1332 return get_doc_event(This
, EVENTID_KEYUP
, p
);
1335 static HRESULT WINAPI
HTMLDocument_put_onkeydown(IHTMLDocument2
*iface
, VARIANT v
)
1337 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1339 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1341 return set_doc_event(This
, EVENTID_KEYDOWN
, &v
);
1344 static HRESULT WINAPI
HTMLDocument_get_onkeydown(IHTMLDocument2
*iface
, VARIANT
*p
)
1346 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1348 TRACE("(%p)->(%p)\n", This
, p
);
1350 return get_doc_event(This
, EVENTID_KEYDOWN
, p
);
1353 static HRESULT WINAPI
HTMLDocument_put_onkeypress(IHTMLDocument2
*iface
, VARIANT v
)
1355 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1357 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1359 return set_doc_event(This
, EVENTID_KEYPRESS
, &v
);
1362 static HRESULT WINAPI
HTMLDocument_get_onkeypress(IHTMLDocument2
*iface
, VARIANT
*p
)
1364 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1366 TRACE("(%p)->(%p)\n", This
, p
);
1368 return get_doc_event(This
, EVENTID_KEYPRESS
, p
);
1371 static HRESULT WINAPI
HTMLDocument_put_onmouseup(IHTMLDocument2
*iface
, VARIANT v
)
1373 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1375 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1377 return set_doc_event(This
, EVENTID_MOUSEUP
, &v
);
1380 static HRESULT WINAPI
HTMLDocument_get_onmouseup(IHTMLDocument2
*iface
, VARIANT
*p
)
1382 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1384 TRACE("(%p)->(%p)\n", This
, p
);
1386 return get_doc_event(This
, EVENTID_MOUSEUP
, p
);
1389 static HRESULT WINAPI
HTMLDocument_put_onmousedown(IHTMLDocument2
*iface
, VARIANT v
)
1391 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1393 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1395 return set_doc_event(This
, EVENTID_MOUSEDOWN
, &v
);
1398 static HRESULT WINAPI
HTMLDocument_get_onmousedown(IHTMLDocument2
*iface
, VARIANT
*p
)
1400 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1402 TRACE("(%p)->(%p)\n", This
, p
);
1404 return get_doc_event(This
, EVENTID_MOUSEDOWN
, p
);
1407 static HRESULT WINAPI
HTMLDocument_put_onmousemove(IHTMLDocument2
*iface
, VARIANT v
)
1409 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1411 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1413 return set_doc_event(This
, EVENTID_MOUSEMOVE
, &v
);
1416 static HRESULT WINAPI
HTMLDocument_get_onmousemove(IHTMLDocument2
*iface
, VARIANT
*p
)
1418 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1420 TRACE("(%p)->(%p)\n", This
, p
);
1422 return get_doc_event(This
, EVENTID_MOUSEMOVE
, p
);
1425 static HRESULT WINAPI
HTMLDocument_put_onmouseout(IHTMLDocument2
*iface
, VARIANT v
)
1427 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1429 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1431 return set_doc_event(This
, EVENTID_MOUSEOUT
, &v
);
1434 static HRESULT WINAPI
HTMLDocument_get_onmouseout(IHTMLDocument2
*iface
, VARIANT
*p
)
1436 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1438 TRACE("(%p)->(%p)\n", This
, p
);
1440 return get_doc_event(This
, EVENTID_MOUSEOUT
, p
);
1443 static HRESULT WINAPI
HTMLDocument_put_onmouseover(IHTMLDocument2
*iface
, VARIANT v
)
1445 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1447 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1449 return set_doc_event(This
, EVENTID_MOUSEOVER
, &v
);
1452 static HRESULT WINAPI
HTMLDocument_get_onmouseover(IHTMLDocument2
*iface
, VARIANT
*p
)
1454 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1456 TRACE("(%p)->(%p)\n", This
, p
);
1458 return get_doc_event(This
, EVENTID_MOUSEOVER
, p
);
1461 static HRESULT WINAPI
HTMLDocument_put_onreadystatechange(IHTMLDocument2
*iface
, VARIANT v
)
1463 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1465 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1467 return set_doc_event(This
, EVENTID_READYSTATECHANGE
, &v
);
1470 static HRESULT WINAPI
HTMLDocument_get_onreadystatechange(IHTMLDocument2
*iface
, VARIANT
*p
)
1472 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1474 TRACE("(%p)->(%p)\n", This
, p
);
1476 return get_doc_event(This
, EVENTID_READYSTATECHANGE
, p
);
1479 static HRESULT WINAPI
HTMLDocument_put_onafterupdate(IHTMLDocument2
*iface
, VARIANT v
)
1481 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1482 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1486 static HRESULT WINAPI
HTMLDocument_get_onafterupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1488 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1489 FIXME("(%p)->(%p)\n", This
, p
);
1493 static HRESULT WINAPI
HTMLDocument_put_onrowexit(IHTMLDocument2
*iface
, VARIANT v
)
1495 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1496 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1500 static HRESULT WINAPI
HTMLDocument_get_onrowexit(IHTMLDocument2
*iface
, VARIANT
*p
)
1502 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1503 FIXME("(%p)->(%p)\n", This
, p
);
1507 static HRESULT WINAPI
HTMLDocument_put_onrowenter(IHTMLDocument2
*iface
, VARIANT v
)
1509 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1510 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1514 static HRESULT WINAPI
HTMLDocument_get_onrowenter(IHTMLDocument2
*iface
, VARIANT
*p
)
1516 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1517 FIXME("(%p)->(%p)\n", This
, p
);
1521 static HRESULT WINAPI
HTMLDocument_put_ondragstart(IHTMLDocument2
*iface
, VARIANT v
)
1523 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1525 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1527 return set_doc_event(This
, EVENTID_DRAGSTART
, &v
);
1530 static HRESULT WINAPI
HTMLDocument_get_ondragstart(IHTMLDocument2
*iface
, VARIANT
*p
)
1532 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1534 TRACE("(%p)->(%p)\n", This
, p
);
1536 return get_doc_event(This
, EVENTID_DRAGSTART
, p
);
1539 static HRESULT WINAPI
HTMLDocument_put_onselectstart(IHTMLDocument2
*iface
, VARIANT v
)
1541 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1543 TRACE("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1545 return set_doc_event(This
, EVENTID_SELECTSTART
, &v
);
1548 static HRESULT WINAPI
HTMLDocument_get_onselectstart(IHTMLDocument2
*iface
, VARIANT
*p
)
1550 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1552 TRACE("(%p)->(%p)\n", This
, p
);
1554 return get_doc_event(This
, EVENTID_SELECTSTART
, p
);
1557 static HRESULT WINAPI
HTMLDocument_elementFromPoint(IHTMLDocument2
*iface
, LONG x
, LONG y
,
1558 IHTMLElement
**elementHit
)
1560 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1561 nsIDOMElement
*nselem
;
1566 TRACE("(%p)->(%d %d %p)\n", This
, x
, y
, elementHit
);
1568 nsres
= nsIDOMHTMLDocument_ElementFromPoint(This
->doc_node
->nsdoc
, x
, y
, &nselem
);
1569 if(NS_FAILED(nsres
)) {
1570 ERR("ElementFromPoint failed: %08x\n", nsres
);
1579 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
1580 nsIDOMElement_Release(nselem
);
1584 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)elementHit
);
1589 static HRESULT WINAPI
HTMLDocument_get_parentWindow(IHTMLDocument2
*iface
, IHTMLWindow2
**p
)
1591 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1593 TRACE("(%p)->(%p)\n", This
, p
);
1595 *p
= &This
->window
->base
.IHTMLWindow2_iface
;
1596 IHTMLWindow2_AddRef(*p
);
1600 static HRESULT WINAPI
HTMLDocument_get_styleSheets(IHTMLDocument2
*iface
,
1601 IHTMLStyleSheetsCollection
**p
)
1603 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1604 nsIDOMStyleSheetList
*nsstylelist
;
1607 TRACE("(%p)->(%p)\n", This
, p
);
1611 if(!This
->doc_node
->nsdoc
) {
1612 WARN("NULL nsdoc\n");
1613 return E_UNEXPECTED
;
1616 nsres
= nsIDOMHTMLDocument_GetStyleSheets(This
->doc_node
->nsdoc
, &nsstylelist
);
1617 if(NS_FAILED(nsres
)) {
1618 ERR("GetStyleSheets failed: %08x\n", nsres
);
1622 *p
= HTMLStyleSheetsCollection_Create(nsstylelist
);
1623 nsIDOMStyleSheetList_Release(nsstylelist
);
1628 static HRESULT WINAPI
HTMLDocument_put_onbeforeupdate(IHTMLDocument2
*iface
, VARIANT v
)
1630 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1631 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1635 static HRESULT WINAPI
HTMLDocument_get_onbeforeupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1637 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1638 FIXME("(%p)->(%p)\n", This
, p
);
1642 static HRESULT WINAPI
HTMLDocument_put_onerrorupdate(IHTMLDocument2
*iface
, VARIANT v
)
1644 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1645 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
1649 static HRESULT WINAPI
HTMLDocument_get_onerrorupdate(IHTMLDocument2
*iface
, VARIANT
*p
)
1651 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1652 FIXME("(%p)->(%p)\n", This
, p
);
1656 static HRESULT WINAPI
HTMLDocument_toString(IHTMLDocument2
*iface
, BSTR
*String
)
1658 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1660 static const WCHAR objectW
[] = {'[','o','b','j','e','c','t',']',0};
1662 TRACE("(%p)->(%p)\n", This
, String
);
1665 return E_INVALIDARG
;
1667 *String
= SysAllocString(objectW
);
1668 return *String
? S_OK
: E_OUTOFMEMORY
;
1672 static HRESULT WINAPI
HTMLDocument_createStyleSheet(IHTMLDocument2
*iface
, BSTR bstrHref
,
1673 LONG lIndex
, IHTMLStyleSheet
**ppnewStyleSheet
)
1675 HTMLDocument
*This
= impl_from_IHTMLDocument2(iface
);
1676 nsIDOMHTMLHeadElement
*head_elem
;
1677 IHTMLStyleElement
*style_elem
;
1682 static const WCHAR styleW
[] = {'s','t','y','l','e',0};
1684 TRACE("(%p)->(%s %d %p)\n", This
, debugstr_w(bstrHref
), lIndex
, ppnewStyleSheet
);
1686 if(!This
->doc_node
->nsdoc
) {
1687 FIXME("not a real doc object\n");
1692 FIXME("Unsupported lIndex %d\n", lIndex
);
1694 if(bstrHref
&& *bstrHref
) {
1695 FIXME("semi-stub for href %s\n", debugstr_w(bstrHref
));
1696 *ppnewStyleSheet
= HTMLStyleSheet_Create(NULL
);
1700 hres
= create_element(This
->doc_node
, styleW
, &elem
);
1704 nsres
= nsIDOMHTMLDocument_GetHead(This
->doc_node
->nsdoc
, &head_elem
);
1705 if(NS_SUCCEEDED(nsres
)) {
1706 nsIDOMNode
*head_node
, *tmp_node
;
1708 nsres
= nsIDOMHTMLHeadElement_QueryInterface(head_elem
, &IID_nsIDOMNode
, (void**)&head_node
);
1709 nsIDOMHTMLHeadElement_Release(head_elem
);
1710 assert(nsres
== NS_OK
);
1712 nsres
= nsIDOMNode_AppendChild(head_node
, elem
->node
.nsnode
, &tmp_node
);
1713 nsIDOMNode_Release(head_node
);
1714 if(NS_SUCCEEDED(nsres
) && tmp_node
)
1715 nsIDOMNode_Release(tmp_node
);
1717 if(NS_FAILED(nsres
)) {
1718 IHTMLElement_Release(&elem
->IHTMLElement_iface
);
1722 hres
= IHTMLElement_QueryInterface(&elem
->IHTMLElement_iface
, &IID_IHTMLStyleElement
, (void**)&style_elem
);
1723 assert(hres
== S_OK
);
1724 IHTMLElement_Release(&elem
->IHTMLElement_iface
);
1726 hres
= IHTMLStyleElement_get_styleSheet(style_elem
, ppnewStyleSheet
);
1727 IHTMLStyleElement_Release(style_elem
);
1731 static const IHTMLDocument2Vtbl HTMLDocumentVtbl
= {
1732 HTMLDocument_QueryInterface
,
1733 HTMLDocument_AddRef
,
1734 HTMLDocument_Release
,
1735 HTMLDocument_GetTypeInfoCount
,
1736 HTMLDocument_GetTypeInfo
,
1737 HTMLDocument_GetIDsOfNames
,
1738 HTMLDocument_Invoke
,
1739 HTMLDocument_get_Script
,
1740 HTMLDocument_get_all
,
1741 HTMLDocument_get_body
,
1742 HTMLDocument_get_activeElement
,
1743 HTMLDocument_get_images
,
1744 HTMLDocument_get_applets
,
1745 HTMLDocument_get_links
,
1746 HTMLDocument_get_forms
,
1747 HTMLDocument_get_anchors
,
1748 HTMLDocument_put_title
,
1749 HTMLDocument_get_title
,
1750 HTMLDocument_get_scripts
,
1751 HTMLDocument_put_designMode
,
1752 HTMLDocument_get_designMode
,
1753 HTMLDocument_get_selection
,
1754 HTMLDocument_get_readyState
,
1755 HTMLDocument_get_frames
,
1756 HTMLDocument_get_embeds
,
1757 HTMLDocument_get_plugins
,
1758 HTMLDocument_put_alinkColor
,
1759 HTMLDocument_get_alinkColor
,
1760 HTMLDocument_put_bgColor
,
1761 HTMLDocument_get_bgColor
,
1762 HTMLDocument_put_fgColor
,
1763 HTMLDocument_get_fgColor
,
1764 HTMLDocument_put_linkColor
,
1765 HTMLDocument_get_linkColor
,
1766 HTMLDocument_put_vlinkColor
,
1767 HTMLDocument_get_vlinkColor
,
1768 HTMLDocument_get_referrer
,
1769 HTMLDocument_get_location
,
1770 HTMLDocument_get_lastModified
,
1771 HTMLDocument_put_URL
,
1772 HTMLDocument_get_URL
,
1773 HTMLDocument_put_domain
,
1774 HTMLDocument_get_domain
,
1775 HTMLDocument_put_cookie
,
1776 HTMLDocument_get_cookie
,
1777 HTMLDocument_put_expando
,
1778 HTMLDocument_get_expando
,
1779 HTMLDocument_put_charset
,
1780 HTMLDocument_get_charset
,
1781 HTMLDocument_put_defaultCharset
,
1782 HTMLDocument_get_defaultCharset
,
1783 HTMLDocument_get_mimeType
,
1784 HTMLDocument_get_fileSize
,
1785 HTMLDocument_get_fileCreatedDate
,
1786 HTMLDocument_get_fileModifiedDate
,
1787 HTMLDocument_get_fileUpdatedDate
,
1788 HTMLDocument_get_security
,
1789 HTMLDocument_get_protocol
,
1790 HTMLDocument_get_nameProp
,
1792 HTMLDocument_writeln
,
1796 HTMLDocument_queryCommandSupported
,
1797 HTMLDocument_queryCommandEnabled
,
1798 HTMLDocument_queryCommandState
,
1799 HTMLDocument_queryCommandIndeterm
,
1800 HTMLDocument_queryCommandText
,
1801 HTMLDocument_queryCommandValue
,
1802 HTMLDocument_execCommand
,
1803 HTMLDocument_execCommandShowHelp
,
1804 HTMLDocument_createElement
,
1805 HTMLDocument_put_onhelp
,
1806 HTMLDocument_get_onhelp
,
1807 HTMLDocument_put_onclick
,
1808 HTMLDocument_get_onclick
,
1809 HTMLDocument_put_ondblclick
,
1810 HTMLDocument_get_ondblclick
,
1811 HTMLDocument_put_onkeyup
,
1812 HTMLDocument_get_onkeyup
,
1813 HTMLDocument_put_onkeydown
,
1814 HTMLDocument_get_onkeydown
,
1815 HTMLDocument_put_onkeypress
,
1816 HTMLDocument_get_onkeypress
,
1817 HTMLDocument_put_onmouseup
,
1818 HTMLDocument_get_onmouseup
,
1819 HTMLDocument_put_onmousedown
,
1820 HTMLDocument_get_onmousedown
,
1821 HTMLDocument_put_onmousemove
,
1822 HTMLDocument_get_onmousemove
,
1823 HTMLDocument_put_onmouseout
,
1824 HTMLDocument_get_onmouseout
,
1825 HTMLDocument_put_onmouseover
,
1826 HTMLDocument_get_onmouseover
,
1827 HTMLDocument_put_onreadystatechange
,
1828 HTMLDocument_get_onreadystatechange
,
1829 HTMLDocument_put_onafterupdate
,
1830 HTMLDocument_get_onafterupdate
,
1831 HTMLDocument_put_onrowexit
,
1832 HTMLDocument_get_onrowexit
,
1833 HTMLDocument_put_onrowenter
,
1834 HTMLDocument_get_onrowenter
,
1835 HTMLDocument_put_ondragstart
,
1836 HTMLDocument_get_ondragstart
,
1837 HTMLDocument_put_onselectstart
,
1838 HTMLDocument_get_onselectstart
,
1839 HTMLDocument_elementFromPoint
,
1840 HTMLDocument_get_parentWindow
,
1841 HTMLDocument_get_styleSheets
,
1842 HTMLDocument_put_onbeforeupdate
,
1843 HTMLDocument_get_onbeforeupdate
,
1844 HTMLDocument_put_onerrorupdate
,
1845 HTMLDocument_get_onerrorupdate
,
1846 HTMLDocument_toString
,
1847 HTMLDocument_createStyleSheet
1850 static inline HTMLDocument
*impl_from_IHTMLDocument3(IHTMLDocument3
*iface
)
1852 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument3_iface
);
1855 static HRESULT WINAPI
HTMLDocument3_QueryInterface(IHTMLDocument3
*iface
,
1856 REFIID riid
, void **ppv
)
1858 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1859 return htmldoc_query_interface(This
, riid
, ppv
);
1862 static ULONG WINAPI
HTMLDocument3_AddRef(IHTMLDocument3
*iface
)
1864 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1865 return htmldoc_addref(This
);
1868 static ULONG WINAPI
HTMLDocument3_Release(IHTMLDocument3
*iface
)
1870 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1871 return htmldoc_release(This
);
1874 static HRESULT WINAPI
HTMLDocument3_GetTypeInfoCount(IHTMLDocument3
*iface
, UINT
*pctinfo
)
1876 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1877 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
1880 static HRESULT WINAPI
HTMLDocument3_GetTypeInfo(IHTMLDocument3
*iface
, UINT iTInfo
,
1881 LCID lcid
, ITypeInfo
**ppTInfo
)
1883 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1884 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
1887 static HRESULT WINAPI
HTMLDocument3_GetIDsOfNames(IHTMLDocument3
*iface
, REFIID riid
,
1888 LPOLESTR
*rgszNames
, UINT cNames
,
1889 LCID lcid
, DISPID
*rgDispId
)
1891 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1892 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
1896 static HRESULT WINAPI
HTMLDocument3_Invoke(IHTMLDocument3
*iface
, DISPID dispIdMember
,
1897 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1898 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
1900 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1901 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
1902 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1905 static HRESULT WINAPI
HTMLDocument3_releaseCapture(IHTMLDocument3
*iface
)
1907 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1908 FIXME("(%p)\n", This
);
1912 static HRESULT WINAPI
HTMLDocument3_recalc(IHTMLDocument3
*iface
, VARIANT_BOOL fForce
)
1914 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1916 WARN("(%p)->(%x)\n", This
, fForce
);
1918 /* Doing nothing here should be fine for us. */
1922 static HRESULT WINAPI
HTMLDocument3_createTextNode(IHTMLDocument3
*iface
, BSTR text
,
1923 IHTMLDOMNode
**newTextNode
)
1925 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1932 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(text
), newTextNode
);
1934 if(!This
->doc_node
->nsdoc
) {
1935 WARN("NULL nsdoc\n");
1936 return E_UNEXPECTED
;
1939 nsAString_InitDepend(&text_str
, text
);
1940 nsres
= nsIDOMHTMLDocument_CreateTextNode(This
->doc_node
->nsdoc
, &text_str
, &nstext
);
1941 nsAString_Finish(&text_str
);
1942 if(NS_FAILED(nsres
)) {
1943 ERR("CreateTextNode failed: %08x\n", nsres
);
1947 hres
= HTMLDOMTextNode_Create(This
->doc_node
, (nsIDOMNode
*)nstext
, &node
);
1948 nsIDOMText_Release(nstext
);
1952 *newTextNode
= &node
->IHTMLDOMNode_iface
;
1956 static HRESULT WINAPI
HTMLDocument3_get_documentElement(IHTMLDocument3
*iface
, IHTMLElement
**p
)
1958 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
1959 nsIDOMElement
*nselem
= NULL
;
1964 TRACE("(%p)->(%p)\n", This
, p
);
1966 if(This
->window
->readystate
== READYSTATE_UNINITIALIZED
) {
1971 if(!This
->doc_node
->nsdoc
) {
1972 WARN("NULL nsdoc\n");
1973 return E_UNEXPECTED
;
1976 nsres
= nsIDOMHTMLDocument_GetDocumentElement(This
->doc_node
->nsdoc
, &nselem
);
1977 if(NS_FAILED(nsres
)) {
1978 ERR("GetDocumentElement failed: %08x\n", nsres
);
1987 hres
= get_node(This
->doc_node
, (nsIDOMNode
*)nselem
, TRUE
, &node
);
1988 nsIDOMElement_Release(nselem
);
1992 hres
= IHTMLDOMNode_QueryInterface(&node
->IHTMLDOMNode_iface
, &IID_IHTMLElement
, (void**)p
);
1997 static HRESULT WINAPI
HTMLDocument3_uniqueID(IHTMLDocument3
*iface
, BSTR
*p
)
1999 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2000 FIXME("(%p)->(%p)\n", This
, p
);
2004 static HRESULT WINAPI
HTMLDocument3_attachEvent(IHTMLDocument3
*iface
, BSTR event
,
2005 IDispatch
* pDisp
, VARIANT_BOOL
*pfResult
)
2007 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2009 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(event
), pDisp
, pfResult
);
2011 return attach_event(&This
->doc_node
->node
.event_target
, event
, pDisp
, pfResult
);
2014 static HRESULT WINAPI
HTMLDocument3_detachEvent(IHTMLDocument3
*iface
, BSTR event
,
2017 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2019 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(event
), pDisp
);
2021 return detach_event(&This
->doc_node
->node
.event_target
, event
, pDisp
);
2024 static HRESULT WINAPI
HTMLDocument3_put_onrowsdelete(IHTMLDocument3
*iface
, VARIANT v
)
2026 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2027 FIXME("(%p)->()\n", This
);
2031 static HRESULT WINAPI
HTMLDocument3_get_onrowsdelete(IHTMLDocument3
*iface
, VARIANT
*p
)
2033 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2034 FIXME("(%p)->(%p)\n", This
, p
);
2038 static HRESULT WINAPI
HTMLDocument3_put_onrowsinserted(IHTMLDocument3
*iface
, VARIANT v
)
2040 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2041 FIXME("(%p)->()\n", This
);
2045 static HRESULT WINAPI
HTMLDocument3_get_onrowsinserted(IHTMLDocument3
*iface
, VARIANT
*p
)
2047 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2048 FIXME("(%p)->(%p)\n", This
, p
);
2052 static HRESULT WINAPI
HTMLDocument3_put_oncellchange(IHTMLDocument3
*iface
, VARIANT v
)
2054 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2055 FIXME("(%p)->()\n", This
);
2059 static HRESULT WINAPI
HTMLDocument3_get_oncellchange(IHTMLDocument3
*iface
, VARIANT
*p
)
2061 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2062 FIXME("(%p)->(%p)\n", This
, p
);
2066 static HRESULT WINAPI
HTMLDocument3_put_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT v
)
2068 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2069 FIXME("(%p)->()\n", This
);
2073 static HRESULT WINAPI
HTMLDocument3_get_ondatasetchanged(IHTMLDocument3
*iface
, VARIANT
*p
)
2075 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2076 FIXME("(%p)->(%p)\n", This
, p
);
2080 static HRESULT WINAPI
HTMLDocument3_put_ondataavailable(IHTMLDocument3
*iface
, VARIANT v
)
2082 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2083 FIXME("(%p)->()\n", This
);
2087 static HRESULT WINAPI
HTMLDocument3_get_ondataavailable(IHTMLDocument3
*iface
, VARIANT
*p
)
2089 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2090 FIXME("(%p)->(%p)\n", This
, p
);
2094 static HRESULT WINAPI
HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT v
)
2096 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2097 FIXME("(%p)->()\n", This
);
2101 static HRESULT WINAPI
HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3
*iface
, VARIANT
*p
)
2103 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2104 FIXME("(%p)->(%p)\n", This
, p
);
2108 static HRESULT WINAPI
HTMLDocument3_put_onpropertychange(IHTMLDocument3
*iface
, VARIANT v
)
2110 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2111 FIXME("(%p)->()\n", This
);
2115 static HRESULT WINAPI
HTMLDocument3_get_onpropertychange(IHTMLDocument3
*iface
, VARIANT
*p
)
2117 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2118 FIXME("(%p)->(%p)\n", This
, p
);
2122 static HRESULT WINAPI
HTMLDocument3_put_dir(IHTMLDocument3
*iface
, BSTR v
)
2124 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2125 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2129 static HRESULT WINAPI
HTMLDocument3_get_dir(IHTMLDocument3
*iface
, BSTR
*p
)
2131 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2132 FIXME("(%p)->(%p)\n", This
, p
);
2136 static HRESULT WINAPI
HTMLDocument3_put_oncontextmenu(IHTMLDocument3
*iface
, VARIANT v
)
2138 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2140 TRACE("(%p)->()\n", This
);
2142 return set_doc_event(This
, EVENTID_CONTEXTMENU
, &v
);
2145 static HRESULT WINAPI
HTMLDocument3_get_oncontextmenu(IHTMLDocument3
*iface
, VARIANT
*p
)
2147 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2149 TRACE("(%p)->(%p)\n", This
, p
);
2151 return get_doc_event(This
, EVENTID_CONTEXTMENU
, p
);
2154 static HRESULT WINAPI
HTMLDocument3_put_onstop(IHTMLDocument3
*iface
, VARIANT v
)
2156 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2157 FIXME("(%p)->()\n", This
);
2161 static HRESULT WINAPI
HTMLDocument3_get_onstop(IHTMLDocument3
*iface
, VARIANT
*p
)
2163 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2164 FIXME("(%p)->(%p)\n", This
, p
);
2168 static HRESULT WINAPI
HTMLDocument3_createDocumentFragment(IHTMLDocument3
*iface
,
2169 IHTMLDocument2
**ppNewDoc
)
2171 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2172 nsIDOMDocumentFragment
*doc_frag
;
2173 HTMLDocumentNode
*docnode
;
2177 TRACE("(%p)->(%p)\n", This
, ppNewDoc
);
2179 if(!This
->doc_node
->nsdoc
) {
2180 FIXME("NULL nsdoc\n");
2184 nsres
= nsIDOMHTMLDocument_CreateDocumentFragment(This
->doc_node
->nsdoc
, &doc_frag
);
2185 if(NS_FAILED(nsres
)) {
2186 ERR("CreateDocumentFragment failed: %08x\n", nsres
);
2190 hres
= create_document_fragment((nsIDOMNode
*)doc_frag
, This
->doc_node
, &docnode
);
2191 nsIDOMDocumentFragment_Release(doc_frag
);
2195 *ppNewDoc
= &docnode
->basedoc
.IHTMLDocument2_iface
;
2199 static HRESULT WINAPI
HTMLDocument3_get_parentDocument(IHTMLDocument3
*iface
,
2202 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2203 FIXME("(%p)->(%p)\n", This
, p
);
2207 static HRESULT WINAPI
HTMLDocument3_put_enableDownload(IHTMLDocument3
*iface
,
2210 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2211 FIXME("(%p)->(%x)\n", This
, v
);
2215 static HRESULT WINAPI
HTMLDocument3_get_enableDownload(IHTMLDocument3
*iface
,
2218 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2219 FIXME("(%p)->(%p)\n", This
, p
);
2223 static HRESULT WINAPI
HTMLDocument3_put_baseUrl(IHTMLDocument3
*iface
, BSTR v
)
2225 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2226 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2230 static HRESULT WINAPI
HTMLDocument3_get_baseUrl(IHTMLDocument3
*iface
, BSTR
*p
)
2232 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2233 FIXME("(%p)->(%p)\n", This
, p
);
2237 static HRESULT WINAPI
HTMLDocument3_get_childNodes(IHTMLDocument3
*iface
, IDispatch
**p
)
2239 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2241 TRACE("(%p)->(%p)\n", This
, p
);
2243 return IHTMLDOMNode_get_childNodes(&This
->doc_node
->node
.IHTMLDOMNode_iface
, p
);
2246 static HRESULT WINAPI
HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3
*iface
,
2249 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2250 FIXME("(%p)->()\n", This
);
2254 static HRESULT WINAPI
HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3
*iface
,
2257 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2258 FIXME("(%p)->(%p)\n", This
, p
);
2262 static HRESULT WINAPI
HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT v
)
2264 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2265 FIXME("(%p)->()\n", This
);
2269 static HRESULT WINAPI
HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3
*iface
, VARIANT
*p
)
2271 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2272 FIXME("(%p)->(%p)\n", This
, p
);
2276 static HRESULT WINAPI
HTMLDocument3_getElementsByName(IHTMLDocument3
*iface
, BSTR v
,
2277 IHTMLElementCollection
**ppelColl
)
2279 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2280 nsIDOMNodeList
*node_list
;
2281 nsAString selector_str
;
2285 static const WCHAR formatW
[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
2287 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppelColl
);
2289 if(!This
->doc_node
|| !This
->doc_node
->nsdoc
) {
2290 /* We should probably return an empty collection. */
2291 FIXME("No nsdoc\n");
2295 selector
= heap_alloc(2*SysStringLen(v
)*sizeof(WCHAR
) + sizeof(formatW
));
2297 return E_OUTOFMEMORY
;
2298 sprintfW(selector
, formatW
, v
, v
);
2301 * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes.
2302 * That's why we use CSS selector instead. We should also use name only when it applies to given element
2303 * types and search should be case insensitive. Those are currently not supported properly.
2305 nsAString_InitDepend(&selector_str
, selector
);
2306 nsres
= nsIDOMHTMLDocument_QuerySelectorAll(This
->doc_node
->nsdoc
, &selector_str
, &node_list
);
2307 nsAString_Finish(&selector_str
);
2308 heap_free(selector
);
2309 if(NS_FAILED(nsres
)) {
2310 ERR("QuerySelectorAll failed: %08x\n", nsres
);
2314 *ppelColl
= create_collection_from_nodelist(This
->doc_node
, node_list
);
2315 nsIDOMNodeList_Release(node_list
);
2320 static HRESULT WINAPI
HTMLDocument3_getElementById(IHTMLDocument3
*iface
, BSTR v
,
2323 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2327 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
2329 hres
= get_doc_elem_by_id(This
->doc_node
, v
, &elem
);
2330 if(FAILED(hres
) || !elem
) {
2335 *pel
= &elem
->IHTMLElement_iface
;
2340 static HRESULT WINAPI
HTMLDocument3_getElementsByTagName(IHTMLDocument3
*iface
, BSTR v
,
2341 IHTMLElementCollection
**pelColl
)
2343 HTMLDocument
*This
= impl_from_IHTMLDocument3(iface
);
2344 nsIDOMNodeList
*nslist
;
2348 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(v
), pelColl
);
2350 if(!This
->doc_node
->nsdoc
) {
2351 WARN("NULL nsdoc\n");
2352 return E_UNEXPECTED
;
2355 nsAString_InitDepend(&id_str
, v
);
2356 nsres
= nsIDOMHTMLDocument_GetElementsByTagName(This
->doc_node
->nsdoc
, &id_str
, &nslist
);
2357 nsAString_Finish(&id_str
);
2359 ERR("GetElementByName failed: %08x\n", nsres
);
2363 *pelColl
= create_collection_from_nodelist(This
->doc_node
, nslist
);
2364 nsIDOMNodeList_Release(nslist
);
2369 static const IHTMLDocument3Vtbl HTMLDocument3Vtbl
= {
2370 HTMLDocument3_QueryInterface
,
2371 HTMLDocument3_AddRef
,
2372 HTMLDocument3_Release
,
2373 HTMLDocument3_GetTypeInfoCount
,
2374 HTMLDocument3_GetTypeInfo
,
2375 HTMLDocument3_GetIDsOfNames
,
2376 HTMLDocument3_Invoke
,
2377 HTMLDocument3_releaseCapture
,
2378 HTMLDocument3_recalc
,
2379 HTMLDocument3_createTextNode
,
2380 HTMLDocument3_get_documentElement
,
2381 HTMLDocument3_uniqueID
,
2382 HTMLDocument3_attachEvent
,
2383 HTMLDocument3_detachEvent
,
2384 HTMLDocument3_put_onrowsdelete
,
2385 HTMLDocument3_get_onrowsdelete
,
2386 HTMLDocument3_put_onrowsinserted
,
2387 HTMLDocument3_get_onrowsinserted
,
2388 HTMLDocument3_put_oncellchange
,
2389 HTMLDocument3_get_oncellchange
,
2390 HTMLDocument3_put_ondatasetchanged
,
2391 HTMLDocument3_get_ondatasetchanged
,
2392 HTMLDocument3_put_ondataavailable
,
2393 HTMLDocument3_get_ondataavailable
,
2394 HTMLDocument3_put_ondatasetcomplete
,
2395 HTMLDocument3_get_ondatasetcomplete
,
2396 HTMLDocument3_put_onpropertychange
,
2397 HTMLDocument3_get_onpropertychange
,
2398 HTMLDocument3_put_dir
,
2399 HTMLDocument3_get_dir
,
2400 HTMLDocument3_put_oncontextmenu
,
2401 HTMLDocument3_get_oncontextmenu
,
2402 HTMLDocument3_put_onstop
,
2403 HTMLDocument3_get_onstop
,
2404 HTMLDocument3_createDocumentFragment
,
2405 HTMLDocument3_get_parentDocument
,
2406 HTMLDocument3_put_enableDownload
,
2407 HTMLDocument3_get_enableDownload
,
2408 HTMLDocument3_put_baseUrl
,
2409 HTMLDocument3_get_baseUrl
,
2410 HTMLDocument3_get_childNodes
,
2411 HTMLDocument3_put_inheritStyleSheets
,
2412 HTMLDocument3_get_inheritStyleSheets
,
2413 HTMLDocument3_put_onbeforeeditfocus
,
2414 HTMLDocument3_get_onbeforeeditfocus
,
2415 HTMLDocument3_getElementsByName
,
2416 HTMLDocument3_getElementById
,
2417 HTMLDocument3_getElementsByTagName
2420 static inline HTMLDocument
*impl_from_IHTMLDocument4(IHTMLDocument4
*iface
)
2422 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument4_iface
);
2425 static HRESULT WINAPI
HTMLDocument4_QueryInterface(IHTMLDocument4
*iface
,
2426 REFIID riid
, void **ppv
)
2428 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2429 return htmldoc_query_interface(This
, riid
, ppv
);
2432 static ULONG WINAPI
HTMLDocument4_AddRef(IHTMLDocument4
*iface
)
2434 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2435 return htmldoc_addref(This
);
2438 static ULONG WINAPI
HTMLDocument4_Release(IHTMLDocument4
*iface
)
2440 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2441 return htmldoc_release(This
);
2444 static HRESULT WINAPI
HTMLDocument4_GetTypeInfoCount(IHTMLDocument4
*iface
, UINT
*pctinfo
)
2446 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2447 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2450 static HRESULT WINAPI
HTMLDocument4_GetTypeInfo(IHTMLDocument4
*iface
, UINT iTInfo
,
2451 LCID lcid
, ITypeInfo
**ppTInfo
)
2453 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2454 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2457 static HRESULT WINAPI
HTMLDocument4_GetIDsOfNames(IHTMLDocument4
*iface
, REFIID riid
,
2458 LPOLESTR
*rgszNames
, UINT cNames
,
2459 LCID lcid
, DISPID
*rgDispId
)
2461 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2462 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2466 static HRESULT WINAPI
HTMLDocument4_Invoke(IHTMLDocument4
*iface
, DISPID dispIdMember
,
2467 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2468 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2470 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2471 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2472 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2475 static HRESULT WINAPI
HTMLDocument4_focus(IHTMLDocument4
*iface
)
2477 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2478 nsIDOMHTMLElement
*nsbody
;
2481 TRACE("(%p)->()\n", This
);
2483 nsres
= nsIDOMHTMLDocument_GetBody(This
->doc_node
->nsdoc
, &nsbody
);
2484 if(NS_FAILED(nsres
) || !nsbody
) {
2485 ERR("GetBody failed: %08x\n", nsres
);
2489 nsres
= nsIDOMHTMLElement_Focus(nsbody
);
2490 nsIDOMHTMLElement_Release(nsbody
);
2491 if(NS_FAILED(nsres
)) {
2492 ERR("Focus failed: %08x\n", nsres
);
2499 static HRESULT WINAPI
HTMLDocument4_hasFocus(IHTMLDocument4
*iface
, VARIANT_BOOL
*pfFocus
)
2501 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2502 FIXME("(%p)->(%p)\n", This
, pfFocus
);
2506 static HRESULT WINAPI
HTMLDocument4_put_onselectionchange(IHTMLDocument4
*iface
, VARIANT v
)
2508 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2509 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2513 static HRESULT WINAPI
HTMLDocument4_get_onselectionchange(IHTMLDocument4
*iface
, VARIANT
*p
)
2515 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2516 FIXME("(%p)->(%p)\n", This
, p
);
2520 static HRESULT WINAPI
HTMLDocument4_get_namespace(IHTMLDocument4
*iface
, IDispatch
**p
)
2522 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2523 FIXME("(%p)->(%p)\n", This
, p
);
2527 static HRESULT WINAPI
HTMLDocument4_createDocumentFromUrl(IHTMLDocument4
*iface
, BSTR bstrUrl
,
2528 BSTR bstrOptions
, IHTMLDocument2
**newDoc
)
2530 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2531 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(bstrUrl
), debugstr_w(bstrOptions
), newDoc
);
2535 static HRESULT WINAPI
HTMLDocument4_put_media(IHTMLDocument4
*iface
, BSTR v
)
2537 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2538 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
2542 static HRESULT WINAPI
HTMLDocument4_get_media(IHTMLDocument4
*iface
, BSTR
*p
)
2544 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2545 FIXME("(%p)->(%p)\n", This
, p
);
2549 static HRESULT WINAPI
HTMLDocument4_createEventObject(IHTMLDocument4
*iface
,
2550 VARIANT
*pvarEventObject
, IHTMLEventObj
**ppEventObj
)
2552 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2554 TRACE("(%p)->(%s %p)\n", This
, debugstr_variant(pvarEventObject
), ppEventObj
);
2556 if(pvarEventObject
&& V_VT(pvarEventObject
) != VT_ERROR
&& V_VT(pvarEventObject
) != VT_EMPTY
) {
2557 FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject
));
2561 return create_event_obj(ppEventObj
);
2564 static HRESULT WINAPI
HTMLDocument4_fireEvent(IHTMLDocument4
*iface
, BSTR bstrEventName
,
2565 VARIANT
*pvarEventObject
, VARIANT_BOOL
*pfCanceled
)
2567 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2569 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_w(bstrEventName
), pvarEventObject
, pfCanceled
);
2571 return dispatch_event(&This
->doc_node
->node
, bstrEventName
, pvarEventObject
, pfCanceled
);
2574 static HRESULT WINAPI
HTMLDocument4_createRenderStyle(IHTMLDocument4
*iface
, BSTR v
,
2575 IHTMLRenderStyle
**ppIHTMLRenderStyle
)
2577 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2578 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), ppIHTMLRenderStyle
);
2582 static HRESULT WINAPI
HTMLDocument4_put_oncontrolselect(IHTMLDocument4
*iface
, VARIANT v
)
2584 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2585 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2589 static HRESULT WINAPI
HTMLDocument4_get_oncontrolselect(IHTMLDocument4
*iface
, VARIANT
*p
)
2591 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2592 FIXME("(%p)->(%p)\n", This
, p
);
2596 static HRESULT WINAPI
HTMLDocument4_get_URLEncoded(IHTMLDocument4
*iface
, BSTR
*p
)
2598 HTMLDocument
*This
= impl_from_IHTMLDocument4(iface
);
2599 FIXME("(%p)->(%p)\n", This
, p
);
2603 static const IHTMLDocument4Vtbl HTMLDocument4Vtbl
= {
2604 HTMLDocument4_QueryInterface
,
2605 HTMLDocument4_AddRef
,
2606 HTMLDocument4_Release
,
2607 HTMLDocument4_GetTypeInfoCount
,
2608 HTMLDocument4_GetTypeInfo
,
2609 HTMLDocument4_GetIDsOfNames
,
2610 HTMLDocument4_Invoke
,
2611 HTMLDocument4_focus
,
2612 HTMLDocument4_hasFocus
,
2613 HTMLDocument4_put_onselectionchange
,
2614 HTMLDocument4_get_onselectionchange
,
2615 HTMLDocument4_get_namespace
,
2616 HTMLDocument4_createDocumentFromUrl
,
2617 HTMLDocument4_put_media
,
2618 HTMLDocument4_get_media
,
2619 HTMLDocument4_createEventObject
,
2620 HTMLDocument4_fireEvent
,
2621 HTMLDocument4_createRenderStyle
,
2622 HTMLDocument4_put_oncontrolselect
,
2623 HTMLDocument4_get_oncontrolselect
,
2624 HTMLDocument4_get_URLEncoded
2627 static inline HTMLDocument
*impl_from_IHTMLDocument5(IHTMLDocument5
*iface
)
2629 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument5_iface
);
2632 static HRESULT WINAPI
HTMLDocument5_QueryInterface(IHTMLDocument5
*iface
,
2633 REFIID riid
, void **ppv
)
2635 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2636 return htmldoc_query_interface(This
, riid
, ppv
);
2639 static ULONG WINAPI
HTMLDocument5_AddRef(IHTMLDocument5
*iface
)
2641 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2642 return htmldoc_addref(This
);
2645 static ULONG WINAPI
HTMLDocument5_Release(IHTMLDocument5
*iface
)
2647 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2648 return htmldoc_release(This
);
2651 static HRESULT WINAPI
HTMLDocument5_GetTypeInfoCount(IHTMLDocument5
*iface
, UINT
*pctinfo
)
2653 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2654 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2657 static HRESULT WINAPI
HTMLDocument5_GetTypeInfo(IHTMLDocument5
*iface
, UINT iTInfo
,
2658 LCID lcid
, ITypeInfo
**ppTInfo
)
2660 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2661 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2664 static HRESULT WINAPI
HTMLDocument5_GetIDsOfNames(IHTMLDocument5
*iface
, REFIID riid
,
2665 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2667 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2668 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2672 static HRESULT WINAPI
HTMLDocument5_Invoke(IHTMLDocument5
*iface
, DISPID dispIdMember
,
2673 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2674 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2676 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2677 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2678 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2681 static HRESULT WINAPI
HTMLDocument5_put_onmousewheel(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_onmousewheel(IHTMLDocument5
*iface
, VARIANT
*p
)
2690 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2691 FIXME("(%p)->(%p)\n", This
, p
);
2695 static HRESULT WINAPI
HTMLDocument5_get_doctype(IHTMLDocument5
*iface
, IHTMLDOMNode
**p
)
2697 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2698 FIXME("(%p)->(%p)\n", This
, p
);
2702 static HRESULT WINAPI
HTMLDocument5_get_implementation(IHTMLDocument5
*iface
, IHTMLDOMImplementation
**p
)
2704 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2705 HTMLDocumentNode
*doc_node
= This
->doc_node
;
2707 TRACE("(%p)->(%p)\n", This
, p
);
2709 if(!doc_node
->dom_implementation
) {
2712 hres
= create_dom_implementation(&doc_node
->dom_implementation
);
2717 IHTMLDOMImplementation_AddRef(doc_node
->dom_implementation
);
2718 *p
= doc_node
->dom_implementation
;
2722 static HRESULT WINAPI
HTMLDocument5_createAttribute(IHTMLDocument5
*iface
, BSTR bstrattrName
,
2723 IHTMLDOMAttribute
**ppattribute
)
2725 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2726 HTMLDOMAttribute
*attr
;
2729 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrattrName
), ppattribute
);
2731 hres
= HTMLDOMAttribute_Create(bstrattrName
, NULL
, 0, &attr
);
2735 *ppattribute
= &attr
->IHTMLDOMAttribute_iface
;
2739 static HRESULT WINAPI
HTMLDocument5_createComment(IHTMLDocument5
*iface
, BSTR bstrdata
,
2740 IHTMLDOMNode
**ppRetNode
)
2742 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2743 nsIDOMComment
*nscomment
;
2749 TRACE("(%p)->(%s %p)\n", This
, debugstr_w(bstrdata
), ppRetNode
);
2751 if(!This
->doc_node
->nsdoc
) {
2752 WARN("NULL nsdoc\n");
2753 return E_UNEXPECTED
;
2756 nsAString_InitDepend(&str
, bstrdata
);
2757 nsres
= nsIDOMHTMLDocument_CreateComment(This
->doc_node
->nsdoc
, &str
, &nscomment
);
2758 nsAString_Finish(&str
);
2759 if(NS_FAILED(nsres
)) {
2760 ERR("CreateTextNode failed: %08x\n", nsres
);
2764 hres
= HTMLCommentElement_Create(This
->doc_node
, (nsIDOMNode
*)nscomment
, &elem
);
2765 nsIDOMComment_Release(nscomment
);
2769 *ppRetNode
= &elem
->node
.IHTMLDOMNode_iface
;
2773 static HRESULT WINAPI
HTMLDocument5_put_onfocusin(IHTMLDocument5
*iface
, VARIANT v
)
2775 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2776 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2780 static HRESULT WINAPI
HTMLDocument5_get_onfocusin(IHTMLDocument5
*iface
, VARIANT
*p
)
2782 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2783 FIXME("(%p)->(%p)\n", This
, p
);
2787 static HRESULT WINAPI
HTMLDocument5_put_onfocusout(IHTMLDocument5
*iface
, VARIANT v
)
2789 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2790 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2794 static HRESULT WINAPI
HTMLDocument5_get_onfocusout(IHTMLDocument5
*iface
, VARIANT
*p
)
2796 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2797 FIXME("(%p)->(%p)\n", This
, p
);
2801 static HRESULT WINAPI
HTMLDocument5_put_onactivate(IHTMLDocument5
*iface
, VARIANT v
)
2803 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2804 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2808 static HRESULT WINAPI
HTMLDocument5_get_onactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2810 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2811 FIXME("(%p)->(%p)\n", This
, p
);
2815 static HRESULT WINAPI
HTMLDocument5_put_ondeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2817 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2818 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2822 static HRESULT WINAPI
HTMLDocument5_get_ondeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2824 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2825 FIXME("(%p)->(%p)\n", This
, p
);
2829 static HRESULT WINAPI
HTMLDocument5_put_onbeforeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2831 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2832 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2836 static HRESULT WINAPI
HTMLDocument5_get_onbeforeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2838 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2839 FIXME("(%p)->(%p)\n", This
, p
);
2843 static HRESULT WINAPI
HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5
*iface
, VARIANT v
)
2845 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2846 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2850 static HRESULT WINAPI
HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5
*iface
, VARIANT
*p
)
2852 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2853 FIXME("(%p)->(%p)\n", This
, p
);
2857 static HRESULT WINAPI
HTMLDocument5_get_compatMode(IHTMLDocument5
*iface
, BSTR
*p
)
2859 HTMLDocument
*This
= impl_from_IHTMLDocument5(iface
);
2863 TRACE("(%p)->(%p)\n", This
, p
);
2865 if(!This
->doc_node
->nsdoc
) {
2866 WARN("NULL nsdoc\n");
2867 return E_UNEXPECTED
;
2870 nsAString_Init(&mode_str
, NULL
);
2871 nsres
= nsIDOMHTMLDocument_GetCompatMode(This
->doc_node
->nsdoc
, &mode_str
);
2872 return return_nsstr(nsres
, &mode_str
, p
);
2875 static const IHTMLDocument5Vtbl HTMLDocument5Vtbl
= {
2876 HTMLDocument5_QueryInterface
,
2877 HTMLDocument5_AddRef
,
2878 HTMLDocument5_Release
,
2879 HTMLDocument5_GetTypeInfoCount
,
2880 HTMLDocument5_GetTypeInfo
,
2881 HTMLDocument5_GetIDsOfNames
,
2882 HTMLDocument5_Invoke
,
2883 HTMLDocument5_put_onmousewheel
,
2884 HTMLDocument5_get_onmousewheel
,
2885 HTMLDocument5_get_doctype
,
2886 HTMLDocument5_get_implementation
,
2887 HTMLDocument5_createAttribute
,
2888 HTMLDocument5_createComment
,
2889 HTMLDocument5_put_onfocusin
,
2890 HTMLDocument5_get_onfocusin
,
2891 HTMLDocument5_put_onfocusout
,
2892 HTMLDocument5_get_onfocusout
,
2893 HTMLDocument5_put_onactivate
,
2894 HTMLDocument5_get_onactivate
,
2895 HTMLDocument5_put_ondeactivate
,
2896 HTMLDocument5_get_ondeactivate
,
2897 HTMLDocument5_put_onbeforeactivate
,
2898 HTMLDocument5_get_onbeforeactivate
,
2899 HTMLDocument5_put_onbeforedeactivate
,
2900 HTMLDocument5_get_onbeforedeactivate
,
2901 HTMLDocument5_get_compatMode
2904 static inline HTMLDocument
*impl_from_IHTMLDocument6(IHTMLDocument6
*iface
)
2906 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument6_iface
);
2909 static HRESULT WINAPI
HTMLDocument6_QueryInterface(IHTMLDocument6
*iface
,
2910 REFIID riid
, void **ppv
)
2912 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2913 return htmldoc_query_interface(This
, riid
, ppv
);
2916 static ULONG WINAPI
HTMLDocument6_AddRef(IHTMLDocument6
*iface
)
2918 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2919 return htmldoc_addref(This
);
2922 static ULONG WINAPI
HTMLDocument6_Release(IHTMLDocument6
*iface
)
2924 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2925 return htmldoc_release(This
);
2928 static HRESULT WINAPI
HTMLDocument6_GetTypeInfoCount(IHTMLDocument6
*iface
, UINT
*pctinfo
)
2930 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2931 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
2934 static HRESULT WINAPI
HTMLDocument6_GetTypeInfo(IHTMLDocument6
*iface
, UINT iTInfo
,
2935 LCID lcid
, ITypeInfo
**ppTInfo
)
2937 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2938 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
2941 static HRESULT WINAPI
HTMLDocument6_GetIDsOfNames(IHTMLDocument6
*iface
, REFIID riid
,
2942 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2944 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2945 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
2949 static HRESULT WINAPI
HTMLDocument6_Invoke(IHTMLDocument6
*iface
, DISPID dispIdMember
,
2950 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
2951 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
2953 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2954 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
2955 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2958 static HRESULT WINAPI
HTMLDocument6_get_compatible(IHTMLDocument6
*iface
,
2959 IHTMLDocumentCompatibleInfoCollection
**p
)
2961 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2962 FIXME("(%p)->(%p)\n", This
, p
);
2966 static HRESULT WINAPI
HTMLDocument6_get_documentMode(IHTMLDocument6
*iface
,
2969 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2970 FIXME("(%p)->(%p)\n", This
, p
);
2974 static HRESULT WINAPI
HTMLDocument6_get_onstorage(IHTMLDocument6
*iface
,
2977 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2978 FIXME("(%p)->(%p)\n", This
, p
);
2982 static HRESULT WINAPI
HTMLDocument6_put_onstorage(IHTMLDocument6
*iface
, VARIANT v
)
2984 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2985 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
2989 static HRESULT WINAPI
HTMLDocument6_get_onstoragecommit(IHTMLDocument6
*iface
,
2992 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
2993 FIXME("(%p)->(%p)\n", This
, p
);
2997 static HRESULT WINAPI
HTMLDocument6_put_onstoragecommit(IHTMLDocument6
*iface
, VARIANT v
)
2999 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
3000 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3004 static HRESULT WINAPI
HTMLDocument6_getElementById(IHTMLDocument6
*iface
,
3005 BSTR bstrId
, IHTMLElement2
**p
)
3007 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
3008 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrId
), p
);
3012 static HRESULT WINAPI
HTMLDocument6_updateSettings(IHTMLDocument6
*iface
)
3014 HTMLDocument
*This
= impl_from_IHTMLDocument6(iface
);
3015 FIXME("(%p)->()\n", This
);
3019 static const IHTMLDocument6Vtbl HTMLDocument6Vtbl
= {
3020 HTMLDocument6_QueryInterface
,
3021 HTMLDocument6_AddRef
,
3022 HTMLDocument6_Release
,
3023 HTMLDocument6_GetTypeInfoCount
,
3024 HTMLDocument6_GetTypeInfo
,
3025 HTMLDocument6_GetIDsOfNames
,
3026 HTMLDocument6_Invoke
,
3027 HTMLDocument6_get_compatible
,
3028 HTMLDocument6_get_documentMode
,
3029 HTMLDocument6_put_onstorage
,
3030 HTMLDocument6_get_onstorage
,
3031 HTMLDocument6_put_onstoragecommit
,
3032 HTMLDocument6_get_onstoragecommit
,
3033 HTMLDocument6_getElementById
,
3034 HTMLDocument6_updateSettings
3037 static inline HTMLDocument
*impl_from_IHTMLDocument7(IHTMLDocument7
*iface
)
3039 return CONTAINING_RECORD(iface
, HTMLDocument
, IHTMLDocument7_iface
);
3042 static HRESULT WINAPI
HTMLDocument7_QueryInterface(IHTMLDocument7
*iface
, REFIID riid
, void **ppv
)
3044 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3045 return htmldoc_query_interface(This
, riid
, ppv
);
3048 static ULONG WINAPI
HTMLDocument7_AddRef(IHTMLDocument7
*iface
)
3050 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3051 return htmldoc_addref(This
);
3054 static ULONG WINAPI
HTMLDocument7_Release(IHTMLDocument7
*iface
)
3056 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3057 return htmldoc_release(This
);
3060 static HRESULT WINAPI
HTMLDocument7_GetTypeInfoCount(IHTMLDocument7
*iface
, UINT
*pctinfo
)
3062 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3063 return IDispatchEx_GetTypeInfoCount(&This
->IDispatchEx_iface
, pctinfo
);
3066 static HRESULT WINAPI
HTMLDocument7_GetTypeInfo(IHTMLDocument7
*iface
, UINT iTInfo
,
3067 LCID lcid
, ITypeInfo
**ppTInfo
)
3069 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3070 return IDispatchEx_GetTypeInfo(&This
->IDispatchEx_iface
, iTInfo
, lcid
, ppTInfo
);
3073 static HRESULT WINAPI
HTMLDocument7_GetIDsOfNames(IHTMLDocument7
*iface
, REFIID riid
,
3074 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3076 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3077 return IDispatchEx_GetIDsOfNames(&This
->IDispatchEx_iface
, riid
, rgszNames
, cNames
, lcid
,
3081 static HRESULT WINAPI
HTMLDocument7_Invoke(IHTMLDocument7
*iface
, DISPID dispIdMember
,
3082 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
3083 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
3085 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3086 return IDispatchEx_Invoke(&This
->IDispatchEx_iface
, dispIdMember
, riid
, lcid
, wFlags
,
3087 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3090 static HRESULT WINAPI
HTMLDocument7_get_defaultView(IHTMLDocument7
*iface
, IHTMLWindow2
**p
)
3092 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3093 FIXME("(%p)->(%p)\n", This
, p
);
3097 static HRESULT WINAPI
HTMLDocument7_createCDATASection(IHTMLDocument7
*iface
, BSTR text
, IHTMLDOMNode
**newCDATASectionNode
)
3099 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3100 FIXME("(%p)->(%p)\n", This
, newCDATASectionNode
);
3104 static HRESULT WINAPI
HTMLDocument7_getSelection(IHTMLDocument7
*iface
, IHTMLSelection
**ppIHTMLSelection
)
3106 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3107 FIXME("(%p)->(%p)\n", This
, ppIHTMLSelection
);
3111 static HRESULT WINAPI
HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
,
3112 BSTR bstrLocalName
, IHTMLElementCollection
**pelColl
)
3114 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3115 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrLocalName
), pelColl
);
3119 static HRESULT WINAPI
HTMLDocument7_createElementNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
, BSTR bstrTag
, IHTMLElement
**newElem
)
3121 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3122 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrTag
), newElem
);
3126 static HRESULT WINAPI
HTMLDocument7_createAttributeNS(IHTMLDocument7
*iface
, VARIANT
*pvarNS
,
3127 BSTR bstrAttrName
, IHTMLDOMAttribute
**ppAttribute
)
3129 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3130 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_variant(pvarNS
), debugstr_w(bstrAttrName
), ppAttribute
);
3134 static HRESULT WINAPI
HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7
*iface
, VARIANT v
)
3136 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3137 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3141 static HRESULT WINAPI
HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7
*iface
, VARIANT
*p
)
3143 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3144 FIXME("(%p)->(%p)\n", This
, p
);
3148 static HRESULT WINAPI
HTMLDocument7_get_characterSet(IHTMLDocument7
*iface
, BSTR
*p
)
3150 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3151 FIXME("(%p)->(%p)\n", This
, p
);
3155 static HRESULT WINAPI
HTMLDocument7_createElement(IHTMLDocument7
*iface
, BSTR bstrTag
, IHTMLElement
**newElem
)
3157 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3158 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrTag
), newElem
);
3162 static HRESULT WINAPI
HTMLDocument7_createAttribute(IHTMLDocument7
*iface
, BSTR bstrAttrName
, IHTMLDOMAttribute
**ppAttribute
)
3164 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3165 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(bstrAttrName
), ppAttribute
);
3169 static HRESULT WINAPI
HTMLDocument7_getElementByClassName(IHTMLDocument7
*iface
, BSTR v
, IHTMLElementCollection
**pel
)
3171 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3172 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(v
), pel
);
3176 static HRESULT WINAPI
HTMLDocument7_createProcessingInstruction(IHTMLDocument7
*iface
, BSTR target
,
3177 BSTR data
, IDOMProcessingInstruction
**newProcessingInstruction
)
3179 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3180 FIXME("(%p)->(%s %s %p)\n", This
, debugstr_w(target
), debugstr_w(data
), newProcessingInstruction
);
3184 static HRESULT WINAPI
HTMLDocument7_adoptNode(IHTMLDocument7
*iface
, IHTMLDOMNode
*pNodeSource
, IHTMLDOMNode3
**ppNodeDest
)
3186 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3187 FIXME("(%p)->(%p %p)\n", This
, pNodeSource
, ppNodeDest
);
3191 static HRESULT WINAPI
HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7
*iface
, VARIANT v
)
3193 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3194 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3198 static HRESULT WINAPI
HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7
*iface
, VARIANT
*p
)
3200 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3201 FIXME("(%p)->(%p)\n", This
, p
);
3205 static HRESULT WINAPI
HTMLDocument7_get_all(IHTMLDocument7
*iface
, IHTMLElementCollection
**p
)
3207 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3208 FIXME("(%p)->(%p)\n", This
, p
);
3212 static HRESULT WINAPI
HTMLDocument7_get_inputEncoding(IHTMLDocument7
*iface
, BSTR
*p
)
3214 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3215 FIXME("(%p)->(%p)\n", This
, p
);
3219 static HRESULT WINAPI
HTMLDocument7_get_xmlEncoding(IHTMLDocument7
*iface
, BSTR
*p
)
3221 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3222 FIXME("(%p)->(%p)\n", This
, p
);
3226 static HRESULT WINAPI
HTMLDocument7_put_xmlStandalone(IHTMLDocument7
*iface
, VARIANT_BOOL v
)
3228 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3229 FIXME("(%p)->(%x)\n", This
, v
);
3233 static HRESULT WINAPI
HTMLDocument7_get_xmlStandalone(IHTMLDocument7
*iface
, VARIANT_BOOL
*p
)
3235 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3236 FIXME("(%p)->(%p)\n", This
, p
);
3240 static HRESULT WINAPI
HTMLDocument7_put_xmlVersion(IHTMLDocument7
*iface
, BSTR v
)
3242 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3243 FIXME("(%p)->(%s)\n", This
, debugstr_w(v
));
3247 static HRESULT WINAPI
HTMLDocument7_get_xmlVersion(IHTMLDocument7
*iface
, BSTR
*p
)
3249 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3250 FIXME("(%p)->(%p)\n", This
, p
);
3254 static HRESULT WINAPI
HTMLDocument7_hasAttributes(IHTMLDocument7
*iface
, VARIANT_BOOL
*pfHasAttributes
)
3256 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3257 FIXME("(%p)->(%p)\n", This
, pfHasAttributes
);
3261 static HRESULT WINAPI
HTMLDocument7_put_onabort(IHTMLDocument7
*iface
, VARIANT v
)
3263 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3264 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3268 static HRESULT WINAPI
HTMLDocument7_get_onabort(IHTMLDocument7
*iface
, VARIANT
*p
)
3270 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3271 FIXME("(%p)->(%p)\n", This
, p
);
3275 static HRESULT WINAPI
HTMLDocument7_put_onblur(IHTMLDocument7
*iface
, VARIANT v
)
3277 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3278 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3282 static HRESULT WINAPI
HTMLDocument7_get_onblur(IHTMLDocument7
*iface
, VARIANT
*p
)
3284 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3285 FIXME("(%p)->(%p)\n", This
, p
);
3289 static HRESULT WINAPI
HTMLDocument7_put_oncanplay(IHTMLDocument7
*iface
, VARIANT v
)
3291 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3292 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3296 static HRESULT WINAPI
HTMLDocument7_get_oncanplay(IHTMLDocument7
*iface
, VARIANT
*p
)
3298 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3299 FIXME("(%p)->(%p)\n", This
, p
);
3303 static HRESULT WINAPI
HTMLDocument7_put_oncanplaythrough(IHTMLDocument7
*iface
, VARIANT v
)
3305 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3306 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3310 static HRESULT WINAPI
HTMLDocument7_get_oncanplaythrough(IHTMLDocument7
*iface
, VARIANT
*p
)
3312 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3313 FIXME("(%p)->(%p)\n", This
, p
);
3317 static HRESULT WINAPI
HTMLDocument7_put_onchange(IHTMLDocument7
*iface
, VARIANT v
)
3319 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3320 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3324 static HRESULT WINAPI
HTMLDocument7_get_onchange(IHTMLDocument7
*iface
, VARIANT
*p
)
3326 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3327 FIXME("(%p)->(%p)\n", This
, p
);
3331 static HRESULT WINAPI
HTMLDocument7_put_ondrag(IHTMLDocument7
*iface
, VARIANT v
)
3333 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3334 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3338 static HRESULT WINAPI
HTMLDocument7_get_ondrag(IHTMLDocument7
*iface
, VARIANT
*p
)
3340 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3341 FIXME("(%p)->(%p)\n", This
, p
);
3345 static HRESULT WINAPI
HTMLDocument7_put_ondragend(IHTMLDocument7
*iface
, VARIANT v
)
3347 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3348 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3352 static HRESULT WINAPI
HTMLDocument7_get_ondragend(IHTMLDocument7
*iface
, VARIANT
*p
)
3354 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3355 FIXME("(%p)->(%p)\n", This
, p
);
3359 static HRESULT WINAPI
HTMLDocument7_put_ondragenter(IHTMLDocument7
*iface
, VARIANT v
)
3361 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3362 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3366 static HRESULT WINAPI
HTMLDocument7_get_ondragenter(IHTMLDocument7
*iface
, VARIANT
*p
)
3368 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3369 FIXME("(%p)->(%p)\n", This
, p
);
3373 static HRESULT WINAPI
HTMLDocument7_put_ondragleave(IHTMLDocument7
*iface
, VARIANT v
)
3375 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3376 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3380 static HRESULT WINAPI
HTMLDocument7_get_ondragleave(IHTMLDocument7
*iface
, VARIANT
*p
)
3382 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3383 FIXME("(%p)->(%p)\n", This
, p
);
3387 static HRESULT WINAPI
HTMLDocument7_put_ondragover(IHTMLDocument7
*iface
, VARIANT v
)
3389 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3390 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3394 static HRESULT WINAPI
HTMLDocument7_get_ondragover(IHTMLDocument7
*iface
, VARIANT
*p
)
3396 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3397 FIXME("(%p)->(%p)\n", This
, p
);
3401 static HRESULT WINAPI
HTMLDocument7_put_ondrop(IHTMLDocument7
*iface
, VARIANT v
)
3403 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3404 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3408 static HRESULT WINAPI
HTMLDocument7_get_ondrop(IHTMLDocument7
*iface
, VARIANT
*p
)
3410 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3411 FIXME("(%p)->(%p)\n", This
, p
);
3415 static HRESULT WINAPI
HTMLDocument7_put_ondurationchange(IHTMLDocument7
*iface
, VARIANT v
)
3417 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3418 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3422 static HRESULT WINAPI
HTMLDocument7_get_ondurationchange(IHTMLDocument7
*iface
, VARIANT
*p
)
3424 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3425 FIXME("(%p)->(%p)\n", This
, p
);
3429 static HRESULT WINAPI
HTMLDocument7_put_onemptied(IHTMLDocument7
*iface
, VARIANT v
)
3431 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3432 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3436 static HRESULT WINAPI
HTMLDocument7_get_onemptied(IHTMLDocument7
*iface
, VARIANT
*p
)
3438 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3439 FIXME("(%p)->(%p)\n", This
, p
);
3443 static HRESULT WINAPI
HTMLDocument7_put_onended(IHTMLDocument7
*iface
, VARIANT v
)
3445 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3446 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3450 static HRESULT WINAPI
HTMLDocument7_get_onended(IHTMLDocument7
*iface
, VARIANT
*p
)
3452 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3453 FIXME("(%p)->(%p)\n", This
, p
);
3457 static HRESULT WINAPI
HTMLDocument7_put_onerror(IHTMLDocument7
*iface
, VARIANT v
)
3459 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3460 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3464 static HRESULT WINAPI
HTMLDocument7_get_onerror(IHTMLDocument7
*iface
, VARIANT
*p
)
3466 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3467 FIXME("(%p)->(%p)\n", This
, p
);
3471 static HRESULT WINAPI
HTMLDocument7_put_onfocus(IHTMLDocument7
*iface
, VARIANT v
)
3473 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3474 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3478 static HRESULT WINAPI
HTMLDocument7_get_onfocus(IHTMLDocument7
*iface
, VARIANT
*p
)
3480 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3481 FIXME("(%p)->(%p)\n", This
, p
);
3485 static HRESULT WINAPI
HTMLDocument7_put_oninput(IHTMLDocument7
*iface
, VARIANT v
)
3487 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3488 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3492 static HRESULT WINAPI
HTMLDocument7_get_oninput(IHTMLDocument7
*iface
, VARIANT
*p
)
3494 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3495 FIXME("(%p)->(%p)\n", This
, p
);
3499 static HRESULT WINAPI
HTMLDocument7_put_onload(IHTMLDocument7
*iface
, VARIANT v
)
3501 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3502 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3506 static HRESULT WINAPI
HTMLDocument7_get_onload(IHTMLDocument7
*iface
, VARIANT
*p
)
3508 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3509 FIXME("(%p)->(%p)\n", This
, p
);
3513 static HRESULT WINAPI
HTMLDocument7_put_onloadeddata(IHTMLDocument7
*iface
, VARIANT v
)
3515 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3516 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3520 static HRESULT WINAPI
HTMLDocument7_get_onloadeddata(IHTMLDocument7
*iface
, VARIANT
*p
)
3522 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3523 FIXME("(%p)->(%p)\n", This
, p
);
3527 static HRESULT WINAPI
HTMLDocument7_put_onloadedmetadata(IHTMLDocument7
*iface
, VARIANT v
)
3529 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3530 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3534 static HRESULT WINAPI
HTMLDocument7_get_onloadedmetadata(IHTMLDocument7
*iface
, VARIANT
*p
)
3536 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3537 FIXME("(%p)->(%p)\n", This
, p
);
3541 static HRESULT WINAPI
HTMLDocument7_put_onloadstart(IHTMLDocument7
*iface
, VARIANT v
)
3543 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3544 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3548 static HRESULT WINAPI
HTMLDocument7_get_onloadstart(IHTMLDocument7
*iface
, VARIANT
*p
)
3550 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3551 FIXME("(%p)->(%p)\n", This
, p
);
3555 static HRESULT WINAPI
HTMLDocument7_put_onpause(IHTMLDocument7
*iface
, VARIANT v
)
3557 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3558 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3562 static HRESULT WINAPI
HTMLDocument7_get_onpause(IHTMLDocument7
*iface
, VARIANT
*p
)
3564 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3565 FIXME("(%p)->(%p)\n", This
, p
);
3569 static HRESULT WINAPI
HTMLDocument7_put_onplay(IHTMLDocument7
*iface
, VARIANT v
)
3571 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3572 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3576 static HRESULT WINAPI
HTMLDocument7_get_onplay(IHTMLDocument7
*iface
, VARIANT
*p
)
3578 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3579 FIXME("(%p)->(%p)\n", This
, p
);
3583 static HRESULT WINAPI
HTMLDocument7_put_onplaying(IHTMLDocument7
*iface
, VARIANT v
)
3585 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3586 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3590 static HRESULT WINAPI
HTMLDocument7_get_onplaying(IHTMLDocument7
*iface
, VARIANT
*p
)
3592 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3593 FIXME("(%p)->(%p)\n", This
, p
);
3597 static HRESULT WINAPI
HTMLDocument7_put_onprogress(IHTMLDocument7
*iface
, VARIANT v
)
3599 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3600 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3604 static HRESULT WINAPI
HTMLDocument7_get_onprogress(IHTMLDocument7
*iface
, VARIANT
*p
)
3606 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3607 FIXME("(%p)->(%p)\n", This
, p
);
3611 static HRESULT WINAPI
HTMLDocument7_put_onratechange(IHTMLDocument7
*iface
, VARIANT v
)
3613 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3614 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3618 static HRESULT WINAPI
HTMLDocument7_get_onratechange(IHTMLDocument7
*iface
, VARIANT
*p
)
3620 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3621 FIXME("(%p)->(%p)\n", This
, p
);
3625 static HRESULT WINAPI
HTMLDocument7_put_onreset(IHTMLDocument7
*iface
, VARIANT v
)
3627 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3628 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3632 static HRESULT WINAPI
HTMLDocument7_get_onreset(IHTMLDocument7
*iface
, VARIANT
*p
)
3634 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3635 FIXME("(%p)->(%p)\n", This
, p
);
3639 static HRESULT WINAPI
HTMLDocument7_put_onscroll(IHTMLDocument7
*iface
, VARIANT v
)
3641 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3642 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3646 static HRESULT WINAPI
HTMLDocument7_get_onscroll(IHTMLDocument7
*iface
, VARIANT
*p
)
3648 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3649 FIXME("(%p)->(%p)\n", This
, p
);
3653 static HRESULT WINAPI
HTMLDocument7_put_onseekend(IHTMLDocument7
*iface
, VARIANT v
)
3655 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3656 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3660 static HRESULT WINAPI
HTMLDocument7_get_onseekend(IHTMLDocument7
*iface
, VARIANT
*p
)
3662 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3663 FIXME("(%p)->(%p)\n", This
, p
);
3667 static HRESULT WINAPI
HTMLDocument7_put_onseeking(IHTMLDocument7
*iface
, VARIANT v
)
3669 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3670 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3674 static HRESULT WINAPI
HTMLDocument7_get_onseeking(IHTMLDocument7
*iface
, VARIANT
*p
)
3676 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3677 FIXME("(%p)->(%p)\n", This
, p
);
3681 static HRESULT WINAPI
HTMLDocument7_put_onselect(IHTMLDocument7
*iface
, VARIANT v
)
3683 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3684 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3688 static HRESULT WINAPI
HTMLDocument7_get_onselect(IHTMLDocument7
*iface
, VARIANT
*p
)
3690 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3691 FIXME("(%p)->(%p)\n", This
, p
);
3695 static HRESULT WINAPI
HTMLDocument7_put_onstalled(IHTMLDocument7
*iface
, VARIANT v
)
3697 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3698 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3702 static HRESULT WINAPI
HTMLDocument7_get_onstalled(IHTMLDocument7
*iface
, VARIANT
*p
)
3704 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3705 FIXME("(%p)->(%p)\n", This
, p
);
3709 static HRESULT WINAPI
HTMLDocument7_put_onsubmit(IHTMLDocument7
*iface
, VARIANT v
)
3711 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3712 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3716 static HRESULT WINAPI
HTMLDocument7_get_onsubmit(IHTMLDocument7
*iface
, VARIANT
*p
)
3718 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3719 FIXME("(%p)->(%p)\n", This
, p
);
3723 static HRESULT WINAPI
HTMLDocument7_put_onsuspend(IHTMLDocument7
*iface
, VARIANT v
)
3725 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3726 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3730 static HRESULT WINAPI
HTMLDocument7_get_onsuspend(IHTMLDocument7
*iface
, VARIANT
*p
)
3732 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3733 FIXME("(%p)->(%p)\n", This
, p
);
3737 static HRESULT WINAPI
HTMLDocument7_put_ontimeupdate(IHTMLDocument7
*iface
, VARIANT v
)
3739 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3740 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3744 static HRESULT WINAPI
HTMLDocument7_get_ontimeupdate(IHTMLDocument7
*iface
, VARIANT
*p
)
3746 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3747 FIXME("(%p)->(%p)\n", This
, p
);
3751 static HRESULT WINAPI
HTMLDocument7_put_onvolumechange(IHTMLDocument7
*iface
, VARIANT v
)
3753 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3754 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3758 static HRESULT WINAPI
HTMLDocument7_get_onvolumechange(IHTMLDocument7
*iface
, VARIANT
*p
)
3760 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3761 FIXME("(%p)->(%p)\n", This
, p
);
3765 static HRESULT WINAPI
HTMLDocument7_put_onwaiting(IHTMLDocument7
*iface
, VARIANT v
)
3767 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3768 FIXME("(%p)->(%s)\n", This
, debugstr_variant(&v
));
3772 static HRESULT WINAPI
HTMLDocument7_get_onwaiting(IHTMLDocument7
*iface
, VARIANT
*p
)
3774 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3775 FIXME("(%p)->(%p)\n", This
, p
);
3779 static HRESULT WINAPI
HTMLDocument7_normalize(IHTMLDocument7
*iface
)
3781 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3782 FIXME("(%p)\n", This
);
3786 static HRESULT WINAPI
HTMLDocument7_importNode(IHTMLDocument7
*iface
, IHTMLDOMNode
*pNodeSource
,
3787 VARIANT_BOOL fDeep
, IHTMLDOMNode3
**ppNodeDest
)
3789 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3790 FIXME("(%p)->(%p %x %p)\n", This
, pNodeSource
, fDeep
, ppNodeDest
);
3794 static HRESULT WINAPI
HTMLDocument7_get_parentWindow(IHTMLDocument7
*iface
, IHTMLWindow2
**p
)
3796 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3797 FIXME("(%p)->(%p)\n", This
, p
);
3801 static HRESULT WINAPI
HTMLDocument7_put_body(IHTMLDocument7
*iface
, IHTMLElement
*v
)
3803 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3804 FIXME("(%p)->(%p)\n", This
, v
);
3808 static HRESULT WINAPI
HTMLDocument7_get_body(IHTMLDocument7
*iface
, IHTMLElement
**p
)
3810 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3811 FIXME("(%p)->(%p)\n", This
, p
);
3815 static HRESULT WINAPI
HTMLDocument7_get_head(IHTMLDocument7
*iface
, IHTMLElement
**p
)
3817 HTMLDocument
*This
= impl_from_IHTMLDocument7(iface
);
3818 FIXME("(%p)->(%p)\n", This
, p
);
3822 static const IHTMLDocument7Vtbl HTMLDocument7Vtbl
= {
3823 HTMLDocument7_QueryInterface
,
3824 HTMLDocument7_AddRef
,
3825 HTMLDocument7_Release
,
3826 HTMLDocument7_GetTypeInfoCount
,
3827 HTMLDocument7_GetTypeInfo
,
3828 HTMLDocument7_GetIDsOfNames
,
3829 HTMLDocument7_Invoke
,
3830 HTMLDocument7_get_defaultView
,
3831 HTMLDocument7_createCDATASection
,
3832 HTMLDocument7_getSelection
,
3833 HTMLDocument7_getElementsByTagNameNS
,
3834 HTMLDocument7_createElementNS
,
3835 HTMLDocument7_createAttributeNS
,
3836 HTMLDocument7_put_onmsthumbnailclick
,
3837 HTMLDocument7_get_onmsthumbnailclick
,
3838 HTMLDocument7_get_characterSet
,
3839 HTMLDocument7_createElement
,
3840 HTMLDocument7_createAttribute
,
3841 HTMLDocument7_getElementByClassName
,
3842 HTMLDocument7_createProcessingInstruction
,
3843 HTMLDocument7_adoptNode
,
3844 HTMLDocument7_put_onmssitemodejumplistitemremoved
,
3845 HTMLDocument7_get_onmssitemodejumplistitemremoved
,
3846 HTMLDocument7_get_all
,
3847 HTMLDocument7_get_inputEncoding
,
3848 HTMLDocument7_get_xmlEncoding
,
3849 HTMLDocument7_put_xmlStandalone
,
3850 HTMLDocument7_get_xmlStandalone
,
3851 HTMLDocument7_put_xmlVersion
,
3852 HTMLDocument7_get_xmlVersion
,
3853 HTMLDocument7_hasAttributes
,
3854 HTMLDocument7_put_onabort
,
3855 HTMLDocument7_get_onabort
,
3856 HTMLDocument7_put_onblur
,
3857 HTMLDocument7_get_onblur
,
3858 HTMLDocument7_put_oncanplay
,
3859 HTMLDocument7_get_oncanplay
,
3860 HTMLDocument7_put_oncanplaythrough
,
3861 HTMLDocument7_get_oncanplaythrough
,
3862 HTMLDocument7_put_onchange
,
3863 HTMLDocument7_get_onchange
,
3864 HTMLDocument7_put_ondrag
,
3865 HTMLDocument7_get_ondrag
,
3866 HTMLDocument7_put_ondragend
,
3867 HTMLDocument7_get_ondragend
,
3868 HTMLDocument7_put_ondragenter
,
3869 HTMLDocument7_get_ondragenter
,
3870 HTMLDocument7_put_ondragleave
,
3871 HTMLDocument7_get_ondragleave
,
3872 HTMLDocument7_put_ondragover
,
3873 HTMLDocument7_get_ondragover
,
3874 HTMLDocument7_put_ondrop
,
3875 HTMLDocument7_get_ondrop
,
3876 HTMLDocument7_put_ondurationchange
,
3877 HTMLDocument7_get_ondurationchange
,
3878 HTMLDocument7_put_onemptied
,
3879 HTMLDocument7_get_onemptied
,
3880 HTMLDocument7_put_onended
,
3881 HTMLDocument7_get_onended
,
3882 HTMLDocument7_put_onerror
,
3883 HTMLDocument7_get_onerror
,
3884 HTMLDocument7_put_onfocus
,
3885 HTMLDocument7_get_onfocus
,
3886 HTMLDocument7_put_oninput
,
3887 HTMLDocument7_get_oninput
,
3888 HTMLDocument7_put_onload
,
3889 HTMLDocument7_get_onload
,
3890 HTMLDocument7_put_onloadeddata
,
3891 HTMLDocument7_get_onloadeddata
,
3892 HTMLDocument7_put_onloadedmetadata
,
3893 HTMLDocument7_get_onloadedmetadata
,
3894 HTMLDocument7_put_onloadstart
,
3895 HTMLDocument7_get_onloadstart
,
3896 HTMLDocument7_put_onpause
,
3897 HTMLDocument7_get_onpause
,
3898 HTMLDocument7_put_onplay
,
3899 HTMLDocument7_get_onplay
,
3900 HTMLDocument7_put_onplaying
,
3901 HTMLDocument7_get_onplaying
,
3902 HTMLDocument7_put_onprogress
,
3903 HTMLDocument7_get_onprogress
,
3904 HTMLDocument7_put_onratechange
,
3905 HTMLDocument7_get_onratechange
,
3906 HTMLDocument7_put_onreset
,
3907 HTMLDocument7_get_onreset
,
3908 HTMLDocument7_put_onscroll
,
3909 HTMLDocument7_get_onscroll
,
3910 HTMLDocument7_put_onseekend
,
3911 HTMLDocument7_get_onseekend
,
3912 HTMLDocument7_put_onseeking
,
3913 HTMLDocument7_get_onseeking
,
3914 HTMLDocument7_put_onselect
,
3915 HTMLDocument7_get_onselect
,
3916 HTMLDocument7_put_onstalled
,
3917 HTMLDocument7_get_onstalled
,
3918 HTMLDocument7_put_onsubmit
,
3919 HTMLDocument7_get_onsubmit
,
3920 HTMLDocument7_put_onsuspend
,
3921 HTMLDocument7_get_onsuspend
,
3922 HTMLDocument7_put_ontimeupdate
,
3923 HTMLDocument7_get_ontimeupdate
,
3924 HTMLDocument7_put_onvolumechange
,
3925 HTMLDocument7_get_onvolumechange
,
3926 HTMLDocument7_put_onwaiting
,
3927 HTMLDocument7_get_onwaiting
,
3928 HTMLDocument7_normalize
,
3929 HTMLDocument7_importNode
,
3930 HTMLDocument7_get_parentWindow
,
3931 HTMLDocument7_put_body
,
3932 HTMLDocument7_get_body
,
3933 HTMLDocument7_get_head
3936 static void HTMLDocument_on_advise(IUnknown
*iface
, cp_static_data_t
*cp
)
3938 HTMLDocument
*This
= impl_from_IHTMLDocument2((IHTMLDocument2
*)iface
);
3941 update_doc_cp_events(This
->doc_node
, cp
);
3944 static inline HTMLDocument
*impl_from_ISupportErrorInfo(ISupportErrorInfo
*iface
)
3946 return CONTAINING_RECORD(iface
, HTMLDocument
, ISupportErrorInfo_iface
);
3949 static HRESULT WINAPI
SupportErrorInfo_QueryInterface(ISupportErrorInfo
*iface
, REFIID riid
, void **ppv
)
3951 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3952 return htmldoc_query_interface(This
, riid
, ppv
);
3955 static ULONG WINAPI
SupportErrorInfo_AddRef(ISupportErrorInfo
*iface
)
3957 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3958 return htmldoc_addref(This
);
3961 static ULONG WINAPI
SupportErrorInfo_Release(ISupportErrorInfo
*iface
)
3963 HTMLDocument
*This
= impl_from_ISupportErrorInfo(iface
);
3964 return htmldoc_release(This
);
3967 static HRESULT WINAPI
SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo
*iface
, REFIID riid
)
3969 FIXME("(%p)->(%s)\n", iface
, debugstr_mshtml_guid(riid
));
3973 static const ISupportErrorInfoVtbl SupportErrorInfoVtbl
= {
3974 SupportErrorInfo_QueryInterface
,
3975 SupportErrorInfo_AddRef
,
3976 SupportErrorInfo_Release
,
3977 SupportErrorInfo_InterfaceSupportsErrorInfo
3980 static inline HTMLDocument
*impl_from_IDispatchEx(IDispatchEx
*iface
)
3982 return CONTAINING_RECORD(iface
, HTMLDocument
, IDispatchEx_iface
);
3985 static HRESULT
dispid_from_elem_name(HTMLDocumentNode
*This
, BSTR name
, DISPID
*dispid
)
3987 nsIDOMNodeList
*node_list
;
3994 return DISP_E_UNKNOWNNAME
;
3996 nsAString_InitDepend(&name_str
, name
);
3997 nsres
= nsIDOMHTMLDocument_GetElementsByName(This
->nsdoc
, &name_str
, &node_list
);
3998 nsAString_Finish(&name_str
);
3999 if(NS_FAILED(nsres
))
4002 nsres
= nsIDOMNodeList_GetLength(node_list
, &len
);
4003 nsIDOMNodeList_Release(node_list
);
4004 if(NS_FAILED(nsres
))
4008 return DISP_E_UNKNOWNNAME
;
4010 for(i
=0; i
< This
->elem_vars_cnt
; i
++) {
4011 if(!strcmpW(name
, This
->elem_vars
[i
])) {
4012 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+i
;
4017 if(This
->elem_vars_cnt
== This
->elem_vars_size
) {
4020 if(This
->elem_vars_size
) {
4021 new_vars
= heap_realloc(This
->elem_vars
, This
->elem_vars_size
*2*sizeof(WCHAR
*));
4023 return E_OUTOFMEMORY
;
4024 This
->elem_vars_size
*= 2;
4026 new_vars
= heap_alloc(16*sizeof(WCHAR
*));
4028 return E_OUTOFMEMORY
;
4029 This
->elem_vars_size
= 16;
4032 This
->elem_vars
= new_vars
;
4035 This
->elem_vars
[This
->elem_vars_cnt
] = heap_strdupW(name
);
4036 if(!This
->elem_vars
[This
->elem_vars_cnt
])
4037 return E_OUTOFMEMORY
;
4039 *dispid
= MSHTML_DISPID_CUSTOM_MIN
+This
->elem_vars_cnt
++;
4043 static HRESULT WINAPI
DocDispatchEx_QueryInterface(IDispatchEx
*iface
, REFIID riid
, void **ppv
)
4045 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4047 return htmldoc_query_interface(This
, riid
, ppv
);
4050 static ULONG WINAPI
DocDispatchEx_AddRef(IDispatchEx
*iface
)
4052 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4054 return htmldoc_addref(This
);
4057 static ULONG WINAPI
DocDispatchEx_Release(IDispatchEx
*iface
)
4059 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4061 return htmldoc_release(This
);
4064 static HRESULT WINAPI
DocDispatchEx_GetTypeInfoCount(IDispatchEx
*iface
, UINT
*pctinfo
)
4066 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4068 return IDispatchEx_GetTypeInfoCount(This
->dispex
, pctinfo
);
4071 static HRESULT WINAPI
DocDispatchEx_GetTypeInfo(IDispatchEx
*iface
, UINT iTInfo
,
4072 LCID lcid
, ITypeInfo
**ppTInfo
)
4074 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4076 return IDispatchEx_GetTypeInfo(This
->dispex
, iTInfo
, lcid
, ppTInfo
);
4079 static HRESULT WINAPI
DocDispatchEx_GetIDsOfNames(IDispatchEx
*iface
, REFIID riid
,
4080 LPOLESTR
*rgszNames
, UINT cNames
,
4081 LCID lcid
, DISPID
*rgDispId
)
4083 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4085 return IDispatchEx_GetIDsOfNames(This
->dispex
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4088 static HRESULT WINAPI
DocDispatchEx_Invoke(IDispatchEx
*iface
, DISPID dispIdMember
,
4089 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
4090 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
4092 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4094 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
4095 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
4097 switch(dispIdMember
) {
4098 case DISPID_READYSTATE
:
4099 TRACE("DISPID_READYSTATE\n");
4101 if(!(wFlags
& DISPATCH_PROPERTYGET
))
4102 return E_INVALIDARG
;
4104 V_VT(pVarResult
) = VT_I4
;
4105 V_I4(pVarResult
) = This
->window
->readystate
;
4109 return IDispatchEx_Invoke(This
->dispex
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
,
4110 pVarResult
, pExcepInfo
, puArgErr
);
4113 static HRESULT WINAPI
DocDispatchEx_GetDispID(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
, DISPID
*pid
)
4115 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4118 hres
= IDispatchEx_GetDispID(This
->dispex
, bstrName
, grfdex
, pid
);
4119 if(hres
!= DISP_E_UNKNOWNNAME
)
4122 return dispid_from_elem_name(This
->doc_node
, bstrName
, pid
);
4125 static HRESULT WINAPI
DocDispatchEx_InvokeEx(IDispatchEx
*iface
, DISPID id
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pdp
,
4126 VARIANT
*pvarRes
, EXCEPINFO
*pei
, IServiceProvider
*pspCaller
)
4128 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4130 if(This
->window
&& id
== DISPID_IHTMLDOCUMENT2_LOCATION
&& (wFlags
& DISPATCH_PROPERTYPUT
))
4131 return IDispatchEx_InvokeEx(&This
->window
->base
.IDispatchEx_iface
, DISPID_IHTMLWINDOW2_LOCATION
,
4132 lcid
, wFlags
, pdp
, pvarRes
, pei
, pspCaller
);
4135 return IDispatchEx_InvokeEx(This
->dispex
, id
, lcid
, wFlags
, pdp
, pvarRes
, pei
, pspCaller
);
4138 static HRESULT WINAPI
DocDispatchEx_DeleteMemberByName(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
)
4140 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4142 return IDispatchEx_DeleteMemberByName(This
->dispex
, bstrName
, grfdex
);
4145 static HRESULT WINAPI
DocDispatchEx_DeleteMemberByDispID(IDispatchEx
*iface
, DISPID id
)
4147 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4149 return IDispatchEx_DeleteMemberByDispID(This
->dispex
, id
);
4152 static HRESULT WINAPI
DocDispatchEx_GetMemberProperties(IDispatchEx
*iface
, DISPID id
, DWORD grfdexFetch
, DWORD
*pgrfdex
)
4154 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4156 return IDispatchEx_GetMemberProperties(This
->dispex
, id
, grfdexFetch
, pgrfdex
);
4159 static HRESULT WINAPI
DocDispatchEx_GetMemberName(IDispatchEx
*iface
, DISPID id
, BSTR
*pbstrName
)
4161 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4163 return IDispatchEx_GetMemberName(This
->dispex
, id
, pbstrName
);
4166 static HRESULT WINAPI
DocDispatchEx_GetNextDispID(IDispatchEx
*iface
, DWORD grfdex
, DISPID id
, DISPID
*pid
)
4168 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4170 return IDispatchEx_GetNextDispID(This
->dispex
, grfdex
, id
, pid
);
4173 static HRESULT WINAPI
DocDispatchEx_GetNameSpaceParent(IDispatchEx
*iface
, IUnknown
**ppunk
)
4175 HTMLDocument
*This
= impl_from_IDispatchEx(iface
);
4177 return IDispatchEx_GetNameSpaceParent(This
->dispex
, ppunk
);
4180 static const IDispatchExVtbl DocDispatchExVtbl
= {
4181 DocDispatchEx_QueryInterface
,
4182 DocDispatchEx_AddRef
,
4183 DocDispatchEx_Release
,
4184 DocDispatchEx_GetTypeInfoCount
,
4185 DocDispatchEx_GetTypeInfo
,
4186 DocDispatchEx_GetIDsOfNames
,
4187 DocDispatchEx_Invoke
,
4188 DocDispatchEx_GetDispID
,
4189 DocDispatchEx_InvokeEx
,
4190 DocDispatchEx_DeleteMemberByName
,
4191 DocDispatchEx_DeleteMemberByDispID
,
4192 DocDispatchEx_GetMemberProperties
,
4193 DocDispatchEx_GetMemberName
,
4194 DocDispatchEx_GetNextDispID
,
4195 DocDispatchEx_GetNameSpaceParent
4198 static inline HTMLDocument
*impl_from_IProvideClassInfo(IProvideClassInfo
*iface
)
4200 return CONTAINING_RECORD(iface
, HTMLDocument
, IProvideClassInfo_iface
);
4203 static HRESULT WINAPI
ProvideClassInfo_QueryInterface(IProvideClassInfo
*iface
,
4204 REFIID riid
, void **ppv
)
4206 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4207 return htmldoc_query_interface(This
, riid
, ppv
);
4210 static ULONG WINAPI
ProvideClassInfo_AddRef(IProvideClassInfo
*iface
)
4212 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4213 return htmldoc_addref(This
);
4216 static ULONG WINAPI
ProvideClassInfo_Release(IProvideClassInfo
*iface
)
4218 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4219 return htmldoc_release(This
);
4222 static HRESULT WINAPI
ProvideClassInfo_GetClassInfo(IProvideClassInfo
* iface
,
4225 HTMLDocument
*This
= impl_from_IProvideClassInfo(iface
);
4226 TRACE("(%p)->(%p)\n", This
, ppTI
);
4227 return get_htmldoc_classinfo(ppTI
);
4230 static const IProvideClassInfoVtbl ProvideClassInfoVtbl
= {
4231 ProvideClassInfo_QueryInterface
,
4232 ProvideClassInfo_AddRef
,
4233 ProvideClassInfo_Release
,
4234 ProvideClassInfo_GetClassInfo
4237 static BOOL
htmldoc_qi(HTMLDocument
*This
, REFIID riid
, void **ppv
)
4241 if(IsEqualGUID(&IID_IUnknown
, riid
))
4242 *ppv
= &This
->IHTMLDocument2_iface
;
4243 else if(IsEqualGUID(&IID_IDispatch
, riid
))
4244 *ppv
= &This
->IDispatchEx_iface
;
4245 else if(IsEqualGUID(&IID_IDispatchEx
, riid
))
4246 *ppv
= &This
->IDispatchEx_iface
;
4247 else if(IsEqualGUID(&IID_IHTMLDocument
, riid
))
4248 *ppv
= &This
->IHTMLDocument2_iface
;
4249 else if(IsEqualGUID(&IID_IHTMLDocument2
, riid
))
4250 *ppv
= &This
->IHTMLDocument2_iface
;
4251 else if(IsEqualGUID(&IID_IHTMLDocument3
, riid
))
4252 *ppv
= &This
->IHTMLDocument3_iface
;
4253 else if(IsEqualGUID(&IID_IHTMLDocument4
, riid
))
4254 *ppv
= &This
->IHTMLDocument4_iface
;
4255 else if(IsEqualGUID(&IID_IHTMLDocument5
, riid
))
4256 *ppv
= &This
->IHTMLDocument5_iface
;
4257 else if(IsEqualGUID(&IID_IHTMLDocument6
, riid
))
4258 *ppv
= &This
->IHTMLDocument6_iface
;
4259 else if(IsEqualGUID(&IID_IHTMLDocument7
, riid
))
4260 *ppv
= &This
->IHTMLDocument7_iface
;
4261 else if(IsEqualGUID(&IID_IPersist
, riid
))
4262 *ppv
= &This
->IPersistFile_iface
;
4263 else if(IsEqualGUID(&IID_IPersistMoniker
, riid
))
4264 *ppv
= &This
->IPersistMoniker_iface
;
4265 else if(IsEqualGUID(&IID_IPersistFile
, riid
))
4266 *ppv
= &This
->IPersistFile_iface
;
4267 else if(IsEqualGUID(&IID_IMonikerProp
, riid
))
4268 *ppv
= &This
->IMonikerProp_iface
;
4269 else if(IsEqualGUID(&IID_IOleObject
, riid
))
4270 *ppv
= &This
->IOleObject_iface
;
4271 else if(IsEqualGUID(&IID_IOleDocument
, riid
))
4272 *ppv
= &This
->IOleDocument_iface
;
4273 else if(IsEqualGUID(&IID_IOleDocumentView
, riid
))
4274 *ppv
= &This
->IOleDocumentView_iface
;
4275 else if(IsEqualGUID(&IID_IOleInPlaceActiveObject
, riid
))
4276 *ppv
= &This
->IOleInPlaceActiveObject_iface
;
4277 else if(IsEqualGUID(&IID_IViewObject
, riid
))
4278 *ppv
= &This
->IViewObjectEx_iface
;
4279 else if(IsEqualGUID(&IID_IViewObject2
, riid
))
4280 *ppv
= &This
->IViewObjectEx_iface
;
4281 else if(IsEqualGUID(&IID_IViewObjectEx
, riid
))
4282 *ppv
= &This
->IViewObjectEx_iface
;
4283 else if(IsEqualGUID(&IID_IOleWindow
, riid
))
4284 *ppv
= &This
->IOleInPlaceActiveObject_iface
;
4285 else if(IsEqualGUID(&IID_IOleInPlaceObject
, riid
))
4286 *ppv
= &This
->IOleInPlaceObjectWindowless_iface
;
4287 else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless
, riid
))
4288 *ppv
= &This
->IOleInPlaceObjectWindowless_iface
;
4289 else if(IsEqualGUID(&IID_IServiceProvider
, riid
))
4290 *ppv
= &This
->IServiceProvider_iface
;
4291 else if(IsEqualGUID(&IID_IOleCommandTarget
, riid
))
4292 *ppv
= &This
->IOleCommandTarget_iface
;
4293 else if(IsEqualGUID(&IID_IOleControl
, riid
))
4294 *ppv
= &This
->IOleControl_iface
;
4295 else if(IsEqualGUID(&IID_IHlinkTarget
, riid
))
4296 *ppv
= &This
->IHlinkTarget_iface
;
4297 else if(IsEqualGUID(&IID_IConnectionPointContainer
, riid
))
4298 *ppv
= &This
->cp_container
.IConnectionPointContainer_iface
;
4299 else if(IsEqualGUID(&IID_IPersistStreamInit
, riid
))
4300 *ppv
= &This
->IPersistStreamInit_iface
;
4301 else if(IsEqualGUID(&DIID_DispHTMLDocument
, riid
))
4302 *ppv
= &This
->IHTMLDocument2_iface
;
4303 else if(IsEqualGUID(&IID_ISupportErrorInfo
, riid
))
4304 *ppv
= &This
->ISupportErrorInfo_iface
;
4305 else if(IsEqualGUID(&IID_IPersistHistory
, riid
))
4306 *ppv
= &This
->IPersistHistory_iface
;
4307 else if(IsEqualGUID(&IID_IObjectWithSite
, riid
))
4308 *ppv
= &This
->IObjectWithSite_iface
;
4309 else if(IsEqualGUID(&IID_IOleContainer
, riid
))
4310 *ppv
= &This
->IOleContainer_iface
;
4311 else if(IsEqualGUID(&IID_IObjectSafety
, riid
))
4312 *ppv
= &This
->IObjectSafety_iface
;
4313 else if(IsEqualGUID(&IID_IProvideClassInfo
, riid
))
4314 *ppv
= &This
->IProvideClassInfo_iface
;
4315 else if(IsEqualGUID(&CLSID_CMarkup
, riid
)) {
4316 FIXME("(%p)->(CLSID_CMarkup %p)\n", This
, ppv
);
4318 }else if(IsEqualGUID(&IID_IRunnableObject
, riid
)) {
4319 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This
, ppv
);
4321 }else if(IsEqualGUID(&IID_IPersistPropertyBag
, riid
)) {
4322 TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This
, ppv
);
4324 }else if(IsEqualGUID(&IID_IMarshal
, riid
)) {
4325 TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This
, ppv
);
4327 }else if(IsEqualGUID(&IID_IExternalConnection
, riid
)) {
4328 TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This
, ppv
);
4330 }else if(IsEqualGUID(&IID_IStdMarshalInfo
, riid
)) {
4331 TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This
, ppv
);
4338 IUnknown_AddRef((IUnknown
*)*ppv
);
4342 static cp_static_data_t HTMLDocumentEvents_data
= { HTMLDocumentEvents_tid
, HTMLDocument_on_advise
};
4344 static const cpc_entry_t HTMLDocument_cpc
[] = {
4345 {&IID_IDispatch
, &HTMLDocumentEvents_data
},
4346 {&IID_IPropertyNotifySink
},
4347 {&DIID_HTMLDocumentEvents
, &HTMLDocumentEvents_data
},
4348 {&DIID_HTMLDocumentEvents2
},
4352 static void init_doc(HTMLDocument
*doc
, IUnknown
*unk_impl
, IDispatchEx
*dispex
)
4354 doc
->IHTMLDocument2_iface
.lpVtbl
= &HTMLDocumentVtbl
;
4355 doc
->IHTMLDocument3_iface
.lpVtbl
= &HTMLDocument3Vtbl
;
4356 doc
->IHTMLDocument4_iface
.lpVtbl
= &HTMLDocument4Vtbl
;
4357 doc
->IHTMLDocument5_iface
.lpVtbl
= &HTMLDocument5Vtbl
;
4358 doc
->IHTMLDocument6_iface
.lpVtbl
= &HTMLDocument6Vtbl
;
4359 doc
->IHTMLDocument7_iface
.lpVtbl
= &HTMLDocument7Vtbl
;
4360 doc
->IDispatchEx_iface
.lpVtbl
= &DocDispatchExVtbl
;
4361 doc
->ISupportErrorInfo_iface
.lpVtbl
= &SupportErrorInfoVtbl
;
4362 doc
->IProvideClassInfo_iface
.lpVtbl
= &ProvideClassInfoVtbl
;
4364 doc
->unk_impl
= unk_impl
;
4365 doc
->dispex
= dispex
;
4366 doc
->task_magic
= get_task_target_magic();
4368 HTMLDocument_Persist_Init(doc
);
4369 HTMLDocument_OleCmd_Init(doc
);
4370 HTMLDocument_OleObj_Init(doc
);
4371 HTMLDocument_View_Init(doc
);
4372 HTMLDocument_Window_Init(doc
);
4373 HTMLDocument_Service_Init(doc
);
4374 HTMLDocument_Hlink_Init(doc
);
4376 ConnectionPointContainer_Init(&doc
->cp_container
, (IUnknown
*)&doc
->IHTMLDocument2_iface
, HTMLDocument_cpc
);
4379 static void destroy_htmldoc(HTMLDocument
*This
)
4381 remove_target_tasks(This
->task_magic
);
4383 ConnectionPointContainer_Destroy(&This
->cp_container
);
4386 static inline HTMLDocumentNode
*impl_from_HTMLDOMNode(HTMLDOMNode
*iface
)
4388 return CONTAINING_RECORD(iface
, HTMLDocumentNode
, node
);
4391 static HRESULT
HTMLDocumentNode_QI(HTMLDOMNode
*iface
, REFIID riid
, void **ppv
)
4393 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4395 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
4397 if(htmldoc_qi(&This
->basedoc
, riid
, ppv
))
4398 return *ppv
? S_OK
: E_NOINTERFACE
;
4400 if(IsEqualGUID(&IID_IInternetHostSecurityManager
, riid
))
4401 *ppv
= &This
->IInternetHostSecurityManager_iface
;
4403 return HTMLDOMNode_QI(&This
->node
, riid
, ppv
);
4405 IUnknown_AddRef((IUnknown
*)*ppv
);
4409 static void HTMLDocumentNode_destructor(HTMLDOMNode
*iface
)
4411 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4414 for(i
=0; i
< This
->elem_vars_cnt
; i
++)
4415 heap_free(This
->elem_vars
[i
]);
4416 heap_free(This
->elem_vars
);
4418 detach_events(This
);
4419 if(This
->body_event_target
)
4420 release_event_target(This
->body_event_target
);
4422 ICatInformation_Release(This
->catmgr
);
4424 detach_selection(This
);
4425 detach_ranges(This
);
4427 while(!list_empty(&This
->plugin_hosts
))
4428 detach_plugin_host(LIST_ENTRY(list_head(&This
->plugin_hosts
), PluginHost
, entry
));
4430 if(!This
->nsdoc
&& This
->window
) {
4431 /* document fragments own reference to inner window */
4432 IHTMLWindow2_Release(&This
->window
->base
.IHTMLWindow2_iface
);
4433 This
->window
= NULL
;
4436 heap_free(This
->event_vector
);
4437 destroy_htmldoc(&This
->basedoc
);
4440 static HRESULT
HTMLDocumentNode_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
4442 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4443 FIXME("%p\n", This
);
4447 static void HTMLDocumentNode_traverse(HTMLDOMNode
*iface
, nsCycleCollectionTraversalCallback
*cb
)
4449 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4452 note_cc_edge((nsISupports
*)This
->nsdoc
, "This->nsdoc", cb
);
4455 static void HTMLDocumentNode_unlink(HTMLDOMNode
*iface
)
4457 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4460 nsIDOMHTMLDocument
*nsdoc
= This
->nsdoc
;
4462 release_document_mutation(This
);
4464 nsIDOMHTMLDocument_Release(nsdoc
);
4465 This
->window
= NULL
;
4469 static const NodeImplVtbl HTMLDocumentNodeImplVtbl
= {
4470 HTMLDocumentNode_QI
,
4471 HTMLDocumentNode_destructor
,
4473 HTMLDocumentNode_clone
,
4485 HTMLDocumentNode_traverse
,
4486 HTMLDocumentNode_unlink
4489 static HRESULT
HTMLDocumentFragment_clone(HTMLDOMNode
*iface
, nsIDOMNode
*nsnode
, HTMLDOMNode
**ret
)
4491 HTMLDocumentNode
*This
= impl_from_HTMLDOMNode(iface
);
4492 HTMLDocumentNode
*new_node
;
4495 hres
= create_document_fragment(nsnode
, This
->node
.doc
, &new_node
);
4499 *ret
= &new_node
->node
;
4503 static inline HTMLDocumentNode
*impl_from_DispatchEx(DispatchEx
*iface
)
4505 return CONTAINING_RECORD(iface
, HTMLDocumentNode
, node
.event_target
.dispex
);
4508 static HRESULT
HTMLDocumentNode_invoke(DispatchEx
*dispex
, DISPID id
, LCID lcid
, WORD flags
, DISPPARAMS
*params
,
4509 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
)
4511 HTMLDocumentNode
*This
= impl_from_DispatchEx(dispex
);
4512 nsIDOMNodeList
*node_list
;
4520 if(flags
!= DISPATCH_PROPERTYGET
&& flags
!= (DISPATCH_METHOD
|DISPATCH_PROPERTYGET
)) {
4521 FIXME("unsupported flags %x\n", flags
);
4525 i
= id
- MSHTML_DISPID_CUSTOM_MIN
;
4527 if(!This
->nsdoc
|| i
>= This
->elem_vars_cnt
)
4528 return DISP_E_UNKNOWNNAME
;
4530 nsAString_InitDepend(&name_str
, This
->elem_vars
[i
]);
4531 nsres
= nsIDOMHTMLDocument_GetElementsByName(This
->nsdoc
, &name_str
, &node_list
);
4532 nsAString_Finish(&name_str
);
4533 if(NS_FAILED(nsres
))
4536 nsres
= nsIDOMNodeList_Item(node_list
, 0, &nsnode
);
4537 nsIDOMNodeList_Release(node_list
);
4538 if(NS_FAILED(nsres
) || !nsnode
)
4539 return DISP_E_UNKNOWNNAME
;
4541 hres
= get_node(This
, nsnode
, TRUE
, &node
);
4545 V_VT(res
) = VT_DISPATCH
;
4546 V_DISPATCH(res
) = (IDispatch
*)&node
->IHTMLDOMNode_iface
;
4550 static void HTMLDocumentNode_bind_event(DispatchEx
*dispex
, int eid
)
4552 HTMLDocumentNode
*This
= impl_from_DispatchEx(dispex
);
4553 ensure_doc_nsevent_handler(This
, eid
);
4556 static const dispex_static_data_vtbl_t HTMLDocumentNode_dispex_vtbl
= {
4559 HTMLDocumentNode_invoke
,
4562 HTMLDocumentNode_bind_event
4565 static const NodeImplVtbl HTMLDocumentFragmentImplVtbl
= {
4566 HTMLDocumentNode_QI
,
4567 HTMLDocumentNode_destructor
,
4569 HTMLDocumentFragment_clone
4572 static const tid_t HTMLDocumentNode_iface_tids
[] = {
4582 static dispex_static_data_t HTMLDocumentNode_dispex
= {
4583 &HTMLDocumentNode_dispex_vtbl
,
4584 DispHTMLDocument_tid
,
4586 HTMLDocumentNode_iface_tids
4589 static HTMLDocumentNode
*alloc_doc_node(HTMLDocumentObj
*doc_obj
, HTMLInnerWindow
*window
)
4591 HTMLDocumentNode
*doc
;
4593 doc
= heap_alloc_zero(sizeof(HTMLDocumentNode
));
4598 doc
->basedoc
.doc_node
= doc
;
4599 doc
->basedoc
.doc_obj
= doc_obj
;
4600 doc
->basedoc
.window
= window
->base
.outer_window
;
4601 doc
->window
= window
;
4603 init_dispex(&doc
->node
.event_target
.dispex
, (IUnknown
*)&doc
->node
.IHTMLDOMNode_iface
,
4604 &HTMLDocumentNode_dispex
);
4605 init_doc(&doc
->basedoc
, (IUnknown
*)&doc
->node
.IHTMLDOMNode_iface
,
4606 &doc
->node
.event_target
.dispex
.IDispatchEx_iface
);
4607 HTMLDocumentNode_SecMgr_Init(doc
);
4609 list_init(&doc
->selection_list
);
4610 list_init(&doc
->range_list
);
4611 list_init(&doc
->plugin_hosts
);
4616 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*nsdoc
, HTMLDocumentObj
*doc_obj
, HTMLInnerWindow
*window
, HTMLDocumentNode
**ret
)
4618 HTMLDocumentNode
*doc
;
4620 doc
= alloc_doc_node(doc_obj
, window
);
4622 return E_OUTOFMEMORY
;
4624 if(!doc_obj
->basedoc
.window
|| window
->base
.outer_window
== doc_obj
->basedoc
.window
)
4625 doc
->basedoc
.cp_container
.forward_container
= &doc_obj
->basedoc
.cp_container
;
4627 HTMLDOMNode_Init(doc
, &doc
->node
, (nsIDOMNode
*)nsdoc
);
4629 nsIDOMHTMLDocument_AddRef(nsdoc
);
4632 init_document_mutation(doc
);
4633 doc_init_events(doc
);
4635 doc
->node
.vtbl
= &HTMLDocumentNodeImplVtbl
;
4636 doc
->node
.cp_container
= &doc
->basedoc
.cp_container
;
4642 static HRESULT
create_document_fragment(nsIDOMNode
*nsnode
, HTMLDocumentNode
*doc_node
, HTMLDocumentNode
**ret
)
4644 HTMLDocumentNode
*doc_frag
;
4646 doc_frag
= alloc_doc_node(doc_node
->basedoc
.doc_obj
, doc_node
->window
);
4648 return E_OUTOFMEMORY
;
4650 IHTMLWindow2_AddRef(&doc_frag
->window
->base
.IHTMLWindow2_iface
);
4652 HTMLDOMNode_Init(doc_node
, &doc_frag
->node
, nsnode
);
4653 doc_frag
->node
.vtbl
= &HTMLDocumentFragmentImplVtbl
;
4654 doc_frag
->node
.cp_container
= &doc_frag
->basedoc
.cp_container
;
4660 /**********************************************************
4661 * ICustomDoc implementation
4664 static inline HTMLDocumentObj
*impl_from_ICustomDoc(ICustomDoc
*iface
)
4666 return CONTAINING_RECORD(iface
, HTMLDocumentObj
, ICustomDoc_iface
);
4669 static HRESULT WINAPI
CustomDoc_QueryInterface(ICustomDoc
*iface
, REFIID riid
, void **ppv
)
4671 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4673 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
4675 if(htmldoc_qi(&This
->basedoc
, riid
, ppv
))
4676 return *ppv
? S_OK
: E_NOINTERFACE
;
4678 if(IsEqualGUID(&IID_ICustomDoc
, riid
)) {
4679 *ppv
= &This
->ICustomDoc_iface
;
4680 }else if(IsEqualGUID(&IID_ITargetContainer
, riid
)) {
4681 *ppv
= &This
->ITargetContainer_iface
;
4682 }else if(dispex_query_interface(&This
->dispex
, riid
, ppv
)) {
4683 return *ppv
? S_OK
: E_NOINTERFACE
;
4685 FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid
));
4687 return E_NOINTERFACE
;
4690 IUnknown_AddRef((IUnknown
*)*ppv
);
4694 static ULONG WINAPI
CustomDoc_AddRef(ICustomDoc
*iface
)
4696 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4697 ULONG ref
= InterlockedIncrement(&This
->ref
);
4699 TRACE("(%p) ref = %u\n", This
, ref
);
4704 static ULONG WINAPI
CustomDoc_Release(ICustomDoc
*iface
)
4706 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4707 ULONG ref
= InterlockedDecrement(&This
->ref
);
4709 TRACE("(%p) ref = %u\n", This
, ref
);
4712 nsIDOMWindowUtils
*window_utils
= NULL
;
4714 if(This
->basedoc
.window
&& This
->basedoc
.window
->nswindow
)
4715 get_nsinterface((nsISupports
*)This
->basedoc
.window
->nswindow
, &IID_nsIDOMWindowUtils
, (void**)&window_utils
);
4717 if(This
->basedoc
.doc_node
) {
4718 This
->basedoc
.doc_node
->basedoc
.doc_obj
= NULL
;
4719 htmldoc_release(&This
->basedoc
.doc_node
->basedoc
);
4721 if(This
->basedoc
.window
) {
4722 This
->basedoc
.window
->doc_obj
= NULL
;
4723 IHTMLWindow2_Release(&This
->basedoc
.window
->base
.IHTMLWindow2_iface
);
4725 if(This
->basedoc
.advise_holder
)
4726 IOleAdviseHolder_Release(This
->basedoc
.advise_holder
);
4729 IAdviseSink_Release(This
->view_sink
);
4731 IOleObject_SetClientSite(&This
->basedoc
.IOleObject_iface
, NULL
);
4733 ICustomDoc_SetUIHandler(&This
->ICustomDoc_iface
, NULL
);
4734 if(This
->in_place_active
)
4735 IOleInPlaceObjectWindowless_InPlaceDeactivate(&This
->basedoc
.IOleInPlaceObjectWindowless_iface
);
4737 IOleDocumentView_SetInPlaceSite(&This
->basedoc
.IOleDocumentView_iface
, NULL
);
4739 IOleUndoManager_Release(This
->undomgr
);
4741 IHTMLEditServices_Release(This
->editsvcs
);
4742 if(This
->tooltips_hwnd
)
4743 DestroyWindow(This
->tooltips_hwnd
);
4746 DestroyWindow(This
->hwnd
);
4747 heap_free(This
->mime
);
4749 destroy_htmldoc(&This
->basedoc
);
4750 release_dispex(&This
->dispex
);
4752 if(This
->nscontainer
)
4753 NSContainer_Release(This
->nscontainer
);
4756 /* Force cycle collection */
4758 nsIDOMWindowUtils_CycleCollect(window_utils
, NULL
, 0);
4759 nsIDOMWindowUtils_Release(window_utils
);
4766 static HRESULT WINAPI
CustomDoc_SetUIHandler(ICustomDoc
*iface
, IDocHostUIHandler
*pUIHandler
)
4768 HTMLDocumentObj
*This
= impl_from_ICustomDoc(iface
);
4769 IOleCommandTarget
*cmdtrg
;
4772 TRACE("(%p)->(%p)\n", This
, pUIHandler
);
4774 if(This
->custom_hostui
&& This
->hostui
== pUIHandler
)
4777 This
->custom_hostui
= TRUE
;
4780 IDocHostUIHandler_Release(This
->hostui
);
4782 IDocHostUIHandler_AddRef(pUIHandler
);
4783 This
->hostui
= pUIHandler
;
4787 hres
= IDocHostUIHandler_QueryInterface(pUIHandler
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
4788 if(SUCCEEDED(hres
)) {
4789 FIXME("custom UI handler supports IOleCommandTarget\n");
4790 IOleCommandTarget_Release(cmdtrg
);
4796 static const ICustomDocVtbl CustomDocVtbl
= {
4797 CustomDoc_QueryInterface
,
4800 CustomDoc_SetUIHandler
4803 static const tid_t HTMLDocumentObj_iface_tids
[] = {
4810 static dispex_static_data_t HTMLDocumentObj_dispex
= {
4812 DispHTMLDocument_tid
,
4814 HTMLDocumentObj_iface_tids
4817 HRESULT
HTMLDocument_Create(IUnknown
*pUnkOuter
, REFIID riid
, void** ppvObject
)
4819 HTMLDocumentObj
*doc
;
4820 nsIDOMWindow
*nswindow
= NULL
;
4824 TRACE("(%p %s %p)\n", pUnkOuter
, debugstr_mshtml_guid(riid
), ppvObject
);
4826 doc
= heap_alloc_zero(sizeof(HTMLDocumentObj
));
4828 return E_OUTOFMEMORY
;
4830 init_dispex(&doc
->dispex
, (IUnknown
*)&doc
->ICustomDoc_iface
, &HTMLDocumentObj_dispex
);
4831 init_doc(&doc
->basedoc
, (IUnknown
*)&doc
->ICustomDoc_iface
, &doc
->dispex
.IDispatchEx_iface
);
4832 TargetContainer_Init(doc
);
4834 doc
->ICustomDoc_iface
.lpVtbl
= &CustomDocVtbl
;
4836 doc
->basedoc
.doc_obj
= doc
;
4838 doc
->usermode
= UNKNOWN_USERMODE
;
4840 init_binding_ui(doc
);
4842 hres
= create_nscontainer(doc
, &doc
->nscontainer
);
4844 ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n");
4845 htmldoc_release(&doc
->basedoc
);
4849 hres
= htmldoc_query_interface(&doc
->basedoc
, riid
, ppvObject
);
4850 htmldoc_release(&doc
->basedoc
);
4854 nsres
= nsIWebBrowser_GetContentDOMWindow(doc
->nscontainer
->webbrowser
, &nswindow
);
4855 if(NS_FAILED(nsres
))
4856 ERR("GetContentDOMWindow failed: %08x\n", nsres
);
4858 hres
= HTMLOuterWindow_Create(doc
, nswindow
, NULL
/* FIXME */, &doc
->basedoc
.window
);
4860 nsIDOMWindow_Release(nswindow
);
4862 htmldoc_release(&doc
->basedoc
);
4866 if(!doc
->basedoc
.doc_node
&& doc
->basedoc
.window
->base
.inner_window
->doc
) {
4867 doc
->basedoc
.doc_node
= doc
->basedoc
.window
->base
.inner_window
->doc
;
4868 htmldoc_addref(&doc
->basedoc
.doc_node
->basedoc
);