Jacek Caban : mshtml: Added IHTMLElement2::put_tabIndex implementation.
Alexandre Julliard
julliard at winehq.org
Tue Jun 24 06:45:06 CDT 2008
Module: wine
Branch: master
Commit: c8284724abcac810772d223f760050cc4950341c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c8284724abcac810772d223f760050cc4950341c
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Jun 23 20:02:22 2008 -0500
mshtml: Added IHTMLElement2::put_tabIndex implementation.
---
dlls/mshtml/htmlelem2.c | 19 +++++++++++++++++--
dlls/mshtml/tests/dom.c | 15 +++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlelem2.c b/dlls/mshtml/htmlelem2.c
index 572841c..d12c60c 100644
--- a/dlls/mshtml/htmlelem2.c
+++ b/dlls/mshtml/htmlelem2.c
@@ -383,8 +383,23 @@ static HRESULT WINAPI HTMLElement2_removeExpression(IHTMLElement2 *iface, BSTR p
static HRESULT WINAPI HTMLElement2_put_tabIndex(IHTMLElement2 *iface, short v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%d)\n", This, v);
- return E_NOTIMPL;
+ nsIDOMNSHTMLElement *nselem;
+ nsresult nsres;
+
+ TRACE("(%p)->(%d)\n", This, v);
+
+ nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+ if(NS_FAILED(nsres)) {
+ ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
+ return S_OK;
+ }
+
+ nsres = nsIDOMNSHTMLElement_SetTabIndex(nselem, v);
+ nsIDOMNSHTMLElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetTabIndex failed: %08x\n", nsres);
+
+ return S_OK;
}
static HRESULT WINAPI HTMLElement2_get_tabIndex(IHTMLElement2 *iface, short *p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 65e9de6..ae8f6de 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -965,6 +965,19 @@ static void _test_elem_tabindex(unsigned line, IUnknown *unk, short exindex)
ok_(__FILE__,line) (index == exindex, "unexpected index %d\n", index);
}
+#define test_elem_set_tabindex(u,i) _test_elem_set_tabindex(__LINE__,u,i)
+static void _test_elem_set_tabindex(unsigned line, IUnknown *unk, short index)
+{
+ IHTMLElement2 *elem2 = _get_elem2_iface(line, unk);
+ HRESULT hres;
+
+ hres = IHTMLElement2_put_tabIndex(elem2, index);
+ IHTMLElement2_Release(elem2);
+ ok_(__FILE__,line) (hres == S_OK, "get_tabIndex failed: %08x\n", hres);
+
+ _test_elem_tabindex(line, unk, index);
+}
+
#define test_elem_set_class(u,c) _test_elem_set_class(__LINE__,u,c)
static void _test_elem_set_class(unsigned line, IUnknown *unk, const char *class)
{
@@ -1854,6 +1867,7 @@ static void test_elems(IHTMLDocument2 *doc)
test_elem_set_class((IUnknown*)elem, "cl");
test_elem_set_class((IUnknown*)elem, NULL);
test_elem_tabindex((IUnknown*)elem, 0);
+ test_elem_set_tabindex((IUnknown*)elem, 1);
IHTMLElement_Release(elem);
}
@@ -1916,6 +1930,7 @@ static void test_elems(IHTMLDocument2 *doc)
test_input_value((IUnknown*)elem, NULL);
test_elem_class((IUnknown*)elem, "testclass");
test_elem_tabindex((IUnknown*)elem, 2);
+ test_elem_set_tabindex((IUnknown*)elem, 3);
IHTMLInputElement_Release(input);
IHTMLElement_Release(elem);
More information about the wine-cvs
mailing list