Commit 7ac09e72 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

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

parent 7a4225c6
...@@ -114,6 +114,7 @@ void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN; ...@@ -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 super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN; HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) 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 create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN; HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN;
...@@ -123,4 +124,7 @@ HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDE ...@@ -123,4 +124,7 @@ HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDE
IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN; 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; HRESULT bind_mon_to_wstr(HTMLInnerWindow*,IMoniker*,WCHAR**) DECLSPEC_HIDDEN;
...@@ -121,7 +121,7 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This) ...@@ -121,7 +121,7 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
if(*href) { if(*href) {
if(!window) if(!window)
window = This->element.node.doc->basedoc.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 { }else {
TRACE("empty href\n"); TRACE("empty href\n");
hres = S_OK; hres = S_OK;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "mshtml_private.h" #include "mshtml_private.h"
#include "htmlevent.h" #include "htmlevent.h"
#include "pluginhost.h" #include "pluginhost.h"
#include "binding.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
...@@ -609,7 +610,7 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v) ...@@ -609,7 +610,7 @@ static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
return E_FAIL; 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) static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "ole2.h" #include "ole2.h"
#include "mshtml_private.h" #include "mshtml_private.h"
#include "binding.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -136,7 +137,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v) ...@@ -136,7 +137,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
return E_FAIL; 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) static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "mshtml_private.h" #include "mshtml_private.h"
#include "binding.h"
#include "resource.h" #include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
...@@ -170,7 +171,7 @@ static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v) ...@@ -170,7 +171,7 @@ static HRESULT WINAPI HTMLLocation_put_href(IHTMLLocation *iface, BSTR v)
return E_FAIL; 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) static HRESULT WINAPI HTMLLocation_get_href(IHTMLLocation *iface, BSTR *p)
...@@ -570,7 +571,8 @@ static HRESULT WINAPI HTMLLocation_replace(IHTMLLocation *iface, BSTR bstr) ...@@ -570,7 +571,8 @@ static HRESULT WINAPI HTMLLocation_replace(IHTMLLocation *iface, BSTR bstr)
return E_FAIL; 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) static HRESULT WINAPI HTMLLocation_assign(IHTMLLocation *iface, BSTR bstr)
......
...@@ -206,7 +206,7 @@ static void release_outer_window(HTMLOuterWindow *This) ...@@ -206,7 +206,7 @@ static void release_outer_window(HTMLOuterWindow *This)
} }
remove_target_tasks(This->task_magic); remove_target_tasks(This->task_magic);
set_current_mon(This, NULL); set_current_mon(This, NULL, 0);
if(This->base.inner_window) if(This->base.inner_window)
detach_inner_window(This->base.inner_window); detach_inner_window(This->base.inner_window);
release_children(This); release_children(This);
......
...@@ -781,7 +781,6 @@ void init_node_cc(void); ...@@ -781,7 +781,6 @@ void init_node_cc(void);
HRESULT nsuri_to_url(LPCWSTR,BOOL,BSTR*) DECLSPEC_HIDDEN; 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; HRESULT set_frame_doc(HTMLFrameBase*,nsIDOMDocument*) DECLSPEC_HIDDEN;
void call_property_onchanged(ConnectionPoint*,DISPID) DECLSPEC_HIDDEN; void call_property_onchanged(ConnectionPoint*,DISPID) DECLSPEC_HIDDEN;
...@@ -810,8 +809,6 @@ nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN; ...@@ -810,8 +809,6 @@ nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN; nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN;
HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) 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 start_binding(HTMLInnerWindow*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
HRESULT async_start_doc_binding(HTMLOuterWindow*,HTMLInnerWindow*) DECLSPEC_HIDDEN; HRESULT async_start_doc_binding(HTMLOuterWindow*,HTMLInnerWindow*) DECLSPEC_HIDDEN;
void abort_window_bindings(HTMLInnerWindow*) DECLSPEC_HIDDEN; void abort_window_bindings(HTMLInnerWindow*) DECLSPEC_HIDDEN;
......
...@@ -1777,7 +1777,7 @@ static void start_doc_binding_proc(task_t *_task) ...@@ -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; 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); start_binding(task->pending_window, &task->pending_window->bscallback->bsc, NULL);
} }
...@@ -1948,6 +1948,7 @@ typedef struct { ...@@ -1948,6 +1948,7 @@ typedef struct {
task_t header; task_t header;
HTMLOuterWindow *window; HTMLOuterWindow *window;
nsChannelBSC *bscallback; nsChannelBSC *bscallback;
DWORD flags;
IMoniker *mon; IMoniker *mon;
IUri *uri; IUri *uri;
} navigate_task_t; } navigate_task_t;
...@@ -1959,7 +1960,7 @@ static void navigate_proc(task_t *_task) ...@@ -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); hres = set_moniker(&task->window->doc_obj->basedoc, task->mon, NULL, task->bscallback, TRUE);
if(SUCCEEDED(hres)) { 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); set_current_uri(task->window, task->uri);
start_binding(task->window->pending_window, &task->bscallback->bsc, NULL); 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 ...@@ -2124,6 +2125,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
task->window = window; task->window = window;
task->bscallback = bsc; task->bscallback = bsc;
task->flags = flags;
task->mon = mon; task->mon = mon;
IUri_AddRef(uri); IUri_AddRef(uri);
...@@ -2317,7 +2319,7 @@ HRESULT load_uri(HTMLOuterWindow *window, IUri *uri, DWORD flags) ...@@ -2317,7 +2319,7 @@ HRESULT load_uri(HTMLOuterWindow *window, IUri *uri, DWORD flags)
return hres; 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; BSTR display_uri;
IUri *uri; IUri *uri;
...@@ -2359,7 +2361,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u ...@@ -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); IUri_Release(uri);
SysFreeString(display_uri); SysFreeString(display_uri);
......
...@@ -992,7 +992,7 @@ static nsresult async_open(nsChannel *This, HTMLOuterWindow *window, BOOL is_doc ...@@ -992,7 +992,7 @@ static nsresult async_open(nsChannel *This, HTMLOuterWindow *window, BOOL is_doc
} }
if(is_doc_channel) 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); hres = create_channelbsc(mon, NULL, NULL, 0, is_doc_channel, &bscallback);
IMoniker_Release(mon); IMoniker_Release(mon);
......
...@@ -132,14 +132,14 @@ void set_current_uri(HTMLOuterWindow *window, IUri *uri) ...@@ -132,14 +132,14 @@ void set_current_uri(HTMLOuterWindow *window, IUri *uri)
IUri_GetDisplayUri(uri, &window->url); 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; IUriContainer *uri_container;
IUri *uri = NULL; IUri *uri = NULL;
HRESULT hres; HRESULT hres;
if(This->mon) { if(This->mon) {
if(This->doc_obj) if(This->doc_obj && !(flags & BINDING_REPLACE))
notify_travellog_update(This->doc_obj); notify_travellog_update(This->doc_obj);
IMoniker_Release(This->mon); IMoniker_Release(This->mon);
This->mon = NULL; This->mon = NULL;
...@@ -323,7 +323,7 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags) ...@@ -323,7 +323,7 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
update_doc(This, UPDATE_TITLE|UPDATE_UI); update_doc(This, UPDATE_TITLE|UPDATE_UI);
}else { }else {
update_doc(This, UPDATE_TITLE); update_doc(This, UPDATE_TITLE);
set_current_mon(This->window, mon); set_current_mon(This->window, mon, flags);
} }
if(This->doc_obj->client) { if(This->doc_obj->client) {
......
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