diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 92b0537f503..926ebb93a0c 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -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) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f2939da2149..14cc561ad2f 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -515,6 +515,7 @@ struct HTMLInnerWindow { IHTMLScreen *screen; OmHistory *history; IHTMLStorage *session_storage; + IHTMLStorage *local_storage; BOOL performance_initialized; VARIANT performance; diff --git a/dlls/mshtml/tests/elements.js b/dlls/mshtml/tests/elements.js index 7213388e54c..b23f5c13847 100644 --- a/dlls/mshtml/tests/elements.js +++ b/dlls/mshtml/tests/elements.js @@ -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 ];