2005-03-31 12:08:02 +02:00
|
|
|
/*
|
2009-09-16 22:14:38 +02:00
|
|
|
* Copyright 2005-2009 Jacek Caban for CodeWeavers
|
2005-03-31 12:08:02 +02:00
|
|
|
*
|
|
|
|
* 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-03-31 12:08:02 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
2012-06-27 10:56:44 +02:00
|
|
|
#include <assert.h>
|
2005-03-31 12:08:02 +02:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
2009-12-01 22:50:43 +01:00
|
|
|
#include "wininet.h"
|
2005-03-31 12:08:02 +02:00
|
|
|
#include "ole2.h"
|
2009-02-26 11:39:36 +01:00
|
|
|
#include "perhist.h"
|
2009-09-29 00:11:28 +02:00
|
|
|
#include "mshtmdid.h"
|
2014-11-24 13:03:30 +01:00
|
|
|
#include "mshtmcid.h"
|
2005-03-31 12:08:02 +02:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2008-10-10 22:46:20 +02:00
|
|
|
#include "htmlevent.h"
|
2010-12-09 16:27:51 +01:00
|
|
|
#include "pluginhost.h"
|
2012-11-12 12:57:48 +01:00
|
|
|
#include "binding.h"
|
2005-03-31 12:08:02 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2015-01-05 19:28:45 +01:00
|
|
|
static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *doc_node, HTMLDocumentNode **ret);
|
|
|
|
|
2014-03-13 14:12:50 +01:00
|
|
|
HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
|
|
|
|
{
|
|
|
|
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) {
|
|
|
|
UINT16 pos;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2014-12-30 15:22:08 +01:00
|
|
|
UINT get_document_charset(HTMLDocumentNode *doc)
|
|
|
|
{
|
|
|
|
nsAString charset_str;
|
|
|
|
UINT ret = 0;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
if(doc->charset)
|
|
|
|
return doc->charset;
|
|
|
|
|
|
|
|
nsAString_Init(&charset_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetCharacterSet(doc->nsdoc, &charset_str);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
const PRUnichar *charset;
|
|
|
|
|
|
|
|
nsAString_GetData(&charset_str, &charset);
|
|
|
|
|
|
|
|
if(*charset) {
|
|
|
|
BSTR str = SysAllocString(charset);
|
|
|
|
ret = cp_from_charset_string(str);
|
|
|
|
SysFreeString(str);
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
ERR("GetCharset failed: %08x\n", nsres);
|
|
|
|
}
|
|
|
|
nsAString_Finish(&charset_str);
|
|
|
|
|
|
|
|
if(!ret)
|
|
|
|
return CP_UTF8;
|
|
|
|
|
|
|
|
return doc->charset = ret;
|
|
|
|
}
|
|
|
|
|
2010-12-16 14:59:51 +01:00
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument2_iface);
|
|
|
|
}
|
2005-08-01 12:59:45 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID riid, void **ppv)
|
2005-03-31 12:08:02 +02:00
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2005-03-31 12:08:02 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument_AddRef(IHTMLDocument2 *iface)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-16 22:06:31 +02:00
|
|
|
|
|
|
|
return htmldoc_addref(This);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2005-03-31 12:08:02 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
return htmldoc_release(This);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_GetTypeInfoCount(IHTMLDocument2 *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:22:12 +02:00
|
|
|
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_GetTypeInfo(IHTMLDocument2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:22:12 +02:00
|
|
|
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_GetIDsOfNames(IHTMLDocument2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:22:12 +02:00
|
|
|
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_Invoke(IHTMLDocument2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-01-04 01:49:05 +01:00
|
|
|
|
2010-12-31 11:02:05 +01:00
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-08-25 10:08:40 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
|
2008-08-25 10:08:40 +02:00
|
|
|
IDispatch_AddRef(*p);
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2007-10-04 02:13:01 +02:00
|
|
|
nsIDOMElement *nselem = NULL;
|
2010-12-01 12:52:08 +01:00
|
|
|
HTMLDOMNode *node;
|
2007-10-04 02:13:01 +02:00
|
|
|
nsresult nsres;
|
2010-12-01 12:52:08 +01:00
|
|
|
HRESULT hres;
|
2006-07-16 21:29:44 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:29:32 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
2007-10-04 02:13:01 +02:00
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
|
2008-10-08 20:29:32 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetDocumentElement failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
2007-10-04 02:13:01 +02:00
|
|
|
}
|
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
if(!nselem) {
|
2007-10-04 02:13:01 +02:00
|
|
|
*p = NULL;
|
2010-12-01 12:52:08 +01:00
|
|
|
return S_OK;
|
2007-10-04 02:13:01 +02:00
|
|
|
}
|
2006-07-16 21:29:44 +02:00
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
hres = get_node(This->doc_node, (nsIDOMNode*)nselem, TRUE, &node);
|
|
|
|
nsIDOMElement_Release(nselem);
|
2012-06-25 14:04:40 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*p = create_all_collection(node, TRUE);
|
|
|
|
node_release(node);
|
2010-12-01 12:52:08 +01:00
|
|
|
return hres;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2006-04-28 19:58:38 +02:00
|
|
|
nsIDOMHTMLElement *nsbody = NULL;
|
|
|
|
HTMLDOMNode *node;
|
2010-12-01 12:52:08 +01:00
|
|
|
HRESULT hres;
|
2006-04-28 19:58:38 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-11-14 14:42:55 +01:00
|
|
|
if(This->doc_node->nsdoc) {
|
|
|
|
nsresult nsres;
|
2006-04-28 19:58:38 +02:00
|
|
|
|
2010-11-14 14:42:55 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
TRACE("Could not get body: %08x\n", nsres);
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
2006-04-28 19:58:38 +02:00
|
|
|
}
|
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
if(!nsbody) {
|
2008-10-08 20:28:43 +02:00
|
|
|
*p = NULL;
|
2010-12-01 12:52:08 +01:00
|
|
|
return S_OK;
|
2008-10-08 20:28:43 +02:00
|
|
|
}
|
2006-04-28 19:58:38 +02:00
|
|
|
|
2010-12-01 12:52:08 +01:00
|
|
|
hres = get_node(This->doc_node, (nsIDOMNode*)nsbody, TRUE, &node);
|
|
|
|
nsIDOMHTMLElement_Release(nsbody);
|
|
|
|
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-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2014-02-14 11:20:14 +01:00
|
|
|
nsIDOMElement *nselem;
|
|
|
|
HTMLElement *elem;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NOTE: Gecko may return an active element even if the document is not visible.
|
|
|
|
* IE returns NULL in this case.
|
|
|
|
*/
|
|
|
|
nsres = nsIDOMHTMLDocument_GetActiveElement(This->doc_node->nsdoc, &nselem);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetActiveElement failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2014-12-24 14:13:23 +01:00
|
|
|
if(!nselem) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2014-02-14 11:20:14 +01:00
|
|
|
hres = get_elem(This->doc_node, nselem, &elem);
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*p = &elem->IHTMLElement_iface;
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-11-18 09:47:45 +01:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-11-18 09:47:45 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetImages(This->doc_node->nsdoc, &nscoll);
|
2008-11-18 09:47:45 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetImages failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
2012-07-26 11:37:48 +02:00
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
2008-11-18 09:47:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-11-23 11:01:17 +01:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-11-23 11:01:17 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetApplets(This->doc_node->nsdoc, &nscoll);
|
2008-11-23 11:01:17 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetApplets failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
2012-07-26 11:37:48 +02:00
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
2008-11-23 11:01:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-11-23 11:02:17 +01:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-11-23 11:02:17 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetLinks(This->doc_node->nsdoc, &nscoll);
|
2008-11-23 11:02:17 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetLinks failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
2012-07-26 11:37:48 +02:00
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
2008-11-23 11:02:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-11-23 11:02:49 +01:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-11-23 11:02:49 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetForms(This->doc_node->nsdoc, &nscoll);
|
2008-11-23 11:02:49 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetForms failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
2012-07-26 11:37:48 +02:00
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
2008-11-23 11:02:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-11-23 11:03:55 +01:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-11-23 11:03:55 +01:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetAnchors(This->doc_node->nsdoc, &nscoll);
|
2008-11-23 11:03:55 +01:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetAnchors failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
2012-06-27 10:55:48 +02:00
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
2012-07-26 11:37:48 +02:00
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
2008-11-23 11:03:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-07-23 13:16:39 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:28:51 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
2008-07-23 13:16:39 +02:00
|
|
|
}
|
|
|
|
|
2010-01-28 23:55:51 +01:00
|
|
|
nsAString_InitDepend(&nsstr, v);
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_SetTitle(This->doc_node->nsdoc, &nsstr);
|
2008-07-23 13:16:39 +02:00
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetTitle failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-07-23 13:16:57 +02:00
|
|
|
const PRUnichar *ret;
|
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:28:59 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
2008-07-23 13:16:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_GetTitle(This->doc_node->nsdoc, &nsstr);
|
2008-10-08 20:28:59 +02:00
|
|
|
if (NS_SUCCEEDED(nsres)) {
|
|
|
|
nsAString_GetData(&nsstr, &ret);
|
|
|
|
*p = SysAllocString(ret);
|
|
|
|
}
|
|
|
|
nsAString_Finish(&nsstr);
|
2008-07-23 13:16:57 +02:00
|
|
|
|
2008-10-08 20:28:59 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
2008-07-23 13:16:57 +02:00
|
|
|
ERR("GetTitle failed: %08x\n", nsres);
|
2008-10-08 20:28:59 +02:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
2008-07-23 13:16:57 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_scripts(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2013-08-28 14:35:12 +02:00
|
|
|
nsIDOMHTMLCollection *nscoll = NULL;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLDocument_GetScripts(This->doc_node->nsdoc, &nscoll);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetImages failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nscoll) {
|
|
|
|
*p = create_collection_from_htmlcol(This->doc_node, nscoll);
|
|
|
|
nsIDOMHTMLCollection_Release(nscoll);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2013-04-23 12:58:18 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR onW[] = {'o','n',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
if(strcmpiW(v, onW)) {
|
|
|
|
FIXME("Unsupported arg %s\n", debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = setup_edit_mode(This->doc_obj);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2013-08-30 12:56:41 +02:00
|
|
|
call_property_onchanged(&This->cp_container, DISPID_IHTMLDOCUMENT2_DESIGNMODE);
|
2013-04-23 12:58:18 +02:00
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2013-12-16 23:26:12 +01:00
|
|
|
static const WCHAR szOff[] = {'O','f','f',0};
|
2008-10-30 10:46:39 +01:00
|
|
|
FIXME("(%p)->(%p) always returning Off\n", This, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = SysAllocString(szOff);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-16 22:06:56 +02:00
|
|
|
nsISelection *nsselection;
|
|
|
|
nsresult nsres;
|
2006-07-05 22:37:39 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2009-09-16 22:06:56 +02:00
|
|
|
nsres = nsIDOMWindow_GetSelection(This->window->nswindow, &nsselection);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetSelection failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
2006-07-05 22:37:39 +02:00
|
|
|
}
|
|
|
|
|
2009-09-16 22:09:42 +02:00
|
|
|
return HTMLSelectionObject_Create(This->doc_node, nsselection, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2006-09-27 16:37:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", iface, p);
|
|
|
|
|
|
|
|
if(!p)
|
|
|
|
return E_POINTER;
|
|
|
|
|
2014-10-09 16:08:15 +02:00
|
|
|
return get_readystate_string(This->window->readystate, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_frames(IHTMLDocument2 *iface, IHTMLFramesCollection2 **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-02-08 15:58:21 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
return IHTMLWindow2_get_frames(&This->window->base.IHTMLWindow2_iface, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_embeds(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_plugins(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_alinkColor(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_alinkColor(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_bgColor(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_bgColor(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_fgColor(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_fgColor(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_linkColor(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_linkColor(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_vlinkColor(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2010-03-13 16:45:30 +01:00
|
|
|
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2010-03-13 16:45:30 +01:00
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2005-03-31 12:08:02 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-03-26 15:23:41 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2010-11-14 14:43:06 +01:00
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
return IHTMLWindow2_get_location(&This->window->base.IHTMLWindow2_iface, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_URL(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-04-17 12:10:26 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
if(!This->window) {
|
|
|
|
FIXME("No window available\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-11-12 12:57:48 +01:00
|
|
|
return navigate_url(This->window, v, This->window->uri, BINDING_NAVIGATED);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_URL(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2007-06-11 17:37:20 +02:00
|
|
|
|
|
|
|
static const WCHAR about_blank_url[] =
|
|
|
|
{'a','b','o','u','t',':','b','l','a','n','k',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", iface, p);
|
|
|
|
|
2009-10-26 23:04:28 +01:00
|
|
|
*p = SysAllocString(This->window->url ? This->window->url : about_blank_url);
|
2009-09-16 22:12:06 +02:00
|
|
|
return *p ? S_OK : E_OUTOFMEMORY;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_domain(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2016-06-21 15:12:25 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, v);
|
|
|
|
nsres = nsIDOMHTMLDocument_SetDomain(This->doc_node->nsdoc, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetDomain failed: %08x\n", nsres);
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_domain(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2016-06-21 15:12:25 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
2012-03-29 15:05:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2016-06-21 15:12:25 +02:00
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetDomain(This->doc_node->nsdoc, &nsstr);
|
|
|
|
if(NS_SUCCEEDED(nsres) && This->window && This->window->uri) {
|
|
|
|
const PRUnichar *str;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
nsAString_GetData(&nsstr, &str);
|
|
|
|
if(!*str) {
|
|
|
|
TRACE("Gecko returned emptry string, fallback to loaded URL.\n");
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
hres = IUri_GetHost(This->window->uri, p);
|
|
|
|
return FAILED(hres) ? hres : S_OK;
|
|
|
|
}
|
2012-03-29 15:05:43 +02:00
|
|
|
}
|
|
|
|
|
2016-06-21 15:12:25 +02:00
|
|
|
return return_nsstr(nsres, &nsstr, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_cookie(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-01 22:51:11 +01:00
|
|
|
BOOL bret;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
bret = InternetSetCookieExW(This->window->url, NULL, v, 0, 0);
|
|
|
|
if(!bret) {
|
|
|
|
FIXME("InternetSetCookieExW failed: %u\n", GetLastError());
|
|
|
|
return HRESULT_FROM_WIN32(GetLastError());
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_cookie(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-01 22:50:43 +01:00
|
|
|
DWORD size;
|
|
|
|
BOOL bret;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
size = 0;
|
|
|
|
bret = InternetGetCookieExW(This->window->url, NULL, NULL, &size, 0, NULL);
|
|
|
|
if(!bret) {
|
|
|
|
switch(GetLastError()) {
|
|
|
|
case ERROR_INSUFFICIENT_BUFFER:
|
|
|
|
break;
|
|
|
|
case ERROR_NO_MORE_ITEMS:
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
default:
|
|
|
|
FIXME("InternetGetCookieExW failed: %u\n", GetLastError());
|
|
|
|
return HRESULT_FROM_WIN32(GetLastError());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!size) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2013-04-24 11:50:23 +02:00
|
|
|
*p = SysAllocStringLen(NULL, size/sizeof(WCHAR)-1);
|
2009-12-01 22:50:43 +01:00
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
bret = InternetGetCookieExW(This->window->url, NULL, *p, &size, 0, NULL);
|
|
|
|
if(!bret) {
|
|
|
|
ERR("InternetGetCookieExW failed: %u\n", GetLastError());
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_expando(IHTMLDocument2 *iface, VARIANT_BOOL v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_expando(IHTMLDocument2 *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_charset(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_charset(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-09-24 14:10:50 +02:00
|
|
|
nsAString charset_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
FIXME("NULL nsdoc\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Init(&charset_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetCharacterSet(This->doc_node->nsdoc, &charset_str);
|
|
|
|
return return_nsstr(nsres, &charset_str, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_defaultCharset(IHTMLDocument2 *iface, BSTR v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_defaultCharset(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2016-01-12 14:42:46 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = charset_string_from_cp(GetACP());
|
|
|
|
return *p ? S_OK : E_OUTOFMEMORY;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_mimeType(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_fileSize(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_fileCreatedDate(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_fileModifiedDate(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_fileUpdatedDate(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_security(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_protocol(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-09-02 12:27:43 +02:00
|
|
|
static HRESULT document_write(HTMLDocument *This, SAFEARRAY *psarray, BOOL ln)
|
2005-03-31 12:08:02 +02:00
|
|
|
{
|
2012-04-23 12:48:58 +02:00
|
|
|
VARIANT *var, tmp;
|
2013-04-29 10:47:19 +02:00
|
|
|
JSContext *jsctx;
|
2008-03-07 12:56:33 +01:00
|
|
|
nsAString nsstr;
|
2009-09-02 12:27:43 +02:00
|
|
|
ULONG i, argc;
|
2008-03-07 12:56:33 +01:00
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:29:08 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2010-02-09 16:54:03 +01:00
|
|
|
if (!psarray)
|
|
|
|
return S_OK;
|
|
|
|
|
2008-03-07 12:56:33 +01:00
|
|
|
if(psarray->cDims != 1) {
|
|
|
|
FIXME("cDims=%d\n", psarray->cDims);
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = SafeArrayAccessData(psarray, (void**)&var);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
WARN("SafeArrayAccessData failed: %08x\n", hres);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2012-04-23 12:48:58 +02:00
|
|
|
V_VT(&tmp) = VT_EMPTY;
|
2008-03-07 12:56:33 +01:00
|
|
|
|
2013-04-29 10:47:19 +02:00
|
|
|
jsctx = get_context_from_document(This->doc_node->nsdoc);
|
2009-09-02 12:27:43 +02:00
|
|
|
argc = psarray->rgsabound[0].cElements;
|
|
|
|
for(i=0; i < argc; i++) {
|
2008-03-07 12:56:33 +01:00
|
|
|
if(V_VT(var+i) == VT_BSTR) {
|
2012-04-23 12:48:58 +02:00
|
|
|
nsAString_InitDepend(&nsstr, V_BSTR(var+i));
|
2008-03-07 12:56:33 +01:00
|
|
|
}else {
|
2012-05-14 11:33:10 +02:00
|
|
|
hres = VariantChangeTypeEx(&tmp, var+i, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, VT_BSTR);
|
2012-04-23 12:48:58 +02:00
|
|
|
if(FAILED(hres)) {
|
|
|
|
WARN("Could not convert %s to string\n", debugstr_variant(var+i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
nsAString_InitDepend(&nsstr, V_BSTR(&tmp));
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!ln || i != argc-1)
|
2013-04-29 10:47:19 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_Write(This->doc_node->nsdoc, &nsstr, jsctx);
|
2012-04-23 12:48:58 +02:00
|
|
|
else
|
2013-04-29 10:47:19 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_Writeln(This->doc_node->nsdoc, &nsstr, jsctx);
|
2012-04-23 12:48:58 +02:00
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(V_VT(var+i) != VT_BSTR)
|
|
|
|
VariantClear(&tmp);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Write failed: %08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
|
|
|
break;
|
2008-03-07 12:56:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SafeArrayUnaccessData(psarray);
|
|
|
|
|
2012-04-23 12:48:58 +02:00
|
|
|
return hres;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
2009-09-02 12:27:43 +02:00
|
|
|
static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-02 12:27:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", iface, psarray);
|
|
|
|
|
|
|
|
return document_write(This, psarray, FALSE);
|
|
|
|
}
|
|
|
|
|
2005-03-31 12:08:02 +02:00
|
|
|
static HRESULT WINAPI HTMLDocument_writeln(IHTMLDocument2 *iface, SAFEARRAY *psarray)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-02 12:27:43 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, psarray);
|
|
|
|
|
|
|
|
return document_write(This, psarray, TRUE);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT name,
|
|
|
|
VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2011-11-09 18:11:42 +01:00
|
|
|
nsISupports *tmp;
|
2008-10-10 22:48:46 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name),
|
|
|
|
debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-10 22:48:46 +02:00
|
|
|
ERR("!nsdoc\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!url || strcmpW(url, text_htmlW) || V_VT(&name) != VT_ERROR
|
|
|
|
|| V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR)
|
|
|
|
FIXME("unsupported args\n");
|
|
|
|
|
2013-04-29 10:47:19 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_Open(This->doc_node->nsdoc, NULL, NULL, NULL,
|
|
|
|
get_context_from_document(This->doc_node->nsdoc), 0, &tmp);
|
2008-10-10 22:48:46 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Open failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2011-11-09 18:11:42 +01:00
|
|
|
if(tmp)
|
|
|
|
nsISupports_Release(tmp);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*pomWindowResult = (IDispatch*)&This->window->base.IHTMLWindow2_iface;
|
|
|
|
IHTMLWindow2_AddRef(&This->window->base.IHTMLWindow2_iface);
|
2008-10-10 22:48:46 +02:00
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:48:46 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-10 22:48:46 +02:00
|
|
|
ERR("!nsdoc\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
nsres = nsIDOMHTMLDocument_Close(This->doc_node->nsdoc);
|
2008-10-10 22:48:46 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Close failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2010-05-07 15:20:10 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
2011-11-09 18:11:42 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_Clear(This->doc_node->nsdoc);
|
2010-05-07 15:20:10 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Clear failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
2014-12-10 18:59:04 +01:00
|
|
|
static const WCHAR copyW[] =
|
|
|
|
{'c','o','p','y',0};
|
|
|
|
static const WCHAR cutW[] =
|
|
|
|
{'c','u','t',0};
|
2014-11-26 14:55:45 +01:00
|
|
|
static const WCHAR fontnameW[] =
|
|
|
|
{'f','o','n','t','n','a','m','e',0};
|
2015-02-13 17:54:15 +01:00
|
|
|
static const WCHAR fontsizeW[] =
|
|
|
|
{'f','o','n','t','s','i','z','e',0};
|
2014-12-01 12:55:34 +01:00
|
|
|
static const WCHAR indentW[] =
|
|
|
|
{'i','n','d','e','n','t',0};
|
2014-11-24 13:03:30 +01:00
|
|
|
static const WCHAR insertorderedlistW[] =
|
|
|
|
{'i','n','s','e','r','t','o','r','d','e','r','e','d','l','i','s','t',0};
|
|
|
|
static const WCHAR insertunorderedlistW[] =
|
|
|
|
{'i','n','s','e','r','t','u','n','o','r','d','e','r','e','d','l','i','s','t',0};
|
|
|
|
static const WCHAR outdentW[] =
|
|
|
|
{'o','u','t','d','e','n','t',0};
|
2014-12-10 18:59:04 +01:00
|
|
|
static const WCHAR pasteW[] =
|
|
|
|
{'p','a','s','t','e',0};
|
2014-11-24 13:03:30 +01:00
|
|
|
static const WCHAR respectvisibilityindesignW[] =
|
|
|
|
{'r','e','s','p','e','c','t','v','i','s','i','b','i','l','i','t','y','i','n','d','e','s','i','g','n',0};
|
|
|
|
|
|
|
|
static const struct {
|
|
|
|
const WCHAR *name;
|
|
|
|
OLECMDID id;
|
|
|
|
}command_names[] = {
|
2014-12-10 18:59:04 +01:00
|
|
|
{copyW, IDM_COPY},
|
|
|
|
{cutW, IDM_CUT},
|
2014-11-26 14:55:45 +01:00
|
|
|
{fontnameW, IDM_FONTNAME},
|
2015-02-13 17:54:15 +01:00
|
|
|
{fontsizeW, IDM_FONTSIZE},
|
2014-12-01 12:55:34 +01:00
|
|
|
{indentW, IDM_INDENT},
|
2014-11-24 13:03:30 +01:00
|
|
|
{insertorderedlistW, IDM_ORDERLIST},
|
|
|
|
{insertunorderedlistW, IDM_UNORDERLIST},
|
|
|
|
{outdentW, IDM_OUTDENT},
|
2014-12-10 18:59:04 +01:00
|
|
|
{pasteW, IDM_PASTE},
|
2014-11-24 13:03:30 +01:00
|
|
|
{respectvisibilityindesignW, IDM_RESPECTVISIBILITY_INDESIGN}
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL cmdid_from_string(const WCHAR *str, OLECMDID *cmdid)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i = 0; i < sizeof(command_names)/sizeof(*command_names); i++) {
|
|
|
|
if(!strcmpiW(command_names[i].name, str)) {
|
|
|
|
*cmdid = command_names[i].id;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("Unknown command %s\n", debugstr_w(str));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2005-03-31 12:08:02 +02:00
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandEnabled(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandState(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandIndeterm(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandText(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
BSTR *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_queryCommandValue(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_execCommand(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL showUI, VARIANT value, VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2014-11-24 13:03:30 +01:00
|
|
|
OLECMDID cmdid;
|
|
|
|
VARIANT ret;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %x %s %p)\n", This, debugstr_w(cmdID), showUI, debugstr_variant(&value), pfRet);
|
|
|
|
|
|
|
|
if(!cmdid_from_string(cmdID, &cmdid))
|
|
|
|
return OLECMDERR_E_NOTSUPPORTED;
|
|
|
|
|
|
|
|
V_VT(&ret) = VT_EMPTY;
|
|
|
|
hres = IOleCommandTarget_Exec(&This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid,
|
|
|
|
showUI ? 0 : OLECMDEXECOPT_DONTPROMPTUSER, &value, &ret);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(V_VT(&ret) != VT_EMPTY) {
|
|
|
|
FIXME("Handle ret %s\n", debugstr_variant(&ret));
|
|
|
|
VariantClear(&ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
*pfRet = VARIANT_TRUE;
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_execCommandShowHelp(IHTMLDocument2 *iface, BSTR cmdID,
|
|
|
|
VARIANT_BOOL *pfRet)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(cmdID), pfRet);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTag,
|
2007-10-13 03:58:55 +02:00
|
|
|
IHTMLElement **newElem)
|
2005-03-31 12:08:02 +02:00
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-06-19 23:14:03 +02:00
|
|
|
HTMLElement *elem;
|
2009-10-19 23:04:19 +02:00
|
|
|
HRESULT hres;
|
2008-06-19 23:14:03 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
|
|
|
|
|
2012-10-11 14:07:44 +02:00
|
|
|
hres = create_element(This->doc_node, eTag, &elem);
|
2010-12-01 22:42:51 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
2008-06-19 23:14:03 +02:00
|
|
|
|
2010-12-30 01:24:59 +01:00
|
|
|
*newElem = &elem->IHTMLElement_iface;
|
2008-06-19 23:14:03 +02:00
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onhelp(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onclick(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-06 19:00:02 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_CLICK, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onclick(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-09-06 19:00:02 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_CLICK, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_ondblclick(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2015-02-03 16:19:55 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_DBLCLICK, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2015-02-03 16:19:55 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_DBLCLICK, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_KEYUP, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_KEYUP, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_KEYDOWN, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_KEYDOWN, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-04-10 12:53:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_KEYPRESS, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onkeypress(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-04-10 12:53:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_KEYPRESS, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onmouseup(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:15:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_MOUSEUP, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onmouseup(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:15:20 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_MOUSEUP, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onmousedown(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:18:45 +01:00
|
|
|
|
2012-03-28 14:26:34 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2009-12-22 23:18:45 +01:00
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_MOUSEDOWN, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onmousedown(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:18:45 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_MOUSEDOWN, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onmousemove(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2011-02-21 10:23:48 +01:00
|
|
|
|
2012-03-28 14:26:34 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2011-02-21 10:23:48 +01:00
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_MOUSEMOVE, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onmousemove(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2011-02-21 10:23:48 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_MOUSEMOVE, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onmouseout(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:21:04 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_MOUSEOUT, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-22 23:21:04 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_MOUSEOUT, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:46:20 +02:00
|
|
|
|
2012-03-28 14:26:34 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-10-10 22:46:20 +02:00
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_MOUSEOVER, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:46:32 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_MOUSEOVER, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-08 01:19:15 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_READYSTATECHANGE, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onreadystatechange(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2009-12-08 01:19:15 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_READYSTATECHANGE, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onafterupdate(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onafterupdate(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onrowexit(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onrowexit(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onrowenter(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_DRAGSTART, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_DRAGSTART, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_SELECTSTART, &v);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-10-10 22:49:25 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_SELECTSTART, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
2009-03-12 01:43:31 +01:00
|
|
|
static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, LONG x, LONG y,
|
2005-03-31 12:08:02 +02:00
|
|
|
IHTMLElement **elementHit)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2011-10-18 15:07:50 +02:00
|
|
|
nsIDOMElement *nselem;
|
|
|
|
HTMLDOMNode *node;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d %d %p)\n", This, x, y, elementHit);
|
|
|
|
|
2011-11-09 18:11:42 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_ElementFromPoint(This->doc_node->nsdoc, x, y, &nselem);
|
2011-10-18 15:07:50 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("ElementFromPoint failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!nselem) {
|
|
|
|
*elementHit = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
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**)elementHit);
|
|
|
|
node_release(node);
|
|
|
|
return hres;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2006-12-06 18:21:16 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
*p = &This->window->base.IHTMLWindow2_iface;
|
2006-12-06 18:21:16 +01:00
|
|
|
IHTMLWindow2_AddRef(*p);
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
|
2007-09-19 13:09:35 +02:00
|
|
|
IHTMLStyleSheetsCollection **p)
|
2005-03-31 12:08:02 +02:00
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2007-09-19 13:09:35 +02:00
|
|
|
nsIDOMStyleSheetList *nsstylelist;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
|
2009-10-21 21:27:42 +02:00
|
|
|
if(!This->doc_node->nsdoc) {
|
2008-10-08 20:29:24 +02:00
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
2007-09-19 13:09:35 +02:00
|
|
|
}
|
|
|
|
|
2011-11-09 18:11:42 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_GetStyleSheets(This->doc_node->nsdoc, &nsstylelist);
|
2008-10-08 20:29:24 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetStyleSheets failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2007-09-19 13:09:35 +02:00
|
|
|
|
|
|
|
*p = HTMLStyleSheetsCollection_Create(nsstylelist);
|
2011-11-09 18:11:42 +01:00
|
|
|
nsIDOMStyleSheetList_Release(nsstylelist);
|
2007-09-19 13:09:35 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onbeforeupdate(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onbeforeupdate(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_put_onerrorupdate(IHTMLDocument2 *iface, VARIANT v)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-03-28 14:26:34 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2008-04-21 18:21:33 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2005-03-31 12:08:02 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2014-05-31 13:51:07 +02:00
|
|
|
|
|
|
|
static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, String);
|
|
|
|
|
|
|
|
if(!String)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*String = SysAllocString(objectW);
|
|
|
|
return *String ? S_OK : E_OUTOFMEMORY;
|
|
|
|
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
|
2009-03-12 01:43:31 +01:00
|
|
|
LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet)
|
2005-03-31 12:08:02 +02:00
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2(iface);
|
2012-10-11 14:08:03 +02:00
|
|
|
nsIDOMHTMLHeadElement *head_elem;
|
|
|
|
IHTMLStyleElement *style_elem;
|
|
|
|
HTMLElement *elem;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
2006-11-17 13:08:09 +01:00
|
|
|
|
2012-10-11 14:08:03 +02:00
|
|
|
static const WCHAR styleW[] = {'s','t','y','l','e',0};
|
2006-11-17 13:08:09 +01:00
|
|
|
|
2012-10-11 14:08:03 +02:00
|
|
|
TRACE("(%p)->(%s %d %p)\n", This, debugstr_w(bstrHref), lIndex, ppnewStyleSheet);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
FIXME("not a real doc object\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(lIndex != -1)
|
|
|
|
FIXME("Unsupported lIndex %d\n", lIndex);
|
|
|
|
|
2014-12-23 17:07:18 +01:00
|
|
|
if(bstrHref && *bstrHref) {
|
2012-10-11 14:08:03 +02:00
|
|
|
FIXME("semi-stub for href %s\n", debugstr_w(bstrHref));
|
|
|
|
*ppnewStyleSheet = HTMLStyleSheet_Create(NULL);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = create_element(This->doc_node, styleW, &elem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLDocument_GetHead(This->doc_node->nsdoc, &head_elem);
|
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
2014-09-30 10:14:06 +02:00
|
|
|
nsIDOMNode *head_node, *tmp_node;
|
2012-10-11 14:08:03 +02:00
|
|
|
|
2014-09-30 10:14:06 +02:00
|
|
|
nsres = nsIDOMHTMLHeadElement_QueryInterface(head_elem, &IID_nsIDOMNode, (void**)&head_node);
|
2012-10-11 14:08:03 +02:00
|
|
|
nsIDOMHTMLHeadElement_Release(head_elem);
|
2014-09-30 10:14:06 +02:00
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
nsres = nsIDOMNode_AppendChild(head_node, elem->node.nsnode, &tmp_node);
|
|
|
|
nsIDOMNode_Release(head_node);
|
2012-10-11 14:08:03 +02:00
|
|
|
if(NS_SUCCEEDED(nsres) && tmp_node)
|
|
|
|
nsIDOMNode_Release(tmp_node);
|
|
|
|
}
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
IHTMLElement_Release(&elem->IHTMLElement_iface);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IHTMLElement_QueryInterface(&elem->IHTMLElement_iface, &IID_IHTMLStyleElement, (void**)&style_elem);
|
|
|
|
assert(hres == S_OK);
|
|
|
|
IHTMLElement_Release(&elem->IHTMLElement_iface);
|
|
|
|
|
|
|
|
hres = IHTMLStyleElement_get_styleSheet(style_elem, ppnewStyleSheet);
|
|
|
|
IHTMLStyleElement_Release(style_elem);
|
|
|
|
return hres;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|
|
|
|
|
2005-06-01 21:57:42 +02:00
|
|
|
static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
|
2005-03-31 12:08:02 +02:00
|
|
|
HTMLDocument_QueryInterface,
|
|
|
|
HTMLDocument_AddRef,
|
|
|
|
HTMLDocument_Release,
|
|
|
|
HTMLDocument_GetTypeInfoCount,
|
|
|
|
HTMLDocument_GetTypeInfo,
|
|
|
|
HTMLDocument_GetIDsOfNames,
|
|
|
|
HTMLDocument_Invoke,
|
|
|
|
HTMLDocument_get_Script,
|
|
|
|
HTMLDocument_get_all,
|
|
|
|
HTMLDocument_get_body,
|
|
|
|
HTMLDocument_get_activeElement,
|
|
|
|
HTMLDocument_get_images,
|
|
|
|
HTMLDocument_get_applets,
|
|
|
|
HTMLDocument_get_links,
|
|
|
|
HTMLDocument_get_forms,
|
|
|
|
HTMLDocument_get_anchors,
|
|
|
|
HTMLDocument_put_title,
|
|
|
|
HTMLDocument_get_title,
|
|
|
|
HTMLDocument_get_scripts,
|
|
|
|
HTMLDocument_put_designMode,
|
|
|
|
HTMLDocument_get_designMode,
|
|
|
|
HTMLDocument_get_selection,
|
|
|
|
HTMLDocument_get_readyState,
|
|
|
|
HTMLDocument_get_frames,
|
|
|
|
HTMLDocument_get_embeds,
|
|
|
|
HTMLDocument_get_plugins,
|
|
|
|
HTMLDocument_put_alinkColor,
|
|
|
|
HTMLDocument_get_alinkColor,
|
|
|
|
HTMLDocument_put_bgColor,
|
|
|
|
HTMLDocument_get_bgColor,
|
|
|
|
HTMLDocument_put_fgColor,
|
|
|
|
HTMLDocument_get_fgColor,
|
|
|
|
HTMLDocument_put_linkColor,
|
|
|
|
HTMLDocument_get_linkColor,
|
|
|
|
HTMLDocument_put_vlinkColor,
|
|
|
|
HTMLDocument_get_vlinkColor,
|
|
|
|
HTMLDocument_get_referrer,
|
|
|
|
HTMLDocument_get_location,
|
|
|
|
HTMLDocument_get_lastModified,
|
|
|
|
HTMLDocument_put_URL,
|
|
|
|
HTMLDocument_get_URL,
|
|
|
|
HTMLDocument_put_domain,
|
|
|
|
HTMLDocument_get_domain,
|
|
|
|
HTMLDocument_put_cookie,
|
|
|
|
HTMLDocument_get_cookie,
|
|
|
|
HTMLDocument_put_expando,
|
|
|
|
HTMLDocument_get_expando,
|
|
|
|
HTMLDocument_put_charset,
|
|
|
|
HTMLDocument_get_charset,
|
|
|
|
HTMLDocument_put_defaultCharset,
|
|
|
|
HTMLDocument_get_defaultCharset,
|
|
|
|
HTMLDocument_get_mimeType,
|
|
|
|
HTMLDocument_get_fileSize,
|
|
|
|
HTMLDocument_get_fileCreatedDate,
|
|
|
|
HTMLDocument_get_fileModifiedDate,
|
|
|
|
HTMLDocument_get_fileUpdatedDate,
|
|
|
|
HTMLDocument_get_security,
|
|
|
|
HTMLDocument_get_protocol,
|
|
|
|
HTMLDocument_get_nameProp,
|
|
|
|
HTMLDocument_write,
|
|
|
|
HTMLDocument_writeln,
|
|
|
|
HTMLDocument_open,
|
|
|
|
HTMLDocument_close,
|
|
|
|
HTMLDocument_clear,
|
|
|
|
HTMLDocument_queryCommandSupported,
|
|
|
|
HTMLDocument_queryCommandEnabled,
|
|
|
|
HTMLDocument_queryCommandState,
|
|
|
|
HTMLDocument_queryCommandIndeterm,
|
|
|
|
HTMLDocument_queryCommandText,
|
|
|
|
HTMLDocument_queryCommandValue,
|
|
|
|
HTMLDocument_execCommand,
|
|
|
|
HTMLDocument_execCommandShowHelp,
|
|
|
|
HTMLDocument_createElement,
|
|
|
|
HTMLDocument_put_onhelp,
|
|
|
|
HTMLDocument_get_onhelp,
|
|
|
|
HTMLDocument_put_onclick,
|
|
|
|
HTMLDocument_get_onclick,
|
|
|
|
HTMLDocument_put_ondblclick,
|
|
|
|
HTMLDocument_get_ondblclick,
|
|
|
|
HTMLDocument_put_onkeyup,
|
|
|
|
HTMLDocument_get_onkeyup,
|
|
|
|
HTMLDocument_put_onkeydown,
|
|
|
|
HTMLDocument_get_onkeydown,
|
|
|
|
HTMLDocument_put_onkeypress,
|
|
|
|
HTMLDocument_get_onkeypress,
|
|
|
|
HTMLDocument_put_onmouseup,
|
|
|
|
HTMLDocument_get_onmouseup,
|
|
|
|
HTMLDocument_put_onmousedown,
|
|
|
|
HTMLDocument_get_onmousedown,
|
|
|
|
HTMLDocument_put_onmousemove,
|
|
|
|
HTMLDocument_get_onmousemove,
|
|
|
|
HTMLDocument_put_onmouseout,
|
|
|
|
HTMLDocument_get_onmouseout,
|
|
|
|
HTMLDocument_put_onmouseover,
|
|
|
|
HTMLDocument_get_onmouseover,
|
|
|
|
HTMLDocument_put_onreadystatechange,
|
|
|
|
HTMLDocument_get_onreadystatechange,
|
|
|
|
HTMLDocument_put_onafterupdate,
|
|
|
|
HTMLDocument_get_onafterupdate,
|
|
|
|
HTMLDocument_put_onrowexit,
|
|
|
|
HTMLDocument_get_onrowexit,
|
|
|
|
HTMLDocument_put_onrowenter,
|
|
|
|
HTMLDocument_get_onrowenter,
|
|
|
|
HTMLDocument_put_ondragstart,
|
|
|
|
HTMLDocument_get_ondragstart,
|
|
|
|
HTMLDocument_put_onselectstart,
|
|
|
|
HTMLDocument_get_onselectstart,
|
|
|
|
HTMLDocument_elementFromPoint,
|
|
|
|
HTMLDocument_get_parentWindow,
|
|
|
|
HTMLDocument_get_styleSheets,
|
|
|
|
HTMLDocument_put_onbeforeupdate,
|
|
|
|
HTMLDocument_get_onbeforeupdate,
|
|
|
|
HTMLDocument_put_onerrorupdate,
|
|
|
|
HTMLDocument_get_onerrorupdate,
|
|
|
|
HTMLDocument_toString,
|
|
|
|
HTMLDocument_createStyleSheet
|
|
|
|
};
|
|
|
|
|
2014-03-13 14:12:50 +01:00
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
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 = impl_from_IHTMLDocument3(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2014-10-17 16:58:39 +02:00
|
|
|
|
|
|
|
WARN("(%p)->(%x)\n", This, fForce);
|
|
|
|
|
|
|
|
/* Doing nothing here should be fine for us. */
|
|
|
|
return S_OK;
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
|
|
|
|
IHTMLDOMNode **newTextNode)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
nsIDOMText *nstext;
|
|
|
|
HTMLDOMNode *node;
|
|
|
|
nsAString text_str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
|
|
|
|
nsIDOMText_Release(nstext);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*newTextNode = &node->IHTMLDOMNode_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
nsIDOMElement *nselem = NULL;
|
|
|
|
HTMLDOMNode *node;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
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) {
|
|
|
|
*p = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
|
|
|
|
nsIDOMElement_Release(nselem);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
|
|
|
|
node_release(node);
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
2016-01-06 18:39:39 +01:00
|
|
|
static HRESULT WINAPI HTMLDocument3_get_uniqueID(IHTMLDocument3 *iface, BSTR *p)
|
2014-03-13 14:12:50 +01:00
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
2016-01-06 18:39:39 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2016-01-11 14:01:57 +01:00
|
|
|
return elem_unique_id(++This->doc_node->unique_id, p);
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
|
|
|
|
IDispatch* pDisp, VARIANT_BOOL *pfResult)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
|
|
|
|
|
2015-05-20 19:46:53 +02:00
|
|
|
return attach_event(&This->doc_node->node.event_target, event, pDisp, pfResult);
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
|
|
|
|
IDispatch *pDisp)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
|
|
|
|
|
2015-05-20 19:47:00 +02:00
|
|
|
return detach_event(&This->doc_node->node.event_target, event, pDisp);
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
|
|
|
return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return get_doc_event(This, EVENTID_CONTEXTMENU, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
|
|
|
|
IHTMLDocument2 **ppNewDoc)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
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;
|
|
|
|
|
|
|
|
*ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
|
|
|
|
IHTMLDocument2 **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
|
|
|
|
VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElementCollection **ppelColl)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
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);
|
2014-11-03 12:39:59 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &selector_str, &node_list);
|
2014-03-13 14:12:50 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElement **pel)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
HTMLElement *elem;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
|
|
|
|
|
|
|
hres = get_doc_elem_by_id(This->doc_node, v, &elem);
|
|
|
|
if(FAILED(hres) || !elem) {
|
|
|
|
*pel = NULL;
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pel = &elem->IHTMLElement_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
|
|
|
|
IHTMLElementCollection **pelColl)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument3(iface);
|
|
|
|
nsIDOMNodeList *nslist;
|
|
|
|
nsAString id_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
|
|
|
|
|
2015-11-19 12:14:59 +01:00
|
|
|
if(This->doc_node->nsdoc) {
|
|
|
|
nsAString_InitDepend(&id_str, v);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
|
|
|
|
nsAString_Finish(&id_str);
|
|
|
|
if(FAILED(nsres)) {
|
|
|
|
ERR("GetElementByName failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
nsIDOMDocumentFragment *docfrag;
|
|
|
|
nsAString nsstr;
|
|
|
|
|
|
|
|
if(v) {
|
|
|
|
const WCHAR *ptr;
|
|
|
|
for(ptr=v; *ptr; ptr++) {
|
|
|
|
if(!isalnumW(*ptr)) {
|
|
|
|
FIXME("Unsupported invalid tag %s\n", debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-03-13 14:12:50 +01:00
|
|
|
|
2015-11-19 12:14:59 +01:00
|
|
|
nsres = nsIDOMNode_QueryInterface(This->doc_node->node.nsnode, &IID_nsIDOMDocumentFragment, (void**)&docfrag);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Could not get nsIDOMDocumentFragment iface: %08x\n", nsres);
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, v);
|
|
|
|
nsres = nsIDOMDocumentFragment_QuerySelectorAll(docfrag, &nsstr, &nslist);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
nsIDOMDocumentFragment_Release(docfrag);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("QuerySelectorAll failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
2015-11-19 12:14:59 +01:00
|
|
|
|
2014-03-13 14:12:50 +01:00
|
|
|
*pelColl = create_collection_from_nodelist(This->doc_node, nslist);
|
|
|
|
nsIDOMNodeList_Release(nslist);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
|
|
|
|
HTMLDocument3_QueryInterface,
|
|
|
|
HTMLDocument3_AddRef,
|
|
|
|
HTMLDocument3_Release,
|
|
|
|
HTMLDocument3_GetTypeInfoCount,
|
|
|
|
HTMLDocument3_GetTypeInfo,
|
|
|
|
HTMLDocument3_GetIDsOfNames,
|
|
|
|
HTMLDocument3_Invoke,
|
|
|
|
HTMLDocument3_releaseCapture,
|
|
|
|
HTMLDocument3_recalc,
|
|
|
|
HTMLDocument3_createTextNode,
|
|
|
|
HTMLDocument3_get_documentElement,
|
2016-01-06 18:39:39 +01:00
|
|
|
HTMLDocument3_get_uniqueID,
|
2014-03-13 14:12:50 +01:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
nsIDOMHTMLElement *nsbody;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->()\n", This);
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
|
|
|
|
if(NS_FAILED(nsres) || !nsbody) {
|
|
|
|
ERR("GetBody failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLElement_Focus(nsbody);
|
|
|
|
nsIDOMHTMLElement_Release(nsbody);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("Focus failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
2016-01-06 15:05:42 +01:00
|
|
|
cpp_bool has_focus;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pfFocus);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
FIXME("Unimplemented for fragments.\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLDocument_HasFocus(This->doc_node->nsdoc, &has_focus);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
|
|
|
*pfFocus = has_focus ? VARIANT_TRUE : VARIANT_FALSE;
|
|
|
|
return S_OK;
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
|
|
|
|
BSTR bstrOptions, IHTMLDocument2 **newDoc)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
|
|
|
|
VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
|
|
|
|
VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
|
|
|
|
|
|
|
|
return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
|
|
|
|
IHTMLRenderStyle **ppIHTMLRenderStyle)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument4(iface);
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
2014-08-22 14:48:37 +02:00
|
|
|
HTMLDocumentNode *doc_node = This->doc_node;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!doc_node->dom_implementation) {
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = create_dom_implementation(&doc_node->dom_implementation);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
IHTMLDOMImplementation_AddRef(doc_node->dom_implementation);
|
|
|
|
*p = doc_node->dom_implementation;
|
|
|
|
return S_OK;
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
|
|
|
|
IHTMLDOMAttribute **ppattribute)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
HTMLDOMAttribute *attr;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
|
|
|
|
|
|
|
|
hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*ppattribute = &attr->IHTMLDOMAttribute_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
|
|
|
|
IHTMLDOMNode **ppRetNode)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
nsIDOMComment *nscomment;
|
|
|
|
HTMLElement *elem;
|
|
|
|
nsAString str;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_InitDepend(&str, bstrdata);
|
|
|
|
nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
|
|
|
|
nsAString_Finish(&str);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("CreateTextNode failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
|
|
|
|
nsIDOMComment_Release(nscomment);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*ppRetNode = &elem->node.IHTMLDOMNode_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument5(iface);
|
|
|
|
nsAString mode_str;
|
2015-02-27 17:31:48 +01:00
|
|
|
nsresult nsres;
|
2014-03-13 14:12:50 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(!This->doc_node->nsdoc) {
|
|
|
|
WARN("NULL nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Init(&mode_str, NULL);
|
2015-02-27 17:31:48 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
|
|
|
|
return return_nsstr(nsres, &mode_str, p);
|
2014-03-13 14:12:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
|
|
|
|
HTMLDocument5_QueryInterface,
|
|
|
|
HTMLDocument5_AddRef,
|
|
|
|
HTMLDocument5_Release,
|
|
|
|
HTMLDocument5_GetTypeInfoCount,
|
|
|
|
HTMLDocument5_GetTypeInfo,
|
|
|
|
HTMLDocument5_GetIDsOfNames,
|
|
|
|
HTMLDocument5_Invoke,
|
|
|
|
HTMLDocument5_put_onmousewheel,
|
|
|
|
HTMLDocument5_get_onmousewheel,
|
|
|
|
HTMLDocument5_get_doctype,
|
|
|
|
HTMLDocument5_get_implementation,
|
|
|
|
HTMLDocument5_createAttribute,
|
|
|
|
HTMLDocument5_createComment,
|
|
|
|
HTMLDocument5_put_onfocusin,
|
|
|
|
HTMLDocument5_get_onfocusin,
|
|
|
|
HTMLDocument5_put_onfocusout,
|
|
|
|
HTMLDocument5_get_onfocusout,
|
|
|
|
HTMLDocument5_put_onactivate,
|
|
|
|
HTMLDocument5_get_onactivate,
|
|
|
|
HTMLDocument5_put_ondeactivate,
|
|
|
|
HTMLDocument5_get_ondeactivate,
|
|
|
|
HTMLDocument5_put_onbeforeactivate,
|
|
|
|
HTMLDocument5_get_onbeforeactivate,
|
|
|
|
HTMLDocument5_put_onbeforedeactivate,
|
|
|
|
HTMLDocument5_get_onbeforedeactivate,
|
|
|
|
HTMLDocument5_get_compatMode
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
|
|
|
|
IHTMLDocumentCompatibleInfoCollection **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
|
|
|
|
VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
|
|
|
|
VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
|
|
|
|
VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
|
|
|
|
BSTR bstrId, IHTMLElement2 **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument6(iface);
|
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
|
|
|
|
HTMLDocument6_QueryInterface,
|
|
|
|
HTMLDocument6_AddRef,
|
|
|
|
HTMLDocument6_Release,
|
|
|
|
HTMLDocument6_GetTypeInfoCount,
|
|
|
|
HTMLDocument6_GetTypeInfo,
|
|
|
|
HTMLDocument6_GetIDsOfNames,
|
|
|
|
HTMLDocument6_Invoke,
|
|
|
|
HTMLDocument6_get_compatible,
|
|
|
|
HTMLDocument6_get_documentMode,
|
|
|
|
HTMLDocument6_put_onstorage,
|
|
|
|
HTMLDocument6_get_onstorage,
|
|
|
|
HTMLDocument6_put_onstoragecommit,
|
|
|
|
HTMLDocument6_get_onstoragecommit,
|
|
|
|
HTMLDocument6_getElementById,
|
|
|
|
HTMLDocument6_updateSettings
|
|
|
|
};
|
|
|
|
|
2014-03-13 14:13:11 +01:00
|
|
|
static inline HTMLDocument *impl_from_IHTMLDocument7(IHTMLDocument7 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument7_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createCDATASection(IHTMLDocument7 *iface, BSTR text, IHTMLDOMNode **newCDATASectionNode)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, newCDATASectionNode);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSelection **ppIHTMLSelection)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppIHTMLSelection);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
|
|
|
|
BSTR bstrLocalName, IHTMLElementCollection **pelColl)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrLocalName), pelColl);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrTag, IHTMLElement **newElem)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrTag), newElem);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createAttributeNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
|
|
|
|
BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrAttrName), ppAttribute);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_characterSet(IHTMLDocument7 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bstrTag, IHTMLElement **newElem)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_getElementByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_createProcessingInstruction(IHTMLDocument7 *iface, BSTR target,
|
|
|
|
BSTR data, IDOMProcessingInstruction **newProcessingInstruction)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), newProcessingInstruction);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_adoptNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, IHTMLDOMNode3 **ppNodeDest)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, pNodeSource, ppNodeDest);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementCollection **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_xmlEncoding(IHTMLDocument7 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_xmlVersion(IHTMLDocument7 *iface, BSTR v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_xmlVersion(IHTMLDocument7 *iface, BSTR *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_hasAttributes(IHTMLDocument7 *iface, VARIANT_BOOL *pfHasAttributes)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pfHasAttributes);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_oncanplay(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_oncanplay(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_oncanplaythrough(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_oncanplaythrough(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondragend(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondragend(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondragenter(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondragenter(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondragleave(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondragleave(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondragover(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondragover(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondrop(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondrop(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ondurationchange(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ondurationchange(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onemptied(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onemptied(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onended(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onended(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onloadeddata(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onloadeddata(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onloadedmetadata(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onloadedmetadata(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onloadstart(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onloadstart(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onpause(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onpause(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onplay(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onplay(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onplaying(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onplaying(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onprogress(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onprogress(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onratechange(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onratechange(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onreset(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onreset(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onseekend(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onseekend(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onseeking(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onseeking(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onselect(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onselect(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onstalled(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onstalled(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onsubmit(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onsubmit(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onsuspend(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onsuspend(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_ontimeupdate(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_ontimeupdate(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onvolumechange(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onvolumechange(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_onwaiting(IHTMLDocument7 *iface, VARIANT v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_onwaiting(IHTMLDocument7 *iface, VARIANT *p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_normalize(IHTMLDocument7 *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_importNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource,
|
|
|
|
VARIANT_BOOL fDeep, IHTMLDOMNode3 **ppNodeDest)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p %x %p)\n", This, pNodeSource, fDeep, ppNodeDest);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_put_body(IHTMLDocument7 *iface, IHTMLElement *v)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_body(IHTMLDocument7 *iface, IHTMLElement **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement **p)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument7(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLDocument7Vtbl HTMLDocument7Vtbl = {
|
|
|
|
HTMLDocument7_QueryInterface,
|
|
|
|
HTMLDocument7_AddRef,
|
|
|
|
HTMLDocument7_Release,
|
|
|
|
HTMLDocument7_GetTypeInfoCount,
|
|
|
|
HTMLDocument7_GetTypeInfo,
|
|
|
|
HTMLDocument7_GetIDsOfNames,
|
|
|
|
HTMLDocument7_Invoke,
|
|
|
|
HTMLDocument7_get_defaultView,
|
|
|
|
HTMLDocument7_createCDATASection,
|
|
|
|
HTMLDocument7_getSelection,
|
|
|
|
HTMLDocument7_getElementsByTagNameNS,
|
|
|
|
HTMLDocument7_createElementNS,
|
|
|
|
HTMLDocument7_createAttributeNS,
|
|
|
|
HTMLDocument7_put_onmsthumbnailclick,
|
|
|
|
HTMLDocument7_get_onmsthumbnailclick,
|
|
|
|
HTMLDocument7_get_characterSet,
|
|
|
|
HTMLDocument7_createElement,
|
|
|
|
HTMLDocument7_createAttribute,
|
|
|
|
HTMLDocument7_getElementByClassName,
|
|
|
|
HTMLDocument7_createProcessingInstruction,
|
|
|
|
HTMLDocument7_adoptNode,
|
|
|
|
HTMLDocument7_put_onmssitemodejumplistitemremoved,
|
|
|
|
HTMLDocument7_get_onmssitemodejumplistitemremoved,
|
|
|
|
HTMLDocument7_get_all,
|
|
|
|
HTMLDocument7_get_inputEncoding,
|
|
|
|
HTMLDocument7_get_xmlEncoding,
|
|
|
|
HTMLDocument7_put_xmlStandalone,
|
|
|
|
HTMLDocument7_get_xmlStandalone,
|
|
|
|
HTMLDocument7_put_xmlVersion,
|
|
|
|
HTMLDocument7_get_xmlVersion,
|
|
|
|
HTMLDocument7_hasAttributes,
|
|
|
|
HTMLDocument7_put_onabort,
|
|
|
|
HTMLDocument7_get_onabort,
|
|
|
|
HTMLDocument7_put_onblur,
|
|
|
|
HTMLDocument7_get_onblur,
|
|
|
|
HTMLDocument7_put_oncanplay,
|
|
|
|
HTMLDocument7_get_oncanplay,
|
|
|
|
HTMLDocument7_put_oncanplaythrough,
|
|
|
|
HTMLDocument7_get_oncanplaythrough,
|
|
|
|
HTMLDocument7_put_onchange,
|
|
|
|
HTMLDocument7_get_onchange,
|
|
|
|
HTMLDocument7_put_ondrag,
|
|
|
|
HTMLDocument7_get_ondrag,
|
|
|
|
HTMLDocument7_put_ondragend,
|
|
|
|
HTMLDocument7_get_ondragend,
|
|
|
|
HTMLDocument7_put_ondragenter,
|
|
|
|
HTMLDocument7_get_ondragenter,
|
|
|
|
HTMLDocument7_put_ondragleave,
|
|
|
|
HTMLDocument7_get_ondragleave,
|
|
|
|
HTMLDocument7_put_ondragover,
|
|
|
|
HTMLDocument7_get_ondragover,
|
|
|
|
HTMLDocument7_put_ondrop,
|
|
|
|
HTMLDocument7_get_ondrop,
|
|
|
|
HTMLDocument7_put_ondurationchange,
|
|
|
|
HTMLDocument7_get_ondurationchange,
|
|
|
|
HTMLDocument7_put_onemptied,
|
|
|
|
HTMLDocument7_get_onemptied,
|
|
|
|
HTMLDocument7_put_onended,
|
|
|
|
HTMLDocument7_get_onended,
|
|
|
|
HTMLDocument7_put_onerror,
|
|
|
|
HTMLDocument7_get_onerror,
|
|
|
|
HTMLDocument7_put_onfocus,
|
|
|
|
HTMLDocument7_get_onfocus,
|
|
|
|
HTMLDocument7_put_oninput,
|
|
|
|
HTMLDocument7_get_oninput,
|
|
|
|
HTMLDocument7_put_onload,
|
|
|
|
HTMLDocument7_get_onload,
|
|
|
|
HTMLDocument7_put_onloadeddata,
|
|
|
|
HTMLDocument7_get_onloadeddata,
|
|
|
|
HTMLDocument7_put_onloadedmetadata,
|
|
|
|
HTMLDocument7_get_onloadedmetadata,
|
|
|
|
HTMLDocument7_put_onloadstart,
|
|
|
|
HTMLDocument7_get_onloadstart,
|
|
|
|
HTMLDocument7_put_onpause,
|
|
|
|
HTMLDocument7_get_onpause,
|
|
|
|
HTMLDocument7_put_onplay,
|
|
|
|
HTMLDocument7_get_onplay,
|
|
|
|
HTMLDocument7_put_onplaying,
|
|
|
|
HTMLDocument7_get_onplaying,
|
|
|
|
HTMLDocument7_put_onprogress,
|
|
|
|
HTMLDocument7_get_onprogress,
|
|
|
|
HTMLDocument7_put_onratechange,
|
|
|
|
HTMLDocument7_get_onratechange,
|
|
|
|
HTMLDocument7_put_onreset,
|
|
|
|
HTMLDocument7_get_onreset,
|
|
|
|
HTMLDocument7_put_onscroll,
|
|
|
|
HTMLDocument7_get_onscroll,
|
|
|
|
HTMLDocument7_put_onseekend,
|
|
|
|
HTMLDocument7_get_onseekend,
|
|
|
|
HTMLDocument7_put_onseeking,
|
|
|
|
HTMLDocument7_get_onseeking,
|
|
|
|
HTMLDocument7_put_onselect,
|
|
|
|
HTMLDocument7_get_onselect,
|
|
|
|
HTMLDocument7_put_onstalled,
|
|
|
|
HTMLDocument7_get_onstalled,
|
|
|
|
HTMLDocument7_put_onsubmit,
|
|
|
|
HTMLDocument7_get_onsubmit,
|
|
|
|
HTMLDocument7_put_onsuspend,
|
|
|
|
HTMLDocument7_get_onsuspend,
|
|
|
|
HTMLDocument7_put_ontimeupdate,
|
|
|
|
HTMLDocument7_get_ontimeupdate,
|
|
|
|
HTMLDocument7_put_onvolumechange,
|
|
|
|
HTMLDocument7_get_onvolumechange,
|
|
|
|
HTMLDocument7_put_onwaiting,
|
|
|
|
HTMLDocument7_get_onwaiting,
|
|
|
|
HTMLDocument7_normalize,
|
|
|
|
HTMLDocument7_importNode,
|
|
|
|
HTMLDocument7_get_parentWindow,
|
|
|
|
HTMLDocument7_put_body,
|
|
|
|
HTMLDocument7_get_body,
|
|
|
|
HTMLDocument7_get_head
|
|
|
|
};
|
|
|
|
|
2016-06-15 17:44:00 +02:00
|
|
|
static inline HTMLDocument *impl_from_IDocumentSelector(IDocumentSelector *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IDocumentSelector_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_QueryInterface(IDocumentSelector *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DocumentSelector_AddRef(IDocumentSelector *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DocumentSelector_Release(IDocumentSelector *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_GetTypeInfoCount(IDocumentSelector *iface, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_GetTypeInfo(IDocumentSelector *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_GetIDsOfNames(IDocumentSelector *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_Invoke(IDocumentSelector *iface, DISPID dispIdMember, REFIID riid,
|
|
|
|
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
|
|
|
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_querySelector(IDocumentSelector *iface, BSTR v, IHTMLElement **pel)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocumentSelector_querySelectorAll(IDocumentSelector *iface, BSTR v, IHTMLDOMChildrenCollection **pel)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IDocumentSelector(iface);
|
2016-06-15 17:44:11 +02:00
|
|
|
nsIDOMNodeList *node_list;
|
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
|
|
|
|
|
|
|
nsAString_InitDepend(&nsstr, v);
|
|
|
|
nsres = nsIDOMHTMLDocument_QuerySelectorAll(This->doc_node->nsdoc, &nsstr, &node_list);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("QuerySelectorAll failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pel = create_child_collection(This->doc_node, node_list);
|
|
|
|
nsIDOMNodeList_Release(node_list);
|
|
|
|
return *pel ? S_OK : E_OUTOFMEMORY;
|
2016-06-15 17:44:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IDocumentSelectorVtbl DocumentSelectorVtbl = {
|
|
|
|
DocumentSelector_QueryInterface,
|
|
|
|
DocumentSelector_AddRef,
|
|
|
|
DocumentSelector_Release,
|
|
|
|
DocumentSelector_GetTypeInfoCount,
|
|
|
|
DocumentSelector_GetTypeInfo,
|
|
|
|
DocumentSelector_GetIDsOfNames,
|
|
|
|
DocumentSelector_Invoke,
|
|
|
|
DocumentSelector_querySelector,
|
|
|
|
DocumentSelector_querySelectorAll
|
|
|
|
};
|
|
|
|
|
2010-01-04 00:37:47 +01:00
|
|
|
static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp)
|
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
HTMLDocument *This = impl_from_IHTMLDocument2((IHTMLDocument2*)iface);
|
2010-01-04 00:37:47 +01:00
|
|
|
|
|
|
|
if(This->window)
|
2015-05-15 17:59:35 +02:00
|
|
|
update_doc_cp_events(This->doc_node, cp);
|
2010-01-04 00:37:47 +01:00
|
|
|
}
|
|
|
|
|
2010-12-27 01:48:10 +01:00
|
|
|
static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface);
|
|
|
|
}
|
2009-01-19 00:03:03 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 01:48:10 +01:00
|
|
|
HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
2009-01-19 00:03:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
|
|
|
|
{
|
2010-12-27 01:48:10 +01:00
|
|
|
HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_addref(This);
|
2009-01-19 00:03:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
|
|
|
|
{
|
2010-12-27 01:48:10 +01:00
|
|
|
HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_release(This);
|
2009-01-19 00:03:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid)
|
|
|
|
{
|
2014-05-08 11:48:32 +02:00
|
|
|
FIXME("(%p)->(%s)\n", iface, debugstr_mshtml_guid(riid));
|
2009-01-19 00:03:03 +01:00
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = {
|
|
|
|
SupportErrorInfo_QueryInterface,
|
|
|
|
SupportErrorInfo_AddRef,
|
|
|
|
SupportErrorInfo_Release,
|
|
|
|
SupportErrorInfo_InterfaceSupportsErrorInfo
|
|
|
|
};
|
|
|
|
|
2010-12-31 11:02:05 +01:00
|
|
|
static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IDispatchEx_iface);
|
|
|
|
}
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2011-05-31 12:19:04 +02:00
|
|
|
static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, BSTR name, DISPID *dispid)
|
|
|
|
{
|
|
|
|
nsIDOMNodeList *node_list;
|
|
|
|
nsAString name_str;
|
2013-01-23 18:44:42 +01:00
|
|
|
UINT32 len;
|
2011-05-31 12:19:04 +02:00
|
|
|
unsigned i;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
if(!This->nsdoc)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
|
|
|
nsAString_InitDepend(&name_str, name);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetElementsByName(This->nsdoc, &name_str, &node_list);
|
|
|
|
nsAString_Finish(&name_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
nsres = nsIDOMNodeList_GetLength(node_list, &len);
|
|
|
|
nsIDOMNodeList_Release(node_list);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
if(!len)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
|
|
|
for(i=0; i < This->elem_vars_cnt; i++) {
|
|
|
|
if(!strcmpW(name, This->elem_vars[i])) {
|
|
|
|
*dispid = MSHTML_DISPID_CUSTOM_MIN+i;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(This->elem_vars_cnt == This->elem_vars_size) {
|
|
|
|
WCHAR **new_vars;
|
|
|
|
|
|
|
|
if(This->elem_vars_size) {
|
|
|
|
new_vars = heap_realloc(This->elem_vars, This->elem_vars_size*2*sizeof(WCHAR*));
|
|
|
|
if(!new_vars)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
This->elem_vars_size *= 2;
|
|
|
|
}else {
|
|
|
|
new_vars = heap_alloc(16*sizeof(WCHAR*));
|
|
|
|
if(!new_vars)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
This->elem_vars_size = 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
This->elem_vars = new_vars;
|
|
|
|
}
|
|
|
|
|
|
|
|
This->elem_vars[This->elem_vars_cnt] = heap_strdupW(name);
|
|
|
|
if(!This->elem_vars[This->elem_vars_cnt])
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
*dispid = MSHTML_DISPID_CUSTOM_MIN+This->elem_vars_cnt++;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2008-04-21 18:21:54 +02:00
|
|
|
static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_addref(This);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2010-12-16 14:59:51 +01:00
|
|
|
return htmldoc_release(This);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetTypeInfoCount(This->dispex, pctinfo);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetTypeInfo(This->dispex, iTInfo, lcid, ppTInfo);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetIDsOfNames(This->dispex, riid, rgszNames, cNames, lcid, rgDispId);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
switch(dispIdMember) {
|
|
|
|
case DISPID_READYSTATE:
|
|
|
|
TRACE("DISPID_READYSTATE\n");
|
|
|
|
|
|
|
|
if(!(wFlags & DISPATCH_PROPERTYGET))
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
V_VT(pVarResult) = VT_I4;
|
2009-11-01 19:25:13 +01:00
|
|
|
V_I4(pVarResult) = This->window->readystate;
|
2008-04-21 18:21:54 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_Invoke(This->dispex, dispIdMember, riid, lcid, wFlags, pDispParams,
|
2008-04-21 18:21:54 +02:00
|
|
|
pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2011-05-31 12:19:04 +02:00
|
|
|
HRESULT hres;
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2011-05-31 12:19:04 +02:00
|
|
|
hres = IDispatchEx_GetDispID(This->dispex, bstrName, grfdex, pid);
|
|
|
|
if(hres != DISP_E_UNKNOWNNAME)
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
return dispid_from_elem_name(This->doc_node, bstrName, pid);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
|
|
|
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2010-03-13 16:45:45 +01:00
|
|
|
if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT))
|
2012-06-25 14:04:59 +02:00
|
|
|
return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION,
|
2010-12-31 11:03:45 +01:00
|
|
|
lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
2010-03-13 16:45:45 +01:00
|
|
|
|
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_DeleteMemberByName(This->dispex, bstrName, grfdex);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_DeleteMemberByDispID(This->dispex, id);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetMemberProperties(This->dispex, id, grfdexFetch, pgrfdex);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetMemberName(This->dispex, id, pbstrName);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetNextDispID(This->dispex, grfdex, id, pid);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
|
|
|
|
{
|
2010-12-31 11:02:05 +01:00
|
|
|
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
2008-04-21 18:21:54 +02:00
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
return IDispatchEx_GetNameSpaceParent(This->dispex, ppunk);
|
2008-04-21 18:21:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IDispatchExVtbl DocDispatchExVtbl = {
|
|
|
|
DocDispatchEx_QueryInterface,
|
|
|
|
DocDispatchEx_AddRef,
|
|
|
|
DocDispatchEx_Release,
|
|
|
|
DocDispatchEx_GetTypeInfoCount,
|
|
|
|
DocDispatchEx_GetTypeInfo,
|
|
|
|
DocDispatchEx_GetIDsOfNames,
|
|
|
|
DocDispatchEx_Invoke,
|
|
|
|
DocDispatchEx_GetDispID,
|
|
|
|
DocDispatchEx_InvokeEx,
|
|
|
|
DocDispatchEx_DeleteMemberByName,
|
|
|
|
DocDispatchEx_DeleteMemberByDispID,
|
|
|
|
DocDispatchEx_GetMemberProperties,
|
|
|
|
DocDispatchEx_GetMemberName,
|
|
|
|
DocDispatchEx_GetNextDispID,
|
|
|
|
DocDispatchEx_GetNameSpaceParent
|
|
|
|
};
|
|
|
|
|
2011-07-11 16:27:28 +02:00
|
|
|
static inline HTMLDocument *impl_from_IProvideClassInfo(IProvideClassInfo *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocument, IProvideClassInfo_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
|
|
|
return htmldoc_query_interface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
|
|
|
return htmldoc_addref(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo *iface)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
|
|
|
return htmldoc_release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo* iface,
|
|
|
|
ITypeInfo **ppTI)
|
|
|
|
{
|
|
|
|
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
2011-07-15 13:09:44 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, ppTI);
|
|
|
|
return get_htmldoc_classinfo(ppTI);
|
2011-07-11 16:27:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IProvideClassInfoVtbl ProvideClassInfoVtbl = {
|
|
|
|
ProvideClassInfo_QueryInterface,
|
|
|
|
ProvideClassInfo_AddRef,
|
|
|
|
ProvideClassInfo_Release,
|
|
|
|
ProvideClassInfo_GetClassInfo
|
|
|
|
};
|
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
|
2009-09-16 22:06:31 +02:00
|
|
|
{
|
|
|
|
*ppv = NULL;
|
|
|
|
|
2014-04-28 11:06:08 +02:00
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid))
|
2010-12-16 14:59:51 +01:00
|
|
|
*ppv = &This->IHTMLDocument2_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IDispatch, riid))
|
2010-12-31 11:02:05 +01:00
|
|
|
*ppv = &This->IDispatchEx_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IDispatchEx, riid))
|
2010-12-31 11:02:05 +01:00
|
|
|
*ppv = &This->IDispatchEx_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument, riid))
|
2010-12-16 14:59:51 +01:00
|
|
|
*ppv = &This->IHTMLDocument2_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument2, riid))
|
2010-12-16 14:59:51 +01:00
|
|
|
*ppv = &This->IHTMLDocument2_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument3, riid))
|
2010-12-22 10:39:41 +01:00
|
|
|
*ppv = &This->IHTMLDocument3_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument4, riid))
|
2010-12-22 10:41:19 +01:00
|
|
|
*ppv = &This->IHTMLDocument4_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument5, riid))
|
2010-12-22 10:43:37 +01:00
|
|
|
*ppv = &This->IHTMLDocument5_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument6, riid))
|
2010-12-22 10:45:14 +01:00
|
|
|
*ppv = &This->IHTMLDocument6_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHTMLDocument7, riid))
|
2014-03-13 14:13:11 +01:00
|
|
|
*ppv = &This->IHTMLDocument7_iface;
|
2016-06-15 17:44:00 +02:00
|
|
|
else if(IsEqualGUID(&IID_IDocumentSelector, riid))
|
|
|
|
*ppv = &This->IDocumentSelector_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IPersist, riid))
|
2010-12-22 10:48:41 +01:00
|
|
|
*ppv = &This->IPersistFile_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IPersistMoniker, riid))
|
2010-12-22 10:48:41 +01:00
|
|
|
*ppv = &This->IPersistMoniker_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IPersistFile, riid))
|
2010-12-22 10:48:41 +01:00
|
|
|
*ppv = &This->IPersistFile_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IMonikerProp, riid))
|
2010-12-23 02:12:25 +01:00
|
|
|
*ppv = &This->IMonikerProp_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleObject, riid))
|
2010-12-23 02:16:00 +01:00
|
|
|
*ppv = &This->IOleObject_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleDocument, riid))
|
2010-12-23 02:17:39 +01:00
|
|
|
*ppv = &This->IOleDocument_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleDocumentView, riid))
|
2010-12-23 02:19:14 +01:00
|
|
|
*ppv = &This->IOleDocumentView_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid))
|
2010-12-23 02:20:05 +01:00
|
|
|
*ppv = &This->IOleInPlaceActiveObject_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IViewObject, riid))
|
2010-12-23 02:21:09 +01:00
|
|
|
*ppv = &This->IViewObjectEx_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IViewObject2, riid))
|
2010-12-23 02:21:09 +01:00
|
|
|
*ppv = &This->IViewObjectEx_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IViewObjectEx, riid))
|
2010-12-23 02:21:09 +01:00
|
|
|
*ppv = &This->IViewObjectEx_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleWindow, riid))
|
2010-12-23 02:20:05 +01:00
|
|
|
*ppv = &This->IOleInPlaceActiveObject_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleInPlaceObject, riid))
|
2010-12-23 02:22:21 +01:00
|
|
|
*ppv = &This->IOleInPlaceObjectWindowless_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid))
|
2010-12-23 02:22:21 +01:00
|
|
|
*ppv = &This->IOleInPlaceObjectWindowless_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IServiceProvider, riid))
|
2010-12-27 01:43:10 +01:00
|
|
|
*ppv = &This->IServiceProvider_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleCommandTarget, riid))
|
2010-12-27 01:44:54 +01:00
|
|
|
*ppv = &This->IOleCommandTarget_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IOleControl, riid))
|
2010-12-27 01:46:09 +01:00
|
|
|
*ppv = &This->IOleControl_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IHlinkTarget, riid))
|
2010-12-27 01:47:29 +01:00
|
|
|
*ppv = &This->IHlinkTarget_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IConnectionPointContainer, riid))
|
2011-01-03 01:02:57 +01:00
|
|
|
*ppv = &This->cp_container.IConnectionPointContainer_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IPersistStreamInit, riid))
|
2010-12-22 10:48:41 +01:00
|
|
|
*ppv = &This->IPersistStreamInit_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&DIID_DispHTMLDocument, riid))
|
2010-12-16 14:59:51 +01:00
|
|
|
*ppv = &This->IHTMLDocument2_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_ISupportErrorInfo, riid))
|
2010-12-27 01:48:10 +01:00
|
|
|
*ppv = &This->ISupportErrorInfo_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IPersistHistory, riid))
|
2010-12-22 10:48:41 +01:00
|
|
|
*ppv = &This->IPersistHistory_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else if(IsEqualGUID(&IID_IObjectWithSite, riid))
|
|
|
|
*ppv = &This->IObjectWithSite_iface;
|
|
|
|
else if(IsEqualGUID(&IID_IOleContainer, riid))
|
|
|
|
*ppv = &This->IOleContainer_iface;
|
|
|
|
else if(IsEqualGUID(&IID_IObjectSafety, riid))
|
|
|
|
*ppv = &This->IObjectSafety_iface;
|
|
|
|
else if(IsEqualGUID(&IID_IProvideClassInfo, riid))
|
|
|
|
*ppv = &This->IProvideClassInfo_iface;
|
|
|
|
else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
|
2009-09-16 22:06:31 +02:00
|
|
|
FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv);
|
2009-09-16 22:13:49 +02:00
|
|
|
*ppv = NULL;
|
2009-09-16 22:06:31 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv);
|
2009-09-16 22:13:49 +02:00
|
|
|
*ppv = NULL;
|
2009-09-16 22:06:31 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppv);
|
2009-09-16 22:13:49 +02:00
|
|
|
*ppv = NULL;
|
2009-09-16 22:06:31 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IMarshal, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This, ppv);
|
2009-09-16 22:13:49 +02:00
|
|
|
*ppv = NULL;
|
2010-02-18 16:31:01 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IExternalConnection, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IExternalConnection %p) returning NULL\n", This, ppv);
|
|
|
|
*ppv = NULL;
|
2010-02-22 17:19:31 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv);
|
|
|
|
*ppv = NULL;
|
2009-09-16 22:06:31 +02:00
|
|
|
}else {
|
2009-09-16 22:13:49 +02:00
|
|
|
return FALSE;
|
2009-09-16 22:06:31 +02:00
|
|
|
}
|
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
if(*ppv)
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return TRUE;
|
2009-09-16 22:06:31 +02:00
|
|
|
}
|
|
|
|
|
2010-01-04 00:37:47 +01:00
|
|
|
static cp_static_data_t HTMLDocumentEvents_data = { HTMLDocumentEvents_tid, HTMLDocument_on_advise };
|
2009-11-23 19:28:43 +01:00
|
|
|
|
2013-03-15 15:01:53 +01:00
|
|
|
static const cpc_entry_t HTMLDocument_cpc[] = {
|
|
|
|
{&IID_IDispatch, &HTMLDocumentEvents_data},
|
|
|
|
{&IID_IPropertyNotifySink},
|
|
|
|
{&DIID_HTMLDocumentEvents, &HTMLDocumentEvents_data},
|
|
|
|
{&DIID_HTMLDocumentEvents2},
|
|
|
|
{NULL}
|
|
|
|
};
|
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
|
2008-10-10 22:48:32 +02:00
|
|
|
{
|
2010-12-16 14:59:51 +01:00
|
|
|
doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl;
|
2014-03-13 14:12:50 +01:00
|
|
|
doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
|
|
|
|
doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
|
|
|
|
doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
|
|
|
|
doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl;
|
2014-03-13 14:13:11 +01:00
|
|
|
doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl;
|
2010-12-31 11:02:05 +01:00
|
|
|
doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl;
|
2016-06-15 17:44:00 +02:00
|
|
|
doc->IDocumentSelector_iface.lpVtbl = &DocumentSelectorVtbl;
|
2010-12-27 01:48:10 +01:00
|
|
|
doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl;
|
2011-07-11 16:27:28 +02:00
|
|
|
doc->IProvideClassInfo_iface.lpVtbl = &ProvideClassInfoVtbl;
|
2008-10-10 22:48:32 +02:00
|
|
|
|
2009-09-16 22:14:21 +02:00
|
|
|
doc->unk_impl = unk_impl;
|
2009-09-16 22:14:38 +02:00
|
|
|
doc->dispex = dispex;
|
2009-10-26 23:05:10 +01:00
|
|
|
doc->task_magic = get_task_target_magic();
|
2009-09-16 22:14:21 +02:00
|
|
|
|
2008-10-10 22:48:32 +02:00
|
|
|
HTMLDocument_Persist_Init(doc);
|
|
|
|
HTMLDocument_OleCmd_Init(doc);
|
|
|
|
HTMLDocument_OleObj_Init(doc);
|
|
|
|
HTMLDocument_View_Init(doc);
|
|
|
|
HTMLDocument_Window_Init(doc);
|
|
|
|
HTMLDocument_Service_Init(doc);
|
|
|
|
HTMLDocument_Hlink_Init(doc);
|
|
|
|
|
2013-03-15 15:01:53 +01:00
|
|
|
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocument_cpc);
|
2009-09-16 22:06:31 +02:00
|
|
|
}
|
2008-10-10 22:48:32 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
static void destroy_htmldoc(HTMLDocument *This)
|
|
|
|
{
|
2009-10-26 23:05:10 +01:00
|
|
|
remove_target_tasks(This->task_magic);
|
2009-09-16 22:06:31 +02:00
|
|
|
|
|
|
|
ConnectionPointContainer_Destroy(&This->cp_container);
|
|
|
|
}
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocumentNode, node);
|
|
|
|
}
|
2009-09-16 22:13:49 +02:00
|
|
|
|
|
|
|
static HRESULT HTMLDocumentNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
2009-09-16 22:13:49 +02:00
|
|
|
|
2014-04-28 11:06:08 +02:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
if(htmldoc_qi(&This->basedoc, riid, ppv))
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
|
2014-04-28 11:06:08 +02:00
|
|
|
if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid))
|
2011-01-03 01:01:38 +01:00
|
|
|
*ppv = &This->IInternetHostSecurityManager_iface;
|
2014-04-28 11:06:08 +02:00
|
|
|
else
|
2009-09-29 00:11:28 +02:00
|
|
|
return HTMLDOMNode_QI(&This->node, riid, ppv);
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2009-09-16 22:13:49 +02:00
|
|
|
}
|
|
|
|
|
2009-10-07 14:49:10 +02:00
|
|
|
static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
|
2009-09-16 22:13:49 +02:00
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
2011-05-31 12:19:04 +02:00
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
for(i=0; i < This->elem_vars_cnt; i++)
|
|
|
|
heap_free(This->elem_vars[i]);
|
|
|
|
heap_free(This->elem_vars);
|
2009-09-16 22:13:49 +02:00
|
|
|
|
2011-11-24 12:48:31 +01:00
|
|
|
detach_events(This);
|
2010-01-04 00:39:31 +01:00
|
|
|
if(This->body_event_target)
|
|
|
|
release_event_target(This->body_event_target);
|
2009-11-20 00:00:41 +01:00
|
|
|
if(This->catmgr)
|
|
|
|
ICatInformation_Release(This->catmgr);
|
2009-10-01 00:05:36 +02:00
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
detach_selection(This);
|
|
|
|
detach_ranges(This);
|
2009-10-21 21:27:42 +02:00
|
|
|
|
2010-12-13 16:00:37 +01:00
|
|
|
while(!list_empty(&This->plugin_hosts))
|
|
|
|
detach_plugin_host(LIST_ENTRY(list_head(&This->plugin_hosts), PluginHost, entry));
|
|
|
|
|
2014-05-27 11:28:44 +02:00
|
|
|
if(!This->nsdoc && This->window) {
|
2012-07-30 15:55:30 +02:00
|
|
|
/* document fragments own reference to inner window */
|
|
|
|
IHTMLWindow2_Release(&This->window->base.IHTMLWindow2_iface);
|
|
|
|
This->window = NULL;
|
2012-07-19 11:29:13 +02:00
|
|
|
}
|
2009-10-21 21:27:42 +02:00
|
|
|
|
2009-10-27 21:10:02 +01:00
|
|
|
heap_free(This->event_vector);
|
2009-09-16 22:13:49 +02:00
|
|
|
destroy_htmldoc(&This->basedoc);
|
|
|
|
}
|
|
|
|
|
2010-11-14 14:41:39 +01:00
|
|
|
static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
2010-11-14 14:41:39 +01:00
|
|
|
FIXME("%p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2012-07-19 11:29:13 +02:00
|
|
|
static void HTMLDocumentNode_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
|
|
|
{
|
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsdoc)
|
|
|
|
note_cc_edge((nsISupports*)This->nsdoc, "This->nsdoc", cb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void HTMLDocumentNode_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsdoc) {
|
|
|
|
nsIDOMHTMLDocument *nsdoc = This->nsdoc;
|
|
|
|
|
|
|
|
release_document_mutation(This);
|
|
|
|
This->nsdoc = NULL;
|
|
|
|
nsIDOMHTMLDocument_Release(nsdoc);
|
2012-07-30 15:55:30 +02:00
|
|
|
This->window = NULL;
|
2012-07-19 11:29:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
static const NodeImplVtbl HTMLDocumentNodeImplVtbl = {
|
|
|
|
HTMLDocumentNode_QI,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLDocumentNode_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLDocument_cpc,
|
2012-07-19 11:29:13 +02:00
|
|
|
HTMLDocumentNode_clone,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLDocumentNode_traverse,
|
|
|
|
HTMLDocumentNode_unlink
|
2009-09-16 22:13:49 +02:00
|
|
|
};
|
|
|
|
|
2010-11-14 14:43:18 +01:00
|
|
|
static HRESULT HTMLDocumentFragment_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface);
|
2010-11-14 14:43:18 +01:00
|
|
|
HTMLDocumentNode *new_node;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
hres = create_document_fragment(nsnode, This->node.doc, &new_node);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
*ret = &new_node->node;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2011-05-31 12:19:04 +02:00
|
|
|
static inline HTMLDocumentNode *impl_from_DispatchEx(DispatchEx *iface)
|
|
|
|
{
|
2015-05-14 13:24:19 +02:00
|
|
|
return CONTAINING_RECORD(iface, HTMLDocumentNode, node.event_target.dispex);
|
2011-05-31 12:19:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
|
|
|
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
|
|
|
{
|
|
|
|
HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
|
|
|
|
nsIDOMNodeList *node_list;
|
|
|
|
nsAString name_str;
|
|
|
|
nsIDOMNode *nsnode;
|
|
|
|
HTMLDOMNode *node;
|
|
|
|
unsigned i;
|
|
|
|
nsresult nsres;
|
|
|
|
HRESULT hres;
|
|
|
|
|
2012-09-10 14:41:09 +02:00
|
|
|
if(flags != DISPATCH_PROPERTYGET && flags != (DISPATCH_METHOD|DISPATCH_PROPERTYGET)) {
|
2011-05-31 12:19:04 +02:00
|
|
|
FIXME("unsupported flags %x\n", flags);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
i = id - MSHTML_DISPID_CUSTOM_MIN;
|
|
|
|
|
|
|
|
if(!This->nsdoc || i >= This->elem_vars_cnt)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
|
|
|
nsAString_InitDepend(&name_str, This->elem_vars[i]);
|
|
|
|
nsres = nsIDOMHTMLDocument_GetElementsByName(This->nsdoc, &name_str, &node_list);
|
|
|
|
nsAString_Finish(&name_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
nsres = nsIDOMNodeList_Item(node_list, 0, &nsnode);
|
|
|
|
nsIDOMNodeList_Release(node_list);
|
|
|
|
if(NS_FAILED(nsres) || !nsnode)
|
|
|
|
return DISP_E_UNKNOWNNAME;
|
|
|
|
|
|
|
|
hres = get_node(This, nsnode, TRUE, &node);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
V_VT(res) = VT_DISPATCH;
|
|
|
|
V_DISPATCH(res) = (IDispatch*)&node->IHTMLDOMNode_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-20 19:46:53 +02:00
|
|
|
static void HTMLDocumentNode_bind_event(DispatchEx *dispex, int eid)
|
|
|
|
{
|
|
|
|
HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
|
|
|
|
ensure_doc_nsevent_handler(This, eid);
|
|
|
|
}
|
2011-05-31 12:19:04 +02:00
|
|
|
|
|
|
|
static const dispex_static_data_vtbl_t HTMLDocumentNode_dispex_vtbl = {
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2011-08-23 11:33:18 +02:00
|
|
|
HTMLDocumentNode_invoke,
|
2015-05-20 19:46:53 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLDocumentNode_bind_event
|
2011-05-31 12:19:04 +02:00
|
|
|
};
|
|
|
|
|
2010-11-14 14:43:18 +01:00
|
|
|
static const NodeImplVtbl HTMLDocumentFragmentImplVtbl = {
|
|
|
|
HTMLDocumentNode_QI,
|
|
|
|
HTMLDocumentNode_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLDocument_cpc,
|
2010-11-14 14:43:18 +01:00
|
|
|
HTMLDocumentFragment_clone
|
|
|
|
};
|
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
static const tid_t HTMLDocumentNode_iface_tids[] = {
|
|
|
|
IHTMLDOMNode_tid,
|
|
|
|
IHTMLDOMNode2_tid,
|
|
|
|
IHTMLDocument2_tid,
|
|
|
|
IHTMLDocument3_tid,
|
|
|
|
IHTMLDocument4_tid,
|
|
|
|
IHTMLDocument5_tid,
|
2016-06-15 17:44:00 +02:00
|
|
|
IDocumentSelector_tid,
|
2009-09-16 22:14:38 +02:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLDocumentNode_dispex = {
|
2011-05-31 12:19:04 +02:00
|
|
|
&HTMLDocumentNode_dispex_vtbl,
|
2009-09-16 22:14:38 +02:00
|
|
|
DispHTMLDocument_tid,
|
|
|
|
NULL,
|
|
|
|
HTMLDocumentNode_iface_tids
|
|
|
|
};
|
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window)
|
2009-09-16 22:06:31 +02:00
|
|
|
{
|
|
|
|
HTMLDocumentNode *doc;
|
2005-03-31 12:08:02 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
doc = heap_alloc_zero(sizeof(HTMLDocumentNode));
|
|
|
|
if(!doc)
|
2010-11-14 14:42:20 +01:00
|
|
|
return NULL;
|
2009-09-16 22:06:31 +02:00
|
|
|
|
2010-11-14 14:42:20 +01:00
|
|
|
doc->ref = 1;
|
2009-09-16 22:07:58 +02:00
|
|
|
doc->basedoc.doc_node = doc;
|
|
|
|
doc->basedoc.doc_obj = doc_obj;
|
2012-07-30 15:55:30 +02:00
|
|
|
doc->basedoc.window = window->base.outer_window;
|
|
|
|
doc->window = window;
|
2009-09-16 22:07:58 +02:00
|
|
|
|
2015-05-14 13:24:19 +02:00
|
|
|
init_dispex(&doc->node.event_target.dispex, (IUnknown*)&doc->node.IHTMLDOMNode_iface,
|
2010-12-30 01:39:16 +01:00
|
|
|
&HTMLDocumentNode_dispex);
|
|
|
|
init_doc(&doc->basedoc, (IUnknown*)&doc->node.IHTMLDOMNode_iface,
|
2015-05-14 13:24:19 +02:00
|
|
|
&doc->node.event_target.dispex.IDispatchEx_iface);
|
2009-09-29 00:11:28 +02:00
|
|
|
HTMLDocumentNode_SecMgr_Init(doc);
|
2005-03-31 12:08:02 +02:00
|
|
|
|
2010-11-14 14:42:20 +01:00
|
|
|
list_init(&doc->selection_list);
|
|
|
|
list_init(&doc->range_list);
|
2010-12-09 16:27:51 +01:00
|
|
|
list_init(&doc->plugin_hosts);
|
2010-11-14 14:42:20 +01:00
|
|
|
|
|
|
|
return doc;
|
|
|
|
}
|
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_obj, HTMLInnerWindow *window, HTMLDocumentNode **ret)
|
2010-11-14 14:42:20 +01:00
|
|
|
{
|
|
|
|
HTMLDocumentNode *doc;
|
|
|
|
|
|
|
|
doc = alloc_doc_node(doc_obj, window);
|
|
|
|
if(!doc)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
if(!doc_obj->basedoc.window || window->base.outer_window == doc_obj->basedoc.window)
|
2009-11-23 19:28:17 +01:00
|
|
|
doc->basedoc.cp_container.forward_container = &doc_obj->basedoc.cp_container;
|
2009-10-27 21:09:25 +01:00
|
|
|
|
2012-06-27 10:56:44 +02:00
|
|
|
HTMLDOMNode_Init(doc, &doc->node, (nsIDOMNode*)nsdoc);
|
|
|
|
|
2012-07-19 11:29:13 +02:00
|
|
|
nsIDOMHTMLDocument_AddRef(nsdoc);
|
2009-10-21 21:27:42 +02:00
|
|
|
doc->nsdoc = nsdoc;
|
2012-06-27 10:56:44 +02:00
|
|
|
|
2011-03-15 13:45:29 +01:00
|
|
|
init_document_mutation(doc);
|
2011-08-02 11:08:32 +02:00
|
|
|
doc_init_events(doc);
|
2009-09-16 22:09:42 +02:00
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
doc->node.vtbl = &HTMLDocumentNodeImplVtbl;
|
2009-11-23 19:28:43 +01:00
|
|
|
doc->node.cp_container = &doc->basedoc.cp_container;
|
2009-09-16 22:13:49 +02:00
|
|
|
|
2008-10-10 22:48:32 +02:00
|
|
|
*ret = doc;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2005-03-31 12:08:02 +02:00
|
|
|
|
2015-01-05 19:28:45 +01:00
|
|
|
static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *doc_node, HTMLDocumentNode **ret)
|
2010-11-14 14:42:20 +01:00
|
|
|
{
|
|
|
|
HTMLDocumentNode *doc_frag;
|
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
doc_frag = alloc_doc_node(doc_node->basedoc.doc_obj, doc_node->window);
|
2010-11-14 14:42:20 +01:00
|
|
|
if(!doc_frag)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-07-30 15:55:30 +02:00
|
|
|
IHTMLWindow2_AddRef(&doc_frag->window->base.IHTMLWindow2_iface);
|
|
|
|
|
2010-11-14 14:42:20 +01:00
|
|
|
HTMLDOMNode_Init(doc_node, &doc_frag->node, nsnode);
|
2010-11-14 14:43:18 +01:00
|
|
|
doc_frag->node.vtbl = &HTMLDocumentFragmentImplVtbl;
|
2010-11-14 14:42:20 +01:00
|
|
|
doc_frag->node.cp_container = &doc_frag->basedoc.cp_container;
|
|
|
|
|
|
|
|
*ret = doc_frag;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2009-09-16 22:14:05 +02:00
|
|
|
/**********************************************************
|
|
|
|
* ICustomDoc implementation
|
|
|
|
*/
|
|
|
|
|
2011-01-03 01:10:03 +01:00
|
|
|
static inline HTMLDocumentObj *impl_from_ICustomDoc(ICustomDoc *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLDocumentObj, ICustomDoc_iface);
|
|
|
|
}
|
2009-09-16 22:14:05 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-03 01:10:03 +01:00
|
|
|
HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
|
2009-09-16 22:06:31 +02:00
|
|
|
|
2014-04-28 11:06:08 +02:00
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
|
|
|
|
|
2009-09-16 22:13:49 +02:00
|
|
|
if(htmldoc_qi(&This->basedoc, riid, ppv))
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
|
|
|
|
2009-09-16 22:14:05 +02:00
|
|
|
if(IsEqualGUID(&IID_ICustomDoc, riid)) {
|
2011-01-03 01:10:03 +01:00
|
|
|
*ppv = &This->ICustomDoc_iface;
|
2012-01-18 19:52:34 +01:00
|
|
|
}else if(IsEqualGUID(&IID_ITargetContainer, riid)) {
|
|
|
|
*ppv = &This->ITargetContainer_iface;
|
2009-09-16 22:14:38 +02:00
|
|
|
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
|
|
|
return *ppv ? S_OK : E_NOINTERFACE;
|
2009-09-16 22:14:05 +02:00
|
|
|
}else {
|
2014-04-28 11:06:08 +02:00
|
|
|
FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid));
|
2009-09-16 22:14:05 +02:00
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2009-09-16 22:06:31 +02:00
|
|
|
}
|
|
|
|
|
2009-09-16 22:14:21 +02:00
|
|
|
static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface)
|
2009-09-16 22:06:31 +02:00
|
|
|
{
|
2011-01-03 01:10:03 +01:00
|
|
|
HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
|
2009-09-16 22:06:31 +02:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref = %u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2009-09-16 22:14:21 +02:00
|
|
|
static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
|
2009-09-16 22:06:31 +02:00
|
|
|
{
|
2011-01-03 01:10:03 +01:00
|
|
|
HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
|
2009-09-16 22:06:31 +02:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref = %u\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref) {
|
2012-07-03 11:05:30 +02:00
|
|
|
nsIDOMWindowUtils *window_utils = NULL;
|
|
|
|
|
|
|
|
if(This->basedoc.window && This->basedoc.window->nswindow)
|
|
|
|
get_nsinterface((nsISupports*)This->basedoc.window->nswindow, &IID_nsIDOMWindowUtils, (void**)&window_utils);
|
|
|
|
|
2009-09-16 22:07:58 +02:00
|
|
|
if(This->basedoc.doc_node) {
|
|
|
|
This->basedoc.doc_node->basedoc.doc_obj = NULL;
|
2010-12-16 14:59:51 +01:00
|
|
|
htmldoc_release(&This->basedoc.doc_node->basedoc);
|
2009-09-16 22:07:58 +02:00
|
|
|
}
|
2009-09-16 22:08:41 +02:00
|
|
|
if(This->basedoc.window) {
|
|
|
|
This->basedoc.window->doc_obj = NULL;
|
2012-06-25 14:04:59 +02:00
|
|
|
IHTMLWindow2_Release(&This->basedoc.window->base.IHTMLWindow2_iface);
|
2009-09-16 22:08:41 +02:00
|
|
|
}
|
2009-12-07 14:52:28 +01:00
|
|
|
if(This->basedoc.advise_holder)
|
|
|
|
IOleAdviseHolder_Release(This->basedoc.advise_holder);
|
2009-09-16 22:08:41 +02:00
|
|
|
|
2010-02-15 16:03:25 +01:00
|
|
|
if(This->view_sink)
|
|
|
|
IAdviseSink_Release(This->view_sink);
|
2009-09-16 22:10:03 +02:00
|
|
|
if(This->client)
|
2010-12-23 02:16:00 +01:00
|
|
|
IOleObject_SetClientSite(&This->basedoc.IOleObject_iface, NULL);
|
2010-11-29 00:18:01 +01:00
|
|
|
if(This->hostui)
|
2011-01-03 01:10:03 +01:00
|
|
|
ICustomDoc_SetUIHandler(&This->ICustomDoc_iface, NULL);
|
2009-09-16 22:11:26 +02:00
|
|
|
if(This->in_place_active)
|
2010-12-23 02:22:21 +01:00
|
|
|
IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.IOleInPlaceObjectWindowless_iface);
|
2009-09-16 22:10:03 +02:00
|
|
|
if(This->ipsite)
|
2010-12-23 02:19:14 +01:00
|
|
|
IOleDocumentView_SetInPlaceSite(&This->basedoc.IOleDocumentView_iface, NULL);
|
2009-09-16 22:10:30 +02:00
|
|
|
if(This->undomgr)
|
|
|
|
IOleUndoManager_Release(This->undomgr);
|
2015-10-13 08:41:30 +02:00
|
|
|
if(This->editsvcs)
|
|
|
|
IHTMLEditServices_Release(This->editsvcs);
|
2009-09-16 22:10:47 +02:00
|
|
|
if(This->tooltips_hwnd)
|
|
|
|
DestroyWindow(This->tooltips_hwnd);
|
|
|
|
|
|
|
|
if(This->hwnd)
|
|
|
|
DestroyWindow(This->hwnd);
|
2009-09-16 22:12:56 +02:00
|
|
|
heap_free(This->mime);
|
2009-09-16 22:10:47 +02:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
destroy_htmldoc(&This->basedoc);
|
2009-09-16 22:14:38 +02:00
|
|
|
release_dispex(&This->dispex);
|
2009-09-16 22:10:47 +02:00
|
|
|
|
2009-09-16 22:09:17 +02:00
|
|
|
if(This->nscontainer)
|
|
|
|
NSContainer_Release(This->nscontainer);
|
2009-09-16 22:06:31 +02:00
|
|
|
heap_free(This);
|
2012-07-03 11:05:30 +02:00
|
|
|
|
|
|
|
/* Force cycle collection */
|
|
|
|
if(window_utils) {
|
|
|
|
nsIDOMWindowUtils_CycleCollect(window_utils, NULL, 0);
|
|
|
|
nsIDOMWindowUtils_Release(window_utils);
|
|
|
|
}
|
2009-09-16 22:06:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2009-09-16 22:14:21 +02:00
|
|
|
static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler)
|
|
|
|
{
|
2011-01-03 01:10:03 +01:00
|
|
|
HTMLDocumentObj *This = impl_from_ICustomDoc(iface);
|
2010-11-29 00:18:01 +01:00
|
|
|
IOleCommandTarget *cmdtrg;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pUIHandler);
|
|
|
|
|
|
|
|
if(This->custom_hostui && This->hostui == pUIHandler)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
This->custom_hostui = TRUE;
|
|
|
|
|
|
|
|
if(This->hostui)
|
|
|
|
IDocHostUIHandler_Release(This->hostui);
|
|
|
|
if(pUIHandler)
|
|
|
|
IDocHostUIHandler_AddRef(pUIHandler);
|
|
|
|
This->hostui = pUIHandler;
|
|
|
|
if(!pUIHandler)
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
hres = IDocHostUIHandler_QueryInterface(pUIHandler, &IID_IOleCommandTarget, (void**)&cmdtrg);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
FIXME("custom UI handler supports IOleCommandTarget\n");
|
|
|
|
IOleCommandTarget_Release(cmdtrg);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2009-09-16 22:14:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const ICustomDocVtbl CustomDocVtbl = {
|
|
|
|
CustomDoc_QueryInterface,
|
|
|
|
CustomDoc_AddRef,
|
|
|
|
CustomDoc_Release,
|
|
|
|
CustomDoc_SetUIHandler
|
2009-09-16 22:06:31 +02:00
|
|
|
};
|
|
|
|
|
2009-09-16 22:14:38 +02:00
|
|
|
static const tid_t HTMLDocumentObj_iface_tids[] = {
|
|
|
|
IHTMLDocument2_tid,
|
|
|
|
IHTMLDocument3_tid,
|
|
|
|
IHTMLDocument4_tid,
|
|
|
|
IHTMLDocument5_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static dispex_static_data_t HTMLDocumentObj_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLDocument_tid,
|
|
|
|
NULL,
|
|
|
|
HTMLDocumentObj_iface_tids
|
|
|
|
};
|
|
|
|
|
2008-10-10 22:48:32 +02:00
|
|
|
HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
|
|
|
{
|
2016-06-13 17:40:51 +02:00
|
|
|
mozIDOMWindowProxy *mozwindow;
|
2009-09-16 22:06:31 +02:00
|
|
|
HTMLDocumentObj *doc;
|
2008-10-16 09:33:07 +02:00
|
|
|
nsIDOMWindow *nswindow = NULL;
|
2009-10-25 21:05:07 +01:00
|
|
|
nsresult nsres;
|
2008-10-10 22:48:32 +02:00
|
|
|
HRESULT hres;
|
|
|
|
|
2014-05-08 11:48:32 +02:00
|
|
|
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_mshtml_guid(riid), ppvObject);
|
2006-02-15 11:51:44 +01:00
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
doc = heap_alloc_zero(sizeof(HTMLDocumentObj));
|
|
|
|
if(!doc)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2011-01-03 01:10:03 +01:00
|
|
|
init_dispex(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex);
|
|
|
|
init_doc(&doc->basedoc, (IUnknown*)&doc->ICustomDoc_iface, &doc->dispex.IDispatchEx_iface);
|
2012-01-18 19:52:34 +01:00
|
|
|
TargetContainer_Init(doc);
|
2009-09-16 22:06:31 +02:00
|
|
|
|
2011-01-03 01:10:03 +01:00
|
|
|
doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl;
|
2009-09-16 22:06:31 +02:00
|
|
|
doc->ref = 1;
|
2009-09-16 22:07:58 +02:00
|
|
|
doc->basedoc.doc_obj = doc;
|
2007-06-29 02:48:50 +02:00
|
|
|
|
2009-10-25 21:05:07 +01:00
|
|
|
doc->usermode = UNKNOWN_USERMODE;
|
|
|
|
|
2012-05-30 15:49:15 +02:00
|
|
|
init_binding_ui(doc);
|
|
|
|
|
2012-05-18 14:20:19 +02:00
|
|
|
hres = create_nscontainer(doc, &doc->nscontainer);
|
2011-10-18 12:27:37 +02:00
|
|
|
if(FAILED(hres)) {
|
2009-10-25 21:05:07 +01:00
|
|
|
ERR("Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE\n");
|
|
|
|
htmldoc_release(&doc->basedoc);
|
2011-10-18 12:27:37 +02:00
|
|
|
return hres;
|
2009-10-25 21:05:07 +01:00
|
|
|
}
|
|
|
|
|
2009-09-16 22:06:31 +02:00
|
|
|
hres = htmldoc_query_interface(&doc->basedoc, riid, ppvObject);
|
|
|
|
htmldoc_release(&doc->basedoc);
|
2008-10-10 22:48:32 +02:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &mozwindow);
|
2009-10-25 21:05:07 +01:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
2008-10-10 22:48:32 +02:00
|
|
|
|
2016-06-13 17:40:51 +02:00
|
|
|
nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&nswindow);
|
|
|
|
mozIDOMWindowProxy_Release(mozwindow);
|
|
|
|
assert(nsres == NS_OK);
|
|
|
|
|
2012-06-25 14:04:59 +02:00
|
|
|
hres = HTMLOuterWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window);
|
2008-10-10 22:48:14 +02:00
|
|
|
if(nswindow)
|
|
|
|
nsIDOMWindow_Release(nswindow);
|
2008-10-10 22:48:32 +02:00
|
|
|
if(FAILED(hres)) {
|
2010-12-16 14:59:51 +01:00
|
|
|
htmldoc_release(&doc->basedoc);
|
2008-10-10 22:48:32 +02:00
|
|
|
return hres;
|
|
|
|
}
|
2005-04-11 18:11:52 +02:00
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
if(!doc->basedoc.doc_node && doc->basedoc.window->base.inner_window->doc) {
|
|
|
|
doc->basedoc.doc_node = doc->basedoc.window->base.inner_window->doc;
|
2009-10-21 21:29:36 +02:00
|
|
|
htmldoc_addref(&doc->basedoc.doc_node->basedoc);
|
|
|
|
}
|
|
|
|
|
2006-09-24 23:10:38 +02:00
|
|
|
get_thread_hwnd();
|
|
|
|
|
2008-10-10 22:48:32 +02:00
|
|
|
return S_OK;
|
2005-03-31 12:08:02 +02:00
|
|
|
}
|