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 {
BSTR key;
BSTR old_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)
......@@ -324,11 +324,16 @@ static HRESULT send_storage_event(HTMLStorage *storage, BSTR key, BSTR old_value
BSTR hostname = NULL;
HRESULT hres = S_OK;
ctx.url = NULL;
if(!window)
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.old_value = old_value;
ctx.new_value = new_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);
done:
SysFreeString(ctx.url);
SysFreeString(hostname);
SysFreeString(old_value);
return hres;
return FAILED(hres) ? hres : S_OK;
}
static HRESULT WINAPI HTMLStorage_QueryInterface(IHTMLStorage *iface, REFIID riid, void **ppv)
......
......@@ -1468,7 +1468,7 @@ async_test("storage events", function() {
ok(e.key === key, "key = " + e.key + ", expected " + key);
ok(e.oldValue === oldValue, "oldValue = " + e.oldValue + ", expected " + oldValue);
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);
}
......
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