mshtml: Properly report history update for location.replace call.

This commit is contained in:
Jacek Caban 2012-11-12 12:57:48 +01:00 committed by Alexandre Julliard
parent 7a4225c68f
commit 7ac09e721c
10 changed files with 24 additions and 17 deletions

View file

@ -114,6 +114,7 @@ void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN;
HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN;
@ -123,4 +124,7 @@ HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDE
IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN;
void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
void set_current_uri(HTMLOuterWindow*,IUri*) DECLSPEC_HIDDEN;
HRESULT bind_mon_to_wstr(HTMLInnerWindow*,IMoniker*,WCHAR**) DECLSPEC_HIDDEN;

View file

@ -121,7 +121,7 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
if(*href) {
if(!window)
window = This->element.node.doc->basedoc.window;
hres = navigate_url(window, href, window->uri);
hres = navigate_url(window, href, window->uri, BINDING_NAVIGATED);
}else {
TRACE("empty href\n");
hres = S_OK;

View file

@ -37,6 +37,7 @@
#include "mshtml_private.h"
#include "htmlevent.h"
#include "pluginhost.h"
#include "binding.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -609,7 +610,7 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
return E_FAIL;
}
return navigate_url(This->window, v, This->window->uri);
return navigate_url(This->window, v, This->window->uri, BINDING_NAVIGATED);
}
static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)

View file

@ -27,6 +27,7 @@
#include "ole2.h"
#include "mshtml_private.h"
#include "binding.h"
#include "wine/debug.h"
@ -136,7 +137,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
return E_FAIL;
}
return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->uri);
return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->uri, BINDING_NAVIGATED);
}
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)

View file

@ -31,6 +31,7 @@
#include "wine/debug.h"
#include "mshtml_private.h"
#include "binding.h"
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -170,7 +171,7 @@ static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
return E_FAIL;
}
return navigate_url(This->window->base.outer_window, v, This->window->base.outer_window->uri);
return navigate_url(This->window->base.outer_window, v, This->window->base.outer_window->uri, BINDING_NAVIGATED);
}
static HRESULT WINAPI HTMLLocation_get_href(IHTMLLocation *iface, BSTR *p)
@ -570,7 +571,8 @@ static HRESULT WINAPI HTMLLocation_replace(IHTMLLocation *iface, BSTR bstr)
return E_FAIL;
}
return navigate_url(This->window->base.outer_window, bstr, This->window->base.outer_window->uri);
return navigate_url(This->window->base.outer_window, bstr, This->window->base.outer_window->uri,
BINDING_NAVIGATED|BINDING_REPLACE);
}
static HRESULT WINAPI HTMLLocation_assign(IHTMLLocation *iface, BSTR bstr)

View file

@ -206,7 +206,7 @@ static void release_outer_window(HTMLOuterWindow *This)
}
remove_target_tasks(This->task_magic);
set_current_mon(This, NULL);
set_current_mon(This, NULL, 0);
if(This->base.inner_window)
detach_inner_window(This->base.inner_window);
release_children(This);

View file

@ -781,7 +781,6 @@ void init_node_cc(void);
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN;
HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*) DECLSPEC_HIDDEN;
HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
void call_property_onchanged(ConnectionPoint*,DISPID) DECLSPEC_HIDDEN;
@ -810,8 +809,6 @@ nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN;
HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
void set_current_mon(HTMLOuterWindow*,IMoniker*) DECLSPEC_HIDDEN;
void set_current_uri(HTMLOuterWindow*,IUri*) DECLSPEC_HIDDEN;
HRESULT start_binding(HTMLInnerWindow*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
HRESULT async_start_doc_binding(HTMLOuterWindow*,HTMLInnerWindow*) DECLSPEC_HIDDEN;
void abort_window_bindings(HTMLInnerWindow*) DECLSPEC_HIDDEN;

View file

@ -1777,7 +1777,7 @@ static void start_doc_binding_proc(task_t *_task)
{
start_doc_binding_task_t *task = (start_doc_binding_task_t*)_task;
set_current_mon(task->window, task->pending_window->bscallback->bsc.mon);
set_current_mon(task->window, task->pending_window->bscallback->bsc.mon, BINDING_NAVIGATED);
start_binding(task->pending_window, &task->pending_window->bscallback->bsc, NULL);
}
@ -1948,6 +1948,7 @@ typedef struct {
task_t header;
HTMLOuterWindow *window;
nsChannelBSC *bscallback;
DWORD flags;
IMoniker *mon;
IUri *uri;
} navigate_task_t;
@ -1959,7 +1960,7 @@ static void navigate_proc(task_t *_task)
hres = set_moniker(&task->window->doc_obj->basedoc, task->mon, NULL, task->bscallback, TRUE);
if(SUCCEEDED(hres)) {
set_current_mon(task->window, task->bscallback->bsc.mon);
set_current_mon(task->window, task->bscallback->bsc.mon, task->flags);
set_current_uri(task->window, task->uri);
start_binding(task->window->pending_window, &task->bscallback->bsc, NULL);
}
@ -2124,6 +2125,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
task->window = window;
task->bscallback = bsc;
task->flags = flags;
task->mon = mon;
IUri_AddRef(uri);
@ -2317,7 +2319,7 @@ HRESULT load_uri(HTMLOuterWindow *window, IUri *uri, DWORD flags)
return hres;
}
HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_uri)
HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_uri, DWORD flags)
{
BSTR display_uri;
IUri *uri;
@ -2359,7 +2361,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
}
}
hres = navigate_uri(window, uri, display_uri, BINDING_NAVIGATED);
hres = navigate_uri(window, uri, display_uri, flags);
IUri_Release(uri);
SysFreeString(display_uri);

View file

@ -992,7 +992,7 @@ static nsresult async_open(nsChannel *This, HTMLOuterWindow *window, BOOL is_doc
}
if(is_doc_channel)
set_current_mon(window, mon);
set_current_mon(window, mon, BINDING_NAVIGATED);
hres = create_channelbsc(mon, NULL, NULL, 0, is_doc_channel, &bscallback);
IMoniker_Release(mon);

View file

@ -132,14 +132,14 @@ void set_current_uri(HTMLOuterWindow *window, IUri *uri)
IUri_GetDisplayUri(uri, &window->url);
}
void set_current_mon(HTMLOuterWindow *This, IMoniker *mon)
void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
{
IUriContainer *uri_container;
IUri *uri = NULL;
HRESULT hres;
if(This->mon) {
if(This->doc_obj)
if(This->doc_obj && !(flags & BINDING_REPLACE))
notify_travellog_update(This->doc_obj);
IMoniker_Release(This->mon);
This->mon = NULL;
@ -323,7 +323,7 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
update_doc(This, UPDATE_TITLE|UPDATE_UI);
}else {
update_doc(This, UPDATE_TITLE);
set_current_mon(This->window, mon);
set_current_mon(This->window, mon, flags);
}
if(This->doc_obj->client) {