From: Jacek Caban jacek@codeweavers.com
Based on patch by Gabriel Ivăncescu. --- dlls/mshtml/htmlstorage.c | 26 +++++++++++++------------- dlls/mshtml/tests/documentmode.js | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 9920a641957..05ef086a814 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1117,17 +1117,6 @@ static HRESULT HTMLStorage_get_dispid(DispatchEx *dispex, const WCHAR *name, DWO return get_prop(This, name, dispid); }
-static HRESULT HTMLStorage_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - HTMLStorage *This = impl_from_DispatchEx(dispex); - DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; - - if(idx >= This->num_props) - return DISP_E_MEMBERNOTFOUND; - - return (*name = SysAllocString(This->props[idx])) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT HTMLStorage_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -1278,16 +1267,27 @@ static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pi return S_OK; }
+static HRESULT HTMLStorage_get_prop_desc(DispatchEx *dispex, DISPID id, struct property_info *desc) +{ + HTMLStorage *This = impl_from_DispatchEx(dispex); + + desc->name = This->props[id - MSHTML_DISPID_CUSTOM_MIN]; + desc->id = id; + desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + desc->func_iid = 0; + return S_OK; +} + static const dispex_static_data_vtbl_t HTMLStorage_dispex_vtbl = { .query_interface = HTMLStorage_query_interface, .destructor = HTMLStorage_destructor, .traverse = HTMLStorage_traverse, .unlink = HTMLStorage_unlink, .get_dispid = HTMLStorage_get_dispid, - .get_name = HTMLStorage_get_name, .invoke = HTMLStorage_invoke, .delete = HTMLStorage_delete, .next_dispid = HTMLStorage_next_dispid, + .get_prop_desc = HTMLStorage_get_prop_desc, };
static const tid_t HTMLStorage_iface_tids[] = { @@ -1451,7 +1451,7 @@ HRESULT create_html_storage(HTMLInnerWindow *window, BOOL local, IHTMLStorage ** storage->window = window; IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
- init_dispatch(&storage->dispex, &HTMLStorage_dispex, NULL, + init_dispatch(&storage->dispex, &HTMLStorage_dispex, window, dispex_compat_mode(&window->event_target.dispex));
*p = &storage->IHTMLStorage_iface; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 5fada630a51..3fb0fbab1d9 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -300,7 +300,7 @@ sync_test("builtin_toString", function() { test("elements", document.getElementsByTagName("body"), "HTMLCollection", null, true); test("history", window.history, "History"); test("implementation", document.implementation, "DOMImplementation"); - if(localStorage) test("localStorage", localStorage, "Storage", null, true); + if(localStorage) test("localStorage", localStorage, "Storage"); test("location", window.location, "Object", window.location.href, null, true); if(v >= 11 /* todo_wine */) test("mimeTypes", window.navigator.mimeTypes, v < 11 ? "MSMimeTypesCollection" : "MimeTypeArray"); test("navigator", window.navigator, "Navigator"); @@ -309,7 +309,7 @@ sync_test("builtin_toString", function() { test("performanceTiming", window.performance.timing, "PerformanceTiming"); if(v >= 11 /* todo_wine */) test("plugins", window.navigator.plugins, v < 11 ? "MSPluginsCollection" : "PluginArray"); test("screen", window.screen, "Screen"); - test("sessionStorage", window.sessionStorage, "Storage", null, true); + test("sessionStorage", window.sessionStorage, "Storage"); test("style", document.body.style, "MSStyleCSSProperties", null, true); test("styleSheet", sheet, "CSSStyleSheet", null, true); test("styleSheetRule", sheet.rules[0], "CSSStyleRule", null, true);