[PATCH v4 07/14] mshtml: Implement HTMLDOMTextNode's toString.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Thu Oct 7 08:52:35 CDT 2021
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
dlls/mshtml/htmltextnode.c | 12 ++++++++++--
dlls/mshtml/tests/documentmode.js | 1 +
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c
index afe5d21..d899fa0 100644
--- a/dlls/mshtml/htmltextnode.c
+++ b/dlls/mshtml/htmltextnode.c
@@ -128,8 +128,16 @@ static HRESULT WINAPI HTMLDOMTextNode_get_data(IHTMLDOMTextNode *iface, BSTR *p)
static HRESULT WINAPI HTMLDOMTextNode_toString(IHTMLDOMTextNode *iface, BSTR *String)
{
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
- FIXME("(%p)->(%p)\n", This, String);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, String);
+
+ if(!String)
+ return E_INVALIDARG;
+
+ if(dispex_compat_mode(&This->node.event_target.dispex) < COMPAT_MODE_IE9)
+ return IHTMLDOMTextNode_get_data(&This->IHTMLDOMTextNode_iface, String);
+
+ return dispex_to_string(&This->node.event_target.dispex, String);
}
static HRESULT WINAPI HTMLDOMTextNode_get_length(IHTMLDOMTextNode *iface, LONG *p)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 91e50c7..c336472 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -223,6 +223,7 @@ sync_test("builtin_toString", function() {
test("styleSheetRule", sheet.rules.item(0), "CSSStyleRule");
test("styleSheetRules", sheet.rules, "MSCSSRuleList");
test("styleSheets", document.styleSheets, "StyleSheetList");
+ test("textNode", document.createTextNode("testNode"), "Text", v < 9 ? "testNode" : null);
test("textRange", txtRange, "TextRange");
test("window", window, "Window", "[object Window]");
test("xmlHttpRequest", new XMLHttpRequest(), "XMLHttpRequest");
--
2.31.1
More information about the wine-devel
mailing list