static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, IHTMLElement **pel) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch* pDisp, VARIANT_BOOL *pfResult) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) { HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMDocument *nsdoc; HTMLDOMNode *node; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); if(!This->nscontainer) { *p = NULL; return S_OK; } nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc); if(NS_FAILED(nsres)) ERR("GetDocument failed: %08lx\n", nsres); if(nsdoc) { node = get_node(This, (nsIDOMNode*)nsdoc); nsIDOMDocument_Release(nsdoc); IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p); }else { *p = NULL; } return S_OK; }
static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, IHTMLDOMNode **newTextNode) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%u %lu %p)\n", This, iTInfo, lcid, ppTInfo); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) { HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMElement *nselem = NULL; HTMLDOMNode *node; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); if(This->window->readystate == READYSTATE_UNINITIALIZED) { *p = NULL; return S_OK; } if(!This->doc_node->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; } nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem); if(NS_FAILED(nsres)) { ERR("GetDocumentElement failed: %08x\n", nsres); return E_FAIL; } if(nselem) { node = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE); nsIDOMElement_Release(nselem); IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p); }else { *p = NULL; } return S_OK; }
static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, IHTMLElementCollection **ppelColl) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId); }
static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, VARIANT_BOOL *p) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, IHTMLDocument2 **p) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, VARIANT_BOOL *p) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch *pDisp) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, IHTMLDocument2 **ppNewDoc) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%p)\n", This, ppNewDoc); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, IHTMLElementCollection **pelColl) { HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMNodeList *nslist; nsAString id_str, ns_str; nsresult nsres; static const WCHAR str[] = {'*',0}; TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl); if(!This->doc_node->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; } nsAString_InitDepend(&id_str, v); nsAString_InitDepend(&ns_str, str); nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->doc_node->nsdoc, &ns_str, &id_str, &nslist); nsAString_Finish(&id_str); nsAString_Finish(&ns_str); if(FAILED(nsres)) { ERR("GetElementByName failed: %08x\n", nsres); return E_FAIL; } *pelColl = (IHTMLElementCollection*)create_collection_from_nodelist(This->doc_node, (IUnknown*)HTMLDOC3(This), nslist); nsIDOMNodeList_Release(nslist); return S_OK; }
static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, IHTMLDOMNode **newTextNode) { HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMText *nstext; HTMLDOMNode *node; nsAString text_str; nsresult nsres; TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); if(!This->doc_node->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; } nsAString_InitDepend(&text_str, text); nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext); nsAString_Finish(&text_str); if(NS_FAILED(nsres)) { ERR("CreateTextNode failed: %08x\n", nsres); return E_FAIL; } node = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext); nsIDOMElement_Release(nstext); *newTextNode = HTMLDOMNODE(node); IHTMLDOMNode_AddRef(HTMLDOMNODE(node)); return S_OK; }
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) { HTMLDocument *This = HTMLDOC3_THIS(iface); TRACE("(%p)->(%p)\n", This, p); return get_doc_event(This, EVENTID_CONTEXTMENU, p); }
static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch* pDisp, VARIANT_BOOL *pfResult) { HTMLDocument *This = HTMLDOC3_THIS(iface); TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult); }
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%ld %s %ld %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%s %p %u %lu %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, IDispatch *pDisp) { HTMLDocument *This = HTMLDOC3_THIS(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); return detach_event(This->doc_node->node.event_target, This, event, pDisp); }
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)\n", This); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%x)\n", This, fForce); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) { HTMLDocument *This = HTMLDOC3_THIS(iface); FIXME("(%p)->(%p)\n", This, p); return E_NOTIMPL; }
static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, REFIID riid, void **ppv) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv); }
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo); }
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo); }
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IHTMLDocument2_Release(HTMLDOC(This)); }
static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, IHTMLElement **pel) { HTMLDocument *This = HTMLDOC3_THIS(iface); nsIDOMElement *nselem; HTMLDOMNode *node; nsIDOMNode *nsnode, *nsnode_by_id, *nsnode_by_name; nsIDOMNodeList *nsnode_list; nsAString id_str; nsresult nsres; TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel); if(!This->doc_node->nsdoc) { WARN("NULL nsdoc\n"); return E_UNEXPECTED; } nsAString_InitDepend(&id_str, v); /* get element by id attribute */ nsres = nsIDOMHTMLDocument_GetElementById(This->doc_node->nsdoc, &id_str, &nselem); if(FAILED(nsres)) { ERR("GetElementById failed: %08x\n", nsres); nsAString_Finish(&id_str); return E_FAIL; } nsnode_by_id = (nsIDOMNode*)nselem; /* get first element by name attribute */ nsres = nsIDOMHTMLDocument_GetElementsByName(This->doc_node->nsdoc, &id_str, &nsnode_list); nsAString_Finish(&id_str); if(FAILED(nsres)) { ERR("getElementsByName failed: %08x\n", nsres); if(nsnode_by_id) nsIDOMNode_Release(nsnode_by_id); return E_FAIL; } nsIDOMNodeList_Item(nsnode_list, 0, &nsnode_by_name); nsIDOMNodeList_Release(nsnode_list); if(nsnode_by_name && nsnode_by_id) { nsIDOM3Node *node3; PRUint16 pos; nsres = nsIDOMNode_QueryInterface(nsnode_by_name, &IID_nsIDOM3Node, (void**)&node3); if(NS_FAILED(nsres)) { FIXME("failed to get nsIDOM3Node interface: 0x%08x\n", nsres); nsIDOMNode_Release(nsnode_by_name); nsIDOMNode_Release(nsnode_by_id); return E_FAIL; } nsres = nsIDOM3Node_CompareDocumentPosition(node3, nsnode_by_id, &pos); nsIDOM3Node_Release(node3); if(NS_FAILED(nsres)) { FIXME("nsIDOM3Node_CompareDocumentPosition failed: 0x%08x\n", nsres); nsIDOMNode_Release(nsnode_by_name); nsIDOMNode_Release(nsnode_by_id); return E_FAIL; } TRACE("CompareDocumentPosition gave: 0x%x\n", pos); if(pos & PRECEDING || pos & CONTAINS) { nsnode = nsnode_by_id; nsIDOMNode_Release(nsnode_by_name); }else { nsnode = nsnode_by_name; nsIDOMNode_Release(nsnode_by_id); } }else nsnode = nsnode_by_name ? nsnode_by_name : nsnode_by_id; if(nsnode) { node = get_node(This->doc_node, nsnode, TRUE); nsIDOMNode_Release(nsnode); IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel); }else { *pel = NULL; } return S_OK; }
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) { HTMLDocument *This = HTMLDOC3_THIS(iface); return IHTMLDocument2_AddRef(HTMLDOC(This)); }