<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Zhenbo,<br>
<br>
On 11/27/15 15:49, Zhenbo Li wrote:<br>
</div>
<blockquote
cite="mid:CAKMejPMRRKH6_As9dLRDNgTNy2j4TVt=BA7zumSED_xMcfvyTg@mail.gmail.com"
type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 12px;"
lang="x-unicode">
<pre wrap="">2015-11-14 17:33 GMT+08:00 Zhenbo Li <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:litimetal@gmail.com"><litimetal@gmail.com></a>:
</pre>
<blockquote type="cite" style="color: #000000;">
<pre wrap=""><span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>Also, I found that there was a hidden bug:
<span class="moz-txt-citetags">> </span>As we will test these urls for responseXML:
<span class="moz-txt-citetags">> </span> static const char xml_url[] = <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="http://test.winehq.org/tests/xmltest.xml">"http://test.winehq.org/tests/xmltest.xml"</a>;
<span class="moz-txt-citetags">> </span> static const char large_page_url[] =
<span class="moz-txt-citetags">> </span><a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="http://test.winehq.org/tests/data.php">"http://test.winehq.org/tests/data.php"</a>;
<span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>char large_page_url is not a valid xml file, but native mshtml.dll can
<span class="moz-txt-citetags">> </span>handle it properly. It shows we can't just past the responseText to
<span class="moz-txt-citetags">> </span>msxml3.dll. I'll check it more carefully it later.
</pre>
</blockquote>
<pre wrap="">Hi, sorry for my late reply.
I tested it on testbot, and found that Windows mshtml.dll would return
an empty xml object</pre>
</div>
</blockquote>
<br>
It looks better now.<br>
<br>
<blockquote
cite="mid:CAKMejPMRRKH6_As9dLRDNgTNy2j4TVt=BA7zumSED_xMcfvyTg@mail.gmail.com"
type="cite">
<pre wrap="">
static BOOL doc_complete;
static IHTMLDocument2 *notif_doc;
+static BOOL ILLEGAL_XML;</pre>
</blockquote>
<br>
Using this global variable makes things harder to follow. Please add
a new argument to test_sync_xhr instead.<br>
<br>
<blockquote
cite="mid:CAKMejPMRRKH6_As9dLRDNgTNy2j4TVt=BA7zumSED_xMcfvyTg@mail.gmail.com"
type="cite">
<pre wrap="">
@@ -334,8 +337,52 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText(IHTMLXMLHttpRequest *i
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *iface, IDispatch **p)
{
HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ IXMLDOMDocument *xmldoc = NULL;
+ BSTR str;
+ HRESULT hres;
+ VARIANT_BOOL vbool;
+ IObjectSafety *safety;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ hres = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void**)&xmldoc);
+ if(FAILED(hres)) {
+ ERR("CoCreateInstance failed: %08x\n", hres);
+ return hres;
+ }
+
+ hres = IHTMLXMLHttpRequest_get_responseText(iface, &str);
+ if(FAILED(hres)) {
+ IXMLDOMDocument_Release(xmldoc);
+ ERR("get_responseText failed: %08x\n", hres);
+ return hres;
+ }
+
+ hres = IXMLDOMDocument_loadXML(xmldoc, str, &vbool);
+ SysFreeString(str);
+ if(hres != S_OK || vbool != VARIANT_TRUE) {
+ ERR("loadXML failed: %08x, returning an cmpty xmldoc\n", hres);
+ }</pre>
</blockquote>
<br>
ERR is not appropriate here. Please use WARN instead.<br>
<br>
<blockquote
cite="mid:CAKMejPMRRKH6_As9dLRDNgTNy2j4TVt=BA7zumSED_xMcfvyTg@mail.gmail.com"
type="cite">
<pre wrap="">
+
+ hres = IXMLDOMDocument_QueryInterface(xmldoc, &IID_IObjectSafety, (void**)&safety);
+ if(SUCCEEDED(hres)) {</pre>
</blockquote>
<br>
Again, this error handling is more complicated than it needs to be.
Please use assert(hres == S_OK) instead.<br>
<br>
<blockquote
cite="mid:CAKMejPMRRKH6_As9dLRDNgTNy2j4TVt=BA7zumSED_xMcfvyTg@mail.gmail.com"
type="cite">
<pre wrap="">
+ hres = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL,
+ INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER,
+ INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER);
+ IObjectSafety_Release(safety);
+ if(FAILED(hres)) {</pre>
</blockquote>
<br>
Same here.<br>
<br>
Thanks,<br>
Jacek<br>
</body>
</html>