2 * Copyright 2006 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
28 #include "wine/debug.h"
29 #include "wine/unicode.h"
31 #include "mshtml_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
36 static struct list window_list = LIST_INIT(window_list);
38 #define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
40 static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
42 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
46 if(IsEqualGUID(&IID_IUnknown, riid)) {
47 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
48 *ppv = HTMLWINDOW2(This);
49 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
50 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
51 *ppv = HTMLWINDOW2(This);
52 }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
53 TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
54 *ppv = DISPATCHEX(This);
55 }else if(IsEqualGUID(&IID_IHTMLFramesCollection2, riid)) {
56 TRACE("(%p)->(IID_IHTMLFramesCollection2 %p)\n", This, ppv);
57 *ppv = HTMLWINDOW2(This);
58 }else if(IsEqualGUID(&IID_IHTMLWindow2, riid)) {
59 TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
60 *ppv = HTMLWINDOW2(This);
61 }else if(IsEqualGUID(&IID_IHTMLWindow3, riid)) {
62 TRACE("(%p)->(IID_IHTMLWindow2 %p)\n", This, ppv);
63 *ppv = HTMLWINDOW3(This);
64 }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
65 return *ppv ? S_OK : E_NOINTERFACE;
69 IUnknown_AddRef((IUnknown*)*ppv);
73 WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
77 static ULONG WINAPI HTMLWindow2_AddRef(IHTMLWindow2 *iface)
79 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
80 LONG ref = InterlockedIncrement(&This->ref);
82 TRACE("(%p) ref=%d\n", This, ref);
87 static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
89 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
90 LONG ref = InterlockedDecrement(&This->ref);
92 TRACE("(%p) ref=%d\n", This, ref);
95 list_remove(&This->entry);
102 static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
104 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
106 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
109 static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
110 LCID lcid, ITypeInfo **ppTInfo)
112 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
114 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
117 static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
118 LPOLESTR *rgszNames, UINT cNames,
119 LCID lcid, DISPID *rgDispId)
121 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
123 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
126 static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
127 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
128 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
130 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
132 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
133 pVarResult, pExcepInfo, puArgErr);
136 static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
138 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
139 FIXME("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
143 static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, long *p)
145 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
146 FIXME("(%p)->(%p)\n", This, p);
150 static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
152 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
153 FIXME("(%p)->(%p)\n", This, p);
157 static HRESULT WINAPI HTMLWindow2_put_defaultStatus(IHTMLWindow2 *iface, BSTR v)
159 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
160 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
164 static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p)
166 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
167 FIXME("(%p)->(%p)\n", This, p);
171 static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v)
173 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
174 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
178 static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p)
180 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
181 FIXME("(%p)->(%p)\n", This, p);
185 static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression,
186 long msec, VARIANT *language, long *timerID)
188 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
191 TRACE("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
193 V_VT(&expr_var) = VT_BSTR;
194 V_BSTR(&expr_var) = expression;
196 return IHTMLWindow3_setTimeout(HTMLWINDOW3(This), &expr_var, msec, language, timerID);
199 static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, long timerID)
201 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
203 TRACE("(%p)->(%ld)\n", This, timerID);
205 return clear_task_timer(This->doc, FALSE, timerID);
208 static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
210 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
213 TRACE("(%p)->(%s)\n", This, debugstr_w(message));
215 if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
216 sizeof(wszTitle)/sizeof(WCHAR))) {
217 WARN("Could not load message box title: %d\n", GetLastError());
221 MessageBoxW(This->doc->hwnd, message, wszTitle, MB_ICONWARNING);
225 static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message,
226 VARIANT_BOOL *confirmed)
228 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
229 FIXME("(%p)->(%s %p)\n", This, debugstr_w(message), confirmed);
233 static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
234 BSTR dststr, VARIANT *textdata)
236 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
237 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(message), debugstr_w(dststr), textdata);
241 static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
243 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
244 FIXME("(%p)->(%p)\n", This, p);
248 static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
250 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
251 FIXME("(%p)->(%p)\n", This, p);
255 static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
257 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
258 FIXME("(%p)->(%p)\n", This, p);
262 static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface)
264 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
265 FIXME("(%p)->()\n", This);
269 static HRESULT WINAPI HTMLWindow2_put_opener(IHTMLWindow2 *iface, VARIANT v)
271 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
272 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
276 static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
278 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
279 FIXME("(%p)->(%p)\n", This, p);
283 static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
285 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
287 TRACE("(%p)->(%p)\n", This, p);
289 *p = OmNavigator_Create();
293 static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
295 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
296 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
300 static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
302 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
303 FIXME("(%p)->(%p)\n", This, p);
307 static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
309 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
310 FIXME("(%p)->(%p)\n", This, p);
314 static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
315 BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
317 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
318 FIXME("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
319 debugstr_w(features), replace, pomWindowResult);
323 static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
325 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
327 TRACE("(%p)->(%p)\n", This, p);
329 /* FIXME: We should return kind of proxy window here. */
330 IHTMLWindow2_AddRef(HTMLWINDOW2(This));
331 *p = HTMLWINDOW2(This);
335 static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
337 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
338 FIXME("(%p)->(%p)\n", This, p);
342 static HRESULT WINAPI HTMLWindow2_get_window(IHTMLWindow2 *iface, IHTMLWindow2 **p)
344 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
346 TRACE("(%p)->(%p)\n", This, p);
348 /* FIXME: We should return kind of proxy window here. */
349 IHTMLWindow2_AddRef(HTMLWINDOW2(This));
350 *p = HTMLWINDOW2(This);
354 static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url)
356 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
357 FIXME("(%p)->(%s)\n", This, debugstr_w(url));
361 static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v)
363 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
364 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
368 static HRESULT WINAPI HTMLWindow2_get_onfocus(IHTMLWindow2 *iface, VARIANT *p)
370 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
371 FIXME("(%p)->(%p)\n", This, p);
375 static HRESULT WINAPI HTMLWindow2_put_onblur(IHTMLWindow2 *iface, VARIANT v)
377 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
378 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
382 static HRESULT WINAPI HTMLWindow2_get_onblur(IHTMLWindow2 *iface, VARIANT *p)
384 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
385 FIXME("(%p)->(%p)\n", This, p);
389 static HRESULT WINAPI HTMLWindow2_put_onload(IHTMLWindow2 *iface, VARIANT v)
391 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
392 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
396 static HRESULT WINAPI HTMLWindow2_get_onload(IHTMLWindow2 *iface, VARIANT *p)
398 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
399 FIXME("(%p)->(%p)\n", This, p);
403 static HRESULT WINAPI HTMLWindow2_put_onbeforeunload(IHTMLWindow2 *iface, VARIANT v)
405 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
406 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
410 static HRESULT WINAPI HTMLWindow2_get_onbeforeunload(IHTMLWindow2 *iface, VARIANT *p)
412 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
413 FIXME("(%p)->(%p)\n", This, p);
417 static HRESULT WINAPI HTMLWindow2_put_onunload(IHTMLWindow2 *iface, VARIANT v)
419 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
420 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
424 static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
426 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
427 FIXME("(%p)->(%p)\n", This, p);
431 static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
433 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
434 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
438 static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
440 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
441 FIXME("(%p)->(%p)\n", This, p);
445 static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
447 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
448 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
452 static HRESULT WINAPI HTMLWindow2_get_onerror(IHTMLWindow2 *iface, VARIANT *p)
454 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
455 FIXME("(%p)->(%p)\n", This, p);
459 static HRESULT WINAPI HTMLWindow2_put_onresize(IHTMLWindow2 *iface, VARIANT v)
461 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
462 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
466 static HRESULT WINAPI HTMLWindow2_get_onresize(IHTMLWindow2 *iface, VARIANT *p)
468 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
469 FIXME("(%p)->(%p)\n", This, p);
473 static HRESULT WINAPI HTMLWindow2_put_onscroll(IHTMLWindow2 *iface, VARIANT v)
475 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
476 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
480 static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p)
482 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
483 FIXME("(%p)->(%p)\n", This, p);
487 static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
489 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
491 TRACE("(%p)->(%p)\n", This, p);
494 /* FIXME: We should return a wrapper object here */
495 *p = HTMLDOC(This->doc);
496 IHTMLDocument2_AddRef(*p);
504 static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
506 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
507 FIXME("(%p)->(%p)\n", This, p);
511 static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
513 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
514 FIXME("(%p)->(%p)\n", This, p);
518 static HRESULT WINAPI HTMLWindow2_showModalDialog(IHTMLWindow2 *iface, BSTR dialog,
519 VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
521 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
522 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(dialog), varArgIn, varOptions, varArgOut);
526 static HRESULT WINAPI HTMLWindow2_showHelp(IHTMLWindow2 *iface, BSTR helpURL, VARIANT helpArg,
529 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
530 FIXME("(%p)->(%s v(%d) %s)\n", This, debugstr_w(helpURL), V_VT(&helpArg), debugstr_w(features));
534 static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
536 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
537 FIXME("(%p)->(%p)\n", This, p);
541 static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
543 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
545 TRACE("(%p)->(%p)\n", This, p);
547 if(!This->doc->option_factory)
548 This->doc->option_factory = HTMLOptionElementFactory_Create(This->doc);
550 *p = HTMLOPTFACTORY(This->doc->option_factory);
551 IHTMLOptionElementFactory_AddRef(*p);
556 static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface)
558 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
559 FIXME("(%p)->()\n", This);
563 static HRESULT WINAPI HTMLWindow2_get_closed(IHTMLWindow2 *iface, VARIANT_BOOL *p)
565 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
566 FIXME("(%p)->(%p)\n", This, p);
570 static HRESULT WINAPI HTMLWindow2_blur(IHTMLWindow2 *iface)
572 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
573 FIXME("(%p)->()\n", This);
577 static HRESULT WINAPI HTMLWindow2_scroll(IHTMLWindow2 *iface, long x, long y)
579 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
580 FIXME("(%p)->(%ld %ld)\n", This, x, y);
584 static HRESULT WINAPI HTMLWindow2_get_clientInformation(IHTMLWindow2 *iface, IOmNavigator **p)
586 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
587 FIXME("(%p)->(%p)\n", This, p);
591 static HRESULT WINAPI HTMLWindow2_setInterval(IHTMLWindow2 *iface, BSTR expression,
592 long msec, VARIANT *language, long *timerID)
594 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
597 TRACE("(%p)->(%s %ld %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
599 V_VT(&expr) = VT_BSTR;
600 V_BSTR(&expr) = expression;
601 return IHTMLWindow3_setInterval(HTMLWINDOW3(This), &expr, msec, language, timerID);
604 static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, long timerID)
606 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
608 TRACE("(%p)->(%ld)\n", This, timerID);
610 return clear_task_timer(This->doc, TRUE, timerID);
613 static HRESULT WINAPI HTMLWindow2_put_offscreenBuffering(IHTMLWindow2 *iface, VARIANT v)
615 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
616 FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
620 static HRESULT WINAPI HTMLWindow2_get_offscreenBuffering(IHTMLWindow2 *iface, VARIANT *p)
622 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
623 FIXME("(%p)->(%p)\n", This, p);
627 static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BSTR language,
630 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
631 FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(scode), debugstr_w(language), pvarRet);
635 static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
637 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
638 FIXME("(%p)->(%p)\n", This, String);
642 static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, long x, long y)
644 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
645 FIXME("(%p)->(%ld %ld)\n", This, x, y);
649 static HRESULT WINAPI HTMLWindow2_scrollTo(IHTMLWindow2 *iface, long x, long y)
651 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
652 TRACE("(%p)->(%ld %ld)\n", This, x, y);
653 return nsIDOMWindow_ScrollTo(This->nswindow, x, y);
656 static HRESULT WINAPI HTMLWindow2_moveTo(IHTMLWindow2 *iface, long x, long y)
658 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
659 FIXME("(%p)->(%ld %ld)\n", This, x, y);
663 static HRESULT WINAPI HTMLWindow2_moveBy(IHTMLWindow2 *iface, long x, long y)
665 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
666 FIXME("(%p)->(%ld %ld)\n", This, x, y);
670 static HRESULT WINAPI HTMLWindow2_resizeTo(IHTMLWindow2 *iface, long x, long y)
672 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
673 FIXME("(%p)->(%ld %ld)\n", This, x, y);
677 static HRESULT WINAPI HTMLWindow2_resizeBy(IHTMLWindow2 *iface, long x, long y)
679 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
680 FIXME("(%p)->(%ld %ld)\n", This, x, y);
684 static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **p)
686 HTMLWindow *This = HTMLWINDOW2_THIS(iface);
688 TRACE("(%p)->(%p)\n", This, p);
692 if(!This->doc->hostui)
695 return IDocHostUIHandler_GetExternal(This->doc->hostui, p);
698 #undef HTMLWINDOW2_THIS
700 static const IHTMLWindow2Vtbl HTMLWindow2Vtbl = {
701 HTMLWindow2_QueryInterface,
704 HTMLWindow2_GetTypeInfoCount,
705 HTMLWindow2_GetTypeInfo,
706 HTMLWindow2_GetIDsOfNames,
709 HTMLWindow2_get_length,
710 HTMLWindow2_get_frames,
711 HTMLWindow2_put_defaultStatus,
712 HTMLWindow2_get_defaultStatus,
713 HTMLWindow2_put_status,
714 HTMLWindow2_get_status,
715 HTMLWindow2_setTimeout,
716 HTMLWindow2_clearTimeout,
720 HTMLWindow2_get_Image,
721 HTMLWindow2_get_location,
722 HTMLWindow2_get_history,
724 HTMLWindow2_put_opener,
725 HTMLWindow2_get_opener,
726 HTMLWindow2_get_navigator,
727 HTMLWindow2_put_name,
728 HTMLWindow2_get_name,
729 HTMLWindow2_get_parent,
731 HTMLWindow2_get_self,
733 HTMLWindow2_get_window,
734 HTMLWindow2_navigate,
735 HTMLWindow2_put_onfocus,
736 HTMLWindow2_get_onfocus,
737 HTMLWindow2_put_onblur,
738 HTMLWindow2_get_onblur,
739 HTMLWindow2_put_onload,
740 HTMLWindow2_get_onload,
741 HTMLWindow2_put_onbeforeunload,
742 HTMLWindow2_get_onbeforeunload,
743 HTMLWindow2_put_onunload,
744 HTMLWindow2_get_onunload,
745 HTMLWindow2_put_onhelp,
746 HTMLWindow2_get_onhelp,
747 HTMLWindow2_put_onerror,
748 HTMLWindow2_get_onerror,
749 HTMLWindow2_put_onresize,
750 HTMLWindow2_get_onresize,
751 HTMLWindow2_put_onscroll,
752 HTMLWindow2_get_onscroll,
753 HTMLWindow2_get_document,
754 HTMLWindow2_get_event,
755 HTMLWindow2_get__newEnum,
756 HTMLWindow2_showModalDialog,
757 HTMLWindow2_showHelp,
758 HTMLWindow2_get_screen,
759 HTMLWindow2_get_Option,
761 HTMLWindow2_get_closed,
764 HTMLWindow2_get_clientInformation,
765 HTMLWindow2_setInterval,
766 HTMLWindow2_clearInterval,
767 HTMLWindow2_put_offscreenBuffering,
768 HTMLWindow2_get_offscreenBuffering,
769 HTMLWindow2_execScript,
770 HTMLWindow2_toString,
771 HTMLWindow2_scrollBy,
772 HTMLWindow2_scrollTo,
775 HTMLWindow2_resizeTo,
776 HTMLWindow2_resizeBy,
777 HTMLWindow2_get_external
780 #define HTMLWINDOW3_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow3, iface)
782 static HRESULT WINAPI HTMLWindow3_QueryInterface(IHTMLWindow3 *iface, REFIID riid, void **ppv)
784 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
786 return IHTMLWindow2_QueryInterface(HTMLWINDOW2(This), riid, ppv);
789 static ULONG WINAPI HTMLWindow3_AddRef(IHTMLWindow3 *iface)
791 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
793 return IHTMLWindow2_AddRef(HTMLWINDOW2(This));
796 static ULONG WINAPI HTMLWindow3_Release(IHTMLWindow3 *iface)
798 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
800 return IHTMLWindow2_Release(HTMLWINDOW2(This));
803 static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pctinfo)
805 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
807 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
810 static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
811 LCID lcid, ITypeInfo **ppTInfo)
813 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
815 return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
818 static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid,
819 LPOLESTR *rgszNames, UINT cNames,
820 LCID lcid, DISPID *rgDispId)
822 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
824 return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
827 static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember,
828 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
829 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
831 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
833 return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
834 pVarResult, pExcepInfo, puArgErr);
837 static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, long *p)
839 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
840 FIXME("(%p)->(%p)\n", This, p);
844 static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, long *p)
846 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
847 FIXME("(%p)->(%p)\n", This, p);
851 static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp, VARIANT_BOOL *pfResult)
853 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
854 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
858 static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
860 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
861 FIXME("(%p)->()\n", This);
865 static HRESULT window_set_timer(HTMLWindow *This, VARIANT *expr, long msec, VARIANT *language,
866 BOOL interval, long *timer_id)
868 IDispatch *disp = NULL;
872 disp = V_DISPATCH(expr);
873 IDispatch_AddRef(disp);
877 disp = script_parse_event(This->doc, V_BSTR(expr));
881 FIXME("unimplemented vt=%d\n", V_VT(expr));
888 *timer_id = set_task_timer(This->doc, msec, interval, disp);
889 IDispatch_Release(disp);
894 static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expression, long msec,
895 VARIANT *language, long *timerID)
897 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
899 TRACE("(%p)->(%p(%d) %ld %p %p)\n", This, expression, V_VT(expression), msec, language, timerID);
901 return window_set_timer(This, expression, msec, language, FALSE, timerID);
904 static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, long msec,
905 VARIANT *language, long *timerID)
907 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
909 TRACE("(%p)->(%p %ld %p %p)\n", This, expression, msec, language, timerID);
911 return window_set_timer(This, expression, msec, language, TRUE, timerID);
914 static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface)
916 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
917 FIXME("(%p)\n", This);
921 static HRESULT WINAPI HTMLWindow3_put_onbeforeprint(IHTMLWindow3 *iface, VARIANT v)
923 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
924 FIXME("(%p)->()\n", This);
928 static HRESULT WINAPI HTMLWindow3_get_onbeforeprint(IHTMLWindow3 *iface, VARIANT *p)
930 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
931 FIXME("(%p)->(%p)\n", This, p);
935 static HRESULT WINAPI HTMLWindow3_put_onafterprint(IHTMLWindow3 *iface, VARIANT v)
937 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
938 FIXME("(%p)->()\n", This);
942 static HRESULT WINAPI HTMLWindow3_get_onafterprint(IHTMLWindow3 *iface, VARIANT *p)
944 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
945 FIXME("(%p)->(%p)\n", This, p);
949 static HRESULT WINAPI HTMLWindow3_get_clipboardData(IHTMLWindow3 *iface, IHTMLDataTransfer **p)
951 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
952 FIXME("(%p)->(%p)\n", This, p);
956 static HRESULT WINAPI HTMLWindow3_showModelessDialog(IHTMLWindow3 *iface, BSTR url,
957 VARIANT *varArgIn, VARIANT *options, IHTMLWindow2 **pDialog)
959 HTMLWindow *This = HTMLWINDOW3_THIS(iface);
960 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(url), varArgIn, options, pDialog);
964 #undef HTMLWINDOW3_THIS
966 static const IHTMLWindow3Vtbl HTMLWindow3Vtbl = {
967 HTMLWindow3_QueryInterface,
970 HTMLWindow3_GetTypeInfoCount,
971 HTMLWindow3_GetTypeInfo,
972 HTMLWindow3_GetIDsOfNames,
974 HTMLWindow3_get_screenLeft,
975 HTMLWindow3_get_screenTop,
976 HTMLWindow3_attachEvent,
977 HTMLWindow3_detachEvent,
978 HTMLWindow3_setTimeout,
979 HTMLWindow3_setInterval,
981 HTMLWindow3_put_onbeforeprint,
982 HTMLWindow3_get_onbeforeprint,
983 HTMLWindow3_put_onafterprint,
984 HTMLWindow3_get_onafterprint,
985 HTMLWindow3_get_clipboardData,
986 HTMLWindow3_showModelessDialog
989 #define DISPEX_THIS(iface) DEFINE_THIS(HTMLWindow, IDispatchEx, iface)
991 static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
993 HTMLWindow *This = DISPEX_THIS(iface);
995 return IHTMLWindow2_QueryInterface(HTMLWINDOW2(This), riid, ppv);
998 static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
1000 HTMLWindow *This = DISPEX_THIS(iface);
1002 return IHTMLWindow2_AddRef(HTMLWINDOW2(This));
1005 static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
1007 HTMLWindow *This = DISPEX_THIS(iface);
1009 return IHTMLWindow2_Release(HTMLWINDOW2(This));
1012 static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
1014 HTMLWindow *This = DISPEX_THIS(iface);
1016 TRACE("(%p)->(%p)\n", This, pctinfo);
1018 return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
1021 static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
1022 LCID lcid, ITypeInfo **ppTInfo)
1024 HTMLWindow *This = DISPEX_THIS(iface);
1026 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
1028 return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
1031 static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
1032 LPOLESTR *rgszNames, UINT cNames,
1033 LCID lcid, DISPID *rgDispId)
1035 HTMLWindow *This = DISPEX_THIS(iface);
1037 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
1040 /* FIXME: Use script dispatch */
1042 return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
1045 static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
1046 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
1047 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1049 HTMLWindow *This = DISPEX_THIS(iface);
1051 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
1052 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1054 /* FIXME: Use script dispatch */
1056 return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
1057 pVarResult, pExcepInfo, puArgErr);
1060 static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
1062 HTMLWindow *This = DISPEX_THIS(iface);
1064 TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
1066 return IDispatchEx_GetDispID(DISPATCHEX(&This->dispex), bstrName, grfdex, pid);
1069 static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
1070 VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
1072 HTMLWindow *This = DISPEX_THIS(iface);
1074 TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1076 return IDispatchEx_InvokeEx(DISPATCHEX(&This->dispex), id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1079 static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
1081 HTMLWindow *This = DISPEX_THIS(iface);
1083 TRACE("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
1085 return IDispatchEx_DeleteMemberByName(DISPATCHEX(&This->dispex), bstrName, grfdex);
1088 static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
1090 HTMLWindow *This = DISPEX_THIS(iface);
1092 TRACE("(%p)->(%x)\n", This, id);
1094 return IDispatchEx_DeleteMemberByDispID(DISPATCHEX(&This->dispex), id);
1097 static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
1099 HTMLWindow *This = DISPEX_THIS(iface);
1101 TRACE("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
1103 return IDispatchEx_GetMemberProperties(DISPATCHEX(&This->dispex), id, grfdexFetch, pgrfdex);
1106 static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
1108 HTMLWindow *This = DISPEX_THIS(iface);
1110 TRACE("(%p)->(%x %p)\n", This, id, pbstrName);
1112 return IDispatchEx_GetMemberName(DISPATCHEX(&This->dispex), id, pbstrName);
1115 static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
1117 HTMLWindow *This = DISPEX_THIS(iface);
1119 TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
1121 return IDispatchEx_GetNextDispID(DISPATCHEX(&This->dispex), grfdex, id, pid);
1124 static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
1126 HTMLWindow *This = DISPEX_THIS(iface);
1128 TRACE("(%p)->(%p)\n", This, ppunk);
1136 static const IDispatchExVtbl WindowDispExVtbl = {
1137 WindowDispEx_QueryInterface,
1138 WindowDispEx_AddRef,
1139 WindowDispEx_Release,
1140 WindowDispEx_GetTypeInfoCount,
1141 WindowDispEx_GetTypeInfo,
1142 WindowDispEx_GetIDsOfNames,
1143 WindowDispEx_Invoke,
1144 WindowDispEx_GetDispID,
1145 WindowDispEx_InvokeEx,
1146 WindowDispEx_DeleteMemberByName,
1147 WindowDispEx_DeleteMemberByDispID,
1148 WindowDispEx_GetMemberProperties,
1149 WindowDispEx_GetMemberName,
1150 WindowDispEx_GetNextDispID,
1151 WindowDispEx_GetNameSpaceParent
1154 static const tid_t HTMLWindow_iface_tids[] = {
1159 static dispex_static_data_t HTMLWindow_dispex = {
1161 DispHTMLWindow2_tid,
1163 HTMLWindow_iface_tids
1166 static const char wineConfig_func[] =
1167 "window.__defineGetter__(\"external\",function() {\n"
1168 " return window.__wineWindow__.external;\n"
1170 "window.__wineWindow__ = wineWindow;\n";
1172 static void astr_to_nswstr(const char *str, nsAString *nsstr)
1177 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
1178 wstr = heap_alloc(len*sizeof(WCHAR));
1179 MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, len);
1181 nsAString_Init(nsstr, wstr);
1186 static nsresult call_js_func(nsIScriptContainer *script_container, nsISupports *target,
1187 const char *name, const char *body,
1188 PRUint32 argc, const char **arg_names, nsIArray *argv)
1190 nsACString name_str;
1192 JSObject func_obj, jsglobal;
1196 nsres = nsIScriptContainer_GetGlobalObject(script_container, &jsglobal);
1197 if(NS_FAILED(nsres))
1198 ERR("GetGlobalObject: %08x\n", nsres);
1200 nsACString_Init(&name_str, name);
1201 astr_to_nswstr(body, &body_str);
1203 nsres = nsIScriptContainer_CompileFunction(script_container, jsglobal, &name_str, argc, arg_names,
1204 &body_str, NULL, 1, FALSE, &func_obj);
1206 nsACString_Finish(&name_str);
1207 nsAString_Finish(&body_str);
1209 if(NS_FAILED(nsres)) {
1210 ERR("CompileFunction failed: %08x\n", nsres);
1214 nsres = nsIScriptContainer_CallFunction(script_container, target, jsglobal, func_obj, argv, &jsret);
1216 nsIScriptContainer_DropScriptObject(script_container, func_obj);
1217 nsIScriptContainer_DropScriptObject(script_container, jsglobal);
1218 if(NS_FAILED(nsres)) {
1219 ERR("CallFunction failed: %08x\n", nsres);
1223 nsIVariant_Release(jsret);
1227 void setup_nswindow(HTMLWindow *This)
1229 nsIScriptContainer *script_container;
1230 nsIDOMWindow *nswindow;
1231 nsIDOMDocument *domdoc;
1232 nsIWritableVariant *nsvar;
1233 nsIMutableArray *argv;
1236 static const char *args[] = {"wineWindow"};
1238 TRACE("(%p)\n", This);
1240 nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &domdoc);
1241 nsres = nsIDOMDocument_QueryInterface(domdoc, &IID_nsIScriptContainer, (void**)&script_container);
1242 nsIDOMDocument_Release(domdoc);
1243 if(NS_FAILED(nsres)) {
1244 TRACE("Could not get nsIDOMScriptContainer: %08x\n", nsres);
1248 nsIWebBrowser_GetContentDOMWindow(This->doc->nscontainer->webbrowser, &nswindow);
1250 nsvar = create_nsvariant();
1251 nsres = nsIWritableVariant_SetAsInterface(nsvar, &IID_IDispatch, HTMLWINDOW2(This));
1252 if(NS_FAILED(nsres))
1253 ERR("SetAsInterface failed: %08x\n", nsres);
1255 argv = create_nsarray();
1256 nsres = nsIMutableArray_AppendElement(argv, (nsISupports*)nsvar, FALSE);
1257 nsIWritableVariant_Release(nsvar);
1258 if(NS_FAILED(nsres))
1259 ERR("AppendElement failed: %08x\n", nsres);
1261 call_js_func(script_container, (nsISupports*)nswindow/*HTMLWINDOW2(This)*/, "wineConfig",
1262 wineConfig_func, 1, args, (nsIArray*)argv);
1264 nsIMutableArray_Release(argv);
1265 nsIScriptContainer_Release(script_container);
1268 HTMLWindow *HTMLWindow_Create(HTMLDocument *doc)
1270 HTMLWindow *ret = heap_alloc(sizeof(HTMLWindow));
1272 ret->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
1273 ret->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl;
1274 ret->lpIDispatchExVtbl = &WindowDispExVtbl;
1278 init_dispex(&ret->dispex, (IUnknown*)HTMLWINDOW2(ret), &HTMLWindow_dispex);
1280 if(doc->nscontainer) {
1283 nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &ret->nswindow);
1284 if(NS_FAILED(nsres))
1285 ERR("GetContentDOMWindow failed: %08x\n", nsres);
1288 list_add_head(&window_list, &ret->entry);
1293 HTMLWindow *nswindow_to_window(const nsIDOMWindow *nswindow)
1297 LIST_FOR_EACH_ENTRY(iter, &window_list, HTMLWindow, entry) {
1298 if(iter->nswindow == nswindow)