[PATCH 02/14] mshtml: Actually set the return value when removing an attribute.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Tue Nov 16 08:29:21 CST 2021
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
dlls/mshtml/htmlelem.c | 8 ++++++--
dlls/mshtml/tests/documentmode.js | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 91ccfb9..4324387 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -1202,8 +1202,12 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess);
- if(dispex_compat_mode(&This->node.event_target.dispex) >= COMPAT_MODE_IE8)
- return element_remove_attribute(This, strAttributeName);
+ if(dispex_compat_mode(&This->node.event_target.dispex) >= COMPAT_MODE_IE8) {
+ *pfSuccess = element_has_attribute(This, strAttributeName);
+ if(*pfSuccess == VARIANT_TRUE)
+ return element_remove_attribute(This, strAttributeName);
+ return S_OK;
+ }
hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, strAttributeName,
lFlags&ATTRFLAG_CASESENSITIVE ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &id);
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index c197f9b..a2c3714 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -1094,7 +1094,7 @@ sync_test("elem_attr", function() {
r = elem.getAttribute("onclick");
ok(r === (v < 8 ? func : null), "onclick attr = " + r);
r = elem.removeAttribute("onclick");
- todo_wine_if(v < 9).
+ todo_wine_if(v < 8).
ok(r === (v < 9 ? false : undefined), "removeAttribute returned " + r);
todo_wine_if(v < 9).
ok(elem.onclick === (v != 8 ? func : null), "removed onclick = " + elem.onclick);
--
2.31.1
More information about the wine-devel
mailing list