From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/editor.c | 20 ++++++++-------- dlls/mshtml/htmlanchor.c | 6 ++--- dlls/mshtml/htmldoc.c | 44 ++++++++++++++++++------------------ dlls/mshtml/htmlframe.c | 6 ++--- dlls/mshtml/mshtml_private.h | 4 ++-- dlls/mshtml/mutation.c | 6 ++--- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsevents.c | 10 ++++---- dlls/mshtml/olecmd.c | 10 ++++---- dlls/mshtml/oleobj.c | 32 +++++++++++++------------- dlls/mshtml/persist.c | 34 ++++++++++++++-------------- dlls/mshtml/pluginhost.c | 4 ++-- dlls/mshtml/range.c | 2 +- dlls/mshtml/secmgr.c | 8 +++---- 14 files changed, 94 insertions(+), 94 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index d70129ae533..b176eb8763b 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -133,7 +133,7 @@ static nsresult get_ns_command_state(GeckoBrowser *This, const char *cmd, nsICom return nsres; }
- nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->basedoc.window->window_proxy, nsparam); + nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->window->window_proxy, nsparam); if(NS_FAILED(nsres)) ERR("GetCommandState(%s) failed: %08lx\n", debugstr_a(cmd), nsres);
@@ -146,7 +146,7 @@ static DWORD query_ns_edit_status(HTMLDocumentNode *doc, const char *nscmd) nsICommandParams *nsparam; cpp_bool b = FALSE;
- if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED;
if(nscmd) { @@ -180,7 +180,7 @@ static DWORD query_align_status(HTMLDocumentNode *doc, const WCHAR *align) cpp_bool b; nsresult nsres;
- if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED;
nsAString_Init(&justify_str, align); @@ -198,7 +198,7 @@ static nsISelection *get_ns_selection(HTMLDocumentNode *doc) nsISelection *nsselection = NULL; nsresult nsres;
- nsres = nsIDOMWindow_GetSelection(doc->basedoc.window->nswindow, &nsselection); + nsres = nsIDOMWindow_GetSelection(doc->outer_window->nswindow, &nsselection); if(NS_FAILED(nsres)) ERR("GetSelection failed %08lx\n", nsres);
@@ -661,7 +661,7 @@ static HRESULT query_justify(HTMLDocumentNode *doc, OLECMD *cmd) case IDM_JUSTIFYLEFT: TRACE("(%p) IDM_JUSTIFYLEFT\n", doc); /* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */ - if(doc->browser->usermode != EDITMODE || doc->basedoc.window->readystate < READYSTATE_INTERACTIVE) + if(doc->browser->usermode != EDITMODE || doc->outer_window->readystate < READYSTATE_INTERACTIVE) cmd->cmdf = OLECMDF_SUPPORTED; else cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED; @@ -1191,9 +1191,9 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
doc->nscontainer->usermode = EDITMODE;
- if(doc->basedoc.window->mon) { + if(doc->window->mon) { CLSID clsid = IID_NULL; - hres = IMoniker_GetClassID(doc->basedoc.window->mon, &clsid); + hres = IMoniker_GetClassID(doc->window->mon, &clsid); if(SUCCEEDED(hres)) { /* We should use IMoniker::Save here */ FIXME("Use CLSID %s\n", debugstr_guid(&clsid)); @@ -1203,7 +1203,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc) if(doc->frame) IOleInPlaceFrame_SetStatusText(doc->frame, NULL);
- doc->basedoc.window->readystate = READYSTATE_UNINITIALIZED; + doc->window->readystate = READYSTATE_UNINITIALIZED;
if(doc->client) { IOleCommandTarget *cmdtrg; @@ -1235,11 +1235,11 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
update_doc(doc, UPDATE_UI);
- if(doc->basedoc.window->mon) { + if(doc->window->mon) { /* FIXME: We should find nicer way to do this */ remove_target_tasks(doc->task_magic);
- mon = doc->basedoc.window->mon; + mon = doc->window->mon; IMoniker_AddRef(mon); }else { hres = CreateURLMoniker(NULL, L"about:blank", &mon); diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 7b4ee80778f..633bb88e9df 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -49,11 +49,11 @@ static HRESULT navigate_href_new_window(HTMLElement *element, nsAString *href_st HRESULT hres;
nsAString_GetData(href_str, &href); - hres = create_relative_uri(element->node.doc->basedoc.window, href, &uri); + hres = create_relative_uri(element->node.doc->outer_window, href, &uri); if(FAILED(hres)) return hres;
- hres = navigate_new_window(element->node.doc->basedoc.window, uri, target, NULL, NULL); + hres = navigate_new_window(element->node.doc->outer_window, uri, target, NULL, NULL); IUri_Release(uri); return hres; } @@ -110,7 +110,7 @@ static HRESULT navigate_href(HTMLElement *element, nsAString *href_str, nsAStrin const PRUnichar *href; HRESULT hres;
- window = get_target_window(element->node.doc->basedoc.window, target_str, &use_new_window); + window = get_target_window(element->node.doc->outer_window, target_str, &use_new_window); if(!window) { if(use_new_window) { const PRUnichar *target; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 027f27f222d..eef6a2d91f1 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -893,7 +893,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p if(!p) return E_POINTER;
- return get_readystate_string(This->basedoc.window ? This->basedoc.window->readystate : 0, p); + return get_readystate_string(This->outer_window ? This->outer_window->readystate : 0, p); }
static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p) @@ -902,11 +902,11 @@ static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFrames
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->outer_window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); + return IHTMLWindow2_get_frames(&This->outer_window->base.IHTMLWindow2_iface, p); }
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p) @@ -1074,12 +1074,12 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->basedoc.window) { + if(!This->outer_window) { FIXME("No window available\n"); return E_FAIL; }
- return navigate_url(This->basedoc.window, v, This->basedoc.window->uri, BINDING_NAVIGATED); + return navigate_url(This->outer_window, v, This->outer_window->uri, BINDING_NAVIGATED); }
static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p) @@ -1088,7 +1088,7 @@ static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", iface, p);
- *p = SysAllocString(This->basedoc.window && This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"); + *p = SysAllocString(This->outer_window && This->outer_window->url ? This->outer_window->url : L"about:blank"); return *p ? S_OK : E_OUTOFMEMORY; }
@@ -1121,7 +1121,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
nsAString_Init(&nsstr, NULL); nsres = nsIDOMHTMLDocument_GetDomain(This->nsdoc, &nsstr); - if(NS_SUCCEEDED(nsres) && This->basedoc.window && This->basedoc.window->uri) { + if(NS_SUCCEEDED(nsres) && This->outer_window && This->outer_window->uri) { const PRUnichar *str; HRESULT hres;
@@ -1129,7 +1129,7 @@ static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p) if(!*str) { TRACE("Gecko returned empty string, fallback to loaded URL.\n"); nsAString_Finish(&nsstr); - hres = IUri_GetHost(This->basedoc.window->uri, p); + hres = IUri_GetHost(This->outer_window->uri, p); return FAILED(hres) ? hres : S_OK; } } @@ -1144,10 +1144,10 @@ static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->basedoc.window) + if(!This->outer_window) return S_OK;
- bret = InternetSetCookieExW(This->basedoc.window->url, NULL, v, 0, 0); + bret = InternetSetCookieExW(This->outer_window->url, NULL, v, 0, 0); if(!bret) { FIXME("InternetSetCookieExW failed: %lu\n", GetLastError()); return HRESULT_FROM_WIN32(GetLastError()); @@ -1164,13 +1164,13 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->outer_window) { *p = NULL; return S_OK; }
size = 0; - bret = InternetGetCookieExW(This->basedoc.window->url, NULL, NULL, &size, 0, NULL); + bret = InternetGetCookieExW(This->outer_window->url, NULL, NULL, &size, 0, NULL); if(!bret && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { WARN("InternetGetCookieExW failed: %lu\n", GetLastError()); *p = NULL; @@ -1186,7 +1186,7 @@ static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p) if(!*p) return E_OUTOFMEMORY;
- bret = InternetGetCookieExW(This->basedoc.window->url, NULL, *p, &size, 0, NULL); + bret = InternetGetCookieExW(This->outer_window->url, NULL, *p, &size, 0, NULL); if(!bret) { ERR("InternetGetCookieExW failed: %lu\n", GetLastError()); return E_FAIL; @@ -1391,7 +1391,7 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
*pomWindowResult = NULL;
- if(!This->basedoc.window) + if(!This->outer_window) return E_FAIL;
if(!This->nsdoc) { @@ -1413,8 +1413,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT if(tmp) nsISupports_Release(tmp);
- *pomWindowResult = (IDispatch*)&This->basedoc.window->base.IHTMLWindow2_iface; - IHTMLWindow2_AddRef(&This->basedoc.window->base.IHTMLWindow2_iface); + *pomWindowResult = (IDispatch*)&This->outer_window->base.IHTMLWindow2_iface; + IHTMLWindow2_AddRef(&This->outer_window->base.IHTMLWindow2_iface); return S_OK; }
@@ -2272,7 +2272,7 @@ static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, I
TRACE("(%p)->(%p)\n", This, p);
- if(This->basedoc.window && This->basedoc.window->readystate == READYSTATE_UNINITIALIZED) { + if(This->outer_window && This->outer_window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; return S_OK; } @@ -4728,7 +4728,7 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, IHTMLDocument2_iface);
- if(This->basedoc.window) + if(This->outer_window) update_doc_cp_events(This, cp); }
@@ -5956,10 +5956,10 @@ static HRESULT HTMLDocumentNode_location_hook(DispatchEx *dispex, WORD flags, DI { HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
- if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + if(!(flags & DISPATCH_PROPERTYPUT) || !This->outer_window) return S_FALSE;
- return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + return IDispatchEx_InvokeEx(&This->outer_window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, 0, flags, dp, res, ei, caller); }
@@ -6065,7 +6065,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc->basedoc.doc_node = doc; doc->basedoc.doc_obj = doc_obj; - doc->basedoc.window = window ? window->base.outer_window : NULL; + doc->outer_window = window ? window->base.outer_window : NULL; doc->window = window;
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocumentNode_cpc); @@ -6098,7 +6098,7 @@ HRESULT create_document_node(nsIDOMHTMLDocument *nsdoc, GeckoBrowser *browser, H lock_document_mode(doc); }
- if(!doc_obj->basedoc.window || (window && is_main_content_window(window->base.outer_window))) + if(!doc_obj->window || (window && is_main_content_window(window->base.outer_window))) doc->cp_container.forward_container = &doc_obj->cp_container;
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc, &HTMLDocumentNode_dispex); diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 707de8eebaa..a93460829fd 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -50,7 +50,7 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) window = mozwindow_to_window(mozwindow); if(!window && frame->element.node.doc->browser) hres = create_outer_window(frame->element.node.doc->browser, mozwindow, - frame->element.node.doc->basedoc.window, &window); + frame->element.node.doc->outer_window, &window); mozIDOMWindowProxy_Release(mozwindow); if(FAILED(hres)) return hres; @@ -127,7 +127,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- if(!This->content_window || !This->element.node.doc || !This->element.node.doc->basedoc.window) { + if(!This->content_window || !This->element.node.doc || !This->element.node.doc->outer_window) { nsAString nsstr; nsresult nsres;
@@ -145,7 +145,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v) return S_OK; }
- return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->uri, BINDING_NAVIGATED); + return navigate_url(This->content_window, v, This->element.node.doc->outer_window->uri, BINDING_NAVIGATED); }
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 738cd770318..3e53a301129 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -642,8 +642,6 @@ struct ConnectionPoint { struct HTMLDocument { HTMLDocumentObj *doc_obj; HTMLDocumentNode *doc_node; - - HTMLOuterWindow *window; };
struct HTMLDocumentObj { @@ -691,6 +689,7 @@ struct HTMLDocumentObj { LONG ref;
IUnknown *outer_unk; + HTMLOuterWindow *window; GeckoBrowser *nscontainer;
IOleClientSite *client; @@ -916,6 +915,7 @@ struct HTMLDocumentNode { LONG ref;
ConnectionPointContainer cp_container; + HTMLOuterWindow *outer_window; HTMLInnerWindow *window;
GeckoBrowser *browser; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 2b000ad8e55..61ed745c588 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -283,8 +283,8 @@ static void parse_complete(HTMLDocumentObj *doc) call_property_onchanged(&doc->cp_container, 1005); call_explorer_69(doc);
- if(doc->webbrowser && doc->nscontainer->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH)) - IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0); + if(doc->webbrowser && doc->nscontainer->usermode != EDITMODE && !(doc->window->load_flags & BINDING_REFRESH)) + IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->window->base.IHTMLWindow2_iface, 0);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */ } @@ -305,7 +305,7 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo }
bind_event_scripts(This); - set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE); + set_ready_state(This->outer_window, READYSTATE_INTERACTIVE); return NS_OK; }
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index c7683a6d06d..744e567e56e 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -1228,7 +1228,7 @@ void setup_editor_controller(GeckoBrowser *This) }
nsres = nsIEditingSession_GetEditorForWindow(editing_session, - This->doc->basedoc.window->window_proxy, &This->editor); + This->doc->window->window_proxy, &This->editor); nsIEditingSession_Release(editing_session); if(NS_FAILED(nsres)) { ERR("Could not get editor: %08lx\n", nsres); diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index d4bd35090c1..00f4ffe526b 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -230,7 +230,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE("(%p)\n", doc);
- if(!doc || !doc->basedoc.window) + if(!doc || !doc->outer_window) return NS_ERROR_FAILURE; if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc) doc_obj = doc->basedoc.doc_obj; @@ -242,7 +242,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event if(doc_obj) handle_docobj_load(doc_obj);
- set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE); + set_ready_state(doc->outer_window, READYSTATE_COMPLETE);
if(doc_obj) { if(doc_obj->view_sink) @@ -254,9 +254,9 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event }
if(doc_obj && doc_obj->nscontainer->usermode != EDITMODE && doc_obj->doc_object_service - && !(doc->basedoc.window->load_flags & BINDING_REFRESH)) + && !(doc->outer_window->load_flags & BINDING_REFRESH)) IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service, - &doc->basedoc.window->base.IHTMLWindow2_iface, 0); + &doc->outer_window->base.IHTMLWindow2_iface, 0);
if(doc->nsdoc) { hres = create_document_event(doc, EVENTID_LOAD, &load_event); @@ -383,7 +383,7 @@ static nsIDOMEventTarget *get_default_document_target(HTMLDocumentNode *doc) nsISupports *target_iface; nsresult nsres;
- target_iface = doc->window ? (nsISupports*)doc->basedoc.window->nswindow : (nsISupports*)doc->nsdoc; + target_iface = doc->window ? (nsISupports*)doc->outer_window->nswindow : (nsISupports*)doc->nsdoc; nsres = nsISupports_QueryInterface(target_iface, &IID_nsIDOMEventTarget, (void**)&target); return NS_SUCCEEDED(nsres) ? target : NULL; } diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index b5dbf3bdbeb..2b12c2bf84b 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -69,7 +69,7 @@ static nsIClipboardCommands *get_clipboard_commands(HTMLDocumentNode *doc) nsIDocShell *doc_shell; nsresult nsres;
- nsres = get_nsinterface((nsISupports*)doc->basedoc.window->nswindow, &IID_nsIDocShell, (void**)&doc_shell); + nsres = get_nsinterface((nsISupports*)doc->outer_window->nswindow, &IID_nsIDocShell, (void**)&doc_shell); if(NS_FAILED(nsres)) { ERR("Could not get nsIDocShell interface\n"); return NULL; @@ -475,17 +475,17 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p } }
- if(!doc->basedoc.window) + if(!doc->outer_window) return E_UNEXPECTED;
task = heap_alloc(sizeof(*task)); if(!task) return E_OUTOFMEMORY;
- IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); - task->window = doc->basedoc.window; + IHTMLWindow2_AddRef(&doc->outer_window->base.IHTMLWindow2_iface); + task->window = doc->outer_window;
- return push_task(&task->header, refresh_proc, refresh_destr, doc->basedoc.window->task_magic); + return push_task(&task->header, refresh_proc, refresh_destr, doc->outer_window->task_magic); }
static HRESULT exec_stop(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index d5df7378df7..4de2efa690f 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -407,7 +407,7 @@ void set_document_navigation(HTMLDocumentObj *doc, BOOL doc_can_navigate)
if(doc_can_navigate) { V_VT(&var) = VT_UNKNOWN; - V_UNKNOWN(&var) = (IUnknown*)&doc->basedoc.window->base.IHTMLWindow2_iface; + V_UNKNOWN(&var) = (IUnknown*)&doc->window->base.IHTMLWindow2_iface; }
IOleCommandTarget_Exec(doc->client_cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, @@ -2276,11 +2276,11 @@ static HRESULT WINAPI DocObjHTMLDocument2_get_frames(IHTMLDocument2 *iface, IHTM
TRACE("(%p)->(%p)\n", This, p);
- if(!This->basedoc.window) { + if(!This->window) { /* Not implemented by IE */ return E_NOTIMPL; } - return IHTMLWindow2_get_frames(&This->basedoc.window->base.IHTMLWindow2_iface, p); + return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p); }
HTMLDOCUMENTOBJ_FWD_TO_NODE_1(HTMLDocument2, get_embeds, IHTMLElementCollection**) @@ -2767,8 +2767,8 @@ static HRESULT WINAPI DocObjHTMLDocument7_get_defaultView(IHTMLDocument7 *iface,
TRACE("(%p)->(%p)\n", This, p);
- if(This->basedoc.window) { - *p = &This->basedoc.window->base.IHTMLWindow2_iface; + if(This->window) { + *p = &This->window->base.IHTMLWindow2_iface; IHTMLWindow2_AddRef(*p); }else { *p = NULL; @@ -3393,8 +3393,8 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) This->basedoc.doc_node->basedoc.doc_obj = NULL; IHTMLDOMNode_Release(&This->basedoc.doc_node->node.IHTMLDOMNode_iface); } - if(This->basedoc.window) - IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface); + if(This->window) + IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface); if(This->advise_holder) IOleAdviseHolder_Release(This->advise_holder);
@@ -3502,7 +3502,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L { HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
- if(This->basedoc.window) { + if(This->window) { switch(id) { case DISPID_READYSTATE: TRACE("DISPID_READYSTATE\n"); @@ -3511,7 +3511,7 @@ static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, L return E_INVALIDARG;
V_VT(pvarRes) = VT_I4; - V_I4(pvarRes) = This->basedoc.window->readystate; + V_I4(pvarRes) = This->window->readystate; return S_OK; default: break; @@ -3646,7 +3646,7 @@ static void HTMLDocumentObj_on_advise(IUnknown *iface, cp_static_data_t *cp) { HTMLDocumentObj *This = impl_from_IUnknown(iface);
- if(This->basedoc.window && This->basedoc.doc_node) + if(This->window && This->basedoc.doc_node) update_doc_cp_events(This->basedoc.doc_node, cp); }
@@ -3666,10 +3666,10 @@ static HRESULT HTMLDocumentObj_location_hook(DispatchEx *dispex, WORD flags, DIS { HTMLDocumentObj *This = CONTAINING_RECORD(dispex, HTMLDocumentObj, dispex);
- if(!(flags & DISPATCH_PROPERTYPUT) || !This->basedoc.window) + if(!(flags & DISPATCH_PROPERTYPUT) || !This->window) return S_FALSE;
- return IDispatchEx_InvokeEx(&This->basedoc.window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, 0, flags, dp, res, ei, caller); }
@@ -3767,11 +3767,11 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii return hres; }
- doc->basedoc.window = doc->nscontainer->content_window; - IHTMLWindow2_AddRef(&doc->basedoc.window->base.IHTMLWindow2_iface); + doc->window = doc->nscontainer->content_window; + IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface);
- if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) { - doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc; + if(!doc->basedoc.doc_node && doc->window->base.inner_window->doc) { + doc->basedoc.doc_node = doc->window->base.inner_window->doc; IHTMLDOMNode_AddRef(&doc->basedoc.doc_node->node.IHTMLDOMNode_iface); }
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 283e3703440..337271a4e3a 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -302,11 +302,11 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags) } }
- if(This->basedoc.window->mon) { + if(This->window->mon) { update_doc(This, UPDATE_TITLE|UPDATE_UI); }else { update_doc(This, UPDATE_TITLE); - set_current_mon(This->basedoc.window, mon, flags); + set_current_mon(This->window, mon, flags); }
if(This->client) { @@ -318,7 +318,7 @@ void prepare_for_binding(HTMLDocumentObj *This, IMoniker *mon, DWORD flags)
if(flags & BINDING_NAVIGATED) { V_VT(&var) = VT_UNKNOWN; - V_UNKNOWN(&var) = (IUnknown*)&This->basedoc.window->base.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)) @@ -707,12 +707,12 @@ static HRESULT WINAPI DocObjPersistMoniker_Load(IPersistMoniker *iface, BOOL fFu
prepare_for_binding(This, mon, FALSE); call_docview_84(This); - hres = set_moniker(This->basedoc.window, mon, NULL, pibc, NULL, TRUE); + hres = set_moniker(This->window, mon, NULL, pibc, NULL, TRUE); IMoniker_Release(mon); if(FAILED(hres)) return hres;
- return start_binding(This->basedoc.window->pending_window, (BSCallback*)This->basedoc.window->pending_window->bscallback, pibc); + return start_binding(This->window->pending_window, (BSCallback*)This->window->pending_window->bscallback, pibc); }
static HRESULT WINAPI DocObjPersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, @@ -736,11 +736,11 @@ static HRESULT WINAPI DocObjPersistMoniker_GetCurMoniker(IPersistMoniker *iface,
TRACE("(%p)->(%p)\n", This, ppimkName);
- if(!This->basedoc.window || !This->basedoc.window->mon) + if(!This->window || !This->window->mon) return E_UNEXPECTED;
- IMoniker_AddRef(This->basedoc.window->mon); - *ppimkName = This->basedoc.window->mon; + IMoniker_AddRef(This->window->mon); + *ppimkName = This->window->mon; return S_OK; }
@@ -1186,9 +1186,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_Load(IPersistStreamInit *iface, IS }
prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, TRUE); + hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE); if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, pStm); + hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
IMoniker_Release(mon); return hres; @@ -1229,9 +1229,9 @@ static HRESULT WINAPI DocObjPersistStreamInit_InitNew(IPersistStreamInit *iface) }
prepare_for_binding(This, mon, FALSE); - hres = set_moniker(This->basedoc.window, mon, NULL, NULL, NULL, FALSE); + hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE); if(SUCCEEDED(hres)) - hres = channelbsc_load_stream(This->basedoc.window->pending_window, mon, NULL); + hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
IMoniker_Release(mon); return hres; @@ -1358,7 +1358,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I
TRACE("(%p)->(%p %p)\n", This, pStream, pbc);
- if(!This->basedoc.window) { + if(!This->window) { FIXME("No current window\n"); return E_UNEXPECTED; } @@ -1397,7 +1397,7 @@ static HRESULT WINAPI DocObjPersistHistory_LoadHistory(IPersistHistory *iface, I if(FAILED(hres)) return hres;
- hres = load_uri(This->basedoc.window, uri, BINDING_FROMHIST); + hres = load_uri(This->window, uri, BINDING_FROMHIST); IUri_Release(uri); return hres; } @@ -1411,14 +1411,14 @@ static HRESULT WINAPI DocObjPersistHistory_SaveHistory(IPersistHistory *iface, I
TRACE("(%p)->(%p)\n", This, pStream);
- if(!This->basedoc.window || !This->basedoc.window->uri) { + if(!This->window || !This->window->uri) { FIXME("No current URI\n"); return E_FAIL; }
/* NOTE: The format we store is *not* compatible with native MSHTML. We currently * store only URI of the page (as a length followed by a string) */ - hres = IUri_GetDisplayUri(This->basedoc.window->uri, &display_uri); + hres = IUri_GetDisplayUri(This->window->uri, &display_uri); if(FAILED(hres)) return hres;
@@ -1592,7 +1592,7 @@ static HRESULT WINAPI DocObjHlinkTarget_Navigate(IHlinkTarget *iface, DWORD grfH HRESULT hres; BSTR uri;
- hres = IUri_GetAbsoluteUri(This->basedoc.window->uri, &uri); + hres = IUri_GetAbsoluteUri(This->window->uri, &uri); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index 444834043d4..f5a0afc517e 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -2238,12 +2238,12 @@ static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, RE
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
- if(!This->doc || !This->doc->basedoc.window) { + if(!This->doc || !This->doc->outer_window) { *ppv = NULL; return E_NOINTERFACE; }
- return IServiceProvider_QueryService(&This->doc->basedoc.window->base.IServiceProvider_iface, + return IServiceProvider_QueryService(&This->doc->outer_window->base.IServiceProvider_iface, guidService, riid, ppv); }
diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index 59d1a59b0b0..c98ba331b12 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1318,7 +1318,7 @@ static HRESULT WINAPI HTMLTxtRange_select(IHTMLTxtRange *iface)
TRACE("(%p)\n", This);
- nsres = nsIDOMWindow_GetSelection(This->doc->basedoc.window->nswindow, &nsselection); + nsres = nsIDOMWindow_GetSelection(This->doc->outer_window->nswindow, &nsselection); if(NS_FAILED(nsres)) { ERR("GetSelection failed: %08lx\n", nsres); return E_FAIL; diff --git a/dlls/mshtml/secmgr.c b/dlls/mshtml/secmgr.c index 02bdc41c369..cee2313b083 100644 --- a/dlls/mshtml/secmgr.c +++ b/dlls/mshtml/secmgr.c @@ -76,10 +76,10 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
TRACE("(%p)->(%ld %p %ld %p %ld %lx %lx)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
- if(!This->basedoc.window) + if(!This->outer_window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"; + url = This->outer_window->url ? This->outer_window->url : L"about:blank";
return IInternetSecurityManager_ProcessUrlAction(get_security_manager(), url, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved); @@ -181,10 +181,10 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
TRACE("(%p)->(%s %p %p %p %ld %lx)\n", This, debugstr_guid(guidKey), ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
- if(!This->basedoc.window) + if(!This->outer_window) return E_UNEXPECTED;
- url = This->basedoc.window->url ? This->basedoc.window->url : L"about:blank"; + url = This->outer_window->url ? This->outer_window->url : L"about:blank";
hres = IInternetSecurityManager_QueryCustomPolicy(get_security_manager(), url, guidKey, ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);