Module: wine Branch: master Commit: e0585d4c184da2534dd3ff07a453981fb06bef10 URL: https://source.winehq.org/git/wine.git/?a=commit;h=e0585d4c184da2534dd3ff07a...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Thu Oct 7 16:52:35 2021 +0300
mshtml: Implement HTMLDOMTextNode's toString.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 afe5d21d77c..d899fa0adff 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 91e50c76fc0..c3364727ce9 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");