2005-12-12 11:51:43 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-12-12 11:51:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
2012-10-02 15:44:27 +02:00
|
|
|
#include <assert.h>
|
2005-12-12 11:51:43 +01:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2009-09-27 20:59:52 +02:00
|
|
|
#include "htmlevent.h"
|
2005-12-12 11:51:43 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2012-10-02 15:46:20 +02:00
|
|
|
HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
|
2012-10-02 15:44:27 +02:00
|
|
|
{
|
|
|
|
nsIDOMNodeList *nsnode_list;
|
|
|
|
nsIDOMElement *nselem;
|
|
|
|
nsIDOMNode *nsnode;
|
|
|
|
nsAString id_str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
if(!doc->nsdoc) {
|
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&id_str, id);
|
|
|
|
/* get element by id attribute */
|
|
|
|
nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem);
|
|
|
|
if(FAILED(nsres)) {
|
|
|
|
ERR("GetElementById failed: %08x\n", nsres);
|
|
|
|
nsAString_Finish(&id_str);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get first element by name attribute */
|
|
|
|
nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list);
|
|
|
|
nsAString_Finish(&id_str);
|
|
|
|
if(FAILED(nsres)) {
|
|
|
|
ERR("getElementsByName failed: %08x\n", nsres);
|
|
|
|
if(nselem)
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
|
|
|
|
nsIDOMNodeList_Release(nsnode_list);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
if(nsnode && nselem) {
|
2013-01-23 18:43:55 +01:00
|
|
|
UINT16 pos;
|
2012-10-02 15:44:27 +02:00
|
|
|
|
|
|
|
nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres);
|
|
|
|
nsIDOMNode_Release(nsnode);
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
|
|
|
|
if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
nselem = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nsnode) {
|
|
|
|
if(!nselem) {
|
|
|
|
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
}
|
|
|
|
nsIDOMNode_Release(nsnode);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!nselem) {
|
|
|
|
*ret = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = get_elem(doc, nselem, ret);
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2010-12-22 10:39:41 +01:00
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
|
|
|
|
}
|
2005-12-12 11:51:43 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_addref(This);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_release(This);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, fForce);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
|
|
|
|
IHTMLDOMNode **newTextNode)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2008-06-23 16:50:22 +02:00
|
|
|
nsIDOMText *nstext;
|
|
|
|
HTMLDOMNode *node;
|
|
|
|
nsAString text_str;
|
|
|
|
nsresult nsres;
|
2010-12-01 22:42:03 +01:00
|
|
|
HRESULT hres;
|
2008-06-23 16:50:22 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:29:39 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
2008-06-23 16:50:22 +02:00
|
|
|
|
2010-01-28 23:55:51 +01:00
|
|
|
nsAString_InitDepend(&text_str, text);
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
|
2008-06-23 16:50:22 +02:00
|
|
|
nsAString_Finish(&text_str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("CreateTextNode failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2010-12-01 22:42:03 +01:00
|
|
|
hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
|
2012-06-28 11:20:14 +02:00
|
|
|
nsIDOMText_Release(nstext);
|
2010-12-01 22:42:03 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
2008-06-23 16:50:22 +02:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
*newTextNode = &node->IHTMLDOMNode_iface;
|
2008-06-23 16:50:22 +02:00
|
|
|
return S_OK;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
2006-03-05 20:41:18 +01:00
|
|
|
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
|
2005-12-12 11:51:43 +01:00
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2007-06-24 10:19:24 +02:00
|
|
|
nsIDOMElement *nselem = NULL;
|
2008-10-08 20:29:47 +02:00
|
|
|
HTMLDOMNode *node;
|
2006-03-05 20:41:18 +01:00
|
|
|
nsresult nsres;
|
2010-12-01 12:52:08 +01:00
|
|
|
HRESULT hres;
|
2006-03-05 20:41:18 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-11-01 19:25:13 +01:00
|
|
|
if(This->window->readystate == READYSTATE_UNINITIALIZED) {
|
2009-10-11 21:10:07 +02:00
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:29:47 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
2006-03-05 20:41:18 +01:00
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
|
2008-10-08 20:29:47 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetDocumentElement failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
2007-06-24 10:19:24 +02:00
|
|
|
}
|
2008-10-08 20:29:47 +02:00
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
if(!nselem) {
|
2006-03-05 20:41:18 +01:00
|
|
|
*p = NULL;
|
2010-12-01 12:52:08 +01:00
|
|
|
return S_OK;
|
2006-03-05 20:41:18 +01:00
|
|
|
}
|
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2012-06-25 14:04:40 +02:00
|
|
|
hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
|
|
|
|
node_release(node);
|
|
|
|
return hres;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
|
|
|
|
IDispatch* pDisp, VARIANT_BOOL *pfResult)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2009-09-27 20:59:52 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
|
|
|
|
|
2010-03-18 01:05:38 +01:00
|
|
|
return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
|
|
|
|
IDispatch *pDisp)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-07-17 13:31:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
|
|
|
|
|
|
|
|
return detach_event(This->doc_node->node.event_target, This, event, pDisp);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-05-07 15:20:33 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-05-07 15:20:33 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_CONTEXTMENU, p);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
|
|
|
|
IHTMLDocument2 **ppNewDoc)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2010-11-14 14:42:20 +01:00
|
|
|
nsIDOMDocumentFragment *doc_frag;
|
|
|
|
HTMLDocumentNode *docnode;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppNewDoc);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
FIXME("NULL nsdoc\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("CreateDocumentFragment failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
|
|
|
|
nsIDOMDocumentFragment_Release(doc_frag);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2010-12-16 14:59:51 +01:00
|
|
|
*ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
|
2010-11-14 14:42:20 +01:00
|
|
|
return S_OK;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
|
|
|
|
IHTMLDocument2 **p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2013-02-20 15:20:51 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2005-12-12 11:51:43 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElementCollection **ppelColl)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2013-11-16 15:50:15 +01:00
|
|
|
nsIDOMNodeList *node_list;
|
|
|
|
nsAString selector_str;
|
|
|
|
WCHAR *selector;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
|
|
|
|
|
|
|
|
if(!This->doc_node || !This->doc_node->nsdoc) {
|
|
|
|
/* We should probably return an empty collection. */
|
|
|
|
FIXME("No nsdoc\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
selector = heap_alloc(2*SysStringLen(v)*sizeof(WCHAR) + sizeof(formatW));
|
|
|
|
if(!selector)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
sprintfW(selector, formatW, v, v);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes.
|
|
|
|
* That's why we use CSS selector instead. We should also use name only when it applies to given element
|
|
|
|
* types and search should be case insensitive. Those are currently not supported properly.
|
|
|
|
*/
|
|
|
|
nsAString_InitDepend(&selector_str, selector);
|
|
|
|
nsres = nsIDOMNodeSelector_QuerySelectorAll(This->doc_node->nsnode_selector, &selector_str, &node_list);
|
|
|
|
nsAString_Finish(&selector_str);
|
|
|
|
heap_free(selector);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("QuerySelectorAll failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ppelColl = create_collection_from_nodelist(This->doc_node, node_list);
|
|
|
|
nsIDOMNodeList_Release(node_list);
|
|
|
|
return S_OK;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElement **pel)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2012-10-02 15:44:27 +02:00
|
|
|
HTMLElement *elem;
|
2010-12-01 12:52:08 +01:00
|
|
|
HRESULT hres;
|
2008-04-23 16:43:50 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
|
|
|
|
2012-10-02 15:44:27 +02:00
|
|
|
hres = get_doc_elem_by_id(This->doc_node, v, &elem);
|
|
|
|
if(FAILED(hres) || !elem) {
|
2008-04-23 16:43:50 +02:00
|
|
|
*pel = NULL;
|
2012-10-02 15:44:27 +02:00
|
|
|
return hres;
|
2008-04-23 16:43:50 +02:00
|
|
|
}
|
|
|
|
|
2012-10-02 15:44:27 +02:00
|
|
|
*pel = &elem->IHTMLElement_iface;
|
|
|
|
return S_OK;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElementCollection **pelColl)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2009-01-20 11:22:24 +01:00
|
|
|
nsIDOMNodeList *nslist;
|
2013-03-15 15:01:23 +01:00
|
|
|
nsAString id_str;
|
2009-01-20 11:22:24 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2009-01-20 11:22:24 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2010-01-28 23:55:51 +01:00
|
|
|
nsAString_InitDepend(&id_str, v);
|
2013-03-15 15:01:23 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
|
2009-01-20 11:22:24 +01:00
|
|
|
nsAString_Finish(&id_str);
|
|
|
|
if(FAILED(nsres)) {
|
|
|
|
ERR("GetElementByName failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-06-27 10:55:48 +02:00
|
|
|
*pelColl = create_collection_from_nodelist(This->doc_node, nslist);
|
2009-01-20 11:22:24 +01:00
|
|
|
nsIDOMNodeList_Release(nslist);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
|
|
|
|
HTMLDocument3_QueryInterface,
|
|
|
|
HTMLDocument3_AddRef,
|
|
|
|
HTMLDocument3_Release,
|
|
|
|
HTMLDocument3_GetTypeInfoCount,
|
|
|
|
HTMLDocument3_GetTypeInfo,
|
|
|
|
HTMLDocument3_GetIDsOfNames,
|
|
|
|
HTMLDocument3_Invoke,
|
|
|
|
HTMLDocument3_releaseCapture,
|
|
|
|
HTMLDocument3_recalc,
|
|
|
|
HTMLDocument3_createTextNode,
|
2006-03-05 20:41:18 +01:00
|
|
|
HTMLDocument3_get_documentElement,
|
2005-12-12 11:51:43 +01:00
|
|
|
HTMLDocument3_uniqueID,
|
|
|
|
HTMLDocument3_attachEvent,
|
|
|
|
HTMLDocument3_detachEvent,
|
|
|
|
HTMLDocument3_put_onrowsdelete,
|
|
|
|
HTMLDocument3_get_onrowsdelete,
|
|
|
|
HTMLDocument3_put_onrowsinserted,
|
|
|
|
HTMLDocument3_get_onrowsinserted,
|
|
|
|
HTMLDocument3_put_oncellchange,
|
|
|
|
HTMLDocument3_get_oncellchange,
|
|
|
|
HTMLDocument3_put_ondatasetchanged,
|
|
|
|
HTMLDocument3_get_ondatasetchanged,
|
|
|
|
HTMLDocument3_put_ondataavailable,
|
|
|
|
HTMLDocument3_get_ondataavailable,
|
|
|
|
HTMLDocument3_put_ondatasetcomplete,
|
|
|
|
HTMLDocument3_get_ondatasetcomplete,
|
|
|
|
HTMLDocument3_put_onpropertychange,
|
|
|
|
HTMLDocument3_get_onpropertychange,
|
|
|
|
HTMLDocument3_put_dir,
|
|
|
|
HTMLDocument3_get_dir,
|
|
|
|
HTMLDocument3_put_oncontextmenu,
|
|
|
|
HTMLDocument3_get_oncontextmenu,
|
|
|
|
HTMLDocument3_put_onstop,
|
|
|
|
HTMLDocument3_get_onstop,
|
|
|
|
HTMLDocument3_createDocumentFragment,
|
|
|
|
HTMLDocument3_get_parentDocument,
|
|
|
|
HTMLDocument3_put_enableDownload,
|
|
|
|
HTMLDocument3_get_enableDownload,
|
|
|
|
HTMLDocument3_put_baseUrl,
|
|
|
|
HTMLDocument3_get_baseUrl,
|
|
|
|
HTMLDocument3_get_childNodes,
|
|
|
|
HTMLDocument3_put_inheritStyleSheets,
|
|
|
|
HTMLDocument3_get_inheritStyleSheets,
|
|
|
|
HTMLDocument3_put_onbeforeeditfocus,
|
|
|
|
HTMLDocument3_get_onbeforeeditfocus,
|
|
|
|
HTMLDocument3_getElementsByName,
|
|
|
|
HTMLDocument3_getElementById,
|
|
|
|
HTMLDocument3_getElementsByTagName
|
|
|
|
};
|
|
|
|
|
2010-12-22 10:41:19 +01:00
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
|
|
|
|
}
|
2007-10-13 03:59:38 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_addref(This);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_release(This);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2008-10-13 21:49:37 +02:00
|
|
|
nsIDOMHTMLElement *nsbody;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
|
2008-10-13 21:49:37 +02:00
|
|
|
if(NS_FAILED(nsres) || !nsbody) {
|
|
|
|
ERR("GetBody failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2011-08-23 14:07:02 +02:00
|
|
|
nsres = nsIDOMHTMLElement_Focus(nsbody);
|
2008-10-13 21:49:37 +02:00
|
|
|
nsIDOMHTMLElement_Release(nsbody);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Focus failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, pfFocus);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2012-03-28 14:27:07 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-10-13 03:59:38 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
|
|
|
|
BSTR bstrOptions, IHTMLDocument2 **newDoc)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
|
|
|
|
VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2012-09-13 12:27:56 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
|
|
|
|
|
|
|
|
if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) {
|
|
|
|
FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return create_event_obj(ppEventObj);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
|
|
|
|
VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2012-09-13 12:29:17 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
|
|
|
|
|
|
|
|
return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
|
2007-10-13 03:59:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
|
|
|
|
IHTMLRenderStyle **ppIHTMLRenderStyle)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2012-03-28 14:27:07 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2007-10-13 03:59:38 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-22 10:41:19 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2007-10-13 03:59:38 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
|
|
|
|
HTMLDocument4_QueryInterface,
|
|
|
|
HTMLDocument4_AddRef,
|
|
|
|
HTMLDocument4_Release,
|
|
|
|
HTMLDocument4_GetTypeInfoCount,
|
|
|
|
HTMLDocument4_GetTypeInfo,
|
|
|
|
HTMLDocument4_GetIDsOfNames,
|
|
|
|
HTMLDocument4_Invoke,
|
|
|
|
HTMLDocument4_focus,
|
|
|
|
HTMLDocument4_hasFocus,
|
|
|
|
HTMLDocument4_put_onselectionchange,
|
|
|
|
HTMLDocument4_get_onselectionchange,
|
|
|
|
HTMLDocument4_get_namespace,
|
|
|
|
HTMLDocument4_createDocumentFromUrl,
|
|
|
|
HTMLDocument4_put_media,
|
|
|
|
HTMLDocument4_get_media,
|
|
|
|
HTMLDocument4_createEventObject,
|
|
|
|
HTMLDocument4_fireEvent,
|
|
|
|
HTMLDocument4_createRenderStyle,
|
|
|
|
HTMLDocument4_put_oncontrolselect,
|
|
|
|
HTMLDocument4_get_oncontrolselect,
|
|
|
|
HTMLDocument4_get_URLEncoded
|
|
|
|
};
|
|
|
|
|
2005-12-12 11:51:43 +01:00
|
|
|
void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
|
|
|
|
{
|
2010-12-22 10:39:41 +01:00
|
|
|
This->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
|
2010-12-22 10:41:19 +01:00
|
|
|
This->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
|
2005-12-12 11:51:43 +01:00
|
|
|
}
|