From 4d858698cd07ad21a8577eecf876917afb85348d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 26 Feb 2017 19:07:55 +0000 Subject: [PATCH] [MSXML3] Sync with Wine Staging 2.2. CORE-12823 45dd9d1 msxml3: Accept AllowXsltScript and AllowDocumentFunction properties. 2191d97 msxml3: Duplicate stylesheet document before passing it to libxslt. 1242648 msxml3: Remove dead initialization (clang). svn path=/trunk/; revision=73969 --- reactos/dll/win32/msxml3/domdoc.c | 6 +++++- reactos/dll/win32/msxml3/node.c | 14 ++++++++------ reactos/media/doc/README.WINE | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/msxml3/domdoc.c b/reactos/dll/win32/msxml3/domdoc.c index b1ffb33e31e..b6cdfc760b8 100644 --- a/reactos/dll/win32/msxml3/domdoc.c +++ b/reactos/dll/win32/msxml3/domdoc.c @@ -51,6 +51,8 @@ static const WCHAR PropertyNewParserW[] = {'N','e','w','P','a','r','s','e','r',0 static const WCHAR PropValueXPathW[] = {'X','P','a','t','h',0}; static const WCHAR PropValueXSLPatternW[] = {'X','S','L','P','a','t','t','e','r','n',0}; static const WCHAR PropertyResolveExternalsW[] = {'R','e','s','o','l','v','e','E','x','t','e','r','n','a','l','s',0}; +static const WCHAR PropertyAllowXsltScriptW[] = {'A','l','l','o','w','X','s','l','t','S','c','r','i','p','t',0}; +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}; /* Anything that passes the test_get_ownerDocument() * tests can go here (data shared between all instances). @@ -3052,7 +3054,9 @@ static HRESULT WINAPI domdoc_setProperty( } else if (lstrcmpiW(p, PropertyProhibitDTDW) == 0 || lstrcmpiW(p, PropertyNewParserW) == 0 || - lstrcmpiW(p, PropertyResolveExternalsW) == 0) + lstrcmpiW(p, PropertyResolveExternalsW) == 0 || + lstrcmpiW(p, PropertyAllowXsltScriptW) == 0 || + lstrcmpiW(p, PropertyAllowDocumentFunctionW) == 0) { /* Ignore */ FIXME("Ignoring property %s, value %s\n", debugstr_w(p), debugstr_variant(&value)); diff --git a/reactos/dll/win32/msxml3/node.c b/reactos/dll/win32/msxml3/node.c index e05d1352520..4b83fe6521d 100644 --- a/reactos/dll/win32/msxml3/node.c +++ b/reactos/dll/win32/msxml3/node.c @@ -810,7 +810,7 @@ static xmlChar* do_get_text(xmlNodePtr node, BOOL trim, DWORD *first, DWORD *las case XML_DOCUMENT_FRAG_NODE: if (trim && !preserving) { - xmlChar* ret = str; + xmlChar* ret; int len; if (!str) @@ -1301,6 +1301,7 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, { #ifdef SONAME_LIBXSLT xsltStylesheetPtr xsltSS; + xmlDocPtr sheet_doc; HRESULT hr = S_OK; xmlnode *sheet; @@ -1312,8 +1313,9 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, sheet = get_node_obj(stylesheet); if(!sheet) return E_FAIL; - xsltSS = pxsltParseStylesheetDoc(sheet->node->doc); - if(xsltSS) + sheet_doc = xmlCopyDoc(sheet->node->doc, 1); + xsltSS = pxsltParseStylesheetDoc(sheet_doc); + if (xsltSS) { const char **xslparams = NULL; xmlDocPtr result; @@ -1358,11 +1360,11 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, hr = node_transform_write_to_bstr(xsltSS, result, p); xmlFreeDoc(result); } - /* libxslt "helpfully" frees the XML document the stylesheet was - generated from, too */ - xsltSS->doc = NULL; + pxsltFreeStylesheet(xsltSS); } + else + xmlFreeDoc(sheet_doc); if(!*p) *p = SysAllocStringLen(NULL, 0); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 1ccd11123ce..2557a97bcb8 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -129,7 +129,7 @@ reactos/dll/win32/msvfw32 # Synced to WineStaging-2.2 reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml2 # Synced to WineStaging-1.9.11 -reactos/dll/win32/msxml3 # Synced to WineStaging-1.9.16 +reactos/dll/win32/msxml3 # Synced to WineStaging-2.2 reactos/dll/win32/msxml4 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml6 # Synced to WineStaging-1.9.11 reactos/dll/win32/nddeapi # Synced to WineStaging-1.9.11