Commit 7b52ece4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Implement IHTMLElement2::accessKey property on top of nsIDOMHTMLElement.

parent 4efad17a
......@@ -2790,22 +2790,38 @@ static HRESULT WINAPI HTMLElement2_focus(IHTMLElement2 *iface)
static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
{
HTMLElement *This = impl_from_IHTMLElement2(iface);
VARIANT var;
static WCHAR accessKeyW[] = L"accessKey";
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = v;
return IHTMLElement_setAttribute(&This->IHTMLElement_iface, accessKeyW, var, 0);
if(!This->html_element) {
FIXME("non-HTML element\n");
return E_NOTIMPL;
}
nsAString_InitDepend(&nsstr, v);
nsres = nsIDOMHTMLElement_SetAccessKey(This->html_element, &nsstr);
nsAString_Finish(&nsstr);
return map_nsresult(nsres);
}
static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
{
HTMLElement *This = impl_from_IHTMLElement2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
if(!This->html_element) {
FIXME("non-HTML element\n");
return E_NOTIMPL;
}
nsAString_InitDepend(&nsstr, NULL);
nsres = nsIDOMHTMLElement_GetAccessKey(This->html_element, &nsstr);
return return_nsstr(nsres, &nsstr, p);
}
static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
......
......@@ -425,3 +425,11 @@ sync_test("navigator", function() {
v.testProp = true;
ok(window.navigator.testProp, "window.navigator.testProp = " + window.navigator.testProp);
});
sync_test("elem_props", function() {
var elem = document.body;
ok(elem.accessKey === "", "accessKey = " + elem.accessKey);
elem.accessKey = "q";
ok(elem.accessKey === "q", "accessKey = " + elem.accessKey + " expected q");
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment