mshtml: Implement IHTMLElement6::msMatchesSelector.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-03-29 15:34:52 +01:00 committed by Alexandre Julliard
parent 6e34275f84
commit c62e96ebfc
2 changed files with 23 additions and 2 deletions

View file

@ -4514,8 +4514,27 @@ static HRESULT WINAPI HTMLElement6_getElementsByClassName(IHTMLElement6 *iface,
static HRESULT WINAPI HTMLElement6_msMatchesSelector(IHTMLElement6 *iface, BSTR v, VARIANT_BOOL *pfMatches)
{
HTMLElement *This = impl_from_IHTMLElement6(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pfMatches);
return E_NOTIMPL;
nsAString nsstr;
cpp_bool b;
nsresult nsres;
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pfMatches);
if(!This->dom_element) {
FIXME("No dom element\n");
return E_UNEXPECTED;
}
nsAString_InitDepend(&nsstr, v);
nsres = nsIDOMElement_MozMatchesSelector(This->dom_element, &nsstr, &b);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres)) {
WARN("MozMatchesSelector failed: %08x\n", nsres);
return map_nsresult(nsres);
}
*pfMatches = b;
return S_OK;
}
static HRESULT WINAPI HTMLElement6_put_onabort(IHTMLElement6 *iface, VARIANT v)

View file

@ -207,6 +207,8 @@ function test_query_selector() {
ok(e.tagName === "DIV", "e.tagName = " + e.tagName);
e = document.body.querySelector(".class1");
ok(e.tagName === "DIV", "e.tagName = " + e.tagName);
ok(e.msMatchesSelector(".class1") === true, "msMatchesSelector returned " + e.msMatchesSelector(".class1"));
ok(e.msMatchesSelector(".class2") === false, "msMatchesSelector returned " + e.msMatchesSelector(".class2"));
e = document.querySelector("a");
ok(e.tagName === "A", "e.tagName = " + e.tagName);