[PATCH 13/14] mshtml: Clear the builtin prop even if removeAttribute returns false on IE8 mode.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Tue Nov 16 08:29:32 CST 2021
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
dlls/mshtml/dispex.c | 13 ++++++++++++-
dlls/mshtml/tests/documentmode.js | 1 -
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 7824f6f..46eb687 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -1460,6 +1460,8 @@ static BOOL is_string_builtin(DispatchEx *This, func_info_t *func)
HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success)
{
+ VARIANT_BOOL tmp;
+
switch(get_dispid_type(id)) {
case DISPEXPROP_CUSTOM:
FIXME("DISPEXPROP_CUSTOM not supported\n");
@@ -1510,11 +1512,20 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success)
return S_OK;
}
- if(!func->put_vtbl_off || !is_string_builtin(This, func)) {
+ if(!func->put_vtbl_off) {
*success = VARIANT_FALSE;
return S_OK;
}
+ if(!is_string_builtin(This, func)) {
+ *success = VARIANT_FALSE;
+ if(dispex_compat_mode(This) < COMPAT_MODE_IE8)
+ return S_OK;
+
+ /* remove the prop without influencing the return value */
+ success = &tmp;
+ }
+
V_VT(&var) = VT_EMPTY;
hres = builtin_propput(This, func, &dp, NULL);
if(hres == E_NOTIMPL) {
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 4f87316..5bf5f08 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -1157,7 +1157,6 @@ sync_test("elem_attr", function() {
ok(r === (v < 8 ? func : null), "onclick attr = " + r);
r = elem.removeAttribute("onclick");
ok(r === (v < 9 ? false : undefined), "removeAttribute returned " + r);
- todo_wine_if(v === 8).
ok(elem.onclick === (v != 8 ? func : null), "removed onclick = " + elem.onclick);
elem.onclick_test = func;
--
2.31.1
More information about the wine-devel
mailing list