mshtml: Added exec_refresh implementation.
This commit is contained in:
parent
f0b7db4df8
commit
1cc3cf1b64
|
@ -101,6 +101,7 @@ typedef struct {
|
|||
#define BINDING_NAVIGATED 0x0001
|
||||
#define BINDING_REPLACE 0x0002
|
||||
#define BINDING_FROMHIST 0x0004
|
||||
#define BINDING_REFRESH 0x0008
|
||||
|
||||
HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
|
||||
HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -374,6 +374,7 @@ struct HTMLOuterWindow {
|
|||
IUri *uri;
|
||||
IUri *uri_nofrag;
|
||||
BSTR url;
|
||||
DWORD load_flags;
|
||||
|
||||
SCRIPTMODE scriptmode;
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "mshtml_private.h"
|
||||
#include "htmlscript.h"
|
||||
#include "htmlevent.h"
|
||||
#include "binding.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -267,7 +268,7 @@ static void parse_complete(HTMLDocumentObj *doc)
|
|||
call_property_onchanged(&doc->basedoc.cp_propnotif, 1005);
|
||||
call_explorer_69(doc);
|
||||
|
||||
if(doc->is_webbrowser && doc->usermode != EDITMODE)
|
||||
if(doc->is_webbrowser && doc->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH))
|
||||
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 */
|
||||
|
|
|
@ -2052,7 +2052,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
|
|||
if(!uri_nofrag)
|
||||
return E_FAIL;
|
||||
|
||||
if(window->doc_obj->client) {
|
||||
if(window->doc_obj->client && !(flags & BINDING_REFRESH)) {
|
||||
IOleCommandTarget *cmdtrg;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(window->doc_obj->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
|
||||
|
@ -2075,7 +2075,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
|
|||
}
|
||||
}
|
||||
|
||||
if(window->uri_nofrag && !post_data_size) {
|
||||
if(!(flags & BINDING_REFRESH) && window->uri_nofrag && !post_data_size) {
|
||||
BOOL eq;
|
||||
|
||||
hres = IUri_IsEqual(uri_nofrag, window->uri_nofrag, &eq);
|
||||
|
@ -2115,7 +2115,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
|
|||
|
||||
/* Silently and repeated when real loading starts? */
|
||||
window->readystate = READYSTATE_LOADING;
|
||||
if(!(flags & BINDING_FROMHIST))
|
||||
if(!(flags & (BINDING_FROMHIST|BINDING_REFRESH)))
|
||||
call_docview_84(window->doc_obj);
|
||||
|
||||
task->window = window;
|
||||
|
@ -2266,13 +2266,15 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
|
|||
HRESULT hres;
|
||||
|
||||
if(window->doc_obj && window->doc_obj->is_webbrowser && window == window->doc_obj->basedoc.window) {
|
||||
BOOL cancel = FALSE;
|
||||
if(!(flags & BINDING_REFRESH)) {
|
||||
BOOL cancel = FALSE;
|
||||
|
||||
hres = IDocObjectService_FireBeforeNavigate2(window->doc_obj->doc_object_service, NULL, display_uri, 0x40,
|
||||
NULL, NULL, 0, NULL, TRUE, &cancel);
|
||||
if(SUCCEEDED(hres) && cancel) {
|
||||
TRACE("Navigation canceled\n");
|
||||
return S_OK;
|
||||
hres = IDocObjectService_FireBeforeNavigate2(window->doc_obj->doc_object_service, NULL, display_uri, 0x40,
|
||||
NULL, NULL, 0, NULL, TRUE, &cancel);
|
||||
if(SUCCEEDED(hres) && cancel) {
|
||||
TRACE("Navigation canceled\n");
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return super_navigate(window, uri, flags, NULL, NULL, 0);
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "mshtml_private.h"
|
||||
#include "htmlscript.h"
|
||||
#include "htmlevent.h"
|
||||
#include "binding.h"
|
||||
#include "resource.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
@ -258,7 +259,8 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
|
|||
update_title(doc_obj);
|
||||
}
|
||||
|
||||
if(doc_obj && doc_obj->usermode!=EDITMODE && doc_obj->doc_object_service)
|
||||
if(doc_obj && doc_obj->usermode!=EDITMODE && doc_obj->doc_object_service
|
||||
&& !(doc->basedoc.window->load_flags & BINDING_REFRESH))
|
||||
IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service,
|
||||
&doc->basedoc.window->base.IHTMLWindow2_iface, 0);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "binding.h"
|
||||
#include "resource.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
@ -384,10 +385,69 @@ static HRESULT exec_get_zoom_range(HTMLDocument *This, DWORD nCmdexecopt, VARIAN
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
task_t header;
|
||||
HTMLOuterWindow *window;
|
||||
}refresh_task_t;
|
||||
|
||||
static void refresh_proc(task_t *_task)
|
||||
{
|
||||
refresh_task_t *task = (refresh_task_t*)_task;
|
||||
HTMLOuterWindow *window = task->window;
|
||||
|
||||
TRACE("%p\n", window);
|
||||
|
||||
window->readystate = READYSTATE_UNINITIALIZED;
|
||||
|
||||
if(window->doc_obj && window->doc_obj->client_cmdtrg) {
|
||||
VARIANT var;
|
||||
|
||||
V_VT(&var) = VT_I4;
|
||||
V_I4(&var) = 0;
|
||||
IOleCommandTarget_Exec(window->doc_obj->client_cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
|
||||
}
|
||||
|
||||
load_uri(task->window, task->window->uri, BINDING_REFRESH);
|
||||
}
|
||||
|
||||
static void refresh_destr(task_t *_task)
|
||||
{
|
||||
refresh_task_t *task = (refresh_task_t*)_task;
|
||||
|
||||
IHTMLWindow2_Release(&task->window->base.IHTMLWindow2_iface);
|
||||
heap_free(task);
|
||||
}
|
||||
|
||||
static HRESULT exec_refresh(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
|
||||
{
|
||||
FIXME("(%p)->(%d %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
|
||||
return E_NOTIMPL;
|
||||
refresh_task_t *task;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%d %s %p)\n", This, nCmdexecopt, debugstr_variant(pvaIn), pvaOut);
|
||||
|
||||
if(This->doc_obj->client) {
|
||||
IOleCommandTarget *olecmd;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IOleCommandTarget_Exec(olecmd, &CGID_DocHostCommandHandler, 2300, nCmdexecopt, pvaIn, pvaOut);
|
||||
IOleCommandTarget_Release(olecmd);
|
||||
if(SUCCEEDED(hres))
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if(!This->window)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
task = heap_alloc(sizeof(*task));
|
||||
if(!task)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
|
||||
task->window = This->window;
|
||||
|
||||
return push_task(&task->header, refresh_proc, refresh_destr, This->window->task_magic);
|
||||
}
|
||||
|
||||
static HRESULT exec_stop(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
|
||||
|
|
|
@ -130,12 +130,13 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
|
|||
HRESULT hres;
|
||||
|
||||
if(This->mon) {
|
||||
if(This->doc_obj && !(flags & BINDING_REPLACE))
|
||||
if(This->doc_obj && !(flags & (BINDING_REPLACE|BINDING_REFRESH)))
|
||||
notify_travellog_update(This->doc_obj);
|
||||
IMoniker_Release(This->mon);
|
||||
This->mon = NULL;
|
||||
}
|
||||
|
||||
This->load_flags = flags;
|
||||
if(!mon)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue