Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This will be tested further during toString implementations later.
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 4e5aba7..b07de03 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 2292e2c..5755afd 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 efbab66..73c2b3b 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()); });