mshtml: Add IHTMLWindow6::get_localStorage implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-03-22 15:16:28 +01:00 committed by Alexandre Julliard
parent 8c79999122
commit 64b5d6b3e5
3 changed files with 28 additions and 4 deletions

View File

@ -295,6 +295,8 @@ static void release_inner_window(HTMLInnerWindow *This)
if(This->session_storage)
IHTMLStorage_Release(This->session_storage);
if(This->local_storage)
IHTMLStorage_Release(This->local_storage);
if(This->mon)
IMoniker_Release(This->mon);
@ -2123,7 +2125,7 @@ static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLS
{
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
FIXME("(%p)->(%p)\n", This, p);
TRACE("(%p)->(%p)\n", This, p);
if(!This->inner_window->session_storage) {
HRESULT hres;
@ -2141,8 +2143,20 @@ static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLS
static HRESULT WINAPI HTMLWindow6_get_localStorage(IHTMLWindow6 *iface, IHTMLStorage **p)
{
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
if(!This->inner_window->local_storage) {
HRESULT hres;
hres = create_storage(&This->inner_window->local_storage);
if(FAILED(hres))
return hres;
}
IHTMLStorage_AddRef(This->inner_window->local_storage);
*p = This->inner_window->local_storage;
return S_OK;
}
static HRESULT WINAPI HTMLWindow6_put_onhashchange(IHTMLWindow6 *iface, VARIANT v)

View File

@ -515,6 +515,7 @@ struct HTMLInnerWindow {
IHTMLScreen *screen;
OmHistory *history;
IHTMLStorage *session_storage;
IHTMLStorage *local_storage;
BOOL performance_initialized;
VARIANT performance;

View File

@ -290,6 +290,14 @@ function test_style_properties() {
next_test();
}
function test_storage() {
ok(typeof(window.sessionStorage) === "object",
"typeof(window.sessionStorage) = " + typeof(window.sessionStorage));
ok(typeof(window.localStorage) === "object",
"typeof(window.localStorage) = " + typeof(window.localStorage));
next_test();
}
var tests = [
test_input_selection,
test_textContent,
@ -301,5 +309,6 @@ var tests = [
test_query_selector,
test_compare_position,
test_document_owner,
test_style_properties
test_style_properties,
test_storage
];