Commit 08964ede authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added separated types for outer and inner HTML windows.

parent 7ebcb182
......@@ -82,7 +82,7 @@ typedef struct nsProtocolStream nsProtocolStream;
struct nsChannelBSC {
BSCallback bsc;
HTMLWindow *window;
HTMLOuterWindow *window;
nsChannel *nschannel;
nsIStreamListener *nslistener;
......@@ -103,15 +103,15 @@ HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_
nsresult on_start_uri_open(NSContainer*,nsIURI*,cpp_bool*) DECLSPEC_HIDDEN;
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN;
HRESULT create_doc_uri(HTMLWindow*,WCHAR*,nsWineURI**) DECLSPEC_HIDDEN;
HRESULT load_nsuri(HTMLWindow*,nsWineURI*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
HRESULT create_doc_uri(HTMLOuterWindow*,WCHAR*,nsWineURI**) DECLSPEC_HIDDEN;
HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
HRESULT set_moniker(HTMLDocument*,IMoniker*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
void prepare_for_binding(HTMLDocument*,IMoniker*,BOOL) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLWindow*,IUri*,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLOuterWindow*,IUri*,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,nsChannelBSC**) DECLSPEC_HIDDEN;
HRESULT channelbsc_load_stream(nsChannelBSC*,IStream*) DECLSPEC_HIDDEN;
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
HRESULT create_relative_uri(HTMLWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
......@@ -73,7 +73,7 @@ static HRESULT navigate_anchor_window(HTMLAnchorElement *This, const WCHAR *targ
static HRESULT navigate_anchor(HTMLAnchorElement *This)
{
nsAString href_str, target_str;
HTMLWindow *window = NULL;
HTMLOuterWindow *window = NULL;
nsresult nsres;
HRESULT hres = E_FAIL;
......
......@@ -106,7 +106,7 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
TRACE("(%p)->(%p)\n", This, p);
*p = (IDispatch*)&This->window->IHTMLWindow2_iface;
*p = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
IDispatch_AddRef(*p);
return S_OK;
}
......@@ -479,7 +479,7 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames
TRACE("(%p)->(%p)\n", This, p);
return IHTMLWindow2_get_frames(&This->window->IHTMLWindow2_iface, p);
return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p);
}
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
......@@ -587,7 +587,7 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca
return E_UNEXPECTED;
}
return IHTMLWindow2_get_location(&This->window->IHTMLWindow2_iface, p);
return IHTMLWindow2_get_location(&This->window->base.IHTMLWindow2_iface, p);
}
static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
......@@ -911,8 +911,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
if(tmp)
nsISupports_Release(tmp);
*pomWindowResult = (IDispatch*)&This->window->IHTMLWindow2_iface;
IHTMLWindow2_AddRef(&This->window->IHTMLWindow2_iface);
*pomWindowResult = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
return S_OK;
}
......@@ -1365,7 +1365,7 @@ static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTML
TRACE("(%p)->(%p)\n", This, p);
*p = &This->window->IHTMLWindow2_iface;
*p = &This->window->base.IHTMLWindow2_iface;
IHTMLWindow2_AddRef(*p);
return S_OK;
}
......@@ -1758,7 +1758,7 @@ static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID
HTMLDocument *This = impl_from_IDispatchEx(iface);
if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT))
return IDispatchEx_InvokeEx(&This->window->IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION,
return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION,
lcid, wFlags, pdp, pvarRes, pei, pspCaller);
......@@ -2199,7 +2199,7 @@ static dispex_static_data_t HTMLDocumentNode_dispex = {
HTMLDocumentNode_iface_tids
};
static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLWindow *window)
static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLOuterWindow *window)
{
HTMLDocumentNode *doc;
......@@ -2226,7 +2226,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLWindow *wi
return doc;
}
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLWindow *window, HTMLDocumentNode **ret)
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLOuterWindow *window, HTMLDocumentNode **ret)
{
HTMLDocumentNode *doc;
......@@ -2325,7 +2325,7 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
}
if(This->basedoc.window) {
This->basedoc.window->doc_obj = NULL;
IHTMLWindow2_Release(&This->basedoc.window->IHTMLWindow2_iface);
IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface);
}
if(This->basedoc.advise_holder)
IOleAdviseHolder_Release(This->basedoc.advise_holder);
......@@ -2453,7 +2453,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
if(NS_FAILED(nsres))
ERR("GetContentDOMWindow failed: %08x\n", nsres);
hres = HTMLWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window);
hres = HTMLOuterWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window);
if(nswindow)
nsIDOMWindow_Release(nswindow);
if(FAILED(hres)) {
......
......@@ -1348,7 +1348,7 @@ HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name,
return S_OK;
}
void update_cp_events(HTMLWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp, nsIDOMNode *nsnode)
void update_cp_events(HTMLOuterWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp, nsIDOMNode *nsnode)
{
event_target_t *event_target;
int i;
......
......@@ -54,7 +54,7 @@ HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,
HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN;
void update_cp_events(HTMLWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN;
void update_cp_events(HTMLOuterWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN;
HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN;
......
......@@ -108,7 +108,7 @@ static HRESULT WINAPI HTMLFrameElement3_get_contentDocument(IHTMLFrameElement3 *
return E_FAIL;
}
hres = IHTMLWindow2_get_document(&This->framebase.content_window->IHTMLWindow2_iface, &doc);
hres = IHTMLWindow2_get_document(&This->framebase.content_window->base.IHTMLWindow2_iface, &doc);
if(FAILED(hres))
return hres;
......@@ -244,7 +244,7 @@ static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
return E_FAIL;
}
return IDispatchEx_InvokeEx(&This->framebase.content_window->IDispatchEx_iface, id, lcid,
return IDispatchEx_InvokeEx(&This->framebase.content_window->base.IDispatchEx_iface, id, lcid,
flags, params, res, ei, caller);
}
......
......@@ -38,7 +38,7 @@ static const WCHAR noW[] = {'n','o',0};
HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
{
nsIDOMWindow *nswindow;
HTMLWindow *window;
HTMLOuterWindow *window;
nsresult nsres;
HRESULT hres = S_OK;
......@@ -51,7 +51,7 @@ HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
window = nswindow_to_window(nswindow);
if(!window)
hres = HTMLWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow,
hres = HTMLOuterWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow,
frame->element.node.doc->basedoc.window, &window);
nsIDOMWindow_Release(nswindow);
if(FAILED(hres))
......@@ -418,8 +418,8 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I
TRACE("(%p)->(%p)\n", This, p);
if(This->content_window) {
IHTMLWindow2_AddRef(&This->content_window->IHTMLWindow2_iface);
*p = &This->content_window->IHTMLWindow2_iface;
IHTMLWindow2_AddRef(&This->content_window->base.IHTMLWindow2_iface);
*p = &This->content_window->base.IHTMLWindow2_iface;
}else {
WARN("NULL content window\n");
*p = NULL;
......
......@@ -215,7 +215,7 @@ static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
return E_FAIL;
}
return IDispatchEx_InvokeEx(&This->framebase.content_window->IDispatchEx_iface, id, lcid,
return IDispatchEx_InvokeEx(&This->framebase.content_window->base.IDispatchEx_iface, id, lcid,
flags, params, res, ei, caller);
}
......
......@@ -917,7 +917,7 @@ static dispex_static_data_t HTMLImageElementFactory_dispex = {
HTMLImageElementFactory_iface_tids
};
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLOuterWindow *window)
{
HTMLImageElementFactory *ret;
......
......@@ -617,7 +617,7 @@ static dispex_static_data_t HTMLLocation_dispex = {
};
HRESULT HTMLLocation_Create(HTMLWindow *window, HTMLLocation **ret)
HRESULT HTMLLocation_Create(HTMLOuterWindow *window, HTMLLocation **ret)
{
HTMLLocation *location;
......
......@@ -517,7 +517,7 @@ static const IHTMLOptionElementFactoryVtbl HTMLOptionElementFactoryVtbl = {
HTMLOptionElementFactory_create
};
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow *window)
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLOuterWindow *window)
{
HTMLOptionElementFactory *ret;
......
......@@ -236,6 +236,8 @@ void release_typelib(void) DECLSPEC_HIDDEN;
HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
typedef struct HTMLWindow HTMLWindow;
typedef struct HTMLInnerWindow HTMLInnerWindow;
typedef struct HTMLOuterWindow HTMLOuterWindow;
typedef struct HTMLDocumentNode HTMLDocumentNode;
typedef struct HTMLDocumentObj HTMLDocumentObj;
typedef struct HTMLFrameBase HTMLFrameBase;
......@@ -267,7 +269,7 @@ typedef struct {
LONG ref;
HTMLWindow *window;
HTMLOuterWindow *window;
} HTMLOptionElementFactory;
typedef struct {
......@@ -276,7 +278,7 @@ typedef struct {
LONG ref;
HTMLWindow *window;
HTMLOuterWindow *window;
} HTMLImageElementFactory;
struct HTMLLocation {
......@@ -285,18 +287,17 @@ struct HTMLLocation {
LONG ref;
HTMLWindow *window;
HTMLOuterWindow *window;
};
typedef struct {
HTMLWindow *window;
HTMLOuterWindow *window;
LONG ref;
} windowref_t;
typedef struct nsChannelBSC nsChannelBSC;
struct HTMLWindow {
DispatchEx dispex;
IHTMLWindow2 IHTMLWindow2_iface;
IHTMLWindow3 IHTMLWindow3_iface;
IHTMLWindow4 IHTMLWindow4_iface;
......@@ -309,13 +310,21 @@ struct HTMLWindow {
LONG ref;
HTMLInnerWindow *inner_window;
HTMLOuterWindow *outer_window;
};
struct HTMLOuterWindow {
HTMLWindow base;
DispatchEx dispex;
windowref_t *window_ref;
LONG task_magic;
HTMLDocumentNode *doc;
HTMLDocumentObj *doc_obj;
nsIDOMWindow *nswindow;
HTMLWindow *parent;
HTMLOuterWindow *parent;
HTMLFrameBase *frame_element;
READYSTATE readystate;
......@@ -346,6 +355,10 @@ struct HTMLWindow {
struct list entry;
};
struct HTMLInnerWindow {
HTMLWindow base;
};
typedef enum {
UNKNOWN_USERMODE,
BROWSEMODE,
......@@ -419,7 +432,7 @@ struct HTMLDocument {
HTMLDocumentObj *doc_obj;
HTMLDocumentNode *doc_node;
HTMLWindow *window;
HTMLOuterWindow *window;
LONG task_magic;
......@@ -598,7 +611,7 @@ struct HTMLFrameBase {
IHTMLFrameBase IHTMLFrameBase_iface;
IHTMLFrameBase2 IHTMLFrameBase2_iface;
HTMLWindow *content_window;
HTMLOuterWindow *content_window;
nsIDOMHTMLFrameElement *nsframe;
nsIDOMHTMLIFrameElement *nsiframe;
......@@ -639,16 +652,16 @@ struct HTMLDocumentNode {
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocumentObj*,HTMLOuterWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
HRESULT create_document_fragment(nsIDOMNode*,HTMLDocumentNode*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
HRESULT HTMLWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLWindow*,HTMLWindow**) DECLSPEC_HIDDEN;
void update_window_doc(HTMLWindow*) DECLSPEC_HIDDEN;
HTMLWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
void get_top_window(HTMLWindow*,HTMLWindow**) DECLSPEC_HIDDEN;
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow*) DECLSPEC_HIDDEN;
HRESULT HTMLLocation_Create(HTMLWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
HRESULT HTMLOuterWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
void update_window_doc(HTMLOuterWindow*) DECLSPEC_HIDDEN;
HTMLOuterWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLOuterWindow*) DECLSPEC_HIDDEN;
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLOuterWindow*) DECLSPEC_HIDDEN;
HRESULT HTMLLocation_Create(HTMLOuterWindow*,HTMLLocation**) DECLSPEC_HIDDEN;
IOmNavigator *OmNavigator_Create(void) DECLSPEC_HIDDEN;
HRESULT HTMLScreen_Create(IHTMLScreen**) DECLSPEC_HIDDEN;
HRESULT create_history(IOmHistory**) DECLSPEC_HIDDEN;
......@@ -701,7 +714,7 @@ BOOL is_gecko_path(const char*) DECLSPEC_HIDDEN;
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN;
BOOL compare_ignoring_frag(IUri*,IUri*) DECLSPEC_HIDDEN;
HRESULT navigate_url(HTMLWindow*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
void call_property_onchanged(ConnectionPoint*,DISPID) DECLSPEC_HIDDEN;
......@@ -728,18 +741,18 @@ void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN;
nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN;
nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
void set_window_bscallback(HTMLWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
void set_current_mon(HTMLWindow*,IMoniker*) DECLSPEC_HIDDEN;
void set_current_uri(HTMLWindow*,IUri*) DECLSPEC_HIDDEN;
HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
HRESULT async_start_doc_binding(HTMLWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
void set_window_bscallback(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
void set_current_mon(HTMLOuterWindow*,IMoniker*) DECLSPEC_HIDDEN;
void set_current_uri(HTMLOuterWindow*,IUri*) DECLSPEC_HIDDEN;
HRESULT start_binding(HTMLOuterWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
HRESULT async_start_doc_binding(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
void abort_document_bindings(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void set_download_state(HTMLDocumentObj*,int) DECLSPEC_HIDDEN;
void call_docview_84(HTMLDocumentObj*) DECLSPEC_HIDDEN;
HRESULT bind_mon_to_buffer(HTMLDocumentNode*,IMoniker*,void**,DWORD*) DECLSPEC_HIDDEN;
void set_ready_state(HTMLWindow*,READYSTATE) DECLSPEC_HIDDEN;
void set_ready_state(HTMLOuterWindow*,READYSTATE) DECLSPEC_HIDDEN;
HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectionObject**) DECLSPEC_HIDDEN;
HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECLSPEC_HIDDEN;
......@@ -828,15 +841,15 @@ void release_nodes(HTMLDocumentNode*) DECLSPEC_HIDDEN;
HTMLElement *unsafe_impl_from_IHTMLElement(IHTMLElement*) DECLSPEC_HIDDEN;
void release_script_hosts(HTMLWindow*) DECLSPEC_HIDDEN;
void connect_scripts(HTMLWindow*) DECLSPEC_HIDDEN;
void doc_insert_script(HTMLWindow*,nsIDOMHTMLScriptElement*) DECLSPEC_HIDDEN;
IDispatch *script_parse_event(HTMLWindow*,LPCWSTR) DECLSPEC_HIDDEN;
HRESULT exec_script(HTMLWindow*,const WCHAR*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN;
void set_script_mode(HTMLWindow*,SCRIPTMODE) DECLSPEC_HIDDEN;
BOOL find_global_prop(HTMLWindow*,BSTR,DWORD,ScriptHost**,DISPID*) DECLSPEC_HIDDEN;
void release_script_hosts(HTMLOuterWindow*) DECLSPEC_HIDDEN;
void connect_scripts(HTMLOuterWindow*) DECLSPEC_HIDDEN;
void doc_insert_script(HTMLOuterWindow*,nsIDOMHTMLScriptElement*) DECLSPEC_HIDDEN;
IDispatch *script_parse_event(HTMLOuterWindow*,LPCWSTR) DECLSPEC_HIDDEN;
HRESULT exec_script(HTMLOuterWindow*,const WCHAR*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN;
void set_script_mode(HTMLOuterWindow*,SCRIPTMODE) DECLSPEC_HIDDEN;
BOOL find_global_prop(HTMLOuterWindow*,BSTR,DWORD,ScriptHost**,DISPID*) DECLSPEC_HIDDEN;
IDispatch *get_script_disp(ScriptHost*) DECLSPEC_HIDDEN;
HRESULT search_window_props(HTMLWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
HRESULT search_window_props(HTMLOuterWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
......
......@@ -267,7 +267,7 @@ static void parse_complete(HTMLDocumentObj *doc)
call_explorer_69(doc);
if(doc->is_webbrowser && doc->usermode != EDITMODE)
IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->IHTMLWindow2_iface, 0);
IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
}
......
......@@ -717,7 +717,7 @@ static HRESULT process_response_headers(nsChannelBSC *This, const WCHAR *headers
return S_OK;
}
HRESULT start_binding(HTMLWindow *window, HTMLDocumentNode *doc, BSCallback *bscallback, IBindCtx *bctx)
HRESULT start_binding(HTMLOuterWindow *window, HTMLDocumentNode *doc, BSCallback *bscallback, IBindCtx *bctx)
{
IStream *str = NULL;
HRESULT hres;
......@@ -1387,7 +1387,7 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result)
ind = 3;
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
SafeArrayPutElement(sa, &ind, &var);
/* FIXME: what are the following fields for? */
......@@ -1653,7 +1653,7 @@ HRESULT create_channelbsc(IMoniker *mon, const WCHAR *headers, BYTE *post_data,
return S_OK;
}
void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback)
void set_window_bscallback(HTMLOuterWindow *window, nsChannelBSC *callback)
{
if(window->bscallback) {
if(window->bscallback->bsc.binding)
......@@ -1674,7 +1674,7 @@ void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback)
typedef struct {
task_t header;
HTMLWindow *window;
HTMLOuterWindow *window;
nsChannelBSC *bscallback;
} start_doc_binding_task_t;
......@@ -1693,7 +1693,7 @@ static void start_doc_binding_task_destr(task_t *_task)
heap_free(task);
}
HRESULT async_start_doc_binding(HTMLWindow *window, nsChannelBSC *bscallback)
HRESULT async_start_doc_binding(HTMLOuterWindow *window, nsChannelBSC *bscallback)
{
start_doc_binding_task_t *task;
......@@ -1784,14 +1784,14 @@ void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamLis
typedef struct {
task_t header;
HTMLWindow *window;
HTMLOuterWindow *window;
IUri *uri;
} navigate_javascript_task_t;
static void navigate_javascript_proc(task_t *_task)
{
navigate_javascript_task_t *task = (navigate_javascript_task_t*)_task;
HTMLWindow *window = task->window;
HTMLOuterWindow *window = task->window;
VARIANT v;
BSTR code;
HRESULT hres;
......@@ -1830,7 +1830,7 @@ static void navigate_javascript_task_destr(task_t *_task)
typedef struct {
task_t header;
HTMLWindow *window;
HTMLOuterWindow *window;
nsChannelBSC *bscallback;
IMoniker *mon;
} navigate_task_t;
......@@ -1854,7 +1854,7 @@ static void navigate_task_destr(task_t *_task)
heap_free(task);
}
static HRESULT navigate_fragment(HTMLWindow *window, IUri *uri)
static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri)
{
nsIDOMLocation *nslocation;
nsAString nsfrag_str;
......@@ -1885,15 +1885,15 @@ static HRESULT navigate_fragment(HTMLWindow *window, IUri *uri)
}
if(window->doc_obj->doc_object_service) {
IDocObjectService_FireNavigateComplete2(window->doc_obj->doc_object_service, &window->IHTMLWindow2_iface, 0x10);
IDocObjectService_FireDocumentComplete(window->doc_obj->doc_object_service, &window->IHTMLWindow2_iface, 0);
IDocObjectService_FireNavigateComplete2(window->doc_obj->doc_object_service, &window->base.IHTMLWindow2_iface, 0x10);
IDocObjectService_FireDocumentComplete(window->doc_obj->doc_object_service, &window->base.IHTMLWindow2_iface, 0);
}
return S_OK;
}
HRESULT super_navigate(HTMLWindow *window, IUri *uri, const WCHAR *headers, BYTE *post_data, DWORD post_data_size)
HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, const WCHAR *headers, BYTE *post_data, DWORD post_data_size)
{
nsChannelBSC *bsc;
IMoniker *mon;
......@@ -1986,7 +1986,7 @@ HRESULT super_navigate(HTMLWindow *window, IUri *uri, const WCHAR *headers, BYTE
return S_OK;
}
HRESULT navigate_new_window(HTMLWindow *window, IUri *uri, const WCHAR *name, IHTMLWindow2 **ret)
HRESULT navigate_new_window(HTMLOuterWindow *window, IUri *uri, const WCHAR *name, IHTMLWindow2 **ret)
{
IWebBrowser2 *web_browser;
IHTMLWindow2 *new_window;
......@@ -2096,7 +2096,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
return hres;
}
HRESULT navigate_url(HTMLWindow *window, const WCHAR *new_url, const WCHAR *base_url)
HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, const WCHAR *base_url)
{
WCHAR url[INTERNET_MAX_URL_LENGTH];
nsWineURI *uri;
......
......@@ -234,11 +234,11 @@ static nsIDOMElement *get_dom_element(NPP instance)
return elem;
}
static HTMLWindow *get_elem_window(nsIDOMElement *elem)
static HTMLOuterWindow *get_elem_window(nsIDOMElement *elem)
{
nsIDOMWindow *nswindow;
nsIDOMDocument *nsdoc;
HTMLWindow *window;
HTMLOuterWindow *window;
nsresult nsres;
nsres = nsIDOMElement_GetOwnerDocument(elem, &nsdoc);
......@@ -313,7 +313,7 @@ static BOOL get_elem_clsid(nsIDOMElement *elem, CLSID *clsid)
return ret;
}
static IUnknown *create_activex_object(HTMLWindow *window, nsIDOMElement *nselem, CLSID *clsid)
static IUnknown *create_activex_object(HTMLOuterWindow *window, nsIDOMElement *nselem, CLSID *clsid)
{
IClassFactoryEx *cfex;
IClassFactory *cf;
......@@ -357,7 +357,7 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
char **argv, NPSavedData *saved)
{
nsIDOMElement *nselem;
HTMLWindow *window;
HTMLOuterWindow *window;
IUnknown *obj;
CLSID clsid;
NPError err = NPERR_NO_ERROR;
......
......@@ -259,7 +259,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if(doc_obj && doc_obj->usermode!=EDITMODE && doc_obj->doc_object_service)
IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service,
&doc->basedoc.window->IHTMLWindow2_iface, 0);
&doc->basedoc.window->base.IHTMLWindow2_iface, 0);
if(!doc->nsdoc) {
ERR("NULL nsdoc\n");
......
......@@ -139,7 +139,7 @@ BOOL compare_ignoring_frag(IUri *uri1, IUri *uri2)
return ret;
}
static nsresult create_nsuri(IUri*,HTMLWindow*,NSContainer*,nsWineURI**);
static nsresult create_nsuri(IUri*,HTMLOuterWindow*,NSContainer*,nsWineURI**);
static const char *debugstr_nsacstr(const nsACString *nsstr)
{
......@@ -264,7 +264,7 @@ static nsresult before_async_open(nsChannel *channel, NSContainer *container, BO
return NS_OK;
}
HRESULT load_nsuri(HTMLWindow *window, nsWineURI *uri, nsChannelBSC *channelbsc, DWORD flags)
HRESULT load_nsuri(HTMLOuterWindow *window, nsWineURI *uri, nsChannelBSC *channelbsc, DWORD flags)
{
nsIWebNavigation *web_navigation;
nsIDocShell *doc_shell;
......@@ -314,7 +314,7 @@ static void set_uri_nscontainer(nsWineURI *This, NSContainer *nscontainer)
This->container = nscontainer;
}
static void set_uri_window(nsWineURI *This, HTMLWindow *window)
static void set_uri_window(nsWineURI *This, HTMLOuterWindow *window)
{
if(This->window_ref) {
if(This->window_ref->window == window)
......@@ -874,9 +874,9 @@ static nsresult NSAPI nsChannel_Open(nsIHttpChannel *iface, nsIInputStream **_re
return NS_ERROR_NOT_IMPLEMENTED;
}
static HTMLWindow *get_window_from_load_group(nsChannel *This)
static HTMLOuterWindow *get_window_from_load_group(nsChannel *This)
{
HTMLWindow *window;
HTMLOuterWindow *window;
nsIChannel *channel;
nsIRequest *req;
nsWineURI *wine_uri;
......@@ -915,17 +915,17 @@ static HTMLWindow *get_window_from_load_group(nsChannel *This)
window = wine_uri->window_ref ? wine_uri->window_ref->window : NULL;
if(window)
IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
nsIURI_Release(&wine_uri->nsIURL_iface);
return window;
}
static HTMLWindow *get_channel_window(nsChannel *This)
static HTMLOuterWindow *get_channel_window(nsChannel *This)
{
nsIWebProgress *web_progress;
nsIDOMWindow *nswindow;
HTMLWindow *window;
HTMLOuterWindow *window;
nsresult nsres;
if(This->load_group) {
......@@ -965,7 +965,7 @@ static HTMLWindow *get_channel_window(nsChannel *This)
nsIDOMWindow_Release(nswindow);
if(window)
IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
else
FIXME("NULL window for %p\n", nswindow);
return window;
......@@ -992,7 +992,7 @@ static void start_binding_task_destr(task_t *_task)
heap_free(task);
}
static nsresult async_open(nsChannel *This, HTMLWindow *window, BOOL is_doc_channel, nsIStreamListener *listener,
static nsresult async_open(nsChannel *This, HTMLOuterWindow *window, BOOL is_doc_channel, nsIStreamListener *listener,
nsISupports *context)
{
nsChannelBSC *bscallback;
......@@ -1034,7 +1034,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsISupports *aContext)
{
nsChannel *This = impl_from_nsIHttpChannel(iface);
HTMLWindow *window = NULL;
HTMLOuterWindow *window = NULL;
BOOL cancel = FALSE;
nsresult nsres = NS_OK;
......@@ -1073,7 +1073,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
if(!window) {
if(This->uri->window_ref && This->uri->window_ref->window) {
window = This->uri->window_ref->window;
IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
}else {
/* FIXME: Analyze removing get_window_from_load_group call */
if(This->load_group)
......@@ -1119,7 +1119,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
ERR("AddRequest failed: %08x\n", nsres);
}
IHTMLWindow2_Release(&window->IHTMLWindow2_iface);
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
return nsres;
}
......@@ -2823,7 +2823,7 @@ static const nsIStandardURLVtbl nsStandardURLVtbl = {
nsStandardURL_Init
};
static nsresult create_nsuri(IUri *iuri, HTMLWindow *window, NSContainer *container, nsWineURI **_retval)
static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *container, nsWineURI **_retval)
{
nsWineURI *ret = heap_alloc_zero(sizeof(nsWineURI));
......@@ -2843,7 +2843,7 @@ static nsresult create_nsuri(IUri *iuri, HTMLWindow *window, NSContainer *contai
return NS_OK;
}
HRESULT create_doc_uri(HTMLWindow *window, WCHAR *url, nsWineURI **ret)
HRESULT create_doc_uri(HTMLOuterWindow *window, WCHAR *url, nsWineURI **ret)
{
nsWineURI *uri;
IUri *iuri;
......@@ -2898,7 +2898,7 @@ static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret)
HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsChannel **ret)
{
HTMLWindow *window = NULL;
HTMLOuterWindow *window = NULL;
nsChannel *channel;
nsWineURI *uri;
IUri *iuri;
......@@ -3183,7 +3183,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
{
nsWineURI *wine_uri, *base_wine_uri = NULL;
WCHAR new_spec[INTERNET_MAX_URL_LENGTH];
HTMLWindow *window = NULL;
HTMLOuterWindow *window = NULL;
const char *spec = NULL;
IUri *urlmon_uri;
nsresult nsres;
......
......@@ -77,7 +77,7 @@ static nsrefcnt NSAPI nsPromptService_Release(nsIPromptService *iface)
static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindow *aParent,
const PRUnichar *aDialogTitle, const PRUnichar *aText)
{
HTMLWindow *window;
HTMLOuterWindow *window;
BSTR text;
TRACE("(%p %s %s)\n", aParent, debugstr_w(aDialogTitle), debugstr_w(aText));
......@@ -89,7 +89,7 @@ static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindo
}
text = SysAllocString(aText);
IHTMLWindow2_alert(&window->IHTMLWindow2_iface, text);
IHTMLWindow2_alert(&window->base.IHTMLWindow2_iface, text);
SysFreeString(text);
return NS_OK;
......
......@@ -325,7 +325,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
IWebBrowser2 *wb;
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
hres = do_query_service((IUnknown*)pClientSite, &IID_IShellBrowser,
......
......@@ -54,7 +54,7 @@ typedef struct {
LPOLESTR url;
} download_proc_task_t;
static BOOL use_gecko_script(HTMLWindow *window)
static BOOL use_gecko_script(HTMLOuterWindow *window)
{
DWORD zone;
HRESULT hres;
......@@ -98,7 +98,7 @@ static void notify_travellog_update(HTMLDocumentObj *doc)
}
}
void set_current_uri(HTMLWindow *window, IUri *uri)
void set_current_uri(HTMLOuterWindow *window, IUri *uri)
{
if(window->uri) {
IUri_Release(window->uri);
......@@ -117,7 +117,7 @@ void set_current_uri(HTMLWindow *window, IUri *uri)
IUri_GetDisplayUri(uri, &window->url);
}
void set_current_mon(HTMLWindow *This, IMoniker *mon)
void set_current_mon(HTMLOuterWindow *This, IMoniker *mon)
{
IUriContainer *uri_container;
IUri *uri = NULL;
......@@ -171,7 +171,7 @@ void set_current_mon(HTMLWindow *This, IMoniker *mon)
set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
}
HRESULT create_relative_uri(HTMLWindow *window, const WCHAR *rel_uri, IUri **uri)
HRESULT create_relative_uri(HTMLOuterWindow *window, const WCHAR *rel_uri, IUri **uri)
{
return window->uri
? CoInternetCombineUrlEx(window->uri, rel_uri, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, uri, 0)
......@@ -325,7 +325,7 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, BOOL navigated_bindi
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}else {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
V_VT(&out) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
if(SUCCEEDED(hres))
......@@ -399,7 +399,7 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel
return S_OK;
}
void set_ready_state(HTMLWindow *window, READYSTATE readystate)
void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
{
window->readystate = readystate;
......
......@@ -1216,7 +1216,7 @@ static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, RE
return E_NOINTERFACE;
}
return IServiceProvider_QueryService(&This->doc->basedoc.window->IServiceProvider_iface,
return IServiceProvider_QueryService(&This->doc->basedoc.window->base.IServiceProvider_iface,
guidService, riid, ppv);
}
......
......@@ -66,7 +66,7 @@ struct ScriptHost {
SCRIPTSTATE script_state;
HTMLWindow *window;
HTMLOuterWindow *window;
GUID guid;
struct list entry;
......@@ -211,7 +211,7 @@ static void release_script_engine(ScriptHost *This)
This->script_state = SCRIPTSTATE_UNINITIALIZED;
}
void connect_scripts(HTMLWindow *window)
void connect_scripts(HTMLOuterWindow *window)
{
ScriptHost *iter;
......@@ -320,7 +320,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC
return E_FAIL;
/* FIXME: Return proxy object */
*ppiunkItem = (IUnknown*)&This->window->IHTMLWindow2_iface;
*ppiunkItem = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
IUnknown_AddRef(*ppiunkItem);
return S_OK;
......@@ -591,7 +591,7 @@ static const IServiceProviderVtbl ASServiceProviderVtbl = {
ASServiceProvider_QueryService
};
static ScriptHost *create_script_host(HTMLWindow *window, const GUID *guid)
static ScriptHost *create_script_host(HTMLOuterWindow *window, const GUID *guid)
{
ScriptHost *ret;
HRESULT hres;
......@@ -796,7 +796,7 @@ static BOOL get_script_guid(nsIDOMHTMLScriptElement *nsscript, GUID *guid)
return ret;
}
static ScriptHost *get_script_host(HTMLWindow *window, const GUID *guid)
static ScriptHost *get_script_host(HTMLOuterWindow *window, const GUID *guid)
{
ScriptHost *iter;
......@@ -808,7 +808,7 @@ static ScriptHost *get_script_host(HTMLWindow *window, const GUID *guid)
return create_script_host(window, guid);
}
void doc_insert_script(HTMLWindow *window, nsIDOMHTMLScriptElement *nsscript)
void doc_insert_script(HTMLOuterWindow *window, nsIDOMHTMLScriptElement *nsscript)
{
ScriptHost *script_host;
GUID guid;
......@@ -831,7 +831,7 @@ void doc_insert_script(HTMLWindow *window, nsIDOMHTMLScriptElement *nsscript)
parse_script_elem(script_host, nsscript);
}
IDispatch *script_parse_event(HTMLWindow *window, LPCWSTR text)
IDispatch *script_parse_event(HTMLOuterWindow *window, LPCWSTR text)
{
ScriptHost *script_host;
GUID guid = CLSID_JScript;
......@@ -885,7 +885,7 @@ IDispatch *script_parse_event(HTMLWindow *window, LPCWSTR text)
return disp;
}
HRESULT exec_script(HTMLWindow *window, const WCHAR *code, const WCHAR *lang, VARIANT *ret)
HRESULT exec_script(HTMLOuterWindow *window, const WCHAR *code, const WCHAR *lang, VARIANT *ret)
{
ScriptHost *script_host;
EXCEPINFO ei;
......@@ -936,7 +936,7 @@ IDispatch *get_script_disp(ScriptHost *script_host)
return disp;
}
BOOL find_global_prop(HTMLWindow *window, BSTR name, DWORD flags, ScriptHost **ret_host, DISPID *ret_id)
BOOL find_global_prop(HTMLOuterWindow *window, BSTR name, DWORD flags, ScriptHost **ret_host, DISPID *ret_id)
{
IDispatchEx *dispex;
IDispatch *disp;
......@@ -987,7 +987,7 @@ static BOOL is_jscript_available(void)
return available;
}
void set_script_mode(HTMLWindow *window, SCRIPTMODE mode)
void set_script_mode(HTMLOuterWindow *window, SCRIPTMODE mode)
{
nsIWebBrowserSetup *setup;
nsresult nsres;
......@@ -1015,7 +1015,7 @@ void set_script_mode(HTMLWindow *window, SCRIPTMODE mode)
ERR("JavaScript setup failed: %08x\n", nsres);
}
void release_script_hosts(HTMLWindow *window)
void release_script_hosts(HTMLOuterWindow *window)
{
ScriptHost *iter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment