2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
33 #include "mshtml_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 #define HTMLDOC_THIS(iface) DEFINE_THIS(HTMLDocument, HTMLDocument2, iface)
39 static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppvObject)
41 HTMLDocument *This = HTMLDOC_THIS(iface);
44 if(IsEqualGUID(&IID_IUnknown, riid)) {
45 TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppvObject);
46 *ppvObject = HTMLDOC(This);
47 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
48 TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppvObject);
49 *ppvObject = DISPATCHEX(This);
50 }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
51 TRACE("(%p)->(IID_IDispatchEx, %p)\n", This, ppvObject);
52 *ppvObject = DISPATCHEX(This);
53 }else if(IsEqualGUID(&IID_IHTMLDocument, riid)) {
54 TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppvObject);
55 *ppvObject = HTMLDOC(This);
56 }else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) {
57 TRACE("(%p)->(IID_IHTMLDocument2, %p)\n", This, ppvObject);
58 *ppvObject = HTMLDOC(This);
59 }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) {
60 TRACE("(%p)->(IID_IHTMLDocument3, %p)\n", This, ppvObject);
61 *ppvObject = HTMLDOC3(This);
62 }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) {
63 TRACE("(%p)->(IID_IHTMLDocument4, %p)\n", This, ppvObject);
64 *ppvObject = HTMLDOC4(This);
65 }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) {
66 TRACE("(%p)->(IID_IHTMLDocument5, %p)\n", This, ppvObject);
67 *ppvObject = HTMLDOC5(This);
68 }else if(IsEqualGUID(&IID_IPersist, riid)) {
69 TRACE("(%p)->(IID_IPersist, %p)\n", This, ppvObject);
70 *ppvObject = PERSIST(This);
71 }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) {
72 TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppvObject);
73 *ppvObject = PERSISTMON(This);
74 }else if(IsEqualGUID(&IID_IPersistFile, riid)) {
75 TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppvObject);
76 *ppvObject = PERSISTFILE(This);
77 }else if(IsEqualGUID(&IID_IMonikerProp, riid)) {
78 TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppvObject);
79 *ppvObject = MONPROP(This);
80 }else if(IsEqualGUID(&IID_IOleObject, riid)) {
81 TRACE("(%p)->(IID_IOleObject, %p)\n", This, ppvObject);
82 *ppvObject = OLEOBJ(This);
83 }else if(IsEqualGUID(&IID_IOleDocument, riid)) {
84 TRACE("(%p)->(IID_IOleDocument, %p)\n", This, ppvObject);
85 *ppvObject = OLEDOC(This);
86 }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) {
87 TRACE("(%p)->(IID_IOleDocumentView, %p)\n", This, ppvObject);
88 *ppvObject = DOCVIEW(This);
89 }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
90 TRACE("(%p)->(IID_IOleInPlaceActiveObject, %p)\n", This, ppvObject);
91 *ppvObject = ACTOBJ(This);
92 }else if(IsEqualGUID(&IID_IViewObject, riid)) {
93 TRACE("(%p)->(IID_IViewObject, %p)\n", This, ppvObject);
94 *ppvObject = VIEWOBJ(This);
95 }else if(IsEqualGUID(&IID_IViewObject2, riid)) {
96 TRACE("(%p)->(IID_IViewObject2, %p)\n", This, ppvObject);
97 *ppvObject = VIEWOBJ2(This);
98 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
99 TRACE("(%p)->(IID_IOleWindow, %p)\n", This, ppvObject);
100 *ppvObject = OLEWIN(This);
101 }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) {
102 TRACE("(%p)->(IID_IOleInPlaceObject, %p)\n", This, ppvObject);
103 *ppvObject = INPLACEOBJ(This);
104 }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) {
105 TRACE("(%p)->(IID_IOleInPlaceObjectWindowless, %p)\n", This, ppvObject);
106 *ppvObject = INPLACEWIN(This);
107 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
108 TRACE("(%p)->(IID_IServiceProvider, %p)\n", This, ppvObject);
109 *ppvObject = SERVPROV(This);
110 }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
111 TRACE("(%p)->(IID_IOleCommandTarget, %p)\n", This, ppvObject);
112 *ppvObject = CMDTARGET(This);
113 }else if(IsEqualGUID(&IID_IOleControl, riid)) {
114 TRACE("(%p)->(IID_IOleControl, %p)\n", This, ppvObject);
115 *ppvObject = CONTROL(This);
116 }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) {
117 TRACE("(%p)->(IID_IHlinkTarget, %p)\n", This, ppvObject);
118 *ppvObject = HLNKTARGET(This);
119 }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
120 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppvObject);
121 *ppvObject = CONPTCONT(&This->cp_container);
122 }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) {
123 TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppvObject);
124 *ppvObject = PERSTRINIT(This);
125 }else if(IsEqualGUID(&IID_ICustomDoc, riid)) {
126 TRACE("(%p)->(IID_ICustomDoc %p)\n", This, ppvObject);
127 *ppvObject = CUSTOMDOC(This);
128 }else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) {
129 TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppvObject);
130 *ppvObject = HTMLDOC(This);
131 }else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
132 FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppvObject);
133 return E_NOINTERFACE;
134 }else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
135 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppvObject);
136 return E_NOINTERFACE;
137 }else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
138 TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppvObject);
139 return E_NOINTERFACE;
140 }else if(dispex_query_interface(&This->dispex, riid, ppvObject)) {
141 return *ppvObject ? S_OK : E_NOINTERFACE;
145 IHTMLDocument2_AddRef(iface);
149 FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppvObject);
150 return E_NOINTERFACE;
153 static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface)
155 HTMLDocument *This = HTMLDOC_THIS(iface);
156 ULONG ref = InterlockedIncrement(&This->ref);
157 TRACE("(%p) ref = %u\n", This, ref);
161 static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
163 HTMLDocument *This = HTMLDOC_THIS(iface);
164 ULONG ref = InterlockedDecrement(&This->ref);
166 TRACE("(%p) ref = %u\n", This, ref);
169 remove_doc_tasks(This);
170 release_script_hosts(This);
173 IOleObject_SetClientSite(OLEOBJ(This), NULL);
174 if(This->in_place_active)
175 IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
177 IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
179 IOleUndoManager_Release(This->undomgr);
181 set_document_bscallback(This, NULL);
182 set_current_mon(This, NULL);
184 if(This->tooltips_hwnd)
185 DestroyWindow(This->tooltips_hwnd);
187 DestroyWindow(This->hwnd);
189 if(This->option_factory) {
190 This->option_factory->doc = NULL;
191 IHTMLOptionElementFactory_Release(HTMLOPTFACTORY(This->option_factory));
195 This->location->doc = NULL;
198 IHTMLWindow2_Release(HTMLWINDOW2(This->window));
200 heap_free(This->mime);
201 detach_selection(This);
205 ConnectionPointContainer_Destroy(&This->cp_container);
208 nsIDOMHTMLDocument_Release(This->nsdoc);
209 if(This->nscontainer)
210 NSContainer_Release(This->nscontainer);
220 static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo)
222 HTMLDocument *This = HTMLDOC_THIS(iface);
224 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
227 static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo,
228 LCID lcid, ITypeInfo **ppTInfo)
230 HTMLDocument *This = HTMLDOC_THIS(iface);
232 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
235 static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid,
236 LPOLESTR *rgszNames, UINT cNames,
237 LCID lcid, DISPID *rgDispId)
239 HTMLDocument *This = HTMLDOC_THIS(iface);
241 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
244 static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember,
245 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
246 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
248 HTMLDocument *This = HTMLDOC_THIS(iface);
250 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
251 pVarResult, pExcepInfo, puArgErr);
254 static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
256 HTMLDocument *This = HTMLDOC_THIS(iface);
258 TRACE("(%p)->(%p)\n", This, p);
260 *p = (IDispatch*)HTMLWINDOW2(This->window);
261 IDispatch_AddRef(*p);
265 static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
267 HTMLDocument *This = HTMLDOC_THIS(iface);
268 nsIDOMElement *nselem = NULL;
271 TRACE("(%p)->(%p)\n", This, p);
274 WARN("NULL nsdoc\n");
278 nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem);
279 if(NS_FAILED(nsres)) {
280 ERR("GetDocumentElement failed: %08x\n", nsres);
285 *p = create_all_collection(get_node(This, (nsIDOMNode*)nselem, TRUE), TRUE);
286 nsIDOMElement_Release(nselem);
294 static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
296 HTMLDocument *This = HTMLDOC_THIS(iface);
297 nsIDOMHTMLElement *nsbody = NULL;
301 TRACE("(%p)->(%p)\n", This, p);
304 WARN("NULL nsdoc\n");
308 nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody);
309 if(NS_FAILED(nsres)) {
310 TRACE("Could not get body: %08x\n", nsres);
315 node = get_node(This, (nsIDOMNode*)nsbody, TRUE);
316 nsIDOMHTMLElement_Release(nsbody);
318 IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
323 TRACE("*p = %p\n", *p);
327 static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
329 HTMLDocument *This = HTMLDOC_THIS(iface);
330 FIXME("(%p)->(%p)\n", This, p);
334 static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
336 HTMLDocument *This = HTMLDOC_THIS(iface);
337 FIXME("(%p)->(%p)\n", This, p);
341 static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
343 HTMLDocument *This = HTMLDOC_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, p);
348 static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
350 HTMLDocument *This = HTMLDOC_THIS(iface);
351 FIXME("(%p)->(%p)\n", This, p);
355 static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
357 HTMLDocument *This = HTMLDOC_THIS(iface);
358 FIXME("(%p)->(%p)\n", This, p);
362 static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
364 HTMLDocument *This = HTMLDOC_THIS(iface);
365 FIXME("(%p)->(%p)\n", This, p);
369 static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
371 HTMLDocument *This = HTMLDOC_THIS(iface);
375 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
378 WARN("NULL nsdoc\n");
382 nsAString_Init(&nsstr, v);
383 nsres = nsIDOMHTMLDocument_SetTitle(This->nsdoc, &nsstr);
384 nsAString_Finish(&nsstr);
386 ERR("SetTitle failed: %08x\n", nsres);
391 static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
393 HTMLDocument *This = HTMLDOC_THIS(iface);
394 const PRUnichar *ret;
398 TRACE("(%p)->(%p)\n", This, p);
401 WARN("NULL nsdoc\n");
406 nsAString_Init(&nsstr, NULL);
407 nsres = nsIDOMHTMLDocument_GetTitle(This->nsdoc, &nsstr);
408 if (NS_SUCCEEDED(nsres)) {
409 nsAString_GetData(&nsstr, &ret);
410 *p = SysAllocString(ret);
412 nsAString_Finish(&nsstr);
414 if(NS_FAILED(nsres)) {
415 ERR("GetTitle failed: %08x\n", nsres);
422 static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
424 HTMLDocument *This = HTMLDOC_THIS(iface);
425 FIXME("(%p)->(%p)\n", This, p);
429 static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
431 HTMLDocument *This = HTMLDOC_THIS(iface);
432 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
436 static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
438 HTMLDocument *This = HTMLDOC_THIS(iface);
439 FIXME("(%p)->(%p)\n", This, p);
443 static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
445 HTMLDocument *This = HTMLDOC_THIS(iface);
446 nsISelection *nsselection = NULL;
448 TRACE("(%p)->(%p)\n", This, p);
450 if(This->nscontainer) {
451 nsIDOMWindow *dom_window = NULL;
453 nsIWebBrowser_GetContentDOMWindow(This->nscontainer->webbrowser, &dom_window);
455 nsIDOMWindow_GetSelection(dom_window, &nsselection);
456 nsIDOMWindow_Release(dom_window);
460 *p = HTMLSelectionObject_Create(This, nsselection);
464 static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p)
466 HTMLDocument *This = HTMLDOC_THIS(iface);
468 static const WCHAR wszUninitialized[] = {'u','n','i','n','i','t','i','a','l','i','z','e','d',0};
469 static const WCHAR wszLoading[] = {'l','o','a','d','i','n','g',0};
470 static const WCHAR wszLoaded[] = {'l','o','a','d','e','d',0};
471 static const WCHAR wszInteractive[] = {'i','n','t','e','r','a','c','t','i','v','e',0};
472 static const WCHAR wszComplete[] = {'c','o','m','p','l','e','t','e',0};
474 static const LPCWSTR readystate_str[] = {
482 TRACE("(%p)->(%p)\n", iface, p);
487 *p = SysAllocString(readystate_str[This->readystate]);
491 static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
493 HTMLDocument *This = HTMLDOC_THIS(iface);
494 FIXME("(%p)->(%p)\n", This, p);
498 static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
500 HTMLDocument *This = HTMLDOC_THIS(iface);
501 FIXME("(%p)->(%p)\n", This, p);
505 static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p)
507 HTMLDocument *This = HTMLDOC_THIS(iface);
508 FIXME("(%p)->(%p)\n", This, p);
512 static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v)
514 HTMLDocument *This = HTMLDOC_THIS(iface);
515 FIXME("(%p)\n", This);
519 static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p)
521 HTMLDocument *This = HTMLDOC_THIS(iface);
522 FIXME("(%p)->(%p)\n", This, p);
526 static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
528 HTMLDocument *This = HTMLDOC_THIS(iface);
529 FIXME("(%p)\n", This);
533 static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p)
535 HTMLDocument *This = HTMLDOC_THIS(iface);
536 FIXME("(%p)->(%p)\n", This, p);
540 static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v)
542 HTMLDocument *This = HTMLDOC_THIS(iface);
543 FIXME("(%p)\n", This);
547 static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p)
549 HTMLDocument *This = HTMLDOC_THIS(iface);
550 FIXME("(%p)->(%p)\n", This, p);
554 static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v)
556 HTMLDocument *This = HTMLDOC_THIS(iface);
557 FIXME("(%p)->()\n", This);
561 static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p)
563 HTMLDocument *This = HTMLDOC_THIS(iface);
564 FIXME("(%p)->(%p)\n", This, p);
568 static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v)
570 HTMLDocument *This = HTMLDOC_THIS(iface);
571 FIXME("(%p)\n", This);
575 static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p)
577 HTMLDocument *This = HTMLDOC_THIS(iface);
578 FIXME("(%p)->(%p)\n", This, p);
582 static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
584 HTMLDocument *This = HTMLDOC_THIS(iface);
585 FIXME("(%p)->(%p)\n", This, p);
589 static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
591 HTMLDocument *This = HTMLDOC_THIS(iface);
593 TRACE("(%p)->(%p)\n", This, p);
596 IHTMLLocation_AddRef(HTMLLOCATION(This->location));
598 This->location = HTMLLocation_Create(This);
600 *p = HTMLLOCATION(This->location);
604 static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
606 HTMLDocument *This = HTMLDOC_THIS(iface);
607 FIXME("(%p)->(%p)\n", This, p);
611 static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
613 HTMLDocument *This = HTMLDOC_THIS(iface);
614 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
618 static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
620 HTMLDocument *This = HTMLDOC_THIS(iface);
622 static const WCHAR about_blank_url[] =
623 {'a','b','o','u','t',':','b','l','a','n','k',0};
625 TRACE("(%p)->(%p)\n", iface, p);
627 *p = SysAllocString(This->url ? This->url : about_blank_url);
631 static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
633 HTMLDocument *This = HTMLDOC_THIS(iface);
634 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
638 static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
640 HTMLDocument *This = HTMLDOC_THIS(iface);
641 FIXME("(%p)->(%p)\n", This, p);
645 static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
647 HTMLDocument *This = HTMLDOC_THIS(iface);
648 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
652 static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
654 HTMLDocument *This = HTMLDOC_THIS(iface);
655 FIXME("(%p)->(%p)\n", This, p);
659 static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v)
661 HTMLDocument *This = HTMLDOC_THIS(iface);
662 FIXME("(%p)->(%x)\n", This, v);
666 static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p)
668 HTMLDocument *This = HTMLDOC_THIS(iface);
669 FIXME("(%p)->(%p)\n", This, p);
673 static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v)
675 HTMLDocument *This = HTMLDOC_THIS(iface);
676 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
680 static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
682 HTMLDocument *This = HTMLDOC_THIS(iface);
683 FIXME("(%p)->(%p)\n", This, p);
687 static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v)
689 HTMLDocument *This = HTMLDOC_THIS(iface);
690 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
694 static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p)
696 HTMLDocument *This = HTMLDOC_THIS(iface);
697 FIXME("(%p)->(%p)\n", This, p);
701 static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p)
703 HTMLDocument *This = HTMLDOC_THIS(iface);
704 FIXME("(%p)->(%p)\n", This, p);
708 static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p)
710 HTMLDocument *This = HTMLDOC_THIS(iface);
711 FIXME("(%p)->(%p)\n", This, p);
715 static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p)
717 HTMLDocument *This = HTMLDOC_THIS(iface);
718 FIXME("(%p)->(%p)\n", This, p);
722 static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p)
724 HTMLDocument *This = HTMLDOC_THIS(iface);
725 FIXME("(%p)->(%p)\n", This, p);
729 static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p)
731 HTMLDocument *This = HTMLDOC_THIS(iface);
732 FIXME("(%p)->(%p)\n", This, p);
736 static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p)
738 HTMLDocument *This = HTMLDOC_THIS(iface);
739 FIXME("(%p)->(%p)\n", This, p);
743 static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p)
745 HTMLDocument *This = HTMLDOC_THIS(iface);
746 FIXME("(%p)->(%p)\n", This, p);
750 static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
752 HTMLDocument *This = HTMLDOC_THIS(iface);
753 FIXME("(%p)->(%p)\n", This, p);
757 static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
759 HTMLDocument *This = HTMLDOC_THIS(iface);
766 TRACE("(%p)->(%p)\n", iface, psarray);
769 WARN("NULL nsdoc\n");
773 if(psarray->cDims != 1) {
774 FIXME("cDims=%d\n", psarray->cDims);
778 hres = SafeArrayAccessData(psarray, (void**)&var);
780 WARN("SafeArrayAccessData failed: %08x\n", hres);
784 nsAString_Init(&nsstr, NULL);
786 for(i=0; i < psarray->rgsabound[0].cElements; i++) {
787 if(V_VT(var+i) == VT_BSTR) {
788 nsAString_SetData(&nsstr, V_BSTR(var+i));
789 nsres = nsIDOMHTMLDocument_Write(This->nsdoc, &nsstr);
791 ERR("Write failed: %08x\n", nsres);
793 FIXME("vt=%d\n", V_VT(var+i));
797 nsAString_Finish(&nsstr);
798 SafeArrayUnaccessData(psarray);
803 static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray)
805 HTMLDocument *This = HTMLDOC_THIS(iface);
806 FIXME("(%p)->(%p)\n", This, psarray);
810 static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name,
811 VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
813 HTMLDocument *This = HTMLDOC_THIS(iface);
814 FIXME("(%p)->(%s %p)\n", This, debugstr_w(url), pomWindowResult);
818 static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
820 HTMLDocument *This = HTMLDOC_THIS(iface);
821 FIXME("(%p)\n", This);
825 static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
827 HTMLDocument *This = HTMLDOC_THIS(iface);
828 FIXME("(%p)\n", This);
832 static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,
835 HTMLDocument *This = HTMLDOC_THIS(iface);
836 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
840 static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID,
843 HTMLDocument *This = HTMLDOC_THIS(iface);
844 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
848 static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID,
851 HTMLDocument *This = HTMLDOC_THIS(iface);
852 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
856 static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID,
859 HTMLDocument *This = HTMLDOC_THIS(iface);
860 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
864 static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID,
867 HTMLDocument *This = HTMLDOC_THIS(iface);
868 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
872 static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID,
875 HTMLDocument *This = HTMLDOC_THIS(iface);
876 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
880 static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID,
881 VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet)
883 HTMLDocument *This = HTMLDOC_THIS(iface);
884 FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(cmdID), showUI, pfRet);
888 static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID,
891 HTMLDocument *This = HTMLDOC_THIS(iface);
892 FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
896 static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag,
897 IHTMLElement **newElem)
899 HTMLDocument *This = HTMLDOC_THIS(iface);
900 nsIDOMElement *nselem;
905 TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
908 WARN("NULL nsdoc\n");
912 nsAString_Init(&tag_str, eTag);
913 nsres = nsIDOMDocument_CreateElement(This->nsdoc, &tag_str, &nselem);
914 nsAString_Finish(&tag_str);
915 if(NS_FAILED(nsres)) {
916 ERR("CreateElement failed: %08x\n", nsres);
920 elem = HTMLElement_Create(This, (nsIDOMNode*)nselem, TRUE);
921 nsIDOMElement_Release(nselem);
923 *newElem = HTMLELEM(elem);
924 IHTMLElement_AddRef(HTMLELEM(elem));
928 static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)
930 HTMLDocument *This = HTMLDOC_THIS(iface);
931 FIXME("(%p)\n", This);
935 static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p)
937 HTMLDocument *This = HTMLDOC_THIS(iface);
938 FIXME("(%p)->(%p)\n", This, p);
942 static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
944 HTMLDocument *This = HTMLDOC_THIS(iface);
945 FIXME("(%p)\n", This);
949 static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p)
951 HTMLDocument *This = HTMLDOC_THIS(iface);
952 FIXME("(%p)->(%p)\n", This, p);
956 static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v)
958 HTMLDocument *This = HTMLDOC_THIS(iface);
959 FIXME("(%p)\n", This);
963 static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p)
965 HTMLDocument *This = HTMLDOC_THIS(iface);
966 FIXME("(%p)->(%p)\n", This, p);
970 static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
972 HTMLDocument *This = HTMLDOC_THIS(iface);
973 FIXME("(%p)\n", This);
977 static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
979 HTMLDocument *This = HTMLDOC_THIS(iface);
980 FIXME("(%p)->(%p)\n", This, p);
984 static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
986 HTMLDocument *This = HTMLDOC_THIS(iface);
987 FIXME("(%p)\n", This);
991 static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
993 HTMLDocument *This = HTMLDOC_THIS(iface);
994 FIXME("(%p)->(%p)\n", This, p);
998 static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
1000 HTMLDocument *This = HTMLDOC_THIS(iface);
1001 FIXME("(%p)\n", This);
1005 static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p)
1007 HTMLDocument *This = HTMLDOC_THIS(iface);
1008 FIXME("(%p)->(%p)\n", This, p);
1012 static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v)
1014 HTMLDocument *This = HTMLDOC_THIS(iface);
1015 FIXME("(%p)\n", This);
1019 static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p)
1021 HTMLDocument *This = HTMLDOC_THIS(iface);
1022 FIXME("(%p)->(%p)\n", This, p);
1026 static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v)
1028 HTMLDocument *This = HTMLDOC_THIS(iface);
1029 FIXME("(%p)\n", This);
1033 static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p)
1035 HTMLDocument *This = HTMLDOC_THIS(iface);
1036 FIXME("(%p)->(%p)\n", This, p);
1040 static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v)
1042 HTMLDocument *This = HTMLDOC_THIS(iface);
1043 FIXME("(%p)\n", This);
1047 static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p)
1049 HTMLDocument *This = HTMLDOC_THIS(iface);
1050 FIXME("(%p)->(%p)\n", This, p);
1054 static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v)
1056 HTMLDocument *This = HTMLDOC_THIS(iface);
1057 FIXME("(%p)\n", This);
1061 static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p)
1063 HTMLDocument *This = HTMLDOC_THIS(iface);
1064 FIXME("(%p)->(%p)\n", This, p);
1068 static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v)
1070 HTMLDocument *This = HTMLDOC_THIS(iface);
1071 FIXME("(%p)\n", This);
1075 static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
1077 HTMLDocument *This = HTMLDOC_THIS(iface);
1078 FIXME("(%p)->(%p)\n", This, p);
1082 static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v)
1084 HTMLDocument *This = HTMLDOC_THIS(iface);
1085 FIXME("(%p)\n", This);
1089 static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p)
1091 HTMLDocument *This = HTMLDOC_THIS(iface);
1092 FIXME("(%p)->(%p)\n", This, p);
1096 static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v)
1098 HTMLDocument *This = HTMLDOC_THIS(iface);
1099 FIXME("(%p)\n", This);
1103 static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p)
1105 HTMLDocument *This = HTMLDOC_THIS(iface);
1106 FIXME("(%p)->(%p)\n", This, p);
1110 static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v)
1112 HTMLDocument *This = HTMLDOC_THIS(iface);
1113 FIXME("(%p)\n", This);
1117 static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p)
1119 HTMLDocument *This = HTMLDOC_THIS(iface);
1120 FIXME("(%p)->(%p)\n", This, p);
1124 static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v)
1126 HTMLDocument *This = HTMLDOC_THIS(iface);
1127 FIXME("(%p)\n", This);
1131 static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p)
1133 HTMLDocument *This = HTMLDOC_THIS(iface);
1134 FIXME("(%p)->(%p)\n", This, p);
1138 static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
1140 HTMLDocument *This = HTMLDOC_THIS(iface);
1141 FIXME("(%p)\n", This);
1145 static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
1147 HTMLDocument *This = HTMLDOC_THIS(iface);
1148 FIXME("(%p)->(%p)\n", This, p);
1152 static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
1154 HTMLDocument *This = HTMLDOC_THIS(iface);
1155 FIXME("(%p)\n", This);
1159 static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
1161 HTMLDocument *This = HTMLDOC_THIS(iface);
1162 FIXME("(%p)->(%p)\n", This, p);
1166 static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, long x, long y,
1167 IHTMLElement **elementHit)
1169 HTMLDocument *This = HTMLDOC_THIS(iface);
1170 FIXME("(%p)->(%ld %ld %p)\n", This, x, y, elementHit);
1174 static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p)
1176 HTMLDocument *This = HTMLDOC_THIS(iface);
1178 TRACE("(%p)->(%p)\n", This, p);
1180 *p = HTMLWINDOW2(This->window);
1181 IHTMLWindow2_AddRef(*p);
1185 static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
1186 IHTMLStyleSheetsCollection **p)
1188 HTMLDocument *This = HTMLDOC_THIS(iface);
1189 nsIDOMStyleSheetList *nsstylelist;
1190 nsIDOMDocumentStyle *nsdocstyle;
1193 TRACE("(%p)->(%p)\n", This, p);
1198 WARN("NULL nsdoc\n");
1199 return E_UNEXPECTED;
1202 nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
1203 nsres = nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
1204 nsIDOMDocumentStyle_Release(nsdocstyle);
1205 if(NS_FAILED(nsres)) {
1206 ERR("GetStyleSheets failed: %08x\n", nsres);
1210 *p = HTMLStyleSheetsCollection_Create(nsstylelist);
1211 nsIDOMDocumentStyle_Release(nsstylelist);
1216 static HRESULT WINAPI HTMLDocument_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v)
1218 HTMLDocument *This = HTMLDOC_THIS(iface);
1219 FIXME("(%p)\n", This);
1223 static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p)
1225 HTMLDocument *This = HTMLDOC_THIS(iface);
1226 FIXME("(%p)->(%p)\n", This, p);
1230 static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v)
1232 HTMLDocument *This = HTMLDOC_THIS(iface);
1233 FIXME("(%p)\n", This);
1237 static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p)
1239 HTMLDocument *This = HTMLDOC_THIS(iface);
1240 FIXME("(%p)->(%p)\n", This, p);
1244 static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
1246 HTMLDocument *This = HTMLDOC_THIS(iface);
1247 FIXME("(%p)->(%p)\n", This, String);
1251 static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
1252 long lIndex, IHTMLStyleSheet **ppnewStyleSheet)
1254 HTMLDocument *This = HTMLDOC_THIS(iface);
1256 FIXME("(%p)->(%s %ld %p) semi-stub\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
1258 *ppnewStyleSheet = HTMLStyleSheet_Create(NULL);
1262 static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
1263 HTMLDocument_QueryInterface,
1264 HTMLDocument_AddRef,
1265 HTMLDocument_Release,
1266 HTMLDocument_GetTypeInfoCount,
1267 HTMLDocument_GetTypeInfo,
1268 HTMLDocument_GetIDsOfNames,
1269 HTMLDocument_Invoke,
1270 HTMLDocument_get_Script,
1271 HTMLDocument_get_all,
1272 HTMLDocument_get_body,
1273 HTMLDocument_get_activeElement,
1274 HTMLDocument_get_images,
1275 HTMLDocument_get_applets,
1276 HTMLDocument_get_links,
1277 HTMLDocument_get_forms,
1278 HTMLDocument_get_anchors,
1279 HTMLDocument_put_title,
1280 HTMLDocument_get_title,
1281 HTMLDocument_get_scripts,
1282 HTMLDocument_put_designMode,
1283 HTMLDocument_get_designMode,
1284 HTMLDocument_get_selection,
1285 HTMLDocument_get_readyState,
1286 HTMLDocument_get_frames,
1287 HTMLDocument_get_embeds,
1288 HTMLDocument_get_plugins,
1289 HTMLDocument_put_alinkColor,
1290 HTMLDocument_get_alinkColor,
1291 HTMLDocument_put_bgColor,
1292 HTMLDocument_get_bgColor,
1293 HTMLDocument_put_fgColor,
1294 HTMLDocument_get_fgColor,
1295 HTMLDocument_put_linkColor,
1296 HTMLDocument_get_linkColor,
1297 HTMLDocument_put_vlinkColor,
1298 HTMLDocument_get_vlinkColor,
1299 HTMLDocument_get_referrer,
1300 HTMLDocument_get_location,
1301 HTMLDocument_get_lastModified,
1302 HTMLDocument_put_URL,
1303 HTMLDocument_get_URL,
1304 HTMLDocument_put_domain,
1305 HTMLDocument_get_domain,
1306 HTMLDocument_put_cookie,
1307 HTMLDocument_get_cookie,
1308 HTMLDocument_put_expando,
1309 HTMLDocument_get_expando,
1310 HTMLDocument_put_charset,
1311 HTMLDocument_get_charset,
1312 HTMLDocument_put_defaultCharset,
1313 HTMLDocument_get_defaultCharset,
1314 HTMLDocument_get_mimeType,
1315 HTMLDocument_get_fileSize,
1316 HTMLDocument_get_fileCreatedDate,
1317 HTMLDocument_get_fileModifiedDate,
1318 HTMLDocument_get_fileUpdatedDate,
1319 HTMLDocument_get_security,
1320 HTMLDocument_get_protocol,
1321 HTMLDocument_get_nameProp,
1323 HTMLDocument_writeln,
1327 HTMLDocument_queryCommandSupported,
1328 HTMLDocument_queryCommandEnabled,
1329 HTMLDocument_queryCommandState,
1330 HTMLDocument_queryCommandIndeterm,
1331 HTMLDocument_queryCommandText,
1332 HTMLDocument_queryCommandValue,
1333 HTMLDocument_execCommand,
1334 HTMLDocument_execCommandShowHelp,
1335 HTMLDocument_createElement,
1336 HTMLDocument_put_onhelp,
1337 HTMLDocument_get_onhelp,
1338 HTMLDocument_put_onclick,
1339 HTMLDocument_get_onclick,
1340 HTMLDocument_put_ondblclick,
1341 HTMLDocument_get_ondblclick,
1342 HTMLDocument_put_onkeyup,
1343 HTMLDocument_get_onkeyup,
1344 HTMLDocument_put_onkeydown,
1345 HTMLDocument_get_onkeydown,
1346 HTMLDocument_put_onkeypress,
1347 HTMLDocument_get_onkeypress,
1348 HTMLDocument_put_onmouseup,
1349 HTMLDocument_get_onmouseup,
1350 HTMLDocument_put_onmousedown,
1351 HTMLDocument_get_onmousedown,
1352 HTMLDocument_put_onmousemove,
1353 HTMLDocument_get_onmousemove,
1354 HTMLDocument_put_onmouseout,
1355 HTMLDocument_get_onmouseout,
1356 HTMLDocument_put_onmouseover,
1357 HTMLDocument_get_onmouseover,
1358 HTMLDocument_put_onreadystatechange,
1359 HTMLDocument_get_onreadystatechange,
1360 HTMLDocument_put_onafterupdate,
1361 HTMLDocument_get_onafterupdate,
1362 HTMLDocument_put_onrowexit,
1363 HTMLDocument_get_onrowexit,
1364 HTMLDocument_put_onrowenter,
1365 HTMLDocument_get_onrowenter,
1366 HTMLDocument_put_ondragstart,
1367 HTMLDocument_get_ondragstart,
1368 HTMLDocument_put_onselectstart,
1369 HTMLDocument_get_onselectstart,
1370 HTMLDocument_elementFromPoint,
1371 HTMLDocument_get_parentWindow,
1372 HTMLDocument_get_styleSheets,
1373 HTMLDocument_put_onbeforeupdate,
1374 HTMLDocument_get_onbeforeupdate,
1375 HTMLDocument_put_onerrorupdate,
1376 HTMLDocument_get_onerrorupdate,
1377 HTMLDocument_toString,
1378 HTMLDocument_createStyleSheet
1381 #define DISPEX_THIS(iface) DEFINE_THIS(HTMLDocument, IDispatchEx, iface)
1383 static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
1385 HTMLDocument *This = DISPEX_THIS(iface);
1387 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
1390 static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface)
1392 HTMLDocument *This = DISPEX_THIS(iface);
1394 return IHTMLDocument2_AddRef(HTMLDOC(This));
1397 static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface)
1399 HTMLDocument *This = DISPEX_THIS(iface);
1401 return IHTMLDocument2_Release(HTMLDOC(This));
1404 static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
1406 HTMLDocument *This = DISPEX_THIS(iface);
1408 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
1411 static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
1412 LCID lcid, ITypeInfo **ppTInfo)
1414 HTMLDocument *This = DISPEX_THIS(iface);
1416 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
1419 static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
1420 LPOLESTR *rgszNames, UINT cNames,
1421 LCID lcid, DISPID *rgDispId)
1423 HTMLDocument *This = DISPEX_THIS(iface);
1425 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
1428 static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
1429 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1430 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1432 HTMLDocument *This = DISPEX_THIS(iface);
1434 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
1435 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1437 switch(dispIdMember) {
1438 case DISPID_READYSTATE:
1439 TRACE("DISPID_READYSTATE\n");
1441 if(!(wFlags & DISPATCH_PROPERTYGET))
1442 return E_INVALIDARG;
1444 V_VT(pVarResult) = VT_I4;
1445 V_I4(pVarResult) = This->readystate;
1449 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
1450 pVarResult, pExcepInfo, puArgErr);
1453 static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
1455 HTMLDocument *This = DISPEX_THIS(iface);
1457 return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
1460 static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
1461 VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
1463 HTMLDocument *This = DISPEX_THIS(iface);
1465 return IDispatchEx_InvokeEx(DISPATCHEX(&This->dispex), id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1468 static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
1470 HTMLDocument *This = DISPEX_THIS(iface);
1472 return IDispatchEx_DeleteMemberByName(DISPATCHEX(&This->dispex), bstrName, grfdex);
1475 static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
1477 HTMLDocument *This = DISPEX_THIS(iface);
1479 return IDispatchEx_DeleteMemberByDispID(DISPATCHEX(&This->dispex), id);
1482 static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
1484 HTMLDocument *This = DISPEX_THIS(iface);
1486 return IDispatchEx_GetMemberProperties(DISPATCHEX(&This->dispex), id, grfdexFetch, pgrfdex);
1489 static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
1491 HTMLDocument *This = DISPEX_THIS(iface);
1493 return IDispatchEx_GetMemberName(DISPATCHEX(&This->dispex), id, pbstrName);
1496 static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
1498 HTMLDocument *This = DISPEX_THIS(iface);
1500 return IDispatchEx_GetNextDispID(DISPATCHEX(&This->dispex), grfdex, id, pid);
1503 static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
1505 HTMLDocument *This = DISPEX_THIS(iface);
1507 return IDispatchEx_GetNameSpaceParent(DISPATCHEX(&This->dispex), ppunk);
1512 static const IDispatchExVtbl DocDispatchExVtbl = {
1513 DocDispatchEx_QueryInterface,
1514 DocDispatchEx_AddRef,
1515 DocDispatchEx_Release,
1516 DocDispatchEx_GetTypeInfoCount,
1517 DocDispatchEx_GetTypeInfo,
1518 DocDispatchEx_GetIDsOfNames,
1519 DocDispatchEx_Invoke,
1520 DocDispatchEx_GetDispID,
1521 DocDispatchEx_InvokeEx,
1522 DocDispatchEx_DeleteMemberByName,
1523 DocDispatchEx_DeleteMemberByDispID,
1524 DocDispatchEx_GetMemberProperties,
1525 DocDispatchEx_GetMemberName,
1526 DocDispatchEx_GetNextDispID,
1527 DocDispatchEx_GetNameSpaceParent
1530 static const tid_t HTMLDocument_iface_tids[] = {
1537 static dispex_static_data_t HTMLDocument_dispex = {
1539 DispHTMLDocument_tid,
1541 HTMLDocument_iface_tids
1544 HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
1549 TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
1551 ret = heap_alloc_zero(sizeof(HTMLDocument));
1552 ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
1553 ret->lpIDispatchExVtbl = &DocDispatchExVtbl;
1555 ret->readystate = READYSTATE_UNINITIALIZED;
1556 ret->scriptmode = SCRIPTMODE_GECKO;
1558 list_init(&ret->bindings);
1559 list_init(&ret->script_hosts);
1560 list_init(&ret->selection_list);
1561 list_init(&ret->range_list);
1563 hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
1571 HTMLDocument_HTMLDocument3_Init(ret);
1572 HTMLDocument_HTMLDocument5_Init(ret);
1573 HTMLDocument_Persist_Init(ret);
1574 HTMLDocument_OleCmd_Init(ret);
1575 HTMLDocument_OleObj_Init(ret);
1576 HTMLDocument_View_Init(ret);
1577 HTMLDocument_Window_Init(ret);
1578 HTMLDocument_Service_Init(ret);
1579 HTMLDocument_Hlink_Init(ret);
1581 ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLDOC(ret));
1582 ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
1583 ConnectionPoint_Init(&ret->cp_htmldocevents, &ret->cp_container, &DIID_HTMLDocumentEvents);
1584 ConnectionPoint_Init(&ret->cp_htmldocevents2, &ret->cp_container, &DIID_HTMLDocumentEvents2);
1586 init_dispex(&ret->dispex, (IUnknown*)HTMLDOC(ret), &HTMLDocument_dispex);
1588 ret->nscontainer = NSContainer_Create(ret, NULL);
1589 update_nsdocument(ret);
1591 ret->window = HTMLWindow_Create(ret);