From 648ed1e1c62af7db41d3cfd96afc80922636f314 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 2 Sep 2011 14:17:49 +0200 Subject: [PATCH] mshtml: Added HTMLAttributeCollection_invoke implementation. --- dlls/mshtml/htmlelem.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 8b5b7f0111d..9d9fc8d957a 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -2622,12 +2622,36 @@ static HRESULT HTMLAttributeCollection_get_dispid(DispatchEx *dispex, BSTR name, return S_OK; } -static HRESULT HTMLAttributeCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, - VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +static HRESULT HTMLAttributeCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { HTMLAttributeCollection *This = HTMLAttributeCollection_from_DispatchEx(dispex); - FIXME("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller); - return E_NOTIMPL; + + TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller); + + switch(flags) { + case DISPATCH_PROPERTYGET: { + HTMLDOMAttribute *iter; + + id = id-MSHTML_DISPID_CUSTOM_MIN+1; + + LIST_FOR_EACH_ENTRY(iter, &This->attrs, HTMLDOMAttribute, entry) { + if(!(--id)) + break; + } + if(id) + return E_INVALIDARG; + + IHTMLDOMAttribute_AddRef(&iter->IHTMLDOMAttribute_iface); + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)&iter->IHTMLDOMAttribute_iface; + return S_OK; + } + + default: + FIXME("unimplemented flags %x\n", flags); + return E_NOTIMPL; + } } static const dispex_static_data_vtbl_t HTMLAttributeCollection_dispex_vtbl = {