From: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- dlls/msxml3/node.c | 12 +++++++++++- dlls/msxml3/tests/domdoc.c | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 4d68d44e0b2..af78ce9ba9d 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -3442,6 +3442,13 @@ HRESULT node_set_attribute(struct domnode *node, IXMLDOMNode *attribute, IXMLDOM return S_OK; } +static bool is_namespace_definition_name(const struct parsed_name *name) +{ + if (!name->prefix && !wcscmp(name->local, L"xmlns")) + return true; + return name->prefix && !wcscmp(name->prefix, L"xmlns"); +} + HRESULT node_set_attribute_value(struct domnode *node, const WCHAR *name, const VARIANT *value) { struct parsed_name attr_name; @@ -3462,7 +3469,10 @@ HRESULT node_set_attribute_value(struct domnode *node, const WCHAR *name, const /* Check for conflict with element namespace. It's possible to have no uri set on element, while still having qualified name. */ - match = node->uri && is_same_namespace_prefix(node, attr_name.local) && !is_same_uri(node, attr_value); + match = node->uri + && is_namespace_definition_name(&attr_name) + && is_same_namespace_prefix(node, attr_name.local) + && !is_same_uri(node, attr_value); parsed_name_cleanup(&attr_name); if (match) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 2e6d29eaf52..d2c13badbef 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -16980,12 +16980,10 @@ static void test_setAttribute(void) IXMLDOMNode_Release(node); hr = IXMLDOMElement_setAttribute(element, _bstr_("prefix"), _variantbstr_("uri2")); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); hr = IXMLDOMElement_get_xml(element, &str); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - todo_wine ok(!wcscmp(str, L"<prefix:name xmlns:prefix=\"uri\" prefix=\"uri2\"/>"), "Unexpected xml %s.\n", debugstr_w(str)); SysFreeString(str); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10688