Commit ff4fde9e authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Implement isContentEditable for HTML elements.

parent cb078982
......@@ -4256,8 +4256,19 @@ static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BST
static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
{
HTMLElement *This = impl_from_IHTMLElement3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsresult nsres;
cpp_bool r;
TRACE("(%p)->(%p)\n", This, p);
if(!This->html_element) {
FIXME("non-HTML element\n");
return E_NOTIMPL;
}
nsres = nsIDOMHTMLElement_GetIsContentEditable(This->html_element, &r);
*p = variant_bool(NS_SUCCEEDED(nsres) && r);
return S_OK;
}
static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
......
......@@ -3945,6 +3945,7 @@ static void test_contenteditable(IUnknown *unk)
IHTMLElement3 *elem3 = get_elem3_iface(unk);
HRESULT hres;
BSTR str, strDefault;
VARIANT_BOOL vbool;
hres = IHTMLElement3_get_contentEditable(elem3, &strDefault);
ok(hres == S_OK, "get_contentEditable failed: 0x%08lx\n", hres);
......@@ -3957,6 +3958,21 @@ static void test_contenteditable(IUnknown *unk)
ok(hres == S_OK, "get_contentEditable failed: 0x%08lx\n", hres);
ok(!lstrcmpW(str, L"true"), "Got %s, expected %s\n", wine_dbgstr_w(str), "true");
SysFreeString(str);
hres = IHTMLElement3_get_isContentEditable(elem3, &vbool);
ok(hres == S_OK, "get_isContentEditable failed: 0x%08lx\n", hres);
ok(vbool == VARIANT_TRUE, "Got %d, expected VARIANT_TRUE\n", vbool);
str = SysAllocString(L"inherit");
hres = IHTMLElement3_put_contentEditable(elem3, str);
ok(hres == S_OK, "put_contentEditable(%s) failed: 0x%08lx\n", wine_dbgstr_w(str), hres);
SysFreeString(str);
hres = IHTMLElement3_get_contentEditable(elem3, &str);
ok(hres == S_OK, "get_contentEditable failed: 0x%08lx\n", hres);
ok(!lstrcmpW(str, L"inherit"), "Got %s, expected %s\n", wine_dbgstr_w(str), "inherit");
SysFreeString(str);
hres = IHTMLElement3_get_isContentEditable(elem3, &vbool);
ok(hres == S_OK, "get_isContentEditable failed: 0x%08lx\n", hres);
ok(vbool == VARIANT_FALSE, "Got %d, expected VARIANT_FALSE\n", vbool);
/* Restore origin contentEditable */
hres = IHTMLElement3_put_contentEditable(elem3, strDefault);
......
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