mshtml: Added IHTMLDocument3::dir property implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b05928aae0
commit
cb11d67035
|
@ -2173,15 +2173,42 @@ static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface,
|
|||
static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
|
||||
{
|
||||
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
nsAString dir_str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
if(!This->doc_node->nsdoc) {
|
||||
FIXME("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_InitDepend(&dir_str, v);
|
||||
nsres = nsIDOMHTMLDocument_SetDir(This->doc_node->nsdoc, &dir_str);
|
||||
nsAString_Finish(&dir_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("SetDir failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
|
||||
{
|
||||
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString dir_str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->doc_node->nsdoc) {
|
||||
FIXME("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetDir(This->doc_node->nsdoc, &dir_str);
|
||||
return return_nsstr(nsres, &dir_str, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
|
||||
|
|
|
@ -6304,6 +6304,42 @@ static void test_default_selection(IHTMLDocument2 *doc)
|
|||
IHTMLTxtRange_Release(range);
|
||||
}
|
||||
|
||||
static void test_doc_dir(IHTMLDocument2 *doc2)
|
||||
{
|
||||
IHTMLDocument3 *doc = get_doc3_iface(doc2);
|
||||
BSTR dir;
|
||||
HRESULT hres;
|
||||
|
||||
dir = (BSTR)0xdeadbeef;
|
||||
hres = IHTMLDocument3_get_dir(doc, &dir);
|
||||
ok(hres == S_OK, "get_dir failed: %08x\n", hres);
|
||||
ok(!dir, "dir = %s\n", wine_dbgstr_w(dir));
|
||||
|
||||
dir = a2bstr("rtl");
|
||||
hres = IHTMLDocument3_put_dir(doc, dir);
|
||||
ok(hres == S_OK, "put_dir failed: %08x\n", hres);
|
||||
SysFreeString(dir);
|
||||
|
||||
dir = NULL;
|
||||
hres = IHTMLDocument3_get_dir(doc, &dir);
|
||||
ok(hres == S_OK, "get_dir failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(dir, "rtl"), "dir = %s\n", wine_dbgstr_w(dir));
|
||||
SysFreeString(dir);
|
||||
|
||||
dir = a2bstr("ltr");
|
||||
hres = IHTMLDocument3_put_dir(doc, dir);
|
||||
ok(hres == S_OK, "put_dir failed: %08x\n", hres);
|
||||
SysFreeString(dir);
|
||||
|
||||
dir = NULL;
|
||||
hres = IHTMLDocument3_get_dir(doc, &dir);
|
||||
ok(hres == S_OK, "get_dir failed: %08x\n", hres);
|
||||
ok(!strcmp_wa(dir, "ltr"), "dir = %s\n", wine_dbgstr_w(dir));
|
||||
SysFreeString(dir);
|
||||
|
||||
IHTMLDocument3_Release(doc);
|
||||
}
|
||||
|
||||
static void test_unique_id(IHTMLDocument2 *doc, IHTMLElement *elem)
|
||||
{
|
||||
IHTMLDocument3 *doc3 = get_doc3_iface(doc);
|
||||
|
@ -6393,6 +6429,7 @@ static void test_doc_elem(IHTMLDocument2 *doc)
|
|||
|
||||
test_elem_client_rect((IUnknown*)elem);
|
||||
test_unique_id(doc, elem);
|
||||
test_doc_dir(doc);
|
||||
|
||||
IHTMLElement_Release(elem);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue