Gabriel Ivăncescu : mshtml: Implement HTMLDocument's toString using dispex_to_string.

Alexandre Julliard julliard at winehq.org
Tue Oct 12 16:12:48 CDT 2021


Module: wine
Branch: master
Commit: 6f78047199ca709724427e4a68d715ae01965da3
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6f78047199ca709724427e4a68d715ae01965da3

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Fri Oct  8 20:30:54 2021 +0300

mshtml: Implement HTMLDocument's toString using dispex_to_string.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmldoc.c             | 7 +------
 dlls/mshtml/tests/documentmode.js | 1 +
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 12fce6d3015..d2caaef2741 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1703,12 +1703,7 @@ static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
 
     TRACE("(%p)->(%p)\n", This, String);
 
-    if(!String)
-        return E_INVALIDARG;
-
-    *String = SysAllocString(L"[object]");
-    return *String ? S_OK : E_OUTOFMEMORY;
-
+    return dispex_to_string(&This->doc_node->node.event_target.dispex, String);
 }
 
 static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 2c11744c848..7f7fe879662 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -210,6 +210,7 @@ sync_test("builtin_toString", function() {
     if(clientRects) test("clientRect", clientRects[0], "ClientRect");
     if(clientRects) test("clientRects", clientRects, "ClientRectList");
     if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties");
+    if(v >= 11 /* todo_wine */) test("document", document, v < 11 ? "Document" : "HTMLDocument");
     test("elements", document.getElementsByTagName("body"), "HTMLCollection");
     test("history", window.history, "History");
     test("implementation", document.implementation, "DOMImplementation");




More information about the wine-cvs mailing list