Module: wine Branch: master Commit: 423b7ba1d174503038b66f9639fd9c1db3df1d1f URL: http://source.winehq.org/git/wine.git/?a=commit;h=423b7ba1d174503038b66f9639...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Mar 30 14:39:08 2016 +0200
mshtml: Added IHTMLDOMAttribute2::get_parentNode implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlattr.c | 7 +++++-- dlls/mshtml/tests/dom.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index bd7cb82..7a11245 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -347,8 +347,11 @@ static HRESULT WINAPI HTMLDOMAttribute2_get_nodeType(IHTMLDOMAttribute2 *iface, static HRESULT WINAPI HTMLDOMAttribute2_get_parentNode(IHTMLDOMAttribute2 *iface, IHTMLDOMNode **p) { HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + *p = NULL; + return S_OK; }
static HRESULT WINAPI HTMLDOMAttribute2_get_childNodes(IHTMLDOMAttribute2 *iface, IDispatch **p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 41dddab..6d6a1e8 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -3402,6 +3402,19 @@ static void _test_attr_node_name(unsigned line, IHTMLDOMAttribute *attr, const c SysFreeString(str); }
+#define test_attr_parent(a) _test_attr_parent(__LINE__,a) +static void _test_attr_parent(unsigned line, IHTMLDOMAttribute *attr) +{ + IHTMLDOMAttribute2 *attr2 = _get_attr2_iface(line, (IUnknown*)attr); + IHTMLDOMNode *parent = (void*)0xdeadbeef; + HRESULT hres; + + hres = IHTMLDOMAttribute2_get_parentNode(attr2, &parent); + ok_(__FILE__,line)(hres == S_OK, "get_parentNode failed: %08x\n", hres); + ok_(__FILE__,line)(!parent, "parent != NULL\n"); + IHTMLDOMAttribute2_Release(attr2); +} + static void test_attr_collection_disp(IDispatch *disp) { IDispatchEx *dispex; @@ -8522,6 +8535,7 @@ static void test_attr(IHTMLDocument2 *doc, IHTMLElement *elem) test_ifaces((IUnknown*)attr, attr_iids); test_no_iface((IUnknown*)attr, &IID_IHTMLDOMNode); test_attr_specified(attr, VARIANT_TRUE); + test_attr_parent(attr);
attr2 = get_elem_attr_node((IUnknown*)elem, "id", TRUE); ok(iface_cmp((IUnknown*)attr, (IUnknown*)attr2), "attr != attr2\n");