From: Andrew Nguyen arethusa26@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57493 --- dlls/msxml3/domdoc.c | 4 +++- dlls/msxml3/tests/domdoc.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 094447a9add..0a4914c9482 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -60,6 +60,7 @@ static const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l' static const WCHAR PropertyAllowDocumentFunctionW[] = {'A','l','l','o','w','D','o','c','u','m','e','n','t','F','u','n','c','t','i','o','n',0}; static const WCHAR PropertyNormalizeAttributeValuesW[] = {'N','o','r','m','a','l','i','z','e','A','t','t','r','i','b','u','t','e','V','a','l','u','e','s',0}; static const WCHAR PropertyValidateOnParse[] = L"ValidateOnParse"; +static const WCHAR PropertyMaxElementDepth[] = L"MaxElementDepth";
/* Anything that passes the test_get_ownerDocument() * tests can go here (data shared between all instances). @@ -3200,7 +3201,8 @@ static HRESULT WINAPI domdoc_setProperty( lstrcmpiW(p, PropertyResolveExternalsW) == 0 || lstrcmpiW(p, PropertyAllowXsltScriptW) == 0 || lstrcmpiW(p, PropertyNormalizeAttributeValuesW) == 0 || - lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0) + lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0 || + lstrcmpiW(p, PropertyMaxElementDepth) == 0) { /* Ignore */ FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value)); diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 8fec2cd9407..81f1235cd9b 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -13667,6 +13667,42 @@ todo_wine { IXMLDOMDocument2_Release(doc); }
+static void test_max_element_depth_values(void) +{ + IXMLDOMDocument2 *doc; + VARIANT var; + HRESULT hr; + + doc = create_document_version(60, &IID_IXMLDOMDocument2); + + /* The default max element depth value should be 256. */ + V_VT(&var) = VT_UI4; + V_UI4(&var) = 0xdeadbeef; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("MaxElementDepth"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_I4(&var) == 256, "Unexpected property value.\n"); +} + + /* Changes to the depth value should be observable when subsequently retrieved. */ + V_VT(&var) = VT_I4; + V_I4(&var) = 32; + hr = IXMLDOMDocument2_setProperty(doc, _bstr_("MaxElementDepth"), var); + ok(hr == S_OK, "Failed to set property, hr %#lx.\n", hr); + + V_VT(&var) = VT_UI4; + V_UI4(&var) = 0xdeadbeef; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("MaxElementDepth"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#lx.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_I4(&var) == 32, "Unexpected property value.\n"); +} + + IXMLDOMDocument2_Release(doc); +} + typedef struct _namespace_as_attribute_t { const GUID *guid; const char *clsid; @@ -14273,6 +14309,7 @@ START_TEST(domdoc) test_validate_on_parse_values(); test_xsltemplate(); test_xsltext(); + test_max_element_depth_values();
if (is_clsid_supported(&CLSID_MXNamespaceManager40, &IID_IMXNamespaceManager)) {