2006-12-06 18:21:16 +01:00
|
|
|
/*
|
2012-06-25 14:04:59 +02:00
|
|
|
* Copyright 2006-2012 Jacek Caban for CodeWeavers
|
2006-12-06 18:21:16 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2012-06-25 14:04:59 +02:00
|
|
|
#include <assert.h>
|
2006-12-06 18:21:16 +01:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
2009-11-30 17:58:37 +01:00
|
|
|
#include "mshtmdid.h"
|
2010-03-03 14:56:21 +01:00
|
|
|
#include "shlguid.h"
|
2012-01-09 17:56:54 +01:00
|
|
|
#include "shobjidl.h"
|
2013-04-15 17:40:53 +02:00
|
|
|
#include "exdispid.h"
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2011-07-23 12:52:17 +02:00
|
|
|
#define NO_SHLWAPI_REG
|
|
|
|
#include "shlwapi.h"
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2009-09-08 22:29:39 +02:00
|
|
|
#include "htmlevent.h"
|
2012-10-16 17:07:29 +02:00
|
|
|
#include "htmlscript.h"
|
2019-03-27 18:52:14 +01:00
|
|
|
#include "htmlstyle.h"
|
2013-09-25 14:17:08 +02:00
|
|
|
#include "pluginhost.h"
|
2011-07-23 12:50:11 +02:00
|
|
|
#include "binding.h"
|
2006-12-06 18:21:16 +01:00
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2016-09-12 13:44:31 +02:00
|
|
|
static int window_map_compare(const void *key, const struct wine_rb_entry *entry)
|
|
|
|
{
|
|
|
|
HTMLOuterWindow *window = WINE_RB_ENTRY_VALUE(entry, HTMLOuterWindow, entry);
|
|
|
|
|
|
|
|
if(window->window_proxy == key)
|
|
|
|
return 0;
|
|
|
|
return (void*)window->window_proxy > key ? -1 : 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct wine_rb_tree window_map = { window_map_compare };
|
|
|
|
|
|
|
|
HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy *mozwindow)
|
|
|
|
{
|
|
|
|
struct wine_rb_entry *entry = wine_rb_get(&window_map, mozwindow);
|
|
|
|
return entry ? WINE_RB_ENTRY_VALUE(entry, HTMLOuterWindow, entry) : NULL;
|
|
|
|
}
|
2006-12-08 12:38:19 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
static inline BOOL is_outer_window(HTMLWindow *window)
|
|
|
|
{
|
|
|
|
return &window->outer_window->base == window;
|
|
|
|
}
|
|
|
|
|
2012-08-14 11:29:17 +02:00
|
|
|
static HRESULT get_location(HTMLInnerWindow *This, HTMLLocation **ret)
|
2009-11-30 17:58:37 +01:00
|
|
|
{
|
|
|
|
if(This->location) {
|
2011-01-03 01:12:05 +01:00
|
|
|
IHTMLLocation_AddRef(&This->location->IHTMLLocation_iface);
|
2009-11-30 17:58:37 +01:00
|
|
|
}else {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = HTMLLocation_Create(This, &This->location);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ret = This->location;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
void get_top_window(HTMLOuterWindow *window, HTMLOuterWindow **ret)
|
2012-03-29 15:05:25 +02:00
|
|
|
{
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *iter;
|
2012-03-29 15:05:25 +02:00
|
|
|
|
2019-03-11 14:23:13 +01:00
|
|
|
for(iter = window; iter->parent && iter->parent; iter = iter->parent);
|
2012-03-29 15:05:25 +02:00
|
|
|
*ret = iter;
|
|
|
|
}
|
|
|
|
|
2010-01-04 00:39:31 +01:00
|
|
|
static inline HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2012-06-25 14:05:17 +02:00
|
|
|
if(!window->inner_window->doc) {
|
2010-01-04 00:39:31 +01:00
|
|
|
FIXME("No document\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2015-05-20 19:47:11 +02:00
|
|
|
return set_event_handler(&window->inner_window->event_target, eid, var);
|
2010-01-04 00:39:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
|
|
|
|
{
|
2012-06-25 14:05:17 +02:00
|
|
|
if(!window->inner_window->doc) {
|
2010-01-04 00:39:31 +01:00
|
|
|
FIXME("No document\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2015-05-14 13:25:34 +02:00
|
|
|
return get_event_handler(&window->inner_window->event_target, eid, var);
|
2010-01-04 00:39:31 +01:00
|
|
|
}
|
|
|
|
|
2012-10-17 12:19:12 +02:00
|
|
|
static void detach_inner_window(HTMLInnerWindow *window)
|
2012-07-11 13:51:39 +02:00
|
|
|
{
|
2012-10-17 12:19:12 +02:00
|
|
|
HTMLOuterWindow *outer_window = window->base.outer_window;
|
2019-03-11 14:22:44 +01:00
|
|
|
HTMLDocumentNode *doc = window->doc;
|
2012-07-11 13:51:39 +02:00
|
|
|
|
2019-03-11 14:23:13 +01:00
|
|
|
while(!list_empty(&window->children)) {
|
|
|
|
HTMLOuterWindow *child = LIST_ENTRY(list_tail(&window->children), HTMLOuterWindow, sibling_entry);
|
|
|
|
|
|
|
|
list_remove(&child->sibling_entry);
|
|
|
|
child->parent = NULL;
|
|
|
|
|
|
|
|
if(child->base.inner_window)
|
|
|
|
detach_inner_window(child->base.inner_window);
|
|
|
|
|
|
|
|
IHTMLWindow2_Release(&child->base.IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
2019-03-14 14:12:42 +01:00
|
|
|
if(outer_window && is_main_content_window(outer_window))
|
2012-07-11 13:51:39 +02:00
|
|
|
window->doc->basedoc.cp_container.forward_container = NULL;
|
|
|
|
|
2019-03-11 14:22:44 +01:00
|
|
|
if(doc)
|
|
|
|
detach_document_node(doc);
|
2013-09-25 14:17:08 +02:00
|
|
|
|
2012-07-11 13:51:39 +02:00
|
|
|
abort_window_bindings(window);
|
2012-10-17 12:19:53 +02:00
|
|
|
remove_target_tasks(window->task_magic);
|
2012-07-11 13:51:39 +02:00
|
|
|
release_script_hosts(window);
|
|
|
|
window->base.outer_window = NULL;
|
|
|
|
|
2012-10-17 12:19:12 +02:00
|
|
|
if(outer_window && outer_window->base.inner_window == window) {
|
|
|
|
outer_window->base.inner_window = NULL;
|
|
|
|
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
|
|
|
|
}
|
2012-07-11 13:51:39 +02:00
|
|
|
}
|
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow2(IHTMLWindow2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow2_iface);
|
|
|
|
}
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2014-05-13 18:56:30 +02:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
2010-12-27 12:50:32 +01:00
|
|
|
*ppv = &This->IHTMLWindow2_iface;
|
2006-12-06 18:21:16 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
2010-12-27 12:50:32 +01:00
|
|
|
*ppv = &This->IHTMLWindow2_iface;
|
2008-04-19 18:41:25 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
|
2010-12-31 11:03:45 +01:00
|
|
|
*ppv = &This->IDispatchEx_iface;
|
2006-12-06 18:21:16 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLFramesCollection2, riid)) {
|
2010-12-27 12:50:32 +01:00
|
|
|
*ppv = &This->IHTMLWindow2_iface;
|
2006-12-06 18:21:16 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow2, riid)) {
|
2010-12-27 12:50:32 +01:00
|
|
|
*ppv = &This->IHTMLWindow2_iface;
|
2008-04-17 22:53:31 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow3, riid)) {
|
2010-12-27 14:22:27 +01:00
|
|
|
*ppv = &This->IHTMLWindow3_iface;
|
2009-11-13 21:12:54 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow4, riid)) {
|
2010-12-27 14:22:27 +01:00
|
|
|
*ppv = &This->IHTMLWindow4_iface;
|
2012-01-23 16:42:15 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow5, riid)) {
|
|
|
|
*ppv = &This->IHTMLWindow5_iface;
|
2011-10-19 16:15:16 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow6, riid)) {
|
|
|
|
*ppv = &This->IHTMLWindow6_iface;
|
2018-05-17 16:22:09 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLWindow7, riid)) {
|
|
|
|
*ppv = &This->IHTMLWindow7_iface;
|
2010-03-03 14:53:03 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLPrivateWindow, riid)) {
|
2010-12-27 14:22:27 +01:00
|
|
|
*ppv = &This->IHTMLPrivateWindow_iface;
|
2010-11-12 12:30:36 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
|
2010-12-27 01:43:10 +01:00
|
|
|
*ppv = &This->IServiceProvider_iface;
|
2012-01-20 15:10:25 +01:00
|
|
|
}else if(IsEqualGUID(&IID_ITravelLogClient, riid)) {
|
|
|
|
*ppv = &This->ITravelLogClient_iface;
|
2013-04-26 15:47:54 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IObjectIdentity, riid)) {
|
|
|
|
*ppv = &This->IObjectIdentity_iface;
|
2017-04-21 13:49:51 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
|
|
|
|
*ppv = &This->IProvideMultipleClassInfo_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
|
|
|
|
*ppv = &This->IProvideMultipleClassInfo_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IProvideMultipleClassInfo, riid)) {
|
|
|
|
*ppv = &This->IProvideMultipleClassInfo_iface;
|
2017-04-13 16:04:41 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IMarshal, riid)) {
|
|
|
|
*ppv = NULL;
|
|
|
|
FIXME("(%p)->(IID_IMarshal %p)\n", This, ppv);
|
|
|
|
return E_NOINTERFACE;
|
2015-05-14 13:24:44 +02:00
|
|
|
}else if(dispex_query_interface(&This->inner_window->event_target.dispex, riid, ppv)) {
|
2012-06-25 14:04:59 +02:00
|
|
|
assert(!*ppv);
|
|
|
|
return E_NOINTERFACE;
|
2014-05-13 18:56:30 +02:00
|
|
|
}else {
|
2017-09-21 23:25:36 +02:00
|
|
|
return EventTarget_QI(&This->inner_window->event_target, riid, ppv);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2014-05-13 18:56:30 +02:00
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow2_AddRef(IHTMLWindow2 *iface)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
static void release_outer_window(HTMLOuterWindow *This)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2019-03-11 14:25:21 +01:00
|
|
|
if(This->browser) {
|
|
|
|
list_remove(&This->browser_entry);
|
|
|
|
This->browser = NULL;
|
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
if(This->pending_window) {
|
|
|
|
abort_window_bindings(This->pending_window);
|
|
|
|
This->pending_window->base.outer_window = NULL;
|
|
|
|
IHTMLWindow2_Release(&This->pending_window->base.IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
remove_target_tasks(This->task_magic);
|
2012-11-12 12:57:48 +01:00
|
|
|
set_current_mon(This, NULL, 0);
|
2016-11-10 14:40:22 +01:00
|
|
|
set_current_uri(This, NULL);
|
2012-10-17 12:19:12 +02:00
|
|
|
if(This->base.inner_window)
|
|
|
|
detach_inner_window(This->base.inner_window);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(This->frame_element)
|
|
|
|
This->frame_element->content_window = NULL;
|
2009-09-16 22:08:41 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(This->nswindow)
|
|
|
|
nsIDOMWindow_Release(This->nswindow);
|
2016-06-13 17:40:51 +02:00
|
|
|
if(This->window_proxy)
|
|
|
|
mozIDOMWindowProxy_Release(This->window_proxy);
|
2009-10-26 23:02:50 +01:00
|
|
|
|
2016-09-12 13:44:31 +02:00
|
|
|
wine_rb_remove(&window_map, &This->entry);
|
2012-06-25 14:04:59 +02:00
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void release_inner_window(HTMLInnerWindow *This)
|
|
|
|
{
|
2012-06-25 14:05:48 +02:00
|
|
|
unsigned i;
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
TRACE("%p\n", This);
|
|
|
|
|
2012-10-17 12:19:12 +02:00
|
|
|
detach_inner_window(This);
|
2012-06-25 14:06:09 +02:00
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
if(This->doc) {
|
|
|
|
This->doc->window = NULL;
|
2012-07-12 14:25:43 +02:00
|
|
|
htmldoc_release(&This->doc->basedoc);
|
2012-07-30 15:55:30 +02:00
|
|
|
}
|
2012-07-12 14:25:43 +02:00
|
|
|
|
2017-02-13 21:11:50 +01:00
|
|
|
release_event_target(&This->event_target);
|
2015-05-14 13:24:44 +02:00
|
|
|
release_dispex(&This->event_target.dispex);
|
2012-06-25 14:05:48 +02:00
|
|
|
|
|
|
|
for(i=0; i < This->global_prop_cnt; i++)
|
|
|
|
heap_free(This->global_props[i].name);
|
|
|
|
heap_free(This->global_props);
|
|
|
|
|
2012-08-14 11:29:17 +02:00
|
|
|
if(This->location) {
|
|
|
|
This->location->window = NULL;
|
|
|
|
IHTMLLocation_Release(&This->location->IHTMLLocation_iface);
|
|
|
|
}
|
|
|
|
|
2012-06-26 12:32:27 +02:00
|
|
|
if(This->image_factory) {
|
|
|
|
This->image_factory->window = NULL;
|
|
|
|
IHTMLImageElementFactory_Release(&This->image_factory->IHTMLImageElementFactory_iface);
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:58 +02:00
|
|
|
if(This->option_factory) {
|
|
|
|
This->option_factory->window = NULL;
|
|
|
|
IHTMLOptionElementFactory_Release(&This->option_factory->IHTMLOptionElementFactory_iface);
|
|
|
|
}
|
|
|
|
|
2015-06-30 15:50:30 +02:00
|
|
|
if(This->xhr_factory) {
|
|
|
|
This->xhr_factory->window = NULL;
|
|
|
|
IHTMLXMLHttpRequestFactory_Release(&This->xhr_factory->IHTMLXMLHttpRequestFactory_iface);
|
2015-06-09 17:21:02 +02:00
|
|
|
}
|
|
|
|
|
2012-06-26 12:32:40 +02:00
|
|
|
if(This->screen)
|
|
|
|
IHTMLScreen_Release(This->screen);
|
2013-04-23 16:21:04 +02:00
|
|
|
|
|
|
|
if(This->history) {
|
|
|
|
This->history->window = NULL;
|
|
|
|
IOmHistory_Release(&This->history->IOmHistory_iface);
|
|
|
|
}
|
|
|
|
|
2021-03-15 16:17:45 +01:00
|
|
|
if(This->navigator)
|
|
|
|
IOmNavigator_Release(This->navigator);
|
2014-09-02 11:34:53 +02:00
|
|
|
if(This->session_storage)
|
|
|
|
IHTMLStorage_Release(This->session_storage);
|
2019-03-22 15:16:28 +01:00
|
|
|
if(This->local_storage)
|
|
|
|
IHTMLStorage_Release(This->local_storage);
|
2014-09-02 11:34:53 +02:00
|
|
|
|
2012-08-14 11:28:37 +02:00
|
|
|
if(This->mon)
|
|
|
|
IMoniker_Release(This->mon);
|
2012-06-26 12:32:40 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
heap_free(This);
|
|
|
|
}
|
2009-10-26 23:02:50 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
2009-11-30 17:58:37 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2009-11-30 17:58:37 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!ref) {
|
|
|
|
if(is_outer_window(This))
|
|
|
|
release_outer_window(This->outer_window);
|
|
|
|
else
|
|
|
|
release_inner_window(This->inner_window);
|
2006-12-08 12:38:19 +01:00
|
|
|
}
|
2006-12-06 18:21:16 +01:00
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2007-07-31 00:53:10 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2007-07-31 00:53:10 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2007-07-31 00:53:10 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2007-07-31 00:53:10 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2013-01-23 18:44:42 +01:00
|
|
|
static HRESULT get_frame_by_index(HTMLOuterWindow *This, UINT32 index, HTMLOuterWindow **ret)
|
2009-11-13 21:13:10 +01:00
|
|
|
{
|
2012-09-03 17:34:44 +02:00
|
|
|
nsIDOMWindowCollection *nsframes;
|
2016-06-13 17:40:51 +02:00
|
|
|
mozIDOMWindowProxy *mozwindow;
|
2013-01-23 18:44:42 +01:00
|
|
|
UINT32 length;
|
2009-11-13 21:13:10 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
2012-09-03 17:34:44 +02:00
|
|
|
nsres = nsIDOMWindow_GetFrames(This->nswindow, &nsframes);
|
2009-11-13 21:13:10 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
2012-09-03 17:34:44 +02:00
|
|
|
FIXME("nsIDOMWindow_GetFrames failed: 0x%08x\n", nsres);
|
2009-11-13 21:13:10 +01:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-09-03 17:34:44 +02:00
|
|
|
nsres = nsIDOMWindowCollection_GetLength(nsframes, &length);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
if(index >= length) {
|
|
|
|
nsIDOMWindowCollection_Release(nsframes);
|
2009-11-13 21:13:10 +01:00
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
2012-09-03 17:34:44 +02:00
|
|
|
}
|
2009-11-13 21:13:10 +01:00
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
nsres = nsIDOMWindowCollection_Item(nsframes, index, &mozwindow);
|
2012-09-03 17:34:44 +02:00
|
|
|
nsIDOMWindowCollection_Release(nsframes);
|
2009-11-13 21:13:10 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("nsIDOMWindowCollection_Item failed: 0x%08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
*ret = mozwindow_to_window(mozwindow);
|
2009-11-13 21:13:10 +01:00
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
mozIDOMWindowProxy_Release(mozwindow);
|
2009-11-13 21:13:10 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-09-03 12:52:15 +02:00
|
|
|
HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, HTMLOuterWindow **ret)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2012-09-03 17:34:44 +02:00
|
|
|
nsIDOMWindowCollection *nsframes;
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *window = NULL;
|
2016-06-13 17:40:51 +02:00
|
|
|
mozIDOMWindowProxy *mozwindow;
|
2012-09-03 12:52:27 +02:00
|
|
|
nsAString name_str;
|
2013-01-23 18:44:42 +01:00
|
|
|
UINT32 length, i;
|
2009-11-13 21:13:10 +01:00
|
|
|
nsresult nsres;
|
2012-09-03 17:34:44 +02:00
|
|
|
HRESULT hres = S_OK;
|
2009-11-13 21:13:10 +01:00
|
|
|
|
2012-09-03 17:34:44 +02:00
|
|
|
nsres = nsIDOMWindow_GetFrames(This->nswindow, &nsframes);
|
2009-11-13 21:13:10 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("nsIDOMWindow_GetFrames failed: 0x%08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2015-08-09 08:24:04 +02:00
|
|
|
if(!nsframes) {
|
|
|
|
WARN("nsIDOMWindow_GetFrames returned NULL nsframes: %p\n", This->nswindow);
|
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
|
|
|
}
|
|
|
|
|
2012-09-03 12:52:27 +02:00
|
|
|
nsAString_InitDepend(&name_str, name);
|
2016-06-13 17:40:51 +02:00
|
|
|
nsres = nsIDOMWindowCollection_NamedItem(nsframes, &name_str, &mozwindow);
|
2012-09-03 12:52:27 +02:00
|
|
|
nsAString_Finish(&name_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
nsIDOMWindowCollection_Release(nsframes);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
if(mozwindow) {
|
|
|
|
*ret = mozwindow_to_window(mozwindow);
|
2012-09-03 12:52:27 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-09-03 17:34:44 +02:00
|
|
|
nsres = nsIDOMWindowCollection_GetLength(nsframes, &length);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
for(i = 0; i < length && !window; ++i) {
|
|
|
|
HTMLOuterWindow *window_iter;
|
|
|
|
BSTR id;
|
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
nsres = nsIDOMWindowCollection_Item(nsframes, i, &mozwindow);
|
2012-09-03 17:34:44 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("nsIDOMWindowCollection_Item failed: 0x%08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
window_iter = mozwindow_to_window(mozwindow);
|
2012-09-03 17:34:44 +02:00
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
mozIDOMWindowProxy_Release(mozwindow);
|
2012-09-03 17:34:44 +02:00
|
|
|
|
2015-05-29 15:51:50 +02:00
|
|
|
if(!window_iter) {
|
2016-06-13 17:40:51 +02:00
|
|
|
WARN("nsIDOMWindow without HTMLOuterWindow: %p\n", mozwindow);
|
2015-05-29 15:51:50 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-09-03 17:34:44 +02:00
|
|
|
hres = IHTMLElement_get_id(&window_iter->frame_element->element.IHTMLElement_iface, &id);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
FIXME("IHTMLElement_get_id failed: 0x%08x\n", hres);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-06-13 08:34:29 +02:00
|
|
|
if(id && !wcsicmp(id, name))
|
2012-09-03 17:34:44 +02:00
|
|
|
window = window_iter;
|
|
|
|
|
|
|
|
SysFreeString(id);
|
2012-09-03 12:52:15 +02:00
|
|
|
|
|
|
|
if(!window && deep)
|
|
|
|
get_frame_by_name(window_iter, name, TRUE, &window);
|
2012-09-03 17:34:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
nsIDOMWindowCollection_Release(nsframes);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*ret = window;
|
2016-09-13 20:54:20 +02:00
|
|
|
return S_OK;
|
2012-09-03 17:34:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex, VARIANT *pvarResult)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
|
|
|
HTMLOuterWindow *window = NULL;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
|
|
|
|
|
2011-11-03 19:24:09 +01:00
|
|
|
switch(V_VT(pvarIndex)) {
|
|
|
|
case VT_I4: {
|
2009-11-13 21:13:10 +01:00
|
|
|
int index = V_I4(pvarIndex);
|
|
|
|
TRACE("Getting index %d\n", index);
|
2011-11-03 19:24:09 +01:00
|
|
|
if(index < 0)
|
2012-09-03 17:34:44 +02:00
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
|
|
|
hres = get_frame_by_index(This->outer_window, index, &window);
|
2011-11-03 19:24:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case VT_UINT: {
|
2009-11-13 21:13:10 +01:00
|
|
|
unsigned int index = V_UINT(pvarIndex);
|
|
|
|
TRACE("Getting index %u\n", index);
|
2012-09-03 17:34:44 +02:00
|
|
|
hres = get_frame_by_index(This->outer_window, index, &window);
|
2011-11-03 19:24:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case VT_BSTR: {
|
2009-11-13 21:13:10 +01:00
|
|
|
BSTR str = V_BSTR(pvarIndex);
|
|
|
|
TRACE("Getting name %s\n", wine_dbgstr_w(str));
|
2012-09-03 12:52:15 +02:00
|
|
|
hres = get_frame_by_name(This->outer_window, str, FALSE, &window);
|
2011-11-03 19:24:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2012-09-03 17:34:44 +02:00
|
|
|
WARN("Invalid index %s\n", debugstr_variant(pvarIndex));
|
|
|
|
return E_INVALIDARG;
|
2009-11-13 21:13:10 +01:00
|
|
|
}
|
|
|
|
|
2011-11-03 19:24:09 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
if(!window)
|
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
|
2009-11-13 21:13:10 +01:00
|
|
|
V_VT(pvarResult) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(pvarResult) = (IDispatch*)window;
|
2011-11-03 19:24:09 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_get_length(IHTMLWindow2 *iface, LONG *p)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-10-13 00:41:28 +02:00
|
|
|
nsIDOMWindowCollection *nscollection;
|
2013-01-23 18:44:42 +01:00
|
|
|
UINT32 length;
|
2009-10-13 00:41:28 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
nsres = nsIDOMWindow_GetFrames(This->outer_window->nswindow, &nscollection);
|
2009-10-13 00:41:28 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetFrames failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMWindowCollection_GetLength(nscollection, &length);
|
|
|
|
nsIDOMWindowCollection_Release(nscollection);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetLength failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = length;
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_frames(IHTMLWindow2 *iface, IHTMLFramesCollection2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-11-13 21:13:07 +01:00
|
|
|
FIXME("(%p)->(%p): semi-stub\n", This, p);
|
|
|
|
|
|
|
|
/* FIXME: Should return a separate Window object */
|
2010-12-27 12:50:32 +01:00
|
|
|
*p = (IHTMLFramesCollection2*)&This->IHTMLWindow2_iface;
|
2016-09-02 13:36:19 +02:00
|
|
|
IHTMLWindow2_AddRef(iface);
|
2009-11-13 21:13:07 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_defaultStatus(IHTMLWindow2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_defaultStatus(IHTMLWindow2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_status(IHTMLWindow2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2011-07-31 16:44:43 +02:00
|
|
|
|
|
|
|
WARN("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FIXME: Since IE7, setting status is blocked, but still possible in certain circumstances.
|
|
|
|
* Ignoring the call should be enough for us.
|
|
|
|
*/
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_status(IHTMLWindow2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2011-07-31 16:44:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* See put_status */
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_setTimeout(IHTMLWindow2 *iface, BSTR expression,
|
2009-03-12 01:42:55 +01:00
|
|
|
LONG msec, VARIANT *language, LONG *timerID)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-04-21 18:12:49 +02:00
|
|
|
VARIANT expr_var;
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
|
2008-04-21 18:12:49 +02:00
|
|
|
|
|
|
|
V_VT(&expr_var) = VT_BSTR;
|
|
|
|
V_BSTR(&expr_var) = expression;
|
|
|
|
|
2010-12-27 14:22:27 +01:00
|
|
|
return IHTMLWindow3_setTimeout(&This->IHTMLWindow3_iface, &expr_var, msec, language, timerID);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-06-27 21:14:40 +02:00
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, timerID);
|
2008-06-27 21:14:40 +02:00
|
|
|
|
2016-05-02 15:39:34 +02:00
|
|
|
return clear_task_timer(This->inner_window, timerID);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2010-04-21 14:01:22 +02:00
|
|
|
#define MAX_MESSAGE_LEN 2000
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2010-04-21 14:01:22 +02:00
|
|
|
WCHAR title[100], *msg = message;
|
|
|
|
DWORD len;
|
2006-12-12 17:08:18 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(message));
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2018-08-23 23:31:15 +02:00
|
|
|
if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, title, ARRAY_SIZE(title))) {
|
2006-12-12 17:08:18 +01:00
|
|
|
WARN("Could not load message box title: %d\n", GetLastError());
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-04-21 14:01:22 +02:00
|
|
|
len = SysStringLen(message);
|
|
|
|
if(len > MAX_MESSAGE_LEN) {
|
|
|
|
msg = heap_alloc((MAX_MESSAGE_LEN+1)*sizeof(WCHAR));
|
|
|
|
if(!msg)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
memcpy(msg, message, MAX_MESSAGE_LEN*sizeof(WCHAR));
|
|
|
|
msg[MAX_MESSAGE_LEN] = 0;
|
|
|
|
}
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
MessageBoxW(This->outer_window->browser->doc->hwnd, msg, title, MB_ICONWARNING);
|
2010-04-21 14:01:22 +02:00
|
|
|
if(msg != message)
|
|
|
|
heap_free(msg);
|
2006-12-12 17:08:18 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message,
|
|
|
|
VARIANT_BOOL *confirmed)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 19:08:30 +01:00
|
|
|
WCHAR wszTitle[100];
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(message), confirmed);
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!confirmed)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
|
|
|
return E_UNEXPECTED;
|
2009-03-12 19:08:30 +01:00
|
|
|
|
2018-08-23 23:31:15 +02:00
|
|
|
if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle, ARRAY_SIZE(wszTitle))) {
|
2009-03-12 19:08:30 +01:00
|
|
|
WARN("Could not load message box title: %d\n", GetLastError());
|
|
|
|
*confirmed = VARIANT_TRUE;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(MessageBoxW(This->outer_window->browser->doc->hwnd, message, wszTitle,
|
2009-03-12 19:08:30 +01:00
|
|
|
MB_OKCANCEL|MB_ICONQUESTION)==IDOK)
|
|
|
|
*confirmed = VARIANT_TRUE;
|
|
|
|
else *confirmed = VARIANT_FALSE;
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 19:08:06 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BSTR message;
|
|
|
|
BSTR dststr;
|
|
|
|
VARIANT *textdata;
|
|
|
|
}prompt_arg;
|
|
|
|
|
|
|
|
static INT_PTR CALLBACK prompt_dlgproc(HWND hwnd, UINT msg,
|
|
|
|
WPARAM wparam, LPARAM lparam)
|
|
|
|
{
|
|
|
|
switch(msg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
|
|
|
{
|
|
|
|
prompt_arg *arg = (prompt_arg*)lparam;
|
|
|
|
WCHAR wszTitle[100];
|
|
|
|
|
2018-08-23 23:31:15 +02:00
|
|
|
if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle, ARRAY_SIZE(wszTitle))) {
|
2009-03-12 19:08:06 +01:00
|
|
|
WARN("Could not load message box title: %d\n", GetLastError());
|
|
|
|
EndDialog(hwnd, wparam);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
|
|
|
|
SetWindowTextW(hwnd, wszTitle);
|
|
|
|
SetWindowTextW(GetDlgItem(hwnd, ID_PROMPT_PROMPT), arg->message);
|
|
|
|
SetWindowTextW(GetDlgItem(hwnd, ID_PROMPT_EDIT), arg->dststr);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
case WM_COMMAND:
|
|
|
|
switch(wparam)
|
|
|
|
{
|
|
|
|
case MAKEWPARAM(IDCANCEL, BN_CLICKED):
|
|
|
|
EndDialog(hwnd, wparam);
|
|
|
|
return TRUE;
|
|
|
|
case MAKEWPARAM(IDOK, BN_CLICKED):
|
|
|
|
{
|
|
|
|
prompt_arg *arg =
|
|
|
|
(prompt_arg*)GetWindowLongPtrW(hwnd, DWLP_USER);
|
|
|
|
HWND hwndPrompt = GetDlgItem(hwnd, ID_PROMPT_EDIT);
|
|
|
|
INT len = GetWindowTextLengthW(hwndPrompt);
|
|
|
|
|
|
|
|
if(!arg->textdata)
|
|
|
|
{
|
|
|
|
EndDialog(hwnd, wparam);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
V_VT(arg->textdata) = VT_BSTR;
|
|
|
|
if(!len && !arg->dststr)
|
|
|
|
V_BSTR(arg->textdata) = NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
V_BSTR(arg->textdata) = SysAllocStringLen(NULL, len);
|
|
|
|
GetWindowTextW(hwndPrompt, V_BSTR(arg->textdata), len+1);
|
|
|
|
}
|
|
|
|
EndDialog(hwnd, wparam);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
case WM_CLOSE:
|
|
|
|
EndDialog(hwnd, IDCANCEL);
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
|
|
|
|
BSTR dststr, VARIANT *textdata)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 19:08:06 +01:00
|
|
|
prompt_arg arg;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(message), debugstr_w(dststr), textdata);
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2009-03-12 19:08:06 +01:00
|
|
|
if(textdata) V_VT(textdata) = VT_NULL;
|
|
|
|
|
|
|
|
arg.message = message;
|
|
|
|
arg.dststr = dststr;
|
|
|
|
arg.textdata = textdata;
|
|
|
|
|
|
|
|
DialogBoxParamW(hInst, MAKEINTRESOURCEW(ID_PROMPT_DIALOG),
|
2019-03-14 14:13:13 +01:00
|
|
|
This->outer_window->browser->doc->hwnd, prompt_dlgproc, (LPARAM)&arg);
|
2009-03-12 19:08:06 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageElementFactory **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-26 12:32:27 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2009-10-20 23:04:34 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-26 12:32:27 +02:00
|
|
|
if(!window->image_factory) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = HTMLImageElementFactory_Create(window, &window->image_factory);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
2009-10-20 23:04:34 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = &window->image_factory->IHTMLImageElementFactory_iface;
|
2009-10-20 23:04:34 +02:00
|
|
|
IHTMLImageElementFactory_AddRef(*p);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-11-30 17:58:37 +01:00
|
|
|
HTMLLocation *location;
|
|
|
|
HRESULT hres;
|
2009-01-03 17:45:47 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-08-14 11:29:17 +02:00
|
|
|
hres = get_location(This->inner_window, &location);
|
2009-11-30 17:58:37 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
2009-01-03 17:45:47 +01:00
|
|
|
|
2011-01-03 01:12:05 +01:00
|
|
|
*p = &location->IHTMLLocation_iface;
|
2009-09-16 22:05:50 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-26 12:32:53 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2012-05-02 10:28:09 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!window->history) {
|
2012-05-02 10:28:09 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2013-04-23 16:21:04 +02:00
|
|
|
hres = create_history(window, &window->history);
|
2012-05-02 10:28:09 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2013-04-23 16:21:04 +02:00
|
|
|
IOmHistory_AddRef(&window->history->IOmHistory_iface);
|
|
|
|
*p = &window->history->IOmHistory_iface;
|
2012-05-02 10:28:09 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2013-04-15 17:40:53 +02:00
|
|
|
static BOOL notify_webbrowser_close(HTMLOuterWindow *window, HTMLDocumentObj *doc)
|
|
|
|
{
|
|
|
|
IConnectionPointContainer *cp_container;
|
|
|
|
VARIANT_BOOL cancel = VARIANT_FALSE;
|
|
|
|
IEnumConnections *enum_conn;
|
|
|
|
VARIANT args[2];
|
|
|
|
DISPPARAMS dp = {args, NULL, 2, 0};
|
|
|
|
CONNECTDATA conn_data;
|
|
|
|
IConnectionPoint *cp;
|
|
|
|
IDispatch *disp;
|
|
|
|
ULONG fetched;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
if(!doc->webbrowser)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(doc->webbrowser, &IID_IConnectionPointContainer, (void**)&cp_container);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
hres = IConnectionPointContainer_FindConnectionPoint(cp_container, &DIID_DWebBrowserEvents2, &cp);
|
|
|
|
IConnectionPointContainer_Release(cp_container);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
hres = IConnectionPoint_EnumConnections(cp, &enum_conn);
|
|
|
|
IConnectionPoint_Release(cp);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
while(!cancel) {
|
|
|
|
conn_data.pUnk = NULL;
|
|
|
|
conn_data.dwCookie = 0;
|
|
|
|
fetched = 0;
|
|
|
|
hres = IEnumConnections_Next(enum_conn, 1, &conn_data, &fetched);
|
|
|
|
if(hres != S_OK)
|
|
|
|
break;
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(conn_data.pUnk, &IID_IDispatch, (void**)&disp);
|
|
|
|
IUnknown_Release(conn_data.pUnk);
|
|
|
|
if(FAILED(hres))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
V_VT(args) = VT_BYREF|VT_BOOL;
|
|
|
|
V_BOOLREF(args) = &cancel;
|
|
|
|
V_VT(args+1) = VT_BOOL;
|
2017-11-02 16:48:02 +01:00
|
|
|
V_BOOL(args+1) = variant_bool(window->parent != NULL);
|
2013-04-15 17:40:53 +02:00
|
|
|
hres = IDispatch_Invoke(disp, DISPID_WINDOWCLOSING, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
|
|
|
|
IDispatch_Release(disp);
|
|
|
|
if(FAILED(hres))
|
|
|
|
cancel = VARIANT_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumConnections_Release(enum_conn);
|
|
|
|
return !cancel;
|
|
|
|
}
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_close(IHTMLWindow2 *iface)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2013-04-15 17:40:53 +02:00
|
|
|
HTMLOuterWindow *window = This->outer_window;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!window || !window->browser) {
|
2013-04-15 17:40:53 +02:00
|
|
|
FIXME("No document object\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!notify_webbrowser_close(window, window->browser->doc))
|
2013-04-15 17:40:53 +02:00
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
FIXME("default action not implemented\n");
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_opener(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_opener(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-04-10 12:53:03 +02:00
|
|
|
|
|
|
|
FIXME("(%p)->(%p) returning empty\n", This, p);
|
|
|
|
|
|
|
|
V_VT(p) = VT_EMPTY;
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigator **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2021-03-15 16:17:45 +01:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2008-04-07 12:34:24 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2021-03-15 16:17:45 +01:00
|
|
|
if(!window->navigator) {
|
|
|
|
HRESULT hres;
|
|
|
|
hres = create_navigator(dispex_compat_mode(&window->event_target.dispex), &window->navigator);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
IOmNavigator_AddRef(*p = window->navigator);
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_name(IHTMLWindow2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-10-13 00:41:11 +02:00
|
|
|
nsAString name_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
2010-01-28 23:56:31 +01:00
|
|
|
nsAString_InitDepend(&name_str, v);
|
2012-06-25 14:04:59 +02:00
|
|
|
nsres = nsIDOMWindow_SetName(This->outer_window->nswindow, &name_str);
|
2009-10-13 00:41:11 +02:00
|
|
|
nsAString_Finish(&name_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetName failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-10-13 00:41:11 +02:00
|
|
|
nsAString name_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&name_str, NULL);
|
2012-06-25 14:04:59 +02:00
|
|
|
nsres = nsIDOMWindow_GetName(This->outer_window->nswindow, &name_str);
|
2012-04-13 12:20:25 +02:00
|
|
|
return return_nsstr(nsres, &name_str, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_parent(IHTMLWindow2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *window = This->outer_window;
|
2012-04-11 11:03:43 +02:00
|
|
|
|
2009-11-13 21:13:12 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!window->parent)
|
2012-04-11 11:03:43 +02:00
|
|
|
return IHTMLWindow2_get_self(&This->IHTMLWindow2_iface, p);
|
2009-11-13 21:13:12 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = &window->parent->base.IHTMLWindow2_iface;
|
2012-04-11 11:03:43 +02:00
|
|
|
IHTMLWindow2_AddRef(*p);
|
2009-11-13 21:13:12 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
|
|
|
|
BSTR features, VARIANT_BOOL replace, IHTMLWindow2 **pomWindowResult)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *window = This->outer_window;
|
2012-01-09 17:56:54 +01:00
|
|
|
IUri *uri;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
|
2006-12-06 18:21:16 +01:00
|
|
|
debugstr_w(features), replace, pomWindowResult);
|
2017-06-21 17:05:31 +02:00
|
|
|
if(features)
|
|
|
|
FIXME("unsupported features argument %s\n", debugstr_w(features));
|
|
|
|
if(replace)
|
|
|
|
FIXME("unsupported relace argument\n");
|
2012-01-09 17:56:54 +01:00
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!window || !window->browser || !window->uri_nofrag)
|
2012-01-09 17:56:54 +01:00
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
if(name && *name == '_') {
|
2020-11-24 00:49:05 +01:00
|
|
|
if(!wcscmp(name, L"_self")) {
|
2015-01-28 15:30:10 +01:00
|
|
|
if((features && *features) || replace)
|
|
|
|
FIXME("Unsupported arguments for _self target\n");
|
|
|
|
|
|
|
|
hres = IHTMLWindow2_navigate(&This->IHTMLWindow2_iface, url);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(pomWindowResult) {
|
|
|
|
FIXME("Returning this window for _self target\n");
|
|
|
|
*pomWindowResult = &This->IHTMLWindow2_iface;
|
|
|
|
IHTMLWindow2_AddRef(*pomWindowResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-01-09 17:56:54 +01:00
|
|
|
FIXME("Unsupported name %s\n", debugstr_w(name));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
hres = create_relative_uri(window, url, &uri);
|
2012-01-09 17:56:54 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2014-12-16 16:13:05 +01:00
|
|
|
hres = navigate_new_window(window, uri, name, NULL, pomWindowResult);
|
2012-01-09 17:56:54 +01:00
|
|
|
IUri_Release(uri);
|
|
|
|
return hres;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-06-30 21:37:41 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* FIXME: We should return kind of proxy window here. */
|
2010-12-27 12:50:32 +01:00
|
|
|
IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
*p = &This->IHTMLWindow2_iface;
|
2008-06-30 21:37:41 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *top;
|
2012-03-29 15:05:25 +02:00
|
|
|
|
2009-11-17 00:28:54 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
get_top_window(This->outer_window, &top);
|
|
|
|
*p = &top->base.IHTMLWindow2_iface;
|
2009-11-17 00:28:54 +01:00
|
|
|
IHTMLWindow2_AddRef(*p);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_window(IHTMLWindow2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-06-30 21:37:18 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* FIXME: We should return kind of proxy window here. */
|
2010-12-27 12:50:32 +01:00
|
|
|
IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
*p = &This->IHTMLWindow2_iface;
|
2008-06-30 21:37:18 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_navigate(IHTMLWindow2 *iface, BSTR url)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2014-07-28 23:56:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(url));
|
|
|
|
|
|
|
|
return navigate_url(This->outer_window, url, This->outer_window->uri, BINDING_NAVIGATED);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onfocus(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2013-02-20 15:20:59 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_FOCUS, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onfocus(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2013-02-20 15:20:59 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_FOCUS, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onblur(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-10-25 15:11:53 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_BLUR, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onblur(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-10-25 15:11:53 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_BLUR, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onload(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-09-08 22:30:38 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_LOAD, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onload(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-09-08 22:30:38 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_LOAD, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onbeforeunload(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-09-08 22:30:14 +02:00
|
|
|
|
2012-03-28 14:26:11 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2009-09-08 22:30:14 +02:00
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_BEFOREUNLOAD, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onbeforeunload(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-09-08 22:30:14 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_BEFOREUNLOAD, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onunload(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2016-05-26 16:16:09 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_UNLOAD, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onunload(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2016-05-26 16:16:09 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_UNLOAD, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onhelp(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-09-04 13:58:58 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_HELP, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onhelp(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-09-04 13:58:58 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_HELP, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onerror(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-04-04 15:08:38 +02:00
|
|
|
|
|
|
|
FIXME("(%p)->(%s) semi-stub\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_ERROR, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onerror(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-04-04 15:08:38 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_ERROR, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onresize(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-12-07 23:28:10 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_RESIZE, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onresize(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-12-07 23:28:10 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_RESIZE, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_onscroll(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-09-10 14:41:28 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_SCROLL, &v);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_onscroll(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-09-10 14:41:28 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_SCROLL, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocument2 **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-04-21 18:12:32 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
if(This->inner_window->doc) {
|
2008-04-21 18:12:32 +02:00
|
|
|
/* FIXME: We should return a wrapper object here */
|
2012-06-25 14:05:17 +02:00
|
|
|
*p = &This->inner_window->doc->basedoc.IHTMLDocument2_iface;
|
2008-04-21 18:12:32 +02:00
|
|
|
IHTMLDocument2_AddRef(*p);
|
|
|
|
}else {
|
|
|
|
*p = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2017-10-19 17:01:43 +02:00
|
|
|
IHTMLEventObj *default_set_current_event(HTMLInnerWindow *window, IHTMLEventObj *event_obj)
|
|
|
|
{
|
|
|
|
IHTMLEventObj *prev_event = NULL;
|
|
|
|
|
|
|
|
if(window) {
|
|
|
|
if(event_obj)
|
|
|
|
IHTMLEventObj_AddRef(event_obj);
|
|
|
|
prev_event = window->event;
|
|
|
|
window->event = event_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return prev_event;
|
|
|
|
}
|
|
|
|
|
2006-12-06 18:21:16 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-25 14:06:27 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2008-10-10 22:47:02 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(window->event)
|
|
|
|
IHTMLEventObj_AddRef(window->event);
|
|
|
|
*p = window->event;
|
2008-10-10 22:47:02 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_showModalDialog(IHTMLWindow2 *iface, BSTR dialog,
|
|
|
|
VARIANT *varArgIn, VARIANT *varOptions, VARIANT *varArgOut)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(dialog), varArgIn, varOptions, varArgOut);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_showHelp(IHTMLWindow2 *iface, BSTR helpURL, VARIANT helpArg,
|
|
|
|
BSTR features)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(helpURL), debugstr_variant(&helpArg), debugstr_w(features));
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_screen(IHTMLWindow2 *iface, IHTMLScreen **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-26 12:32:40 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2009-11-30 17:56:01 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!window->screen) {
|
2009-11-30 17:56:01 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
2021-03-12 17:40:13 +01:00
|
|
|
hres = create_html_screen(dispex_compat_mode(&window->event_target.dispex), &window->screen);
|
2009-11-30 17:56:01 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = window->screen;
|
|
|
|
IHTMLScreen_AddRef(window->screen);
|
2009-11-30 17:56:01 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionElementFactory **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-06-25 14:05:58 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2007-10-13 03:58:55 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:05:58 +02:00
|
|
|
if(!window->option_factory) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = HTMLOptionElementFactory_Create(window, &window->option_factory);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
2007-10-13 03:58:55 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = &window->option_factory->IHTMLOptionElementFactory_iface;
|
2007-10-13 03:58:55 +02:00
|
|
|
IHTMLOptionElementFactory_AddRef(*p);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2011-02-06 22:15:57 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
SetFocus(This->outer_window->browser->doc->hwnd);
|
2011-02-06 22:15:57 +01:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_closed(IHTMLWindow2 *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_blur(IHTMLWindow2 *iface)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_scroll(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2014-06-17 12:43:48 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %d)\n", This, x, y);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_Scroll(This->outer_window->nswindow, x, y);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("ScrollBy failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_clientInformation(IHTMLWindow2 *iface, IOmNavigator **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2015-12-21 14:30:50 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLWindow2_get_navigator(&This->IHTMLWindow2_iface, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_setInterval(IHTMLWindow2 *iface, BSTR expression,
|
2009-03-12 01:42:55 +01:00
|
|
|
LONG msec, VARIANT *language, LONG *timerID)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-06-27 21:10:23 +02:00
|
|
|
VARIANT expr;
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%s %d %p %p)\n", This, debugstr_w(expression), msec, language, timerID);
|
2008-06-27 21:10:23 +02:00
|
|
|
|
|
|
|
V_VT(&expr) = VT_BSTR;
|
|
|
|
V_BSTR(&expr) = expression;
|
2010-12-27 14:22:27 +01:00
|
|
|
return IHTMLWindow3_setInterval(&This->IHTMLWindow3_iface, &expr, msec, language, timerID);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, LONG timerID)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-06-27 21:14:08 +02:00
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%d)\n", This, timerID);
|
2008-06-27 21:14:08 +02:00
|
|
|
|
2016-05-02 15:39:34 +02:00
|
|
|
return clear_task_timer(This->inner_window, timerID);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_put_offscreenBuffering(IHTMLWindow2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_offscreenBuffering(IHTMLWindow2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BSTR language,
|
|
|
|
VARIANT *pvarRet)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2010-11-09 13:36:24 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(scode), debugstr_w(language), pvarRet);
|
|
|
|
|
2012-06-25 14:06:09 +02:00
|
|
|
return exec_script(This->inner_window, scode, language, pvarRet);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-08-31 20:45:02 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, String);
|
|
|
|
|
|
|
|
if(!String)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2020-11-24 00:49:05 +01:00
|
|
|
*String = SysAllocString(L"[object]");
|
2009-08-31 20:45:02 +02:00
|
|
|
return *String ? S_OK : E_OUTOFMEMORY;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-07-04 17:23:51 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%d %d)\n", This, x, y);
|
2008-07-04 17:23:51 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
nsres = nsIDOMWindow_ScrollBy(This->outer_window->nswindow, x, y);
|
2008-07-04 17:23:51 +02:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("ScrollBy failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_scrollTo(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2008-07-04 17:23:51 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%d %d)\n", This, x, y);
|
2008-07-04 17:23:51 +02:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
nsres = nsIDOMWindow_ScrollTo(This->outer_window->nswindow, x, y);
|
2008-07-04 17:23:51 +02:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("ScrollTo failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_moveTo(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 01:42:55 +01:00
|
|
|
FIXME("(%p)->(%d %d)\n", This, x, y);
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_moveBy(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 01:42:55 +01:00
|
|
|
FIXME("(%p)->(%d %d)\n", This, x, y);
|
2016-06-21 15:12:34 +02:00
|
|
|
return S_FALSE;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_resizeTo(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 01:42:55 +01:00
|
|
|
FIXME("(%p)->(%d %d)\n", This, x, y);
|
2006-12-06 18:21:16 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow2_resizeBy(IHTMLWindow2 *iface, LONG x, LONG y)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2009-03-12 01:42:55 +01:00
|
|
|
FIXME("(%p)->(%d %d)\n", This, x, y);
|
2016-06-21 15:12:34 +02:00
|
|
|
return S_FALSE;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-27 12:50:32 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
2007-08-01 00:59:48 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2007-08-01 00:59:48 +02:00
|
|
|
*p = NULL;
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
if(!This->outer_window->browser->doc->hostui)
|
2007-08-01 00:59:48 +02:00
|
|
|
return S_OK;
|
|
|
|
|
2019-03-14 14:13:13 +01:00
|
|
|
return IDocHostUIHandler_GetExternal(This->outer_window->browser->doc->hostui, p);
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLWindow2Vtbl HTMLWindow2Vtbl = {
|
|
|
|
HTMLWindow2_QueryInterface,
|
|
|
|
HTMLWindow2_AddRef,
|
|
|
|
HTMLWindow2_Release,
|
|
|
|
HTMLWindow2_GetTypeInfoCount,
|
|
|
|
HTMLWindow2_GetTypeInfo,
|
|
|
|
HTMLWindow2_GetIDsOfNames,
|
|
|
|
HTMLWindow2_Invoke,
|
|
|
|
HTMLWindow2_item,
|
|
|
|
HTMLWindow2_get_length,
|
|
|
|
HTMLWindow2_get_frames,
|
|
|
|
HTMLWindow2_put_defaultStatus,
|
|
|
|
HTMLWindow2_get_defaultStatus,
|
|
|
|
HTMLWindow2_put_status,
|
|
|
|
HTMLWindow2_get_status,
|
|
|
|
HTMLWindow2_setTimeout,
|
|
|
|
HTMLWindow2_clearTimeout,
|
|
|
|
HTMLWindow2_alert,
|
|
|
|
HTMLWindow2_confirm,
|
|
|
|
HTMLWindow2_prompt,
|
|
|
|
HTMLWindow2_get_Image,
|
|
|
|
HTMLWindow2_get_location,
|
|
|
|
HTMLWindow2_get_history,
|
|
|
|
HTMLWindow2_close,
|
|
|
|
HTMLWindow2_put_opener,
|
|
|
|
HTMLWindow2_get_opener,
|
|
|
|
HTMLWindow2_get_navigator,
|
|
|
|
HTMLWindow2_put_name,
|
|
|
|
HTMLWindow2_get_name,
|
|
|
|
HTMLWindow2_get_parent,
|
|
|
|
HTMLWindow2_open,
|
|
|
|
HTMLWindow2_get_self,
|
|
|
|
HTMLWindow2_get_top,
|
|
|
|
HTMLWindow2_get_window,
|
|
|
|
HTMLWindow2_navigate,
|
|
|
|
HTMLWindow2_put_onfocus,
|
|
|
|
HTMLWindow2_get_onfocus,
|
|
|
|
HTMLWindow2_put_onblur,
|
|
|
|
HTMLWindow2_get_onblur,
|
|
|
|
HTMLWindow2_put_onload,
|
|
|
|
HTMLWindow2_get_onload,
|
|
|
|
HTMLWindow2_put_onbeforeunload,
|
|
|
|
HTMLWindow2_get_onbeforeunload,
|
|
|
|
HTMLWindow2_put_onunload,
|
|
|
|
HTMLWindow2_get_onunload,
|
|
|
|
HTMLWindow2_put_onhelp,
|
|
|
|
HTMLWindow2_get_onhelp,
|
|
|
|
HTMLWindow2_put_onerror,
|
|
|
|
HTMLWindow2_get_onerror,
|
|
|
|
HTMLWindow2_put_onresize,
|
|
|
|
HTMLWindow2_get_onresize,
|
|
|
|
HTMLWindow2_put_onscroll,
|
|
|
|
HTMLWindow2_get_onscroll,
|
|
|
|
HTMLWindow2_get_document,
|
|
|
|
HTMLWindow2_get_event,
|
|
|
|
HTMLWindow2_get__newEnum,
|
|
|
|
HTMLWindow2_showModalDialog,
|
|
|
|
HTMLWindow2_showHelp,
|
|
|
|
HTMLWindow2_get_screen,
|
|
|
|
HTMLWindow2_get_Option,
|
|
|
|
HTMLWindow2_focus,
|
|
|
|
HTMLWindow2_get_closed,
|
|
|
|
HTMLWindow2_blur,
|
|
|
|
HTMLWindow2_scroll,
|
|
|
|
HTMLWindow2_get_clientInformation,
|
|
|
|
HTMLWindow2_setInterval,
|
|
|
|
HTMLWindow2_clearInterval,
|
|
|
|
HTMLWindow2_put_offscreenBuffering,
|
|
|
|
HTMLWindow2_get_offscreenBuffering,
|
|
|
|
HTMLWindow2_execScript,
|
|
|
|
HTMLWindow2_toString,
|
|
|
|
HTMLWindow2_scrollBy,
|
|
|
|
HTMLWindow2_scrollTo,
|
|
|
|
HTMLWindow2_moveTo,
|
|
|
|
HTMLWindow2_moveBy,
|
|
|
|
HTMLWindow2_resizeTo,
|
|
|
|
HTMLWindow2_resizeBy,
|
|
|
|
HTMLWindow2_get_external
|
|
|
|
};
|
|
|
|
|
2010-12-27 14:22:27 +01:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow3(IHTMLWindow3 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow3_iface);
|
|
|
|
}
|
2008-04-17 22:53:31 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_QueryInterface(IHTMLWindow3 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow3_AddRef(IHTMLWindow3 *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow3_Release(IHTMLWindow3 *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-19 18:41:44 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-19 18:41:44 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-19 18:41:44 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-19 18:41:44 +02:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, LONG *p)
|
2008-04-17 22:53:31 +02:00
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2014-12-23 21:12:43 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetScreenX(This->outer_window->nswindow, p);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetScreenX failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow3_get_screenTop(IHTMLWindow3 *iface, LONG *p)
|
2008-04-17 22:53:31 +02:00
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2014-12-23 21:12:43 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetScreenY(This->outer_window->nswindow, p);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetScreenY failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp, VARIANT_BOOL *pfResult)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2012-06-25 14:05:17 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2009-09-08 22:31:10 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!window->doc) {
|
2010-01-04 00:39:31 +01:00
|
|
|
FIXME("No document\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2015-05-20 19:46:53 +02:00
|
|
|
return attach_event(&window->event_target, event, pDisp, pfResult);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2012-06-25 14:05:17 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2012-04-17 12:11:01 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(!window->doc) {
|
2012-04-17 12:11:01 +02:00
|
|
|
FIXME("No document\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2015-05-20 19:47:00 +02:00
|
|
|
return detach_event(&window->event_target, event, pDisp);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
static HRESULT window_set_timer(HTMLInnerWindow *This, VARIANT *expr, LONG msec, VARIANT *language,
|
2021-04-22 01:49:02 +02:00
|
|
|
enum timer_type timer_type, LONG *timer_id)
|
2008-04-17 22:53:31 +02:00
|
|
|
{
|
2008-06-27 21:10:04 +02:00
|
|
|
IDispatch *disp = NULL;
|
2012-10-19 11:56:59 +02:00
|
|
|
HRESULT hres;
|
2008-04-21 18:21:19 +02:00
|
|
|
|
2008-06-27 21:10:04 +02:00
|
|
|
switch(V_VT(expr)) {
|
2008-04-21 18:21:19 +02:00
|
|
|
case VT_DISPATCH:
|
2008-06-27 21:10:04 +02:00
|
|
|
disp = V_DISPATCH(expr);
|
|
|
|
IDispatch_AddRef(disp);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case VT_BSTR:
|
2012-06-25 14:06:09 +02:00
|
|
|
disp = script_parse_event(This->base.inner_window, V_BSTR(expr));
|
2008-04-21 18:21:19 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("unimplemented expr %s\n", debugstr_variant(expr));
|
2008-06-27 21:10:04 +02:00
|
|
|
return E_NOTIMPL;
|
2008-04-21 18:21:19 +02:00
|
|
|
}
|
|
|
|
|
2008-06-27 21:10:04 +02:00
|
|
|
if(!disp)
|
|
|
|
return E_FAIL;
|
|
|
|
|
2021-04-22 01:49:02 +02:00
|
|
|
hres = set_task_timer(This, msec, timer_type, disp, timer_id);
|
2008-06-27 21:10:04 +02:00
|
|
|
IDispatch_Release(disp);
|
|
|
|
|
2012-10-19 11:56:59 +02:00
|
|
|
return hres;
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
|
|
|
|
VARIANT *language, LONG *timerID)
|
2008-06-27 21:10:04 +02:00
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-06-27 21:10:04 +02:00
|
|
|
|
2012-03-28 14:26:11 +02:00
|
|
|
TRACE("(%p)->(%s %d %s %p)\n", This, debugstr_variant(expression), msec, debugstr_variant(language), timerID);
|
2008-06-27 21:10:04 +02:00
|
|
|
|
2021-04-22 01:49:02 +02:00
|
|
|
return window_set_timer(This->inner_window, expression, msec, language, TIMER_TIMEOUT, timerID);
|
2008-06-27 21:10:04 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, LONG msec,
|
|
|
|
VARIANT *language, LONG *timerID)
|
2008-04-17 22:53:31 +02:00
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-06-27 21:11:38 +02:00
|
|
|
|
2009-03-12 01:42:55 +01:00
|
|
|
TRACE("(%p)->(%p %d %p %p)\n", This, expression, msec, language, timerID);
|
2008-06-27 21:11:38 +02:00
|
|
|
|
2021-04-22 01:49:02 +02:00
|
|
|
return window_set_timer(This->inner_window, expression, msec, language, TIMER_INTERVAL, timerID);
|
2008-04-17 22:53:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_put_onbeforeprint(IHTMLWindow3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-04-17 22:53:31 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_get_onbeforeprint(IHTMLWindow3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_put_onafterprint(IHTMLWindow3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2012-03-28 14:26:11 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-04-17 22:53:31 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_get_onafterprint(IHTMLWindow3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_get_clipboardData(IHTMLWindow3 *iface, IHTMLDataTransfer **p)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow3_showModelessDialog(IHTMLWindow3 *iface, BSTR url,
|
|
|
|
VARIANT *varArgIn, VARIANT *options, IHTMLWindow2 **pDialog)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
2008-04-17 22:53:31 +02:00
|
|
|
FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_w(url), varArgIn, options, pDialog);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLWindow3Vtbl HTMLWindow3Vtbl = {
|
|
|
|
HTMLWindow3_QueryInterface,
|
|
|
|
HTMLWindow3_AddRef,
|
|
|
|
HTMLWindow3_Release,
|
|
|
|
HTMLWindow3_GetTypeInfoCount,
|
|
|
|
HTMLWindow3_GetTypeInfo,
|
|
|
|
HTMLWindow3_GetIDsOfNames,
|
|
|
|
HTMLWindow3_Invoke,
|
|
|
|
HTMLWindow3_get_screenLeft,
|
|
|
|
HTMLWindow3_get_screenTop,
|
|
|
|
HTMLWindow3_attachEvent,
|
|
|
|
HTMLWindow3_detachEvent,
|
|
|
|
HTMLWindow3_setTimeout,
|
|
|
|
HTMLWindow3_setInterval,
|
|
|
|
HTMLWindow3_print,
|
|
|
|
HTMLWindow3_put_onbeforeprint,
|
|
|
|
HTMLWindow3_get_onbeforeprint,
|
|
|
|
HTMLWindow3_put_onafterprint,
|
|
|
|
HTMLWindow3_get_onafterprint,
|
|
|
|
HTMLWindow3_get_clipboardData,
|
|
|
|
HTMLWindow3_showModelessDialog
|
|
|
|
};
|
|
|
|
|
2010-12-27 14:22:27 +01:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow4(IHTMLWindow4 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow4_iface);
|
|
|
|
}
|
2009-11-13 21:12:54 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_QueryInterface(IHTMLWindow4 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow4_AddRef(IHTMLWindow4 *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow4_Release(IHTMLWindow4 *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_GetTypeInfoCount(IHTMLWindow4 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_GetTypeInfo(IHTMLWindow4 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_GetIDsOfNames(IHTMLWindow4 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_Invoke(IHTMLWindow4 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_createPopup(IHTMLWindow4 *iface, VARIANT *varArgIn,
|
|
|
|
IDispatch **ppPopup)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:12:54 +01:00
|
|
|
FIXME("(%p)->(%p %p)\n", This, varArgIn, ppPopup);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow4_get_frameElement(IHTMLWindow4 *iface, IHTMLFrameBase **p)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
2009-11-13 21:13:04 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
if(This->outer_window->frame_element) {
|
|
|
|
*p = &This->outer_window->frame_element->IHTMLFrameBase_iface;
|
2009-11-13 21:13:04 +01:00
|
|
|
IHTMLFrameBase_AddRef(*p);
|
|
|
|
}else
|
|
|
|
*p = NULL;
|
|
|
|
|
|
|
|
return S_OK;
|
2009-11-13 21:12:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLWindow4Vtbl HTMLWindow4Vtbl = {
|
|
|
|
HTMLWindow4_QueryInterface,
|
|
|
|
HTMLWindow4_AddRef,
|
|
|
|
HTMLWindow4_Release,
|
|
|
|
HTMLWindow4_GetTypeInfoCount,
|
|
|
|
HTMLWindow4_GetTypeInfo,
|
|
|
|
HTMLWindow4_GetIDsOfNames,
|
|
|
|
HTMLWindow4_Invoke,
|
|
|
|
HTMLWindow4_createPopup,
|
|
|
|
HTMLWindow4_get_frameElement
|
|
|
|
};
|
|
|
|
|
2012-01-23 16:42:15 +01:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow5(IHTMLWindow5 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow5_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_QueryInterface(IHTMLWindow5 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow5_AddRef(IHTMLWindow5 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow5_Release(IHTMLWindow5 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_GetTypeInfoCount(IHTMLWindow5 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_GetTypeInfo(IHTMLWindow5 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_GetIDsOfNames(IHTMLWindow5 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_Invoke(IHTMLWindow5 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_put_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow5(iface);
|
2015-06-09 17:21:02 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2015-06-30 15:50:30 +02:00
|
|
|
if(!window->xhr_factory) {
|
2015-06-09 17:21:02 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2015-06-30 15:50:30 +02:00
|
|
|
hres = HTMLXMLHttpRequestFactory_Create(window, &window->xhr_factory);
|
|
|
|
if(FAILED(hres)) {
|
2015-06-09 17:21:02 +02:00
|
|
|
return hres;
|
2015-06-30 15:50:30 +02:00
|
|
|
}
|
2015-06-09 17:21:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
V_VT(p) = VT_DISPATCH;
|
2015-06-30 15:50:30 +02:00
|
|
|
V_DISPATCH(p) = (IDispatch*)&window->xhr_factory->IHTMLXMLHttpRequestFactory_iface;
|
2015-06-09 17:21:02 +02:00
|
|
|
IDispatch_AddRef(V_DISPATCH(p));
|
|
|
|
|
|
|
|
return S_OK;
|
2012-01-23 16:42:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLWindow5Vtbl HTMLWindow5Vtbl = {
|
|
|
|
HTMLWindow5_QueryInterface,
|
|
|
|
HTMLWindow5_AddRef,
|
|
|
|
HTMLWindow5_Release,
|
|
|
|
HTMLWindow5_GetTypeInfoCount,
|
|
|
|
HTMLWindow5_GetTypeInfo,
|
|
|
|
HTMLWindow5_GetIDsOfNames,
|
|
|
|
HTMLWindow5_Invoke,
|
|
|
|
HTMLWindow5_put_XMLHttpRequest,
|
|
|
|
HTMLWindow5_get_XMLHttpRequest
|
|
|
|
};
|
|
|
|
|
2011-10-19 16:15:16 +02:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow6(IHTMLWindow6 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow6_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_QueryInterface(IHTMLWindow6 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow6_AddRef(IHTMLWindow6 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow6_Release(IHTMLWindow6 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_GetTypeInfoCount(IHTMLWindow6 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_GetTypeInfo(IHTMLWindow6 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_GetIDsOfNames(IHTMLWindow6 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_Invoke(IHTMLWindow6 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_put_XDomainRequest(IHTMLWindow6 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_XDomainRequest(IHTMLWindow6 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
2012-08-20 16:19:41 +02:00
|
|
|
|
2019-03-22 15:16:28 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
2012-08-20 16:19:41 +02:00
|
|
|
|
|
|
|
if(!This->inner_window->session_storage) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
2021-03-16 19:57:01 +01:00
|
|
|
hres = create_html_storage(dispex_compat_mode(&This->inner_window->event_target.dispex),
|
|
|
|
&This->inner_window->session_storage);
|
2012-08-20 16:19:41 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
IHTMLStorage_AddRef(This->inner_window->session_storage);
|
|
|
|
*p = This->inner_window->session_storage;
|
|
|
|
return S_OK;
|
2011-10-19 16:15:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_localStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
2019-03-22 15:16:28 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->inner_window->local_storage) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
2021-03-16 19:57:01 +01:00
|
|
|
hres = create_html_storage(dispex_compat_mode(&This->inner_window->event_target.dispex),
|
|
|
|
&This->inner_window->local_storage);
|
2019-03-22 15:16:28 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
IHTMLStorage_AddRef(This->inner_window->local_storage);
|
|
|
|
*p = This->inner_window->local_storage;
|
|
|
|
return S_OK;
|
2011-10-19 16:15:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_put_onhashchange(IHTMLWindow6 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_onhashchange(IHTMLWindow6 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VARIANT targetOrigin)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
2017-10-20 15:09:52 +02:00
|
|
|
DOMEvent *event;
|
|
|
|
HRESULT hres;
|
2016-04-04 18:01:57 +02:00
|
|
|
|
|
|
|
FIXME("(%p)->(%s %s) semi-stub\n", This, debugstr_w(msg), debugstr_variant(&targetOrigin));
|
|
|
|
|
|
|
|
if(!This->inner_window->doc) {
|
|
|
|
FIXME("No document\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2017-10-20 15:09:52 +02:00
|
|
|
hres = create_document_event(This->inner_window->doc, EVENTID_MESSAGE, &event);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2017-10-20 15:10:46 +02:00
|
|
|
dispatch_event(&This->inner_window->event_target, event);
|
2017-10-20 15:09:52 +02:00
|
|
|
IDOMEvent_Release(&event->IDOMEvent_iface);
|
2016-04-04 18:01:57 +02:00
|
|
|
return S_OK;
|
2011-10-19 16:15:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_toStaticHTML(IHTMLWindow6 *iface, BSTR bstrHTML, BSTR *pbstrStaticHTML)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrHTML), pbstrStaticHTML);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_put_onmessage(IHTMLWindow6 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
2016-04-04 18:01:46 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_window_event(This, EVENTID_MESSAGE, &v);
|
2011-10-19 16:15:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_get_onmessage(IHTMLWindow6 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
2016-04-04 18:01:46 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_window_event(This, EVENTID_MESSAGE, p);
|
2011-10-19 16:15:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow6_msWriteProfilerMark(IHTMLWindow6 *iface, BSTR bstrProfilerMark)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(bstrProfilerMark));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLWindow6Vtbl HTMLWindow6Vtbl = {
|
|
|
|
HTMLWindow6_QueryInterface,
|
|
|
|
HTMLWindow6_AddRef,
|
|
|
|
HTMLWindow6_Release,
|
|
|
|
HTMLWindow6_GetTypeInfoCount,
|
|
|
|
HTMLWindow6_GetTypeInfo,
|
|
|
|
HTMLWindow6_GetIDsOfNames,
|
|
|
|
HTMLWindow6_Invoke,
|
|
|
|
HTMLWindow6_put_XDomainRequest,
|
|
|
|
HTMLWindow6_get_XDomainRequest,
|
|
|
|
HTMLWindow6_get_sessionStorage,
|
|
|
|
HTMLWindow6_get_localStorage,
|
|
|
|
HTMLWindow6_put_onhashchange,
|
|
|
|
HTMLWindow6_get_onhashchange,
|
|
|
|
HTMLWindow6_get_maxConnectionsPerServer,
|
|
|
|
HTMLWindow6_postMessage,
|
|
|
|
HTMLWindow6_toStaticHTML,
|
|
|
|
HTMLWindow6_put_onmessage,
|
|
|
|
HTMLWindow6_get_onmessage,
|
|
|
|
HTMLWindow6_msWriteProfilerMark
|
|
|
|
};
|
|
|
|
|
2018-05-17 16:22:09 +02:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLWindow7(IHTMLWindow7 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLWindow7_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_QueryInterface(IHTMLWindow7 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow7_AddRef(IHTMLWindow7 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindow7_Release(IHTMLWindow7 *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_GetTypeInfoCount(IHTMLWindow7 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_GetTypeInfo(IHTMLWindow7 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_GetIDsOfNames(IHTMLWindow7 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_Invoke(IHTMLWindow7 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_getSelection(IHTMLWindow7 *iface, IHTMLSelection **p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOMNode *node,
|
|
|
|
BSTR pseudo_elt, IHTMLCSSStyleDeclaration **p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
2019-03-27 18:52:14 +01:00
|
|
|
nsIDOMCSSStyleDeclaration *nsstyle;
|
|
|
|
nsAString pseudo_elt_str;
|
|
|
|
HTMLElement *element;
|
|
|
|
IHTMLElement *elem;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p %s %p)\n", This, node, debugstr_w(pseudo_elt), p);
|
|
|
|
|
2020-06-09 16:17:13 +02:00
|
|
|
if(!This->outer_window || !This->inner_window)
|
2019-03-27 18:52:14 +01:00
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)&elem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
element = unsafe_impl_from_IHTMLElement(elem);
|
|
|
|
if(!element) {
|
|
|
|
WARN("Not our element\n");
|
|
|
|
IHTMLElement_Release(elem);
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Init(&pseudo_elt_str, NULL);
|
|
|
|
nsres = nsIDOMWindow_GetComputedStyle(This->outer_window->nswindow, element->dom_element,
|
|
|
|
&pseudo_elt_str, &nsstyle);
|
|
|
|
IHTMLElement_Release(elem);
|
|
|
|
nsAString_Finish(&pseudo_elt_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("GetComputedStyle failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2020-06-09 16:17:13 +02:00
|
|
|
hres = create_computed_style(nsstyle, dispex_compat_mode(&This->inner_window->event_target.dispex), p);
|
2019-03-27 18:52:14 +01:00
|
|
|
nsIDOMCSSStyleDeclaration_Release(nsstyle);
|
|
|
|
return hres;
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_styleMedia(IHTMLWindow7 *iface, IHTMLStyleMedia **p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_put_performance(IHTMLWindow7 *iface, VARIANT v)
|
|
|
|
{
|
2018-06-14 17:35:14 +02:00
|
|
|
HTMLInnerWindow *This = impl_from_IHTMLWindow7(iface)->inner_window;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
if(!This->performance_initialized) {
|
|
|
|
V_VT(&This->performance) = VT_EMPTY;
|
|
|
|
This->performance_initialized = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return VariantCopy(&This->performance, &v);
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_performance(IHTMLWindow7 *iface, VARIANT *p)
|
|
|
|
{
|
2018-06-14 17:35:14 +02:00
|
|
|
HTMLInnerWindow *This = impl_from_IHTMLWindow7(iface)->inner_window;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->performance_initialized) {
|
|
|
|
IHTMLPerformance *performance;
|
|
|
|
|
2021-03-15 16:17:52 +01:00
|
|
|
hres = create_performance(dispex_compat_mode(&This->event_target.dispex), &performance);
|
2018-06-14 17:35:14 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
V_VT(&This->performance) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(&This->performance) = (IDispatch*)performance;
|
|
|
|
This->performance_initialized = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
V_VT(p) = VT_NULL;
|
|
|
|
return VariantCopy(p, &This->performance);
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_innerWidth(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
2018-05-18 13:53:38 +02:00
|
|
|
INT32 ret;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetInnerWidth(This->outer_window->nswindow, &ret);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetInnerWidth failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = ret;
|
|
|
|
return S_OK;
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_innerHeight(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
2018-05-18 13:53:38 +02:00
|
|
|
INT32 ret;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetInnerHeight(This->outer_window->nswindow, &ret);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetInnerWidth failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = ret;
|
|
|
|
return S_OK;
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_pageXOffset(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
2020-01-21 21:26:44 +01:00
|
|
|
nsresult nsres;
|
|
|
|
INT32 ret;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetPageXOffset(This->outer_window->nswindow, &ret);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetPageXOffset failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = ret;
|
|
|
|
return S_OK;
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_pageYOffset(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
2020-01-21 21:26:44 +01:00
|
|
|
nsresult nsres;
|
|
|
|
INT32 ret;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetPageYOffset(This->outer_window->nswindow, &ret);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetPageYOffset failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*p = ret;
|
|
|
|
return S_OK;
|
2018-05-17 16:22:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_screenX(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_screenY(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_outerWidth(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_outerHeight(IHTMLWindow7 *iface, LONG *p)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-05-17 16:22:18 +02:00
|
|
|
#define HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(name, event_id) \
|
|
|
|
static HRESULT WINAPI HTMLWindow7_put_on##name(IHTMLWindow7 *iface, VARIANT v) \
|
|
|
|
{ \
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface); \
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); \
|
|
|
|
return set_window_event(This, event_id, &v); \
|
|
|
|
} \
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_on##name(IHTMLWindow7 *iface, VARIANT *p) \
|
|
|
|
{ \
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface); \
|
|
|
|
TRACE("(%p)->(%p)\n", This, p); \
|
|
|
|
return get_window_event(This, event_id, p); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define HTMLWINDOW7_ONEVENT_PROPERTY_STUB(name) \
|
2018-05-17 16:22:09 +02:00
|
|
|
static HRESULT WINAPI HTMLWindow7_put_on##name(IHTMLWindow7 *iface, VARIANT v) \
|
|
|
|
{ \
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface); \
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); \
|
|
|
|
return E_NOTIMPL; \
|
|
|
|
} \
|
|
|
|
static HRESULT WINAPI HTMLWindow7_get_on##name(IHTMLWindow7 *iface, VARIANT *p) \
|
|
|
|
{ \
|
|
|
|
HTMLWindow *This = impl_from_IHTMLWindow7(iface); \
|
|
|
|
FIXME("(%p)->(%p)\n", This, p); \
|
|
|
|
return E_NOTIMPL; \
|
|
|
|
}
|
|
|
|
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(abort, EVENTID_ABORT)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(canplay)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(canplaythrough)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(change)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(click)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(contextmenu, EVENTID_CONTEXTMENU)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(dblclick, EVENTID_DBLCLICK)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(drag, EVENTID_DRAG)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(dragend)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(dragenter)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(dragleave)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(dragover)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(dragstart, EVENTID_DRAGSTART)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(drop)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(durationchange)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(focusin, EVENTID_FOCUSIN)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(focusout, EVENTID_FOCUSOUT)
|
2018-06-12 14:21:42 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(input, EVENTID_INPUT)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(emptied)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(ended)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(keydown, EVENTID_KEYDOWN)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(keypress, EVENTID_KEYPRESS)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(keyup)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(loadeddata)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(loadedmetadata)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(loadstart)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mousedown, EVENTID_MOUSEDOWN)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(mouseenter)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(mouseleave)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mousemove, EVENTID_MOUSEMOVE)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mouseout, EVENTID_MOUSEOUT)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mouseover, EVENTID_MOUSEOVER)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mouseup, EVENTID_MOUSEUP)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(mousewheel, EVENTID_MOUSEWHEEL)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(offline)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(online)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(progress)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(ratechange)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(readystatechange, EVENTID_READYSTATECHANGE)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(reset)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(seeked)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(seeking)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(select)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(stalled)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(storage)
|
2018-05-17 16:22:18 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_IMPL(submit, EVENTID_SUBMIT)
|
2018-05-17 16:22:09 +02:00
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(suspend)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(timeupdate)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(pause)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(play)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(playing)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(volumechange)
|
|
|
|
HTMLWINDOW7_ONEVENT_PROPERTY_STUB(waiting)
|
|
|
|
|
|
|
|
static const IHTMLWindow7Vtbl HTMLWindow7Vtbl = {
|
|
|
|
HTMLWindow7_QueryInterface,
|
|
|
|
HTMLWindow7_AddRef,
|
|
|
|
HTMLWindow7_Release,
|
|
|
|
HTMLWindow7_GetTypeInfoCount,
|
|
|
|
HTMLWindow7_GetTypeInfo,
|
|
|
|
HTMLWindow7_GetIDsOfNames,
|
|
|
|
HTMLWindow7_Invoke,
|
|
|
|
HTMLWindow7_getSelection,
|
|
|
|
HTMLWindow7_getComputedStyle,
|
|
|
|
HTMLWindow7_get_styleMedia,
|
|
|
|
HTMLWindow7_put_performance,
|
|
|
|
HTMLWindow7_get_performance,
|
|
|
|
HTMLWindow7_get_innerWidth,
|
|
|
|
HTMLWindow7_get_innerHeight,
|
|
|
|
HTMLWindow7_get_pageXOffset,
|
|
|
|
HTMLWindow7_get_pageYOffset,
|
|
|
|
HTMLWindow7_get_screenX,
|
|
|
|
HTMLWindow7_get_screenY,
|
|
|
|
HTMLWindow7_get_outerWidth,
|
|
|
|
HTMLWindow7_get_outerHeight,
|
|
|
|
HTMLWindow7_put_onabort,
|
|
|
|
HTMLWindow7_get_onabort,
|
|
|
|
HTMLWindow7_put_oncanplay,
|
|
|
|
HTMLWindow7_get_oncanplay,
|
|
|
|
HTMLWindow7_put_oncanplaythrough,
|
|
|
|
HTMLWindow7_get_oncanplaythrough,
|
|
|
|
HTMLWindow7_put_onchange,
|
|
|
|
HTMLWindow7_get_onchange,
|
|
|
|
HTMLWindow7_put_onclick,
|
|
|
|
HTMLWindow7_get_onclick,
|
|
|
|
HTMLWindow7_put_oncontextmenu,
|
|
|
|
HTMLWindow7_get_oncontextmenu,
|
|
|
|
HTMLWindow7_put_ondblclick,
|
|
|
|
HTMLWindow7_get_ondblclick,
|
|
|
|
HTMLWindow7_put_ondrag,
|
|
|
|
HTMLWindow7_get_ondrag,
|
|
|
|
HTMLWindow7_put_ondragend,
|
|
|
|
HTMLWindow7_get_ondragend,
|
|
|
|
HTMLWindow7_put_ondragenter,
|
|
|
|
HTMLWindow7_get_ondragenter,
|
|
|
|
HTMLWindow7_put_ondragleave,
|
|
|
|
HTMLWindow7_get_ondragleave,
|
|
|
|
HTMLWindow7_put_ondragover,
|
|
|
|
HTMLWindow7_get_ondragover,
|
|
|
|
HTMLWindow7_put_ondragstart,
|
|
|
|
HTMLWindow7_get_ondragstart,
|
|
|
|
HTMLWindow7_put_ondrop,
|
|
|
|
HTMLWindow7_get_ondrop,
|
|
|
|
HTMLWindow7_put_ondurationchange,
|
|
|
|
HTMLWindow7_get_ondurationchange,
|
|
|
|
HTMLWindow7_put_onfocusin,
|
|
|
|
HTMLWindow7_get_onfocusin,
|
|
|
|
HTMLWindow7_put_onfocusout,
|
|
|
|
HTMLWindow7_get_onfocusout,
|
|
|
|
HTMLWindow7_put_oninput,
|
|
|
|
HTMLWindow7_get_oninput,
|
|
|
|
HTMLWindow7_put_onemptied,
|
|
|
|
HTMLWindow7_get_onemptied,
|
|
|
|
HTMLWindow7_put_onended,
|
|
|
|
HTMLWindow7_get_onended,
|
|
|
|
HTMLWindow7_put_onkeydown,
|
|
|
|
HTMLWindow7_get_onkeydown,
|
|
|
|
HTMLWindow7_put_onkeypress,
|
|
|
|
HTMLWindow7_get_onkeypress,
|
|
|
|
HTMLWindow7_put_onkeyup,
|
|
|
|
HTMLWindow7_get_onkeyup,
|
|
|
|
HTMLWindow7_put_onloadeddata,
|
|
|
|
HTMLWindow7_get_onloadeddata,
|
|
|
|
HTMLWindow7_put_onloadedmetadata,
|
|
|
|
HTMLWindow7_get_onloadedmetadata,
|
|
|
|
HTMLWindow7_put_onloadstart,
|
|
|
|
HTMLWindow7_get_onloadstart,
|
|
|
|
HTMLWindow7_put_onmousedown,
|
|
|
|
HTMLWindow7_get_onmousedown,
|
|
|
|
HTMLWindow7_put_onmouseenter,
|
|
|
|
HTMLWindow7_get_onmouseenter,
|
|
|
|
HTMLWindow7_put_onmouseleave,
|
|
|
|
HTMLWindow7_get_onmouseleave,
|
|
|
|
HTMLWindow7_put_onmousemove,
|
|
|
|
HTMLWindow7_get_onmousemove,
|
|
|
|
HTMLWindow7_put_onmouseout,
|
|
|
|
HTMLWindow7_get_onmouseout,
|
|
|
|
HTMLWindow7_put_onmouseover,
|
|
|
|
HTMLWindow7_get_onmouseover,
|
|
|
|
HTMLWindow7_put_onmouseup,
|
|
|
|
HTMLWindow7_get_onmouseup,
|
|
|
|
HTMLWindow7_put_onmousewheel,
|
|
|
|
HTMLWindow7_get_onmousewheel,
|
|
|
|
HTMLWindow7_put_onoffline,
|
|
|
|
HTMLWindow7_get_onoffline,
|
|
|
|
HTMLWindow7_put_ononline,
|
|
|
|
HTMLWindow7_get_ononline,
|
|
|
|
HTMLWindow7_put_onprogress,
|
|
|
|
HTMLWindow7_get_onprogress,
|
|
|
|
HTMLWindow7_put_onratechange,
|
|
|
|
HTMLWindow7_get_onratechange,
|
|
|
|
HTMLWindow7_put_onreadystatechange,
|
|
|
|
HTMLWindow7_get_onreadystatechange,
|
|
|
|
HTMLWindow7_put_onreset,
|
|
|
|
HTMLWindow7_get_onreset,
|
|
|
|
HTMLWindow7_put_onseeked,
|
|
|
|
HTMLWindow7_get_onseeked,
|
|
|
|
HTMLWindow7_put_onseeking,
|
|
|
|
HTMLWindow7_get_onseeking,
|
|
|
|
HTMLWindow7_put_onselect,
|
|
|
|
HTMLWindow7_get_onselect,
|
|
|
|
HTMLWindow7_put_onstalled,
|
|
|
|
HTMLWindow7_get_onstalled,
|
|
|
|
HTMLWindow7_put_onstorage,
|
|
|
|
HTMLWindow7_get_onstorage,
|
|
|
|
HTMLWindow7_put_onsubmit,
|
|
|
|
HTMLWindow7_get_onsubmit,
|
|
|
|
HTMLWindow7_put_onsuspend,
|
|
|
|
HTMLWindow7_get_onsuspend,
|
|
|
|
HTMLWindow7_put_ontimeupdate,
|
|
|
|
HTMLWindow7_get_ontimeupdate,
|
|
|
|
HTMLWindow7_put_onpause,
|
|
|
|
HTMLWindow7_get_onpause,
|
|
|
|
HTMLWindow7_put_onplay,
|
|
|
|
HTMLWindow7_get_onplay,
|
|
|
|
HTMLWindow7_put_onplaying,
|
|
|
|
HTMLWindow7_get_onplaying,
|
|
|
|
HTMLWindow7_put_onvolumechange,
|
|
|
|
HTMLWindow7_get_onvolumechange,
|
|
|
|
HTMLWindow7_put_onwaiting,
|
|
|
|
HTMLWindow7_get_onwaiting
|
|
|
|
};
|
|
|
|
|
2010-12-27 14:22:27 +01:00
|
|
|
static inline HTMLWindow *impl_from_IHTMLPrivateWindow(IHTMLPrivateWindow *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IHTMLPrivateWindow_iface);
|
|
|
|
}
|
2010-03-03 14:53:03 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_QueryInterface(IHTMLPrivateWindow *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2010-03-03 14:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPrivateWindow_AddRef(IHTMLPrivateWindow *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLPrivateWindow_Release(IHTMLPrivateWindow *iface)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, BSTR url, BSTR arg2, BSTR arg3,
|
|
|
|
BSTR arg4, VARIANT *post_data_var, VARIANT *headers_var, ULONG flags)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *window = This->outer_window;
|
2011-11-15 13:29:43 +01:00
|
|
|
OLECHAR *translated_url = NULL;
|
2010-03-03 14:56:21 +01:00
|
|
|
DWORD post_data_size = 0;
|
|
|
|
BYTE *post_data = NULL;
|
|
|
|
WCHAR *headers = NULL;
|
2011-07-23 12:50:32 +02:00
|
|
|
IUri *uri;
|
2010-03-03 14:56:21 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %s %s %s %s %x)\n", This, debugstr_w(url), debugstr_w(arg2), debugstr_w(arg3), debugstr_w(arg4),
|
|
|
|
debugstr_variant(post_data_var), debugstr_variant(headers_var), flags);
|
|
|
|
|
2019-03-14 14:13:18 +01:00
|
|
|
if(!window || !window->browser)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
if(window->browser->doc->hostui) {
|
|
|
|
hres = IDocHostUIHandler_TranslateUrl(window->browser->doc->hostui, 0, url, &translated_url);
|
2011-11-15 13:29:43 +01:00
|
|
|
if(hres != S_OK)
|
|
|
|
translated_url = NULL;
|
2010-03-03 14:56:21 +01:00
|
|
|
}
|
|
|
|
|
2013-03-26 11:37:47 +01:00
|
|
|
hres = create_uri(translated_url ? translated_url : url, 0, &uri);
|
2011-11-15 13:29:43 +01:00
|
|
|
CoTaskMemFree(translated_url);
|
2011-07-23 12:50:32 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2010-03-03 14:56:21 +01:00
|
|
|
if(post_data_var) {
|
|
|
|
if(V_VT(post_data_var) == (VT_ARRAY|VT_UI1)) {
|
|
|
|
SafeArrayAccessData(V_ARRAY(post_data_var), (void**)&post_data);
|
|
|
|
post_data_size = V_ARRAY(post_data_var)->rgsabound[0].cElements;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(headers_var && V_VT(headers_var) != VT_EMPTY && V_VT(headers_var) != VT_ERROR) {
|
|
|
|
if(V_VT(headers_var) != VT_BSTR)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
headers = V_BSTR(headers_var);
|
|
|
|
}
|
|
|
|
|
2014-03-04 16:48:31 +01:00
|
|
|
hres = super_navigate(window, uri, BINDING_NAVIGATED|BINDING_NOFRAG, headers, post_data, post_data_size);
|
2011-11-15 13:29:43 +01:00
|
|
|
IUri_Release(uri);
|
2010-03-03 14:56:21 +01:00
|
|
|
if(post_data)
|
|
|
|
SafeArrayUnaccessData(V_ARRAY(post_data_var));
|
2011-07-23 12:52:17 +02:00
|
|
|
|
2011-11-15 13:29:43 +01:00
|
|
|
return hres;
|
2010-03-03 14:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_GetPendingUrl(IHTMLPrivateWindow *iface, BSTR *url)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, url);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_SetPICSTarget(IHTMLPrivateWindow *iface, IOleCommandTarget *cmdtrg)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, cmdtrg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_PICSComplete(IHTMLPrivateWindow *iface, int arg)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, arg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_FindWindowByName(IHTMLPrivateWindow *iface, LPCWSTR name, IHTMLWindow2 **ret)
|
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2010-03-03 14:53:03 +01:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(name), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-11-12 14:32:47 +01:00
|
|
|
static HRESULT WINAPI HTMLPrivateWindow_GetAddressBarUrl(IHTMLPrivateWindow *iface, BSTR *url)
|
2010-03-03 14:53:03 +01:00
|
|
|
{
|
2010-12-27 14:22:27 +01:00
|
|
|
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
|
2011-03-11 11:14:08 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, url);
|
|
|
|
|
|
|
|
if(!url)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*url = SysAllocString(This->outer_window->url);
|
2011-03-11 11:14:08 +01:00
|
|
|
return S_OK;
|
2010-03-03 14:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLPrivateWindowVtbl HTMLPrivateWindowVtbl = {
|
|
|
|
HTMLPrivateWindow_QueryInterface,
|
|
|
|
HTMLPrivateWindow_AddRef,
|
|
|
|
HTMLPrivateWindow_Release,
|
|
|
|
HTMLPrivateWindow_SuperNavigate,
|
|
|
|
HTMLPrivateWindow_GetPendingUrl,
|
|
|
|
HTMLPrivateWindow_SetPICSTarget,
|
|
|
|
HTMLPrivateWindow_PICSComplete,
|
|
|
|
HTMLPrivateWindow_FindWindowByName,
|
2011-11-12 14:32:47 +01:00
|
|
|
HTMLPrivateWindow_GetAddressBarUrl
|
2010-03-03 14:53:03 +01:00
|
|
|
};
|
|
|
|
|
2012-01-20 15:10:25 +01:00
|
|
|
static inline HTMLWindow *impl_from_ITravelLogClient(ITravelLogClient *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, ITravelLogClient_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TravelLogClient_QueryInterface(ITravelLogClient *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TravelLogClient_AddRef(ITravelLogClient *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TravelLogClient_Release(ITravelLogClient *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TravelLogClient_FindWindowByIndex(ITravelLogClient *iface, DWORD dwID, IUnknown **ppunk)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
2012-01-20 15:10:39 +01:00
|
|
|
|
|
|
|
FIXME("(%p)->(%d %p) semi-stub\n", This, dwID, ppunk);
|
|
|
|
|
|
|
|
*ppunk = NULL;
|
|
|
|
return E_FAIL;
|
2012-01-20 15:10:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TravelLogClient_GetWindowData(ITravelLogClient *iface, IStream *pStream, LPWINDOWDATA pWinData)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, pStream, pWinData);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TravelLogClient_LoadHistoryPosition(ITravelLogClient *iface, LPWSTR pszUrlLocation, DWORD dwPosition)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_ITravelLogClient(iface);
|
|
|
|
FIXME("(%p)->(%s %d)\n", This, debugstr_w(pszUrlLocation), dwPosition);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITravelLogClientVtbl TravelLogClientVtbl = {
|
|
|
|
TravelLogClient_QueryInterface,
|
|
|
|
TravelLogClient_AddRef,
|
|
|
|
TravelLogClient_Release,
|
|
|
|
TravelLogClient_FindWindowByIndex,
|
|
|
|
TravelLogClient_GetWindowData,
|
|
|
|
TravelLogClient_LoadHistoryPosition
|
|
|
|
};
|
|
|
|
|
2013-04-26 15:47:54 +02:00
|
|
|
static inline HTMLWindow *impl_from_IObjectIdentity(IObjectIdentity *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IObjectIdentity_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ObjectIdentity_QueryInterface(IObjectIdentity *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IObjectIdentity(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ObjectIdentity_AddRef(IObjectIdentity *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IObjectIdentity(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ObjectIdentity_Release(IObjectIdentity *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IObjectIdentity(iface);
|
|
|
|
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ObjectIdentity_IsEqualObject(IObjectIdentity *iface, IUnknown *unk)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IObjectIdentity(iface);
|
|
|
|
IServiceProvider *sp;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, unk);
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(unk, &IID_IServiceProvider, (void**)&sp);
|
|
|
|
if(hres != S_OK)
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
hres = &This->inner_window->base.IServiceProvider_iface==sp ||
|
|
|
|
&This->outer_window->base.IServiceProvider_iface==sp ? S_OK : S_FALSE;
|
|
|
|
IServiceProvider_Release(sp);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IObjectIdentityVtbl ObjectIdentityVtbl = {
|
|
|
|
ObjectIdentity_QueryInterface,
|
|
|
|
ObjectIdentity_AddRef,
|
|
|
|
ObjectIdentity_Release,
|
|
|
|
ObjectIdentity_IsEqualObject
|
|
|
|
};
|
|
|
|
|
2017-04-21 13:49:51 +02:00
|
|
|
static inline HTMLWindow *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IProvideMultipleClassInfo_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideMultipleClassInfo *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideMultipleClassInfo *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ProvideClassInfo_Release(IProvideMultipleClassInfo *iface)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideMultipleClassInfo *iface, ITypeInfo **ppTI)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppTI);
|
|
|
|
return get_class_typeinfo(&CLSID_HTMLWindow2, ppTI);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideMultipleClassInfo *iface, DWORD dwGuidKind, GUID *pGUID)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
FIXME("(%p)->(%u %p)\n", This, dwGuidKind, pGUID);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideMultipleClassInfo_GetMultiTypeInfoCount(IProvideMultipleClassInfo *iface, ULONG *pcti)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pcti);
|
|
|
|
*pcti = 1;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideMultipleClassInfo_GetInfoOfIndex(IProvideMultipleClassInfo *iface, ULONG iti,
|
|
|
|
DWORD dwFlags, ITypeInfo **pptiCoClass, DWORD *pdwTIFlags, ULONG *pcdispidReserved, IID *piidPrimary, IID *piidSource)
|
|
|
|
{
|
|
|
|
HTMLWindow *This = impl_from_IProvideMultipleClassInfo(iface);
|
|
|
|
FIXME("(%p)->(%u %x %p %p %p %p %p)\n", This, iti, dwFlags, pptiCoClass, pdwTIFlags, pcdispidReserved, piidPrimary, piidSource);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IProvideMultipleClassInfoVtbl ProvideMultipleClassInfoVtbl = {
|
|
|
|
ProvideClassInfo_QueryInterface,
|
|
|
|
ProvideClassInfo_AddRef,
|
|
|
|
ProvideClassInfo_Release,
|
|
|
|
ProvideClassInfo_GetClassInfo,
|
|
|
|
ProvideClassInfo2_GetGUID,
|
|
|
|
ProvideMultipleClassInfo_GetMultiTypeInfoCount,
|
|
|
|
ProvideMultipleClassInfo_GetInfoOfIndex
|
|
|
|
};
|
|
|
|
|
2010-12-31 11:03:45 +01:00
|
|
|
static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface);
|
|
|
|
}
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->inner_window->event_target.dispex.IDispatchEx_iface, pctinfo);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->inner_window->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2010-01-24 21:39:01 +01:00
|
|
|
UINT i;
|
|
|
|
HRESULT hres;
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2014-05-13 18:56:30 +02:00
|
|
|
WARN("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2010-01-24 21:39:01 +01:00
|
|
|
for(i=0; i < cNames; i++) {
|
|
|
|
/* We shouldn't use script's IDispatchEx here, so we shouldn't use GetDispID */
|
2010-12-31 11:03:45 +01:00
|
|
|
hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[i], 0, rgDispId+i);
|
2010-01-24 21:39:01 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2010-01-24 21:39:01 +01:00
|
|
|
return S_OK;
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
/* FIXME: Use script dispatch */
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_Invoke(&This->inner_window->event_target.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
2010-12-31 11:07:33 +01:00
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:48 +02:00
|
|
|
static global_prop_t *alloc_global_prop(HTMLInnerWindow *This, global_prop_type_t type, BSTR name)
|
2009-11-01 19:21:37 +01:00
|
|
|
{
|
|
|
|
if(This->global_prop_cnt == This->global_prop_size) {
|
|
|
|
global_prop_t *new_props;
|
|
|
|
DWORD new_size;
|
|
|
|
|
|
|
|
if(This->global_props) {
|
|
|
|
new_size = This->global_prop_size*2;
|
|
|
|
new_props = heap_realloc(This->global_props, new_size*sizeof(global_prop_t));
|
|
|
|
}else {
|
|
|
|
new_size = 16;
|
|
|
|
new_props = heap_alloc(new_size*sizeof(global_prop_t));
|
|
|
|
}
|
|
|
|
if(!new_props)
|
|
|
|
return NULL;
|
|
|
|
This->global_props = new_props;
|
|
|
|
This->global_prop_size = new_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
This->global_props[This->global_prop_cnt].name = heap_strdupW(name);
|
|
|
|
if(!This->global_props[This->global_prop_cnt].name)
|
|
|
|
return NULL;
|
|
|
|
|
2009-11-01 19:21:57 +01:00
|
|
|
This->global_props[This->global_prop_cnt].type = type;
|
2009-11-01 19:21:37 +01:00
|
|
|
return This->global_props + This->global_prop_cnt++;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:48 +02:00
|
|
|
static inline DWORD prop_to_dispid(HTMLInnerWindow *This, global_prop_t *prop)
|
2009-11-01 19:21:37 +01:00
|
|
|
{
|
|
|
|
return MSHTML_DISPID_CUSTOM_MIN + (prop-This->global_props);
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:48 +02:00
|
|
|
HRESULT search_window_props(HTMLInnerWindow *This, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
2008-04-19 18:41:25 +02:00
|
|
|
{
|
2009-12-15 00:38:53 +01:00
|
|
|
DWORD i;
|
2009-09-09 21:31:32 +02:00
|
|
|
ScriptHost *script_host;
|
|
|
|
DISPID id;
|
2008-04-19 18:41:25 +02:00
|
|
|
|
2009-09-09 21:31:32 +02:00
|
|
|
for(i=0; i < This->global_prop_cnt; i++) {
|
|
|
|
/* FIXME: case sensitivity */
|
2019-06-13 08:34:29 +02:00
|
|
|
if(!wcscmp(This->global_props[i].name, bstrName)) {
|
2009-09-09 21:31:32 +02:00
|
|
|
*pid = MSHTML_DISPID_CUSTOM_MIN+i;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:06:09 +02:00
|
|
|
if(find_global_prop(This->base.inner_window, bstrName, grfdex, &script_host, &id)) {
|
2009-11-01 19:21:37 +01:00
|
|
|
global_prop_t *prop;
|
2009-09-09 21:31:32 +02:00
|
|
|
|
2009-11-01 19:21:57 +01:00
|
|
|
prop = alloc_global_prop(This, GLOBAL_SCRIPTVAR, bstrName);
|
2009-11-01 19:21:37 +01:00
|
|
|
if(!prop)
|
2009-09-09 21:31:32 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2009-11-01 19:21:37 +01:00
|
|
|
prop->script_host = script_host;
|
|
|
|
prop->id = id;
|
2009-09-09 21:31:32 +02:00
|
|
|
|
2009-11-01 19:21:37 +01:00
|
|
|
*pid = prop_to_dispid(This, prop);
|
2009-09-09 21:31:32 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-12-15 00:38:53 +01:00
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
}
|
|
|
|
|
2021-04-22 01:52:53 +02:00
|
|
|
/* DISPIDs not exposed by interfaces */
|
|
|
|
#define DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME 1300
|
|
|
|
|
2009-12-15 00:38:53 +01:00
|
|
|
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2012-06-25 14:05:48 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2009-12-15 00:38:53 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
hres = search_window_props(window, bstrName, grfdex, pid);
|
2009-12-15 00:38:53 +01:00
|
|
|
if(hres != DISP_E_UNKNOWNNAME)
|
|
|
|
return hres;
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
hres = IDispatchEx_GetDispID(&window->base.inner_window->event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid);
|
2009-11-01 19:21:57 +01:00
|
|
|
if(hres != DISP_E_UNKNOWNNAME)
|
|
|
|
return hres;
|
|
|
|
|
2021-04-22 01:52:53 +02:00
|
|
|
if(dispex_compat_mode(&window->event_target.dispex) >= COMPAT_MODE_IE10 &&
|
|
|
|
!wcscmp(bstrName, L"requestAnimationFrame")) {
|
|
|
|
TRACE("requestAnimationFrame\n");
|
|
|
|
*pid = DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-09-04 13:58:39 +02:00
|
|
|
if(This->outer_window) {
|
|
|
|
HTMLOuterWindow *frame;
|
|
|
|
|
|
|
|
hres = get_frame_by_name(This->outer_window, bstrName, FALSE, &frame);
|
|
|
|
if(SUCCEEDED(hres) && frame) {
|
|
|
|
global_prop_t *prop;
|
|
|
|
|
|
|
|
IHTMLWindow2_Release(&frame->base.IHTMLWindow2_iface);
|
|
|
|
|
|
|
|
prop = alloc_global_prop(window, GLOBAL_FRAMEVAR, bstrName);
|
|
|
|
if(!prop)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
*pid = prop_to_dispid(window, prop);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(window->doc) {
|
2009-11-01 19:21:57 +01:00
|
|
|
global_prop_t *prop;
|
|
|
|
IHTMLElement *elem;
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
hres = IHTMLDocument3_getElementById(&window->base.inner_window->doc->basedoc.IHTMLDocument3_iface,
|
2010-12-22 10:39:41 +01:00
|
|
|
bstrName, &elem);
|
2009-11-01 19:21:57 +01:00
|
|
|
if(SUCCEEDED(hres) && elem) {
|
|
|
|
IHTMLElement_Release(elem);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
prop = alloc_global_prop(window, GLOBAL_ELEMENTVAR, bstrName);
|
2009-11-01 19:21:57 +01:00
|
|
|
if(!prop)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*pid = prop_to_dispid(window, prop);
|
2009-11-01 19:21:57 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
|
|
|
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2012-08-14 11:29:17 +02:00
|
|
|
HTMLInnerWindow *window = This->inner_window;
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
|
|
|
|
2015-11-20 13:15:56 +01:00
|
|
|
switch(id) {
|
|
|
|
case DISPID_IHTMLWINDOW2_LOCATION: {
|
2009-11-30 17:58:37 +01:00
|
|
|
HTMLLocation *location;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2015-11-20 13:15:56 +01:00
|
|
|
if(!(wFlags & DISPATCH_PROPERTYPUT))
|
|
|
|
break;
|
|
|
|
|
2009-11-30 17:58:37 +01:00
|
|
|
TRACE("forwarding to location.href\n");
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
hres = get_location(window, &location);
|
2009-11-30 17:58:37 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
hres = IDispatchEx_InvokeEx(&location->dispex.IDispatchEx_iface, DISPID_VALUE, lcid,
|
|
|
|
wFlags, pdp, pvarRes, pei, pspCaller);
|
2011-01-03 01:12:05 +01:00
|
|
|
IHTMLLocation_Release(&location->IHTMLLocation_iface);
|
2009-11-30 17:58:37 +01:00
|
|
|
return hres;
|
|
|
|
}
|
2015-11-20 13:15:56 +01:00
|
|
|
case DISPID_IHTMLWINDOW2_SETTIMEOUT:
|
|
|
|
case DISPID_IHTMLWINDOW3_SETTIMEOUT: {
|
|
|
|
VARIANT args[2];
|
|
|
|
DISPPARAMS dp = {args, NULL, 2, 0};
|
|
|
|
|
|
|
|
/*
|
2015-12-02 01:42:31 +01:00
|
|
|
* setTimeout calls should use default value 0 for the second argument if only one is provided,
|
2015-11-20 13:15:56 +01:00
|
|
|
* but IDL file does not reflect that. We fixup arguments here instead.
|
|
|
|
*/
|
|
|
|
if(!(wFlags & DISPATCH_METHOD) || pdp->cArgs != 1 || pdp->cNamedArgs)
|
|
|
|
break;
|
|
|
|
|
|
|
|
TRACE("Fixing args\n");
|
|
|
|
|
|
|
|
V_VT(args) = VT_I4;
|
|
|
|
V_I4(args) = 0;
|
|
|
|
args[1] = *pdp->rgvarg;
|
|
|
|
return IDispatchEx_InvokeEx(&window->event_target.dispex.IDispatchEx_iface, id, lcid,
|
|
|
|
wFlags, &dp, pvarRes, pei, pspCaller);
|
|
|
|
}
|
2021-04-22 01:52:53 +02:00
|
|
|
case DISPID_IHTMLWINDOW_IE10_REQUESTANIMATIONFRAME: {
|
|
|
|
HRESULT hres;
|
|
|
|
LONG r;
|
|
|
|
|
|
|
|
FIXME("requestAnimationFrame: semi-stub\n");
|
|
|
|
|
|
|
|
if(!(wFlags & DISPATCH_METHOD) || pdp->cArgs != 1 || pdp->cNamedArgs) {
|
|
|
|
FIXME("unsupported args\n");
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = window_set_timer(window, pdp->rgvarg, 50, NULL, TIMER_ANIMATION_FRAME, &r);
|
|
|
|
if(SUCCEEDED(hres) && pvarRes) {
|
|
|
|
V_VT(pvarRes) = VT_I4;
|
|
|
|
V_I4(pvarRes) = r;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
|
|
|
}
|
2015-11-20 13:15:56 +01:00
|
|
|
}
|
2009-11-30 17:58:37 +01:00
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_InvokeEx(&window->event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_DeleteMemberByName(&This->inner_window->event_target.dispex.IDispatchEx_iface, bstrName, grfdex);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x)\n", This, id);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_DeleteMemberByDispID(&This->inner_window->event_target.dispex.IDispatchEx_iface, id);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_GetMemberProperties(&This->inner_window->event_target.dispex.IDispatchEx_iface, id, grfdexFetch,
|
2010-12-31 11:07:33 +01:00
|
|
|
pgrfdex);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x %p)\n", This, id, pbstrName);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_GetMemberName(&This->inner_window->event_target.dispex.IDispatchEx_iface, id, pbstrName);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_GetNextDispID(&This->inner_window->event_target.dispex.IDispatchEx_iface, grfdex, id, pid);
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
|
|
|
|
{
|
2010-12-31 11:03:45 +01:00
|
|
|
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
2008-04-19 18:41:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppunk);
|
|
|
|
|
2008-06-30 21:40:09 +02:00
|
|
|
*ppunk = NULL;
|
|
|
|
return S_OK;
|
2008-04-19 18:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IDispatchExVtbl WindowDispExVtbl = {
|
|
|
|
WindowDispEx_QueryInterface,
|
|
|
|
WindowDispEx_AddRef,
|
|
|
|
WindowDispEx_Release,
|
|
|
|
WindowDispEx_GetTypeInfoCount,
|
|
|
|
WindowDispEx_GetTypeInfo,
|
|
|
|
WindowDispEx_GetIDsOfNames,
|
|
|
|
WindowDispEx_Invoke,
|
|
|
|
WindowDispEx_GetDispID,
|
|
|
|
WindowDispEx_InvokeEx,
|
|
|
|
WindowDispEx_DeleteMemberByName,
|
|
|
|
WindowDispEx_DeleteMemberByDispID,
|
|
|
|
WindowDispEx_GetMemberProperties,
|
|
|
|
WindowDispEx_GetMemberName,
|
|
|
|
WindowDispEx_GetNextDispID,
|
|
|
|
WindowDispEx_GetNameSpaceParent
|
|
|
|
};
|
|
|
|
|
2010-12-27 01:43:10 +01:00
|
|
|
static inline HTMLWindow *impl_from_IServiceProvider(IServiceProvider *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLWindow, IServiceProvider_iface);
|
|
|
|
}
|
2010-11-12 12:30:36 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindowSP_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 01:43:10 +01:00
|
|
|
HTMLWindow *This = impl_from_IServiceProvider(iface);
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2010-11-12 12:30:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindowSP_AddRef(IServiceProvider *iface)
|
|
|
|
{
|
2010-12-27 01:43:10 +01:00
|
|
|
HTMLWindow *This = impl_from_IServiceProvider(iface);
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
2010-11-12 12:30:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLWindowSP_Release(IServiceProvider *iface)
|
|
|
|
{
|
2010-12-27 01:43:10 +01:00
|
|
|
HTMLWindow *This = impl_from_IServiceProvider(iface);
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
2010-11-12 12:30:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLWindowSP_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 01:43:10 +01:00
|
|
|
HTMLWindow *This = impl_from_IServiceProvider(iface);
|
2010-11-12 12:30:36 +01:00
|
|
|
|
|
|
|
if(IsEqualGUID(guidService, &IID_IHTMLWindow2)) {
|
|
|
|
TRACE("IID_IHTMLWindow2\n");
|
2010-12-27 12:50:32 +01:00
|
|
|
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
2010-11-12 12:30:36 +01:00
|
|
|
}
|
|
|
|
|
2014-05-13 18:56:30 +02:00
|
|
|
TRACE("(%p)->(%s %s %p)\n", This, debugstr_mshtml_guid(guidService), debugstr_mshtml_guid(riid), ppv);
|
2010-11-12 12:30:36 +01:00
|
|
|
|
2019-03-14 14:13:24 +01:00
|
|
|
if(!This->outer_window || !This->outer_window->browser)
|
2010-11-12 12:30:36 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
2019-03-14 14:13:24 +01:00
|
|
|
return IServiceProvider_QueryService(&This->outer_window->browser->doc->basedoc.IServiceProvider_iface,
|
2010-12-27 01:43:10 +01:00
|
|
|
guidService, riid, ppv);
|
2010-11-12 12:30:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IServiceProviderVtbl ServiceProviderVtbl = {
|
|
|
|
HTMLWindowSP_QueryInterface,
|
|
|
|
HTMLWindowSP_AddRef,
|
|
|
|
HTMLWindowSP_Release,
|
|
|
|
HTMLWindowSP_QueryService
|
|
|
|
};
|
|
|
|
|
2012-06-25 14:05:33 +02:00
|
|
|
static inline HTMLInnerWindow *impl_from_DispatchEx(DispatchEx *iface)
|
2010-12-27 18:34:39 +01:00
|
|
|
{
|
2015-05-14 13:24:44 +02:00
|
|
|
return CONTAINING_RECORD(iface, HTMLInnerWindow, event_target.dispex);
|
2010-12-27 18:34:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
|
|
|
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
|
|
|
{
|
2012-06-25 14:05:33 +02:00
|
|
|
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
|
2010-12-27 18:34:39 +01:00
|
|
|
global_prop_t *prop;
|
|
|
|
DWORD idx;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
idx = id - MSHTML_DISPID_CUSTOM_MIN;
|
2012-06-25 14:05:48 +02:00
|
|
|
if(idx >= This->global_prop_cnt)
|
2010-12-27 18:34:39 +01:00
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
|
|
|
|
2012-06-25 14:05:48 +02:00
|
|
|
prop = This->global_props+idx;
|
2010-12-27 18:34:39 +01:00
|
|
|
|
|
|
|
switch(prop->type) {
|
|
|
|
case GLOBAL_SCRIPTVAR: {
|
2011-03-22 01:40:33 +01:00
|
|
|
IDispatchEx *iface;
|
2010-12-27 18:34:39 +01:00
|
|
|
IDispatch *disp;
|
|
|
|
|
|
|
|
disp = get_script_disp(prop->script_host);
|
|
|
|
if(!disp)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
2011-03-22 01:40:33 +01:00
|
|
|
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&iface);
|
2010-12-27 18:34:39 +01:00
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
TRACE("%s >>>\n", debugstr_w(prop->name));
|
2011-03-22 01:40:33 +01:00
|
|
|
hres = IDispatchEx_InvokeEx(iface, prop->id, lcid, flags, params, res, ei, caller);
|
2010-12-27 18:34:39 +01:00
|
|
|
if(hres == S_OK)
|
|
|
|
TRACE("%s <<<\n", debugstr_w(prop->name));
|
|
|
|
else
|
|
|
|
WARN("%s <<< %08x\n", debugstr_w(prop->name), hres);
|
2011-03-22 01:40:33 +01:00
|
|
|
IDispatchEx_Release(iface);
|
2010-12-27 18:34:39 +01:00
|
|
|
}else {
|
|
|
|
FIXME("No IDispatchEx\n");
|
|
|
|
}
|
|
|
|
IDispatch_Release(disp);
|
|
|
|
break;
|
|
|
|
}
|
2012-04-17 12:10:48 +02:00
|
|
|
case GLOBAL_ELEMENTVAR:
|
|
|
|
switch(flags) {
|
2012-09-25 14:18:30 +02:00
|
|
|
case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
|
2012-04-17 12:10:48 +02:00
|
|
|
case DISPATCH_PROPERTYGET: {
|
|
|
|
IHTMLElement *elem;
|
2010-12-27 18:34:39 +01:00
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
hres = IHTMLDocument3_getElementById(&This->base.inner_window->doc->basedoc.IHTMLDocument3_iface,
|
2012-04-17 12:10:48 +02:00
|
|
|
prop->name, &elem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
2010-12-27 18:34:39 +01:00
|
|
|
|
2012-04-17 12:10:48 +02:00
|
|
|
if(!elem)
|
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
2010-12-27 18:34:39 +01:00
|
|
|
|
2012-04-17 12:10:48 +02:00
|
|
|
V_VT(res) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(res) = (IDispatch*)elem;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
case DISPATCH_PROPERTYPUT: {
|
|
|
|
DISPID dispex_id;
|
|
|
|
|
2015-05-14 13:24:44 +02:00
|
|
|
hres = dispex_get_dynid(&This->event_target.dispex, prop->name, &dispex_id);
|
2012-04-17 12:10:48 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
prop->type = GLOBAL_DISPEXVAR;
|
|
|
|
prop->id = dispex_id;
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_InvokeEx(&This->event_target.dispex.IDispatchEx_iface, dispex_id, 0, flags, params, res, ei, caller);
|
2012-04-17 12:10:48 +02:00
|
|
|
}
|
|
|
|
default:
|
2012-05-15 10:15:32 +02:00
|
|
|
FIXME("Not supported flags: %x\n", flags);
|
2012-04-17 12:10:48 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2012-09-04 13:58:39 +02:00
|
|
|
case GLOBAL_FRAMEVAR:
|
|
|
|
if(!This->base.outer_window)
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
switch(flags) {
|
|
|
|
case DISPATCH_PROPERTYGET: {
|
|
|
|
HTMLOuterWindow *frame;
|
|
|
|
|
|
|
|
hres = get_frame_by_name(This->base.outer_window, prop->name, FALSE, &frame);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(!frame)
|
|
|
|
return DISP_E_MEMBERNOTFOUND;
|
|
|
|
|
|
|
|
V_VT(res) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(res) = (IDispatch*)&frame->base.inner_window->base.IHTMLWindow2_iface;
|
|
|
|
IDispatch_AddRef(V_DISPATCH(res));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("Not supported flags: %x\n", flags);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2012-04-17 12:10:48 +02:00
|
|
|
case GLOBAL_DISPEXVAR:
|
2015-05-14 13:24:44 +02:00
|
|
|
return IDispatchEx_InvokeEx(&This->event_target.dispex.IDispatchEx_iface, prop->id, 0, flags, params, res, ei, caller);
|
2010-12-27 18:34:39 +01:00
|
|
|
default:
|
|
|
|
ERR("invalid type %d\n", prop->type);
|
|
|
|
hres = DISP_E_MEMBERNOTFOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2017-11-01 16:44:02 +01:00
|
|
|
static compat_mode_t HTMLWindow_get_compat_mode(DispatchEx *dispex)
|
|
|
|
{
|
|
|
|
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
|
2018-02-22 19:48:18 +01:00
|
|
|
return lock_document_mode(This->doc);
|
2017-11-01 16:44:02 +01:00
|
|
|
}
|
|
|
|
|
2018-02-20 13:48:44 +01:00
|
|
|
static nsISupports *HTMLWindow_get_gecko_target(DispatchEx *dispex)
|
|
|
|
{
|
|
|
|
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
|
|
|
|
return (nsISupports*)This->base.outer_window->nswindow;
|
|
|
|
}
|
|
|
|
|
2017-10-18 16:38:51 +02:00
|
|
|
static void HTMLWindow_bind_event(DispatchEx *dispex, eventid_t eid)
|
2015-05-20 19:46:53 +02:00
|
|
|
{
|
|
|
|
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
|
2018-02-22 19:47:26 +01:00
|
|
|
ensure_doc_nsevent_handler(This->doc, NULL, eid);
|
2015-05-20 19:46:53 +02:00
|
|
|
}
|
|
|
|
|
2016-07-07 12:49:45 +02:00
|
|
|
static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode)
|
2016-07-05 22:48:20 +02:00
|
|
|
{
|
2018-05-18 13:53:54 +02:00
|
|
|
if(compat_mode >= COMPAT_MODE_IE9)
|
2019-03-27 18:52:27 +01:00
|
|
|
dispex_info_add_interface(info, IHTMLWindow7_tid, NULL);
|
2017-05-09 17:32:33 +02:00
|
|
|
dispex_info_add_interface(info, IHTMLWindow5_tid, NULL);
|
2017-11-01 16:44:02 +01:00
|
|
|
EventTarget_init_dispex_info(info, compat_mode);
|
2016-07-05 22:48:20 +02:00
|
|
|
}
|
|
|
|
|
2017-10-19 17:01:43 +02:00
|
|
|
static IHTMLEventObj *HTMLWindow_set_current_event(DispatchEx *dispex, IHTMLEventObj *event)
|
|
|
|
{
|
|
|
|
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
|
|
|
|
return default_set_current_event(This, event);
|
|
|
|
}
|
|
|
|
|
2017-10-18 16:38:51 +02:00
|
|
|
static const event_target_vtbl_t HTMLWindow_event_target_vtbl = {
|
|
|
|
{
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLWindow_invoke,
|
2017-11-01 16:44:02 +01:00
|
|
|
HTMLWindow_get_compat_mode,
|
2017-10-18 16:38:51 +02:00
|
|
|
NULL
|
|
|
|
},
|
2018-02-20 13:48:44 +01:00
|
|
|
HTMLWindow_get_gecko_target,
|
2017-10-19 17:01:43 +02:00
|
|
|
HTMLWindow_bind_event,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLWindow_set_current_event
|
2009-09-09 21:31:32 +02:00
|
|
|
};
|
|
|
|
|
2010-12-27 18:34:39 +01:00
|
|
|
static const tid_t HTMLWindow_iface_tids[] = {
|
|
|
|
IHTMLWindow2_tid,
|
|
|
|
IHTMLWindow3_tid,
|
|
|
|
IHTMLWindow4_tid,
|
2011-10-19 16:15:16 +02:00
|
|
|
IHTMLWindow6_tid,
|
2010-12-27 18:34:39 +01:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
2009-09-09 21:31:32 +02:00
|
|
|
static dispex_static_data_t HTMLWindow_dispex = {
|
2017-10-18 16:38:51 +02:00
|
|
|
&HTMLWindow_event_target_vtbl.dispex_vtbl,
|
2008-04-19 18:41:25 +02:00
|
|
|
DispHTMLWindow2_tid,
|
2016-02-24 15:21:24 +01:00
|
|
|
HTMLWindow_iface_tids,
|
2016-07-05 22:48:20 +02:00
|
|
|
HTMLWindow_init_dispex_info
|
2008-04-19 18:41:25 +02:00
|
|
|
};
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
static void *alloc_window(size_t size)
|
2006-12-06 18:21:16 +01:00
|
|
|
{
|
2008-10-10 22:48:14 +02:00
|
|
|
HTMLWindow *window;
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
window = heap_alloc_zero(size);
|
2008-10-10 22:48:14 +02:00
|
|
|
if(!window)
|
2012-06-25 14:04:59 +02:00
|
|
|
return NULL;
|
2009-10-26 23:02:50 +01:00
|
|
|
|
2010-12-27 12:50:32 +01:00
|
|
|
window->IHTMLWindow2_iface.lpVtbl = &HTMLWindow2Vtbl;
|
2010-12-27 14:22:27 +01:00
|
|
|
window->IHTMLWindow3_iface.lpVtbl = &HTMLWindow3Vtbl;
|
|
|
|
window->IHTMLWindow4_iface.lpVtbl = &HTMLWindow4Vtbl;
|
2012-01-23 16:42:15 +01:00
|
|
|
window->IHTMLWindow5_iface.lpVtbl = &HTMLWindow5Vtbl;
|
2011-10-19 16:15:16 +02:00
|
|
|
window->IHTMLWindow6_iface.lpVtbl = &HTMLWindow6Vtbl;
|
2018-05-17 16:22:09 +02:00
|
|
|
window->IHTMLWindow7_iface.lpVtbl = &HTMLWindow7Vtbl;
|
2010-12-27 14:22:27 +01:00
|
|
|
window->IHTMLPrivateWindow_iface.lpVtbl = &HTMLPrivateWindowVtbl;
|
2010-12-31 11:03:45 +01:00
|
|
|
window->IDispatchEx_iface.lpVtbl = &WindowDispExVtbl;
|
2010-12-27 01:43:10 +01:00
|
|
|
window->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
|
2012-01-20 15:10:25 +01:00
|
|
|
window->ITravelLogClient_iface.lpVtbl = &TravelLogClientVtbl;
|
2013-04-26 15:47:54 +02:00
|
|
|
window->IObjectIdentity_iface.lpVtbl = &ObjectIdentityVtbl;
|
2017-04-21 13:49:51 +02:00
|
|
|
window->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl;
|
2008-10-10 22:48:14 +02:00
|
|
|
window->ref = 1;
|
2012-06-25 14:04:59 +02:00
|
|
|
|
|
|
|
return window;
|
|
|
|
}
|
|
|
|
|
2012-08-14 11:28:37 +02:00
|
|
|
static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, HTMLInnerWindow **ret)
|
2012-06-25 14:05:17 +02:00
|
|
|
{
|
|
|
|
HTMLInnerWindow *window;
|
|
|
|
|
|
|
|
window = alloc_window(sizeof(HTMLInnerWindow));
|
|
|
|
if(!window)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2019-03-11 14:23:13 +01:00
|
|
|
list_init(&window->children);
|
2012-06-25 14:06:09 +02:00
|
|
|
list_init(&window->script_hosts);
|
2012-07-11 13:51:00 +02:00
|
|
|
list_init(&window->bindings);
|
2012-10-16 17:08:25 +02:00
|
|
|
list_init(&window->script_queue);
|
2012-06-25 14:06:09 +02:00
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
window->base.outer_window = outer_window;
|
|
|
|
window->base.inner_window = window;
|
|
|
|
|
2017-09-21 23:25:27 +02:00
|
|
|
EventTarget_Init(&window->event_target, (IUnknown*)&window->base.IHTMLWindow2_iface,
|
|
|
|
&HTMLWindow_dispex, COMPAT_MODE_NONE);
|
2012-06-25 14:05:33 +02:00
|
|
|
|
2012-07-12 14:25:58 +02:00
|
|
|
window->task_magic = get_task_target_magic();
|
|
|
|
|
2012-08-14 11:28:37 +02:00
|
|
|
if(mon) {
|
|
|
|
IMoniker_AddRef(mon);
|
|
|
|
window->mon = mon;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
*ret = window;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-03-11 14:24:59 +01:00
|
|
|
HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow,
|
2012-06-25 14:05:17 +02:00
|
|
|
HTMLOuterWindow *parent, HTMLOuterWindow **ret)
|
2012-06-25 14:04:59 +02:00
|
|
|
{
|
|
|
|
HTMLOuterWindow *window;
|
2019-03-11 14:24:59 +01:00
|
|
|
nsresult nsres;
|
2012-06-25 14:04:59 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
window = alloc_window(sizeof(HTMLOuterWindow));
|
|
|
|
if(!window)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
window->base.outer_window = window;
|
|
|
|
window->base.inner_window = NULL;
|
2019-03-11 14:25:21 +01:00
|
|
|
window->browser = browser;
|
|
|
|
list_add_head(&browser->outer_windows, &window->browser_entry);
|
2016-06-13 17:40:51 +02:00
|
|
|
|
2019-03-11 14:24:59 +01:00
|
|
|
mozIDOMWindowProxy_AddRef(mozwindow);
|
|
|
|
window->window_proxy = mozwindow;
|
|
|
|
nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&window->nswindow);
|
|
|
|
assert(nsres == NS_OK);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
2009-11-01 19:25:13 +01:00
|
|
|
window->readystate = READYSTATE_UNINITIALIZED;
|
2016-09-12 13:44:31 +02:00
|
|
|
window->task_magic = get_task_target_magic();
|
|
|
|
|
|
|
|
wine_rb_put(&window_map, window->window_proxy, &window->entry);
|
2009-09-09 21:30:41 +02:00
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
hres = create_pending_window(window, NULL);
|
|
|
|
if(SUCCEEDED(hres))
|
|
|
|
hres = update_window_doc(window->pending_window);
|
2012-06-25 14:05:17 +02:00
|
|
|
if(FAILED(hres)) {
|
|
|
|
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:30:20 +02:00
|
|
|
if(parent) {
|
2012-06-25 14:04:59 +02:00
|
|
|
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
|
2009-10-21 21:30:20 +02:00
|
|
|
|
|
|
|
window->parent = parent;
|
2019-03-11 14:23:13 +01:00
|
|
|
list_add_tail(&parent->base.inner_window->children, &window->sibling_entry);
|
2009-10-21 21:30:20 +02:00
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
TRACE("%p inner_window %p\n", window, window->base.inner_window);
|
|
|
|
|
2011-03-08 18:45:45 +01:00
|
|
|
*ret = window;
|
2008-10-10 22:48:14 +02:00
|
|
|
return S_OK;
|
2006-12-06 18:21:16 +01:00
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
HRESULT create_pending_window(HTMLOuterWindow *outer_window, nsChannelBSC *channelbsc)
|
2012-06-25 14:05:17 +02:00
|
|
|
{
|
2012-07-12 14:25:43 +02:00
|
|
|
HTMLInnerWindow *pending_window;
|
2012-06-25 14:05:17 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2012-08-14 11:28:37 +02:00
|
|
|
hres = create_inner_window(outer_window, outer_window->mon /* FIXME */, &pending_window);
|
2012-07-11 13:51:39 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
2012-06-25 14:05:17 +02:00
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
if(channelbsc) {
|
|
|
|
IBindStatusCallback_AddRef(&channelbsc->bsc.IBindStatusCallback_iface);
|
|
|
|
pending_window->bscallback = channelbsc;
|
2012-06-25 14:05:17 +02:00
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
if(outer_window->pending_window) {
|
|
|
|
abort_window_bindings(outer_window->pending_window);
|
|
|
|
outer_window->pending_window->base.outer_window = NULL;
|
|
|
|
IHTMLWindow2_Release(&outer_window->pending_window->base.IHTMLWindow2_iface);
|
2012-06-25 14:05:17 +02:00
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
outer_window->pending_window = pending_window;
|
2012-06-25 14:05:17 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
HRESULT update_window_doc(HTMLInnerWindow *window)
|
2009-10-21 21:29:36 +02:00
|
|
|
{
|
2012-07-12 14:25:43 +02:00
|
|
|
HTMLOuterWindow *outer_window = window->base.outer_window;
|
2019-03-13 17:54:22 +01:00
|
|
|
compat_mode_t parent_mode = COMPAT_MODE_QUIRKS;
|
2009-10-21 21:29:36 +02:00
|
|
|
nsIDOMHTMLDocument *nshtmldoc;
|
|
|
|
nsIDOMDocument *nsdoc;
|
|
|
|
nsresult nsres;
|
2012-06-25 14:05:17 +02:00
|
|
|
HRESULT hres;
|
2009-10-21 21:29:36 +02:00
|
|
|
|
2012-07-12 14:25:43 +02:00
|
|
|
assert(!window->doc);
|
|
|
|
|
2019-03-11 14:23:30 +01:00
|
|
|
if(!outer_window)
|
2012-07-12 14:25:43 +02:00
|
|
|
return E_UNEXPECTED;
|
|
|
|
|
|
|
|
nsres = nsIDOMWindow_GetDocument(outer_window->nswindow, &nsdoc);
|
2009-10-21 21:29:36 +02:00
|
|
|
if(NS_FAILED(nsres) || !nsdoc) {
|
|
|
|
ERR("GetDocument failed: %08x\n", nsres);
|
2012-06-25 14:05:17 +02:00
|
|
|
return E_FAIL;
|
2009-10-21 21:29:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
|
|
|
nsIDOMDocument_Release(nsdoc);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
|
2012-06-25 14:05:17 +02:00
|
|
|
return E_FAIL;
|
2009-10-21 21:29:36 +02:00
|
|
|
}
|
|
|
|
|
2019-03-13 17:54:22 +01:00
|
|
|
if(outer_window->parent)
|
|
|
|
parent_mode = outer_window->parent->base.inner_window->doc->document_mode;
|
|
|
|
|
|
|
|
hres = create_document_node(nshtmldoc, outer_window->browser, window, parent_mode, &window->doc);
|
2012-07-12 14:25:43 +02:00
|
|
|
nsIDOMHTMLDocument_Release(nshtmldoc);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(window != outer_window->pending_window) {
|
|
|
|
ERR("not current pending window\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2009-10-21 21:29:36 +02:00
|
|
|
|
2012-10-17 12:19:12 +02:00
|
|
|
if(outer_window->base.inner_window)
|
|
|
|
detach_inner_window(outer_window->base.inner_window);
|
2012-07-12 14:25:43 +02:00
|
|
|
outer_window->base.inner_window = window;
|
|
|
|
outer_window->pending_window = NULL;
|
|
|
|
|
2019-03-14 14:13:29 +01:00
|
|
|
if(is_main_content_window(outer_window) || !outer_window->browser->content_window) {
|
|
|
|
HTMLDocumentObj *doc_obj = outer_window->browser->doc;
|
|
|
|
if(doc_obj->basedoc.doc_node)
|
|
|
|
htmldoc_release(&doc_obj->basedoc.doc_node->basedoc);
|
|
|
|
doc_obj->basedoc.doc_node = window->doc;
|
2012-07-12 14:25:43 +02:00
|
|
|
htmldoc_addref(&window->doc->basedoc);
|
2009-10-21 21:29:36 +02:00
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
return hres;
|
2009-10-21 21:29:36 +02:00
|
|
|
}
|