2009-11-01 19:17:17 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2012-06-27 10:56:14 +02:00
|
|
|
#include <assert.h>
|
2009-11-01 19:17:17 +01:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2009-12-07 23:28:07 +01:00
|
|
|
static const WCHAR autoW[] = {'a','u','t','o',0};
|
|
|
|
static const WCHAR yesW[] = {'y','e','s',0};
|
|
|
|
static const WCHAR noW[] = {'n','o',0};
|
|
|
|
|
2009-12-03 01:12:12 +01:00
|
|
|
HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
|
|
|
|
{
|
|
|
|
nsIDOMWindow *nswindow;
|
2012-06-25 14:04:59 +02:00
|
|
|
HTMLOuterWindow *window;
|
2011-08-24 15:38:08 +02:00
|
|
|
nsresult nsres;
|
2009-12-03 01:12:12 +01:00
|
|
|
HRESULT hres = S_OK;
|
|
|
|
|
|
|
|
if(frame->content_window)
|
|
|
|
return S_OK;
|
|
|
|
|
2011-08-24 15:38:08 +02:00
|
|
|
nsres = nsIDOMDocument_GetDefaultView(nsdoc, &nswindow);
|
|
|
|
if(NS_FAILED(nsres) || !nswindow)
|
2009-12-03 01:12:12 +01:00
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
window = nswindow_to_window(nswindow);
|
|
|
|
if(!window)
|
2012-06-25 14:04:59 +02:00
|
|
|
hres = HTMLOuterWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow,
|
2009-12-03 01:12:12 +01:00
|
|
|
frame->element.node.doc->basedoc.window, &window);
|
|
|
|
nsIDOMWindow_Release(nswindow);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
frame->content_window = window;
|
|
|
|
window->frame_element = frame;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2011-01-03 00:59:45 +01:00
|
|
|
static inline HTMLFrameBase *impl_from_IHTMLFrameBase(IHTMLFrameBase *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLFrameBase, IHTMLFrameBase_iface);
|
|
|
|
}
|
2009-11-01 19:17:17 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_QueryInterface(IHTMLFrameBase *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLFrameBase_AddRef(IHTMLFrameBase *iface)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLFrameBase_Release(IHTMLFrameBase *iface)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_GetTypeInfo(IHTMLFrameBase *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
|
|
|
|
ppTInfo);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
|
2009-11-01 19:17:17 +01:00
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_Invoke(IHTMLFrameBase *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
|
2010-12-31 11:07:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-30 18:02:11 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
if(!This->content_window || !This->element.node.doc || !This->element.node.doc->basedoc.window) {
|
|
|
|
FIXME("detached element\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return navigate_url(This->content_window, v, This->element.node.doc->basedoc.window->url);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-12-07 23:28:12 +01:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-04-13 12:20:25 +02:00
|
|
|
if(!This->nsframe && !This->nsiframe) {
|
2009-12-07 23:28:12 +01:00
|
|
|
ERR("No attached ns frame object\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2012-04-13 12:20:25 +02:00
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
if(This->nsframe)
|
|
|
|
nsres = nsIDOMHTMLFrameElement_GetName(This->nsframe, &nsstr);
|
|
|
|
else
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_GetName(This->nsiframe, &nsstr);
|
|
|
|
return return_nsstr(nsres, &nsstr, p);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_border(IHTMLFrameBase *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_border(IHTMLFrameBase *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_frameBorder(IHTMLFrameBase *iface, BSTR v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_frameBorder(IHTMLFrameBase *iface, BSTR *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_frameSpacing(IHTMLFrameBase *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_frameSpacing(IHTMLFrameBase *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_marginWidth(IHTMLFrameBase *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_marginHeight(IHTMLFrameBase *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_noResize(IHTMLFrameBase *iface, VARIANT_BOOL v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_noResize(IHTMLFrameBase *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-11-01 19:17:17 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-12-07 23:28:07 +01:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
if(!(!strcmpiW(v, yesW) || !strcmpiW(v, noW) || !strcmpiW(v, autoW)))
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(This->nsframe) {
|
2010-01-28 23:56:31 +01:00
|
|
|
nsAString_InitDepend(&nsstr, v);
|
2009-12-07 23:28:07 +01:00
|
|
|
nsres = nsIDOMHTMLFrameElement_SetScrolling(This->nsframe, &nsstr);
|
|
|
|
}else if(This->nsiframe) {
|
2010-01-28 23:56:31 +01:00
|
|
|
nsAString_InitDepend(&nsstr, v);
|
2009-12-07 23:28:07 +01:00
|
|
|
nsres = nsIDOMHTMLIFrameElement_SetScrolling(This->nsiframe, &nsstr);
|
|
|
|
}else {
|
|
|
|
ERR("No attached ns frame object\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetScrolling failed: 0x%08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
|
2009-12-07 23:28:07 +01:00
|
|
|
nsAString nsstr;
|
|
|
|
const PRUnichar *strdata;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(This->nsframe) {
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLFrameElement_GetScrolling(This->nsframe, &nsstr);
|
|
|
|
}else if(This->nsiframe) {
|
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLIFrameElement_GetScrolling(This->nsiframe, &nsstr);
|
|
|
|
}else {
|
|
|
|
ERR("No attached ns frame object\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("GetScrolling failed: 0x%08x\n", nsres);
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_GetData(&nsstr, &strdata);
|
|
|
|
|
|
|
|
if(*strdata)
|
|
|
|
*p = SysAllocString(strdata);
|
|
|
|
else
|
|
|
|
*p = SysAllocString(autoW);
|
|
|
|
|
|
|
|
nsAString_Finish(&nsstr);
|
|
|
|
|
|
|
|
return *p ? S_OK : E_OUTOFMEMORY;
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl = {
|
|
|
|
HTMLFrameBase_QueryInterface,
|
|
|
|
HTMLFrameBase_AddRef,
|
|
|
|
HTMLFrameBase_Release,
|
|
|
|
HTMLFrameBase_GetTypeInfoCount,
|
|
|
|
HTMLFrameBase_GetTypeInfo,
|
|
|
|
HTMLFrameBase_GetIDsOfNames,
|
|
|
|
HTMLFrameBase_Invoke,
|
|
|
|
HTMLFrameBase_put_src,
|
|
|
|
HTMLFrameBase_get_src,
|
|
|
|
HTMLFrameBase_put_name,
|
|
|
|
HTMLFrameBase_get_name,
|
|
|
|
HTMLFrameBase_put_border,
|
|
|
|
HTMLFrameBase_get_border,
|
|
|
|
HTMLFrameBase_put_frameBorder,
|
|
|
|
HTMLFrameBase_get_frameBorder,
|
|
|
|
HTMLFrameBase_put_frameSpacing,
|
|
|
|
HTMLFrameBase_get_frameSpacing,
|
|
|
|
HTMLFrameBase_put_marginWidth,
|
|
|
|
HTMLFrameBase_get_marginWidth,
|
|
|
|
HTMLFrameBase_put_marginHeight,
|
|
|
|
HTMLFrameBase_get_marginHeight,
|
|
|
|
HTMLFrameBase_put_noResize,
|
|
|
|
HTMLFrameBase_get_noResize,
|
|
|
|
HTMLFrameBase_put_scrolling,
|
|
|
|
HTMLFrameBase_get_scrolling
|
|
|
|
};
|
|
|
|
|
2011-01-03 00:59:45 +01:00
|
|
|
static inline HTMLFrameBase *impl_from_IHTMLFrameBase2(IHTMLFrameBase2 *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLFrameBase, IHTMLFrameBase2_iface);
|
|
|
|
}
|
2009-11-24 21:13:12 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_QueryInterface(IHTMLFrameBase2 *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2009-11-24 21:13:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLFrameBase2_AddRef(IHTMLFrameBase2 *iface)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLFrameBase2_Release(IHTMLFrameBase2 *iface)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
|
2010-12-30 01:39:16 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UINT *pctinfo)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2 *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2 *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_Invoke(IHTMLFrameBase2 *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, IHTMLWindow2 **p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
if(This->content_window) {
|
2012-06-25 14:04:59 +02:00
|
|
|
IHTMLWindow2_AddRef(&This->content_window->base.IHTMLWindow2_iface);
|
|
|
|
*p = &This->content_window->base.IHTMLWindow2_iface;
|
2009-11-24 21:13:12 +01:00
|
|
|
}else {
|
|
|
|
WARN("NULL content window\n");
|
|
|
|
*p = NULL;
|
|
|
|
}
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-30 18:02:25 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
if(!This->content_window || !This->content_window->base.inner_window->doc) {
|
2009-11-30 18:02:25 +01:00
|
|
|
FIXME("no document associated\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2012-06-25 14:05:17 +02:00
|
|
|
return IHTMLDocument2_get_readyState(&This->content_window->base.inner_window->doc->basedoc.IHTMLDocument2_iface, p);
|
2009-11-24 21:13:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL v)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2011-01-03 00:59:45 +01:00
|
|
|
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
|
2009-11-24 21:13:12 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl = {
|
|
|
|
HTMLFrameBase2_QueryInterface,
|
|
|
|
HTMLFrameBase2_AddRef,
|
|
|
|
HTMLFrameBase2_Release,
|
|
|
|
HTMLFrameBase2_GetTypeInfoCount,
|
|
|
|
HTMLFrameBase2_GetTypeInfo,
|
|
|
|
HTMLFrameBase2_GetIDsOfNames,
|
|
|
|
HTMLFrameBase2_Invoke,
|
|
|
|
HTMLFrameBase2_get_contentWindow,
|
|
|
|
HTMLFrameBase2_put_onload,
|
|
|
|
HTMLFrameBase2_get_onload,
|
|
|
|
HTMLFrameBase2_put_onreadystatechange,
|
|
|
|
HTMLFrameBase2_get_onreadystatechange,
|
|
|
|
HTMLFrameBase2_get_readyState,
|
|
|
|
HTMLFrameBase2_put_allowTransparency,
|
|
|
|
HTMLFrameBase2_get_allowTransparency
|
|
|
|
};
|
|
|
|
|
2009-11-01 19:17:17 +01:00
|
|
|
HRESULT HTMLFrameBase_QI(HTMLFrameBase *This, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
if(IsEqualGUID(&IID_IHTMLFrameBase, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This, ppv);
|
2011-01-03 00:59:45 +01:00
|
|
|
*ppv = &This->IHTMLFrameBase_iface;
|
2009-11-24 21:13:12 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLFrameBase2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This, ppv);
|
2011-01-03 00:59:45 +01:00
|
|
|
*ppv = &This->IHTMLFrameBase2_iface;
|
2009-11-01 19:17:17 +01:00
|
|
|
}else {
|
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void HTMLFrameBase_destructor(HTMLFrameBase *This)
|
|
|
|
{
|
2009-12-03 01:12:12 +01:00
|
|
|
if(This->content_window)
|
2009-11-01 19:19:19 +01:00
|
|
|
This->content_window->frame_element = NULL;
|
2009-11-01 19:18:38 +01:00
|
|
|
|
2009-11-01 19:17:17 +01:00
|
|
|
HTMLElement_destructor(&This->element.node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void HTMLFrameBase_Init(HTMLFrameBase *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
|
2009-12-03 01:12:12 +01:00
|
|
|
dispex_static_data_t *dispex_data)
|
2009-11-01 19:17:17 +01:00
|
|
|
{
|
2009-12-07 23:28:04 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
2011-01-03 00:59:45 +01:00
|
|
|
This->IHTMLFrameBase_iface.lpVtbl = &HTMLFrameBaseVtbl;
|
|
|
|
This->IHTMLFrameBase2_iface.lpVtbl = &HTMLFrameBase2Vtbl;
|
2009-11-01 19:17:17 +01:00
|
|
|
|
|
|
|
HTMLElement_Init(&This->element, doc, nselem, dispex_data);
|
2009-12-07 23:28:04 +01:00
|
|
|
|
|
|
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLFrameElement, (void**)&This->nsframe);
|
|
|
|
if(NS_FAILED(nsres)) {
|
2012-06-27 10:56:14 +02:00
|
|
|
This->nsframe = NULL;
|
2009-12-07 23:28:04 +01:00
|
|
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&This->nsiframe);
|
2012-06-27 10:56:14 +02:00
|
|
|
assert(nsres == NS_OK && (nsIDOMNode*)This->nsiframe == This->element.node.nsnode);
|
|
|
|
}else {
|
|
|
|
assert((nsIDOMNode*)This->nsframe == This->element.node.nsnode);
|
2009-12-07 23:28:04 +01:00
|
|
|
This->nsiframe = NULL;
|
2012-06-27 10:56:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Share the reference with nsnode */
|
|
|
|
nsIDOMNode_Release(This->element.node.nsnode);
|
2009-11-01 19:17:17 +01:00
|
|
|
}
|