Gabriel Ivăncescu : mshtml: Expose toString() for WineDOMTokenList.

Alexandre Julliard julliard at winehq.org
Fri Oct 1 18:02:23 CDT 2021


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Fri Oct  1 16:12:44 2021 +0300

mshtml: Expose toString() for WineDOMTokenList.

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/htmlelem.c               | 10 ++++++++++
 dlls/mshtml/mshtml_private_iface.idl |  2 ++
 dlls/mshtml/tests/dom.js             |  2 ++
 3 files changed, 14 insertions(+)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 4e5aba7c344..b07de03be2d 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -6612,6 +6612,15 @@ static HRESULT WINAPI token_list_remove(IWineDOMTokenList *iface, BSTR token)
     return token_list_add_remove(iface, token, TRUE);
 }
 
+static HRESULT WINAPI token_list_toString(IWineDOMTokenList *iface, BSTR *String)
+{
+    struct token_list *token_list = impl_from_IWineDOMTokenList(iface);
+
+    TRACE("(%p)->(%p)\n", token_list, String);
+
+    return IHTMLElement_get_className(token_list->element, String);
+}
+
 static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = {
     token_list_QueryInterface,
     token_list_AddRef,
@@ -6622,6 +6631,7 @@ static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = {
     token_list_Invoke,
     token_list_add,
     token_list_remove,
+    token_list_toString
 };
 
 static inline struct token_list *token_list_from_DispatchEx(DispatchEx *iface)
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl
index 2292e2cf76b..5755afdfe5c 100644
--- a/dlls/mshtml/mshtml_private_iface.idl
+++ b/dlls/mshtml/mshtml_private_iface.idl
@@ -115,6 +115,8 @@ interface IWineDOMTokenList : IDispatch
     HRESULT add([in] BSTR token);
     [id(2)]
     HRESULT remove([in] BSTR token);
+    [id(3)]
+    HRESULT toString([retval, out] BSTR *String);
 }
 
 } /* library MSHTML_private */
diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js
index efbab663902..73c2b3b0866 100644
--- a/dlls/mshtml/tests/dom.js
+++ b/dlls/mshtml/tests/dom.js
@@ -528,6 +528,7 @@ sync_test("classList", function() {
     classList.add("c");
     ok(elem.className === "a b c 4", "(2) Expected className 'a b c 4', got " + elem.className);
     ok(("" + classList) === "a b c 4", "Expected classList value 'a b c 4', got " + classList);
+    ok(classList.toString() === "a b c 4", "Expected classList toString 'a b c 4', got " + classList.toString());
 
     var exception = false
 
@@ -609,4 +610,5 @@ sync_test("classList", function() {
 
     elem.className = "  testclass    foobar  ";
     ok(("" + classList) === "  testclass    foobar  ", "Expected classList value '  testclass    foobar  ', got " + classList);
+    ok(classList.toString() === "  testclass    foobar  ", "Expected classList toString '  testclass    foobar  ', got " + classList.toString());
 });




More information about the wine-cvs mailing list