#include "wine/unicode.h"
#include "mshtml_private.h"
+#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, pctinfo);
- return E_NOTIMPL;
+ return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
}
static HRESULT WINAPI HTMLElement2_GetTypeInfo(IHTMLElement2 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
- return E_NOTIMPL;
+ return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
}
static HRESULT WINAPI HTMLElement2_GetIDsOfNames(IHTMLElement2 *iface, REFIID riid,
LCID lcid, DISPID *rgDispId)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
- lcid, rgDispId);
- return E_NOTIMPL;
+ return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLElement2_Invoke(IHTMLElement2 *iface, DISPID dispIdMember,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
- lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
- return E_NOTIMPL;
+ return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
+ wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLElement2_get_scopeName(IHTMLElement2 *iface, BSTR *p)
}
static HRESULT WINAPI HTMLElement2_componentFromPoint(IHTMLElement2 *iface,
- long x, long y, BSTR *component)
+ LONG x, LONG y, BSTR *component)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%ld %ld %p)\n", This, x, y, component);
+ FIXME("(%p)->(%d %d %p)\n", This, x, y, component);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLElement2_doScroll(IHTMLElement2 *iface, VARIANT component)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&component));
+
+ if(!This->node.doc->content_ready
+ || !This->node.doc->basedoc.doc_obj->in_place_active)
+ return E_PENDING;
+
+ WARN("stub\n");
+ return S_OK;
}
static HRESULT WINAPI HTMLElement2_put_onscroll(IHTMLElement2 *iface, VARIANT v)
static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_DRAG, &v);
}
static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_DRAG, p);
}
static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_PASTE, &v);
}
static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_PASTE, p);
}
static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return HTMLCurrentStyle_Create(This, p);
}
static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
- nsIDOMNSHTMLElement_focus(nselem);
+ nsIDOMNSHTMLElement_Focus(nselem);
nsIDOMNSHTMLElement_Release(nselem);
}else {
ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_BLUR, &v);
}
static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_BLUR, p);
}
static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_FOCUS, &v);
}
static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_FOCUS, p);
}
static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- nsIDOMNSHTMLElement *nselem;
+ nsIDOMNSElement *nselem;
PRInt32 height=0;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+ nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
- nsIDOMNSHTMLElement_GetClientHeight(nselem, &height);
- nsIDOMNSHTMLElement_Release(nselem);
+ nsIDOMNSElement_GetClientHeight(nselem, &height);
+ nsIDOMNSElement_Release(nselem);
}else {
- ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
+ ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
}
*p = height;
return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- nsIDOMNSHTMLElement *nselem;
+ nsIDOMNSElement *nselem;
PRInt32 width=0;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+ nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
- nsIDOMNSHTMLElement_GetClientWidth(nselem, &width);
- nsIDOMNSHTMLElement_Release(nselem);
+ nsIDOMNSElement_GetClientWidth(nselem, &width);
+ nsIDOMNSElement_Release(nselem);
}else {
- ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
+ ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
}
*p = width;
return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_clientTop(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 client_top = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres)) {
+ nsres = nsIDOMNSElement_GetClientTop(nselem, &client_top);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetScrollHeight failed: %08x\n", nsres);
+ }else {
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
+ }
+
+ *p = client_top;
+ TRACE("*p = %d\n", *p);
+ return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_clientLeft(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 client_left = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres)) {
+ nsres = nsIDOMNSElement_GetClientLeft(nselem, &client_left);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetScrollHeight failed: %08x\n", nsres);
+ }else {
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
+ }
+
+ *p = client_left;
+ TRACE("*p = %d\n", *p);
+ return S_OK;
}
static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
IDispatch *pDisp, VARIANT_BOOL *pfResult)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
+
+ return attach_event(get_node_event_target(&This->node), This->node.nsnode, &This->node.doc->basedoc, event, pDisp, pfResult);
}
static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
+
+ return detach_event(*get_node_event_target(&This->node), &This->node.doc->basedoc, event, pDisp);
}
static HRESULT WINAPI HTMLElement2_get_readyState(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ BSTR str;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ if(This->node.vtbl->get_readystate) {
+ HRESULT hres;
+
+ hres = This->node.vtbl->get_readystate(&This->node, &str);
+ if(FAILED(hres))
+ return hres;
+ }else {
+ static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
+
+ str = SysAllocString(completeW);
+ if(!str)
+ return E_OUTOFMEMORY;
+ }
+
+ V_VT(p) = VT_BSTR;
+ V_BSTR(p) = str;
+ return S_OK;
}
static HRESULT WINAPI HTMLElement2_put_onreadystatechange(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->node, EVENTID_READYSTATECHANGE, &v);
}
static HRESULT WINAPI HTMLElement2_get_onreadystatechange(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->node, EVENTID_READYSTATECHANGE, p);
}
static HRESULT WINAPI HTMLElement2_put_onrowsdelete(IHTMLElement2 *iface, VARIANT v)
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 height = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres)) {
+ nsres = nsIDOMNSElement_GetScrollHeight(nselem, &height);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetScrollHeight failed: %08x\n", nsres);
+ }else {
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
+ }
+
+ *p = height;
+ TRACE("*p = %d\n", *p);
+
+ return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 width = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres)) {
+ nsres = nsIDOMNSElement_GetScrollWidth(nselem, &width);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetScrollWidth failed: %08x\n", nsres);
+ }else {
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
+ }
+
+ *p = width;
+ TRACE("*p = %d\n", *p);
+
+ return S_OK;
}
-static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
+static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, LONG v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- nsIDOMNSHTMLElement *nselem;
+ nsIDOMNSElement *nselem;
nsresult nsres;
- TRACE("(%p)->(%ld)\n", This, v);
+ TRACE("(%p)->(%d)\n", This, v);
if(!This->nselem) {
FIXME("NULL nselem\n");
return E_NOTIMPL;
}
- nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+ nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
- nsIDOMNSHTMLElement_SetScrollTop(nselem, v);
- nsIDOMNSHTMLElement_Release(nselem);
+ nsIDOMNSElement_SetScrollTop(nselem, v);
+ nsIDOMNSElement_Release(nselem);
}else {
- ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
}
return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 top = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres)) {
+ nsres = nsIDOMNSElement_GetScrollTop(nselem, &top);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ ERR("GetScrollTop failed: %08x\n", nsres);
+ }else {
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
+ }
+
+ *p = top;
+ TRACE("*p = %d\n", *p);
+
+ return S_OK;
}
-static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
+static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, LONG v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- nsIDOMNSHTMLElement *nselem;
+ nsIDOMNSElement *nselem;
nsresult nsres;
- TRACE("(%p)->(%ld)\n", This, v);
+ TRACE("(%p)->(%d)\n", This, v);
if(!This->nselem) {
FIXME("NULL nselem\n");
return E_NOTIMPL;
}
- nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
+ nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
if(NS_SUCCEEDED(nsres)) {
- nsIDOMNSHTMLElement_SetScrollLeft(nselem, v);
- nsIDOMNSHTMLElement_Release(nselem);
+ nsIDOMNSElement_SetScrollLeft(nselem, v);
+ nsIDOMNSElement_Release(nselem);
}else {
- ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
+ ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
}
return S_OK;
}
-static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ nsIDOMNSElement *nselem;
+ PRInt32 left = 0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ if(!p)
+ return E_INVALIDARG;
+
+ if(!This->nselem)
+ {
+ FIXME("NULL nselem\n");
+ return E_NOTIMPL;
+ }
+
+ nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
+ if(NS_SUCCEEDED(nsres))
+ {
+ nsres = nsIDOMNSElement_GetScrollLeft(nselem, &left);
+ nsIDOMNSElement_Release(nselem);
+ if(NS_FAILED(nsres))
+ left = 0;
+ }
+
+ *p = left;
+ TRACE("*p = %d\n", *p);
+
+ return S_OK;
}
static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
}
static HRESULT WINAPI HTMLElement2_addBehavior(IHTMLElement2 *iface, BSTR bstrUrl,
- VARIANT *pvarFactory, long *pCookie)
+ VARIANT *pvarFactory, LONG *pCookie)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrUrl), pvarFactory, pCookie);
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, long cookie,
+static HRESULT WINAPI HTMLElement2_removeBehavior(IHTMLElement2 *iface, LONG cookie,
VARIANT_BOOL *pfResult)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%ld %p)\n", This, cookie, pfResult);
+ FIXME("(%p)->(%d %p)\n", This, cookie, pfResult);
return E_NOTIMPL;
}
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, long *p)
+static HRESULT WINAPI HTMLElement2_get_readyStateValue(IHTMLElement2 *iface, LONG *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLElement2_getElementByTagName(IHTMLElement2 *iface, BSTR v,
+static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BSTR v,
IHTMLElementCollection **pelColl)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
- FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
- return E_NOTIMPL;
+ nsIDOMNodeList *nslist;
+ nsAString tag_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
+
+ nsAString_InitDepend(&tag_str, v);
+ nsres = nsIDOMHTMLElement_GetElementsByTagName(This->nselem, &tag_str, &nslist);
+ nsAString_Finish(&tag_str);
+ if(NS_FAILED(nsres)) {
+ ERR("GetElementByTagName failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
+ nsIDOMNodeList_Release(nslist);
+ return S_OK;
}
#undef HTMLELEM2_THIS
HTMLElement2_put_onbeforeeditfocus,
HTMLElement2_get_onbeforeeditfocus,
HTMLElement2_get_readyStateValue,
- HTMLElement2_getElementByTagName,
+ HTMLElement2_getElementsByTagName,
};
void HTMLElement2_Init(HTMLElement *This)