2006-03-09 00:20:19 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2006 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2006-03-09 00:20:19 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
2018-02-28 16:31:33 +01:00
|
|
|
#include <assert.h>
|
2006-03-09 00:20:19 +01:00
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
2016-03-31 14:50:33 +02:00
|
|
|
#include "mshtmdid.h"
|
2006-03-09 00:20:19 +01:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include "mshtml_private.h"
|
2012-10-16 17:07:10 +02:00
|
|
|
#include "htmlevent.h"
|
2013-11-11 14:36:43 +01:00
|
|
|
#include "htmlstyle.h"
|
2006-03-09 00:20:19 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|
|
|
|
2018-02-28 16:31:22 +01:00
|
|
|
typedef struct {
|
|
|
|
HTMLElement element;
|
|
|
|
|
2010-12-06 16:44:18 +01:00
|
|
|
IHTMLBodyElement IHTMLBodyElement_iface;
|
2018-02-28 16:31:33 +01:00
|
|
|
IHTMLTextContainer IHTMLTextContainer_iface;
|
2006-03-09 00:20:19 +01:00
|
|
|
|
|
|
|
nsIDOMHTMLBodyElement *nsbody;
|
|
|
|
} HTMLBodyElement;
|
|
|
|
|
2009-08-02 00:09:09 +02:00
|
|
|
static const struct {
|
|
|
|
LPCWSTR keyword;
|
2009-12-27 00:49:31 +01:00
|
|
|
DWORD rgb;
|
2009-08-02 00:09:09 +02:00
|
|
|
} keyword_table[] = {
|
2020-10-23 11:19:59 +02:00
|
|
|
{L"aqua", 0x00ffff},
|
|
|
|
{L"black", 0x000000},
|
|
|
|
{L"blue", 0x0000ff},
|
2020-11-18 20:59:31 +01:00
|
|
|
{L"fuchsia", 0xff00ff},
|
2020-10-23 11:19:59 +02:00
|
|
|
{L"gray", 0x808080},
|
|
|
|
{L"green", 0x008000},
|
|
|
|
{L"lime", 0x00ff00},
|
|
|
|
{L"maroon", 0x800000},
|
|
|
|
{L"navy", 0x000080},
|
|
|
|
{L"olive", 0x808000},
|
|
|
|
{L"purple", 0x800080},
|
|
|
|
{L"red", 0xff0000},
|
|
|
|
{L"silver", 0xc0c0c0},
|
|
|
|
{L"teal", 0x008080},
|
|
|
|
{L"white", 0xffffff},
|
|
|
|
{L"yellow", 0xffff00}
|
2009-08-02 00:09:09 +02:00
|
|
|
};
|
|
|
|
|
2009-12-27 00:49:46 +01:00
|
|
|
static int comp_value(const WCHAR *ptr, int dpc)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
WCHAR ch;
|
|
|
|
|
|
|
|
if(dpc > 2)
|
|
|
|
dpc = 2;
|
|
|
|
|
|
|
|
while(dpc--) {
|
|
|
|
if(!*ptr)
|
|
|
|
ret *= 16;
|
2019-11-12 20:49:03 +01:00
|
|
|
else if(is_digit(ch = *ptr++))
|
2009-12-27 00:49:46 +01:00
|
|
|
ret = ret*16 + (ch-'0');
|
|
|
|
else if('a' <= ch && ch <= 'f')
|
|
|
|
ret = ret*16 + (ch-'a') + 10;
|
|
|
|
else if('A' <= ch && ch <= 'F')
|
|
|
|
ret = ret*16 + (ch-'A') + 10;
|
|
|
|
else
|
|
|
|
ret *= 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Based on Gecko NS_LooseHexToRGB */
|
|
|
|
static int loose_hex_to_rgb(const WCHAR *hex)
|
|
|
|
{
|
|
|
|
int len, dpc;
|
|
|
|
|
2019-06-13 08:34:29 +02:00
|
|
|
len = lstrlenW(hex);
|
2009-12-27 00:49:46 +01:00
|
|
|
if(*hex == '#') {
|
|
|
|
hex++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
if(len <= 3)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
dpc = min(len/3 + (len%3 ? 1 : 0), 4);
|
|
|
|
return (comp_value(hex, dpc) << 16)
|
|
|
|
| (comp_value(hex+dpc, dpc) << 8)
|
|
|
|
| comp_value(hex+2*dpc, dpc);
|
|
|
|
}
|
|
|
|
|
2014-03-26 08:06:39 +01:00
|
|
|
HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
|
2009-08-02 00:09:09 +02:00
|
|
|
{
|
2013-02-16 22:09:13 +01:00
|
|
|
unsigned int i;
|
|
|
|
int rgb = -1;
|
2009-12-27 00:49:31 +01:00
|
|
|
|
2009-12-27 00:49:46 +01:00
|
|
|
if(!color || !*color) {
|
|
|
|
*ret = NULL;
|
|
|
|
return S_OK;
|
2009-12-27 00:49:10 +01:00
|
|
|
}
|
2009-08-02 00:09:09 +02:00
|
|
|
|
2009-12-27 00:49:31 +01:00
|
|
|
if(*color != '#') {
|
2018-08-23 23:31:15 +02:00
|
|
|
for(i=0; i < ARRAY_SIZE(keyword_table); i++) {
|
2019-06-13 08:34:29 +02:00
|
|
|
if(!wcsicmp(color, keyword_table[i].keyword))
|
2009-12-27 00:49:31 +01:00
|
|
|
rgb = keyword_table[i].rgb;
|
2009-12-27 00:49:10 +01:00
|
|
|
}
|
2009-08-02 00:09:09 +02:00
|
|
|
}
|
2009-12-27 00:49:46 +01:00
|
|
|
if(rgb == -1)
|
|
|
|
rgb = loose_hex_to_rgb(color);
|
2009-12-27 00:49:31 +01:00
|
|
|
|
|
|
|
*ret = SysAllocStringLen(NULL, 7);
|
|
|
|
if(!*ret)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2020-11-24 00:49:05 +01:00
|
|
|
swprintf(*ret, 8, L"#%02x%02x%02x", rgb>>16, (rgb>>8)&0xff, rgb&0xff);
|
2009-08-02 00:09:09 +02:00
|
|
|
|
2009-12-27 00:49:31 +01:00
|
|
|
TRACE("%s -> %s\n", debugstr_w(color), debugstr_w(*ret));
|
|
|
|
return S_OK;
|
2009-08-02 00:09:09 +02:00
|
|
|
}
|
|
|
|
|
2014-03-26 08:06:39 +01:00
|
|
|
BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
|
2008-02-24 22:17:32 +01:00
|
|
|
{
|
|
|
|
switch(V_VT(v)) {
|
|
|
|
case VT_BSTR:
|
|
|
|
nsAString_Init(nsstr, V_BSTR(v));
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case VT_I4: {
|
|
|
|
PRUnichar buf[10];
|
|
|
|
|
2020-11-24 00:49:05 +01:00
|
|
|
wsprintfW(buf, L"#%x", V_I4(v));
|
2008-02-24 22:17:32 +01:00
|
|
|
nsAString_Init(nsstr, buf);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("invalid color %s\n", debugstr_variant(v));
|
2008-02-24 22:17:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-13 12:00:55 +02:00
|
|
|
static HRESULT return_nscolor(nsresult nsres, nsAString *nsstr, VARIANT *p)
|
2008-02-24 22:17:55 +01:00
|
|
|
{
|
|
|
|
const PRUnichar *color;
|
|
|
|
|
2012-04-13 12:00:55 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("failed: %08x\n", nsres);
|
|
|
|
nsAString_Finish(nsstr);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2008-02-24 22:17:55 +01:00
|
|
|
nsAString_GetData(nsstr, &color);
|
|
|
|
|
|
|
|
if(*color == '#') {
|
|
|
|
V_VT(p) = VT_I4;
|
2019-06-13 08:34:29 +02:00
|
|
|
V_I4(p) = wcstol(color+1, NULL, 16);
|
2008-02-24 22:17:55 +01:00
|
|
|
}else {
|
|
|
|
V_VT(p) = VT_BSTR;
|
|
|
|
V_BSTR(p) = SysAllocString(color);
|
2012-04-13 12:00:55 +02:00
|
|
|
if(!V_BSTR(p)) {
|
|
|
|
nsAString_Finish(nsstr);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2008-02-24 22:17:55 +01:00
|
|
|
}
|
2012-04-13 12:00:55 +02:00
|
|
|
|
|
|
|
nsAString_Finish(nsstr);
|
|
|
|
TRACE("ret %s\n", debugstr_variant(p));
|
|
|
|
return S_OK;
|
2008-02-24 22:17:55 +01:00
|
|
|
}
|
|
|
|
|
2010-12-06 16:44:18 +01:00
|
|
|
static inline HTMLBodyElement *impl_from_IHTMLBodyElement(IHTMLBodyElement *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, HTMLBodyElement, IHTMLBodyElement_iface);
|
|
|
|
}
|
2006-03-09 00:20:19 +01:00
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2006-03-09 00:20:19 +01:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2006-03-09 00:20:19 +01:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2006-03-09 00:20:19 +01:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2018-02-28 16:31:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface,
|
2010-12-31 11:07:33 +01:00
|
|
|
pctinfo);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetTypeInfo(IHTMLBodyElement *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2018-02-28 16:31:33 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo,
|
2010-12-31 11:07:33 +01:00
|
|
|
lcid, ppTInfo);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_GetIDsOfNames(IHTMLBodyElement *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2018-02-28 16:31:33 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid,
|
2010-12-31 11:07:33 +01:00
|
|
|
rgszNames, cNames, lcid, rgDispId);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2018-02-28 16:31:33 +01:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember,
|
2010-12-31 11:07:33 +01:00
|
|
|
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_background(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-09-23 12:03:58 +02:00
|
|
|
nsAString nsstr;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
2010-01-28 23:55:51 +01:00
|
|
|
nsAString_InitDepend(&nsstr, v);
|
2008-09-23 12:03:58 +02:00
|
|
|
nsres = nsIDOMHTMLBodyElement_SetBackground(This->nsbody, &nsstr);
|
|
|
|
nsAString_Finish(&nsstr);
|
2010-01-28 23:55:51 +01:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
return E_FAIL;
|
2008-09-23 12:03:58 +02:00
|
|
|
|
2010-01-28 23:55:51 +01:00
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_background(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:22:51 +02:00
|
|
|
nsAString background_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&background_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetBackground(This->nsbody, &background_str);
|
2012-04-13 12:02:11 +02:00
|
|
|
return return_nsstr(nsres, &background_str, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bgProperties(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bgProperties(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_leftMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_leftMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_topMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_topMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_rightMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_rightMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bottomMargin(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bottomMargin(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%x)\n", This, v);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIANT_BOOL *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-09-05 12:34:59 +02:00
|
|
|
nsAString strColor;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2012-03-28 14:26:57 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-09-05 12:34:59 +02:00
|
|
|
|
|
|
|
if(!variant_to_nscolor(&v, &strColor))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_SetBgColor(This->nsbody, &strColor);
|
|
|
|
nsAString_Finish(&strColor);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetBgColor failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2020-06-05 18:27:01 +02:00
|
|
|
nsAString nsstr;
|
2008-09-05 12:34:59 +02:00
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2020-06-05 18:27:01 +02:00
|
|
|
nsAString_Init(&nsstr, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetBgColor(This->nsbody, &nsstr);
|
|
|
|
return return_nsstr_variant(nsres, &nsstr, NSSTR_COLOR, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-09-17 12:41:47 +02:00
|
|
|
nsAString text;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2012-03-28 14:26:57 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-09-17 12:41:47 +02:00
|
|
|
|
|
|
|
if(!variant_to_nscolor(&v, &text))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_SetText(This->nsbody, &text);
|
|
|
|
nsAString_Finish(&text);
|
2010-05-08 18:33:52 +02:00
|
|
|
if(NS_FAILED(nsres)) {
|
|
|
|
ERR("SetText failed: %08x\n", nsres);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
2008-09-17 12:41:47 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-09-17 12:41:47 +02:00
|
|
|
nsAString text;
|
|
|
|
nsresult nsres;
|
2009-12-27 00:50:04 +01:00
|
|
|
HRESULT hres;
|
2008-09-17 12:41:47 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&text, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetText(This->nsbody, &text);
|
2009-12-27 00:50:04 +01:00
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
|
|
|
const PRUnichar *color;
|
2008-09-17 12:41:47 +02:00
|
|
|
|
2009-12-27 00:50:04 +01:00
|
|
|
nsAString_GetData(&text, &color);
|
2008-09-17 12:41:47 +02:00
|
|
|
V_VT(p) = VT_BSTR;
|
2009-12-27 00:50:04 +01:00
|
|
|
hres = nscolor_to_str(color, &V_BSTR(p));
|
|
|
|
}else {
|
|
|
|
ERR("GetText failed: %08x\n", nsres);
|
|
|
|
hres = E_FAIL;
|
2008-09-17 12:41:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
nsAString_Finish(&text);
|
|
|
|
|
2010-05-01 16:19:05 +02:00
|
|
|
return hres;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:17:32 +01:00
|
|
|
nsAString link_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2012-03-28 14:26:57 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-02-24 22:17:32 +01:00
|
|
|
|
|
|
|
if(!variant_to_nscolor(&v, &link_str))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_SetLink(This->nsbody, &link_str);
|
|
|
|
nsAString_Finish(&link_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetLink failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:17:55 +01:00
|
|
|
nsAString link_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&link_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetLink(This->nsbody, &link_str);
|
2012-04-13 12:00:55 +02:00
|
|
|
return return_nscolor(nsres, &link_str, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_vLink(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:18:24 +01:00
|
|
|
nsAString vlink_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2012-03-28 14:26:57 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-02-24 22:18:24 +01:00
|
|
|
|
|
|
|
if(!variant_to_nscolor(&v, &vlink_str))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_SetVLink(This->nsbody, &vlink_str);
|
|
|
|
nsAString_Finish(&vlink_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetLink failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_vLink(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:18:24 +01:00
|
|
|
nsAString vlink_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&vlink_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetVLink(This->nsbody, &vlink_str);
|
2012-04-13 12:00:55 +02:00
|
|
|
return return_nscolor(nsres, &vlink_str, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_aLink(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:18:47 +01:00
|
|
|
nsAString alink_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
2012-03-28 14:26:57 +02:00
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2008-02-24 22:18:47 +01:00
|
|
|
|
|
|
|
if(!variant_to_nscolor(&v, &alink_str))
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
nsres = nsIDOMHTMLBodyElement_SetALink(This->nsbody, &alink_str);
|
|
|
|
nsAString_Finish(&alink_str);
|
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SetALink failed: %08x\n", nsres);
|
|
|
|
|
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_aLink(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2008-02-24 22:18:47 +01:00
|
|
|
nsAString alink_str;
|
|
|
|
nsresult nsres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
nsAString_Init(&alink_str, NULL);
|
|
|
|
nsres = nsIDOMHTMLBodyElement_GetALink(This->nsbody, &alink_str);
|
2012-04-13 12:00:55 +02:00
|
|
|
return return_nscolor(nsres, &alink_str, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-10-16 17:07:10 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return set_node_event(&This->element.node, EVENTID_LOAD, &v);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-10-16 17:07:10 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return get_node_event(&This->element.node, EVENTID_LOAD, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onunload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2013-11-11 14:36:43 +01:00
|
|
|
static const WCHAR *val;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
|
|
|
|
|
|
|
/* Emulate with CSS visibility attribute */
|
2020-11-24 00:49:05 +01:00
|
|
|
if(!wcscmp(v, L"yes")) {
|
|
|
|
val = L"scroll";
|
|
|
|
}else if(!wcscmp(v, L"auto")) {
|
|
|
|
val = L"visible";
|
|
|
|
}else if(!wcscmp(v, L"no")) {
|
|
|
|
val = L"hidden";
|
2013-11-11 14:36:43 +01:00
|
|
|
}else {
|
|
|
|
WARN("Invalid argument %s\n", debugstr_w(v));
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return set_elem_style(&This->element, STYLEID_OVERFLOW, val);
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2013-11-30 20:17:31 +01:00
|
|
|
const WCHAR *ret = NULL;
|
2013-11-11 14:36:43 +01:00
|
|
|
BSTR overflow;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
/* Emulate with CSS visibility attribute */
|
2018-02-28 16:31:33 +01:00
|
|
|
hres = get_elem_style(&This->element, STYLEID_OVERFLOW, &overflow);
|
2013-11-11 14:36:43 +01:00
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
if(!overflow || !*overflow) {
|
|
|
|
*p = NULL;
|
2013-11-30 20:17:31 +01:00
|
|
|
hres = S_OK;
|
2020-11-24 00:49:05 +01:00
|
|
|
}else if(!wcscmp(overflow, L"visible") || !wcscmp(overflow, L"auto")) {
|
|
|
|
ret = L"auto";
|
|
|
|
}else if(!wcscmp(overflow, L"scroll")) {
|
|
|
|
ret = L"yes";
|
|
|
|
}else if(!wcscmp(overflow, L"hidden")) {
|
|
|
|
ret = L"no";
|
2013-11-11 14:36:43 +01:00
|
|
|
}else {
|
2013-11-14 10:02:33 +01:00
|
|
|
TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
|
2013-11-11 14:36:43 +01:00
|
|
|
*p = NULL;
|
2013-11-30 20:17:31 +01:00
|
|
|
hres = S_OK;
|
2013-11-11 14:36:43 +01:00
|
|
|
}
|
|
|
|
|
2013-11-30 20:17:31 +01:00
|
|
|
SysFreeString(overflow);
|
|
|
|
if(ret) {
|
|
|
|
*p = SysAllocString(ret);
|
|
|
|
hres = *p ? S_OK : E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hres;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onselect(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_put_onbeforeunload(IHTMLBodyElement *iface, VARIANT v)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2012-03-28 14:26:57 +02:00
|
|
|
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface, VARIANT *p)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-04-12 21:21:49 +02:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
2006-03-09 00:20:19 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
|
|
|
|
{
|
2010-12-06 16:44:18 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
2007-05-10 01:13:13 +02:00
|
|
|
nsIDOMRange *nsrange = NULL;
|
2008-10-08 20:28:27 +02:00
|
|
|
nsresult nsres;
|
2009-09-16 22:11:43 +02:00
|
|
|
HRESULT hres;
|
2007-05-10 01:13:13 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, range);
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
if(!This->element.node.doc->nsdoc) {
|
2008-10-08 20:28:27 +02:00
|
|
|
WARN("No nsdoc\n");
|
|
|
|
return E_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
nsres = nsIDOMHTMLDocument_CreateRange(This->element.node.doc->nsdoc, &nsrange);
|
2008-10-08 20:28:27 +02:00
|
|
|
if(NS_SUCCEEDED(nsres)) {
|
2018-02-28 16:31:33 +01:00
|
|
|
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->element.node.nsnode);
|
2008-10-08 20:28:27 +02:00
|
|
|
if(NS_FAILED(nsres))
|
|
|
|
ERR("SelectNodeContents failed: %08x\n", nsres);
|
|
|
|
}else {
|
|
|
|
ERR("CreateRange failed: %08x\n", nsres);
|
2007-05-10 01:13:13 +02:00
|
|
|
}
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
hres = HTMLTxtRange_Create(This->element.node.doc->basedoc.doc_node, nsrange, range);
|
2009-09-16 22:11:43 +02:00
|
|
|
|
|
|
|
nsIDOMRange_Release(nsrange);
|
|
|
|
return hres;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
|
|
|
|
HTMLBodyElement_QueryInterface,
|
|
|
|
HTMLBodyElement_AddRef,
|
|
|
|
HTMLBodyElement_Release,
|
|
|
|
HTMLBodyElement_GetTypeInfoCount,
|
|
|
|
HTMLBodyElement_GetTypeInfo,
|
|
|
|
HTMLBodyElement_GetIDsOfNames,
|
|
|
|
HTMLBodyElement_Invoke,
|
|
|
|
HTMLBodyElement_put_background,
|
|
|
|
HTMLBodyElement_get_background,
|
|
|
|
HTMLBodyElement_put_bgProperties,
|
|
|
|
HTMLBodyElement_get_bgProperties,
|
|
|
|
HTMLBodyElement_put_leftMargin,
|
|
|
|
HTMLBodyElement_get_leftMargin,
|
|
|
|
HTMLBodyElement_put_topMargin,
|
|
|
|
HTMLBodyElement_get_topMargin,
|
|
|
|
HTMLBodyElement_put_rightMargin,
|
|
|
|
HTMLBodyElement_get_rightMargin,
|
|
|
|
HTMLBodyElement_put_bottomMargin,
|
|
|
|
HTMLBodyElement_get_bottomMargin,
|
|
|
|
HTMLBodyElement_put_noWrap,
|
|
|
|
HTMLBodyElement_get_noWrap,
|
|
|
|
HTMLBodyElement_put_bgColor,
|
|
|
|
HTMLBodyElement_get_bgColor,
|
|
|
|
HTMLBodyElement_put_text,
|
|
|
|
HTMLBodyElement_get_text,
|
|
|
|
HTMLBodyElement_put_link,
|
|
|
|
HTMLBodyElement_get_link,
|
|
|
|
HTMLBodyElement_put_vLink,
|
|
|
|
HTMLBodyElement_get_vLink,
|
|
|
|
HTMLBodyElement_put_aLink,
|
|
|
|
HTMLBodyElement_get_aLink,
|
|
|
|
HTMLBodyElement_put_onload,
|
|
|
|
HTMLBodyElement_get_onload,
|
|
|
|
HTMLBodyElement_put_onunload,
|
|
|
|
HTMLBodyElement_get_onunload,
|
|
|
|
HTMLBodyElement_put_scroll,
|
|
|
|
HTMLBodyElement_get_scroll,
|
|
|
|
HTMLBodyElement_put_onselect,
|
|
|
|
HTMLBodyElement_get_onselect,
|
|
|
|
HTMLBodyElement_put_onbeforeunload,
|
|
|
|
HTMLBodyElement_get_onbeforeunload,
|
|
|
|
HTMLBodyElement_createTextRange
|
|
|
|
};
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
static inline HTMLBodyElement *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
|
2018-02-28 16:31:22 +01:00
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
return CONTAINING_RECORD(iface, HTMLBodyElement, IHTMLTextContainer_iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IHTMLElement_Release(&This->element.IHTMLElement_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
|
|
|
|
LCID lcid, ITypeInfo **ppTInfo)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
|
|
|
ppTInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames,
|
|
|
|
LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
|
|
|
cNames, lcid, rgDispId);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
|
|
|
|
IDispatch **range)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, range);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLElement2_get_scrollHeight(&This->element.IHTMLElement2_iface, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLElement2_get_scrollWidth(&This->element.IHTMLElement2_iface, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, v);
|
|
|
|
|
|
|
|
return IHTMLElement2_put_scrollTop(&This->element.IHTMLElement2_iface, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLElement2_get_scrollTop(&This->element.IHTMLElement2_iface, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, v);
|
|
|
|
|
|
|
|
return IHTMLElement2_put_scrollLeft(&This->element.IHTMLElement2_iface, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, p);
|
|
|
|
|
|
|
|
return IHTMLElement2_get_scrollLeft(&This->element.IHTMLElement2_iface, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
2018-02-28 16:31:22 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, p);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
|
|
|
|
HTMLTextContainer_QueryInterface,
|
|
|
|
HTMLTextContainer_AddRef,
|
|
|
|
HTMLTextContainer_Release,
|
|
|
|
HTMLTextContainer_GetTypeInfoCount,
|
|
|
|
HTMLTextContainer_GetTypeInfo,
|
|
|
|
HTMLTextContainer_GetIDsOfNames,
|
|
|
|
HTMLTextContainer_Invoke,
|
|
|
|
HTMLTextContainer_createControlRange,
|
|
|
|
HTMLTextContainer_get_scrollHeight,
|
|
|
|
HTMLTextContainer_get_scrollWidth,
|
|
|
|
HTMLTextContainer_put_scrollTop,
|
|
|
|
HTMLTextContainer_get_scrollTop,
|
|
|
|
HTMLTextContainer_put_scrollLeft,
|
|
|
|
HTMLTextContainer_get_scrollLeft,
|
|
|
|
HTMLTextContainer_put_onscroll,
|
|
|
|
HTMLTextContainer_get_onscroll
|
|
|
|
};
|
|
|
|
|
2010-12-27 20:13:09 +01:00
|
|
|
static inline HTMLBodyElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
|
|
|
{
|
2018-02-28 16:31:33 +01:00
|
|
|
return CONTAINING_RECORD(iface, HTMLBodyElement, element.node);
|
2010-12-27 20:13:09 +01:00
|
|
|
}
|
2007-10-04 02:08:56 +02:00
|
|
|
|
2007-10-04 02:10:36 +02:00
|
|
|
static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
|
2007-10-04 02:10:36 +02:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2010-12-06 16:44:18 +01:00
|
|
|
*ppv = &This->IHTMLBodyElement_iface;
|
2007-10-04 02:10:36 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
2010-12-06 16:44:18 +01:00
|
|
|
*ppv = &This->IHTMLBodyElement_iface;
|
2007-10-04 02:10:36 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLBodyElement, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IHTMLBodyElement %p)\n", This, ppv);
|
2010-12-06 16:44:18 +01:00
|
|
|
*ppv = &This->IHTMLBodyElement_iface;
|
2007-10-04 02:10:36 +02:00
|
|
|
}else if(IsEqualGUID(&IID_IHTMLTextContainer, riid)) {
|
2018-02-28 16:31:33 +01:00
|
|
|
TRACE("(%p)->(IID_IHTMLTextContainer %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IHTMLTextContainer_iface;
|
2007-10-04 02:10:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
2007-10-04 02:10:36 +02:00
|
|
|
}
|
|
|
|
|
2014-12-21 19:29:35 +01:00
|
|
|
static void HTMLBodyElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
2007-10-04 02:08:56 +02:00
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
|
2007-10-04 02:08:56 +02:00
|
|
|
|
2014-12-21 19:29:35 +01:00
|
|
|
if(This->nsbody)
|
|
|
|
note_cc_edge((nsISupports*)This->nsbody, "This->nsbody", cb);
|
|
|
|
}
|
2007-10-04 02:09:48 +02:00
|
|
|
|
2014-12-21 19:29:35 +01:00
|
|
|
static void HTMLBodyElement_unlink(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
|
|
|
|
|
|
|
|
if(This->nsbody) {
|
|
|
|
nsIDOMHTMLBodyElement *nsbody = This->nsbody;
|
|
|
|
This->nsbody = NULL;
|
|
|
|
nsIDOMHTMLBodyElement_Release(nsbody);
|
|
|
|
}
|
2007-10-04 02:08:56 +02:00
|
|
|
}
|
|
|
|
|
2017-10-16 22:31:42 +02:00
|
|
|
static EventTarget *HTMLBodyElement_get_event_prop_target(HTMLDOMNode *iface, int event_id)
|
2009-09-08 22:29:39 +02:00
|
|
|
{
|
2010-12-27 20:13:09 +01:00
|
|
|
HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
|
2009-09-08 22:29:39 +02:00
|
|
|
|
2017-10-16 22:31:42 +02:00
|
|
|
switch(event_id) {
|
|
|
|
case EVENTID_BLUR:
|
|
|
|
case EVENTID_ERROR:
|
|
|
|
case EVENTID_FOCUS:
|
|
|
|
case EVENTID_LOAD:
|
|
|
|
case EVENTID_SCROLL:
|
2018-02-28 16:31:33 +01:00
|
|
|
return This->element.node.doc && This->element.node.doc->window
|
|
|
|
? &This->element.node.doc->window->event_target
|
|
|
|
: &This->element.node.event_target;
|
2017-10-16 22:31:42 +02:00
|
|
|
default:
|
2018-02-28 16:31:33 +01:00
|
|
|
return &This->element.node.event_target;
|
2017-10-16 22:31:42 +02:00
|
|
|
}
|
2009-09-08 22:29:39 +02:00
|
|
|
}
|
|
|
|
|
2014-12-21 19:29:46 +01:00
|
|
|
static BOOL HTMLBodyElement_is_text_edit(HTMLDOMNode *iface)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-03-31 14:50:33 +02:00
|
|
|
static BOOL HTMLBodyElement_is_settable(HTMLDOMNode *iface, DISPID dispid)
|
|
|
|
{
|
|
|
|
switch(dispid) {
|
|
|
|
case DISPID_IHTMLELEMENT_OUTERTEXT:
|
|
|
|
return FALSE;
|
|
|
|
default:
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-15 15:01:53 +01:00
|
|
|
static const cpc_entry_t HTMLBodyElement_cpc[] = {
|
|
|
|
{&DIID_HTMLTextContainerEvents},
|
|
|
|
{&IID_IPropertyNotifySink},
|
|
|
|
HTMLELEMENT_CPC,
|
|
|
|
{NULL}
|
|
|
|
};
|
|
|
|
|
2007-10-04 02:09:48 +02:00
|
|
|
static const NodeImplVtbl HTMLBodyElementImplVtbl = {
|
2017-04-21 13:50:49 +02:00
|
|
|
&CLSID_HTMLBody,
|
2007-10-04 02:10:36 +02:00
|
|
|
HTMLBodyElement_QI,
|
2014-12-21 19:29:35 +01:00
|
|
|
HTMLElement_destructor,
|
2013-03-15 15:01:53 +01:00
|
|
|
HTMLBodyElement_cpc,
|
2010-11-14 14:41:39 +01:00
|
|
|
HTMLElement_clone,
|
2012-09-04 13:58:58 +02:00
|
|
|
HTMLElement_handle_event,
|
2011-08-25 15:23:35 +02:00
|
|
|
HTMLElement_get_attr_col,
|
2017-10-16 22:31:42 +02:00
|
|
|
HTMLBodyElement_get_event_prop_target,
|
2014-12-21 19:29:35 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
HTMLBodyElement_traverse,
|
2014-12-21 19:29:46 +01:00
|
|
|
HTMLBodyElement_unlink,
|
2016-03-31 14:50:33 +02:00
|
|
|
HTMLBodyElement_is_text_edit,
|
|
|
|
HTMLBodyElement_is_settable
|
2007-10-04 02:09:48 +02:00
|
|
|
};
|
|
|
|
|
2008-09-01 14:21:21 +02:00
|
|
|
static const tid_t HTMLBodyElement_iface_tids[] = {
|
|
|
|
IHTMLBodyElement_tid,
|
|
|
|
IHTMLBodyElement2_tid,
|
2010-01-28 02:09:02 +01:00
|
|
|
HTMLELEMENT_TIDS,
|
2008-09-01 14:21:21 +02:00
|
|
|
IHTMLTextContainer_tid,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
static dispex_static_data_t HTMLBodyElement_dispex = {
|
|
|
|
NULL,
|
|
|
|
DispHTMLBody_tid,
|
2016-07-07 12:50:18 +02:00
|
|
|
HTMLBodyElement_iface_tids,
|
|
|
|
HTMLElement_init_dispex_info
|
2008-09-01 14:21:21 +02:00
|
|
|
};
|
|
|
|
|
2018-02-12 01:29:41 +01:00
|
|
|
HRESULT HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTMLElement **elem)
|
2006-03-09 00:20:19 +01:00
|
|
|
{
|
2010-12-01 22:43:14 +01:00
|
|
|
HTMLBodyElement *ret;
|
2006-03-09 00:20:19 +01:00
|
|
|
nsresult nsres;
|
|
|
|
|
2010-12-01 22:43:14 +01:00
|
|
|
ret = heap_alloc_zero(sizeof(HTMLBodyElement));
|
|
|
|
if(!ret)
|
|
|
|
return E_OUTOFMEMORY;
|
2007-09-22 05:45:06 +02:00
|
|
|
|
2010-12-06 16:44:18 +01:00
|
|
|
ret->IHTMLBodyElement_iface.lpVtbl = &HTMLBodyElementVtbl;
|
2018-02-28 16:31:33 +01:00
|
|
|
ret->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
|
|
|
|
ret->element.node.vtbl = &HTMLBodyElementImplVtbl;
|
2006-03-09 00:20:19 +01:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLBodyElement_dispex);
|
2010-12-01 22:43:14 +01:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement, (void**)&ret->nsbody);
|
|
|
|
assert(nsres == NS_OK);
|
2009-10-02 13:50:48 +02:00
|
|
|
|
2018-02-28 16:31:33 +01:00
|
|
|
*elem = &ret->element;
|
2010-12-01 22:43:14 +01:00
|
|
|
return S_OK;
|
2006-03-09 00:20:19 +01:00
|
|
|
}
|