From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 40 ++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private_iface.idl | 8 ++++++ dlls/mshtml/tests/dom.js | 10 ++++++- 3 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 5cdb74c2051..42572637238 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7561,6 +7561,42 @@ static HRESULT WINAPI token_list_remove(IWineDOMTokenList *iface, BSTR token) return token_list_add_remove(iface, token, TRUE); }
+static HRESULT WINAPI token_list_toggle(IWineDOMTokenList *iface, BSTR token, VARIANT_BOOL *p) +{ + struct token_list *token_list = impl_from_IWineDOMTokenList(iface); + + FIXME("(%p)->(%s %p)\n", token_list, debugstr_w(token), p); + + return E_NOTIMPL; +} + +static HRESULT WINAPI token_list_contains(IWineDOMTokenList *iface, BSTR token, VARIANT_BOOL *p) +{ + struct token_list *token_list = impl_from_IWineDOMTokenList(iface); + + FIXME("(%p)->(%s %p)\n", token_list, debugstr_w(token), p); + + return E_NOTIMPL; +} + +static HRESULT WINAPI token_list_get_length(IWineDOMTokenList *iface, LONG *p) +{ + struct token_list *token_list = impl_from_IWineDOMTokenList(iface); + + FIXME("(%p)->(%p)\n", token_list, p); + + return E_NOTIMPL; +} + +static HRESULT WINAPI token_list_item(IWineDOMTokenList *iface, LONG index, VARIANT *p) +{ + struct token_list *token_list = impl_from_IWineDOMTokenList(iface); + + FIXME("(%p)->(%ld %p)\n", token_list, index, p); + + return E_NOTIMPL; +} + static HRESULT WINAPI token_list_toString(IWineDOMTokenList *iface, BSTR *String) { struct token_list *token_list = impl_from_IWineDOMTokenList(iface); @@ -7580,6 +7616,10 @@ static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = { token_list_Invoke, token_list_add, token_list_remove, + token_list_toggle, + token_list_contains, + token_list_get_length, + token_list_item, token_list_toString };
diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 8e4a64bda39..c0bb30fbbc8 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -159,6 +159,14 @@ interface IWineDOMTokenList : IDispatch [id(2)] HRESULT remove([in] BSTR token); [id(3)] + HRESULT toggle([in] BSTR token, [retval, out] VARIANT_BOOL *p); + [id(4)] + HRESULT contains([in] BSTR token, [retval, out] VARIANT_BOOL *p); + [propget, id(5)] + HRESULT length([retval, out] LONG *p); + [id(6)] + HRESULT item([in] LONG index, [retval, out] VARIANT *p); + [id(7)] HRESULT toString([retval, out] BSTR *String); }
diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index e5a07027f7c..85890074431 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -623,7 +623,15 @@ sync_test("hasAttribute", function() {
sync_test("classList", function() { var elem = document.createElement("div"); - var classList = elem.classList; + var classList = elem.classList, i; + + var props = [ "add", "contains", "item", "length", "remove", "toggle" ]; + for(i = 0; i < props.length; i++) + ok(props[i] in classList, props[i] + " not found in classList."); + + props = [ "entries", "forEach", "keys", "replace", "supports", "value", "values"]; + for(i = 0; i < props.length; i++) + ok(!(props[i] in classList), props[i] + " found in classList.");
classList.add("a"); ok(elem.className === "a", "Expected className 'a', got " + elem.className);