From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/dispex.c | 8 ++++++++ dlls/mshtml/htmlwindow.c | 4 +++- dlls/mshtml/tests/documentmode.js | 2 -- 3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 21927315443..43896729a9e 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -803,6 +803,14 @@ HRESULT dispex_define_property(DispatchEx *dispex, const WCHAR *name, DWORD flag dynamic_prop_t *prop; HRESULT hres;
+ if(flags & PROPF_CONFIGURABLE) { + prop = NULL; + hres = get_dynamic_prop(dispex, name, 0, &prop); + assert(FAILED(hres)); + if(prop) + return hres; + } + hres = alloc_dynamic_prop(dispex, name, NULL, &prop); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c8c0c7c1ea6..8913c4e511c 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3816,7 +3816,9 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO
V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = (IDispatch *)&constr->IWineJSDispatchHost_iface; - return dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + hres = dispex_define_property(&This->event_target.dispex, name, PROPF_WRITABLE | PROPF_CONFIGURABLE, &v, dispid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; } } } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 9aa199bcadc..073ca769cca 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4058,14 +4058,12 @@ sync_test("constructors", function() { old = window.HTMLMetaElement; r = (delete window.HTMLMetaElement); ok(r === true, "delete HTMLMetaElement returned " + r); - todo_wine. ok(!window.hasOwnProperty("HTMLMetaElement"), "HTMLMetaElement still a property of window"); window.HTMLMetaElement = old;
old = HTMLMetaElement.prototype.constructor; r = (delete HTMLMetaElement.prototype.constructor); ok(r === true, "delete HTMLMetaElement.prototype.constructor returned " + r); - todo_wine. ok(!HTMLMetaElement.prototype.hasOwnProperty("constructor"), "constructor still a property of HTMLMetaElement.prototype"); HTMLMetaElement.prototype.constructor = old; });