Commit 176f5409 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Don't include fragment in storage event's url prop.

parent c2d55cd2
...@@ -235,7 +235,7 @@ struct send_storage_event_ctx { ...@@ -235,7 +235,7 @@ struct send_storage_event_ctx {
BSTR key; BSTR key;
BSTR old_value; BSTR old_value;
BSTR new_value; BSTR new_value;
const WCHAR *url; BSTR url;
}; };
static HRESULT push_storage_event_task(struct send_storage_event_ctx *ctx, HTMLInnerWindow *window, BOOL commit) static HRESULT push_storage_event_task(struct send_storage_event_ctx *ctx, HTMLInnerWindow *window, BOOL commit)
...@@ -324,11 +324,16 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value ...@@ -324,11 +324,16 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
BSTR hostname = NULL; BSTR hostname = NULL;
HRESULT hres = S_OK; HRESULT hres = S_OK;
ctx.url = NULL;
if(!window) if(!window)
goto done; goto done;
get_top_window(window->base.outer_window, &top_window); if(window->base.outer_window->uri_nofrag) {
hres = IUri_GetDisplayUri(window->base.outer_window->uri_nofrag, &ctx.url);
if(hres != S_OK)
goto done;
}
ctx.url = window->base.outer_window->url; get_top_window(window->base.outer_window, &top_window);
ctx.key = key; ctx.key = key;
ctx.old_value = old_value; ctx.old_value = old_value;
ctx.new_value = new_value; ctx.new_value = new_value;
...@@ -351,9 +356,10 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value ...@@ -351,9 +356,10 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
hres = push_storage_event_task(&ctx, window, TRUE); hres = push_storage_event_task(&ctx, window, TRUE);
done: done:
SysFreeString(ctx.url);
SysFreeString(hostname); SysFreeString(hostname);
SysFreeString(old_value); SysFreeString(old_value);
return hres; return FAILED(hres) ? hres : S_OK;
} }
static HRESULT WINAPI HTMLStorage_QueryInterface(IHTMLStorage *iface, REFIID riid, void **ppv) static HRESULT WINAPI HTMLStorage_QueryInterface(IHTMLStorage *iface, REFIID riid, void **ppv)
......
...@@ -1468,7 +1468,7 @@ async_test("storage events", function() { ...@@ -1468,7 +1468,7 @@ async_test("storage events", function() {
ok(e.key === key, "key = " + e.key + ", expected " + key); ok(e.key === key, "key = " + e.key + ", expected " + key);
ok(e.oldValue === oldValue, "oldValue = " + e.oldValue + ", expected " + oldValue); ok(e.oldValue === oldValue, "oldValue = " + e.oldValue + ", expected " + oldValue);
ok(e.newValue === newValue, "newValue = " + e.newValue + ", expected " + newValue); ok(e.newValue === newValue, "newValue = " + e.newValue + ", expected " + newValue);
s = (idx ? iframe.contentWindow : window)["location"]["href"]; s = (idx ? iframe.contentWindow : window)["location"]["href"].split('#', 1)[0];
ok(e.url === s, "url = " + e.url + ", expected " + s); ok(e.url === s, "url = " + e.url + ", expected " + s);
} }
......
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