mshtml: Implement IHTMLTextContainer interface directly in HTMLBodyElement object.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
49f20a5b74
commit
e55e6b8c45
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
|
@ -38,13 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||||
typedef struct {
|
typedef struct {
|
||||||
HTMLElement element;
|
HTMLElement element;
|
||||||
|
|
||||||
IHTMLTextContainer IHTMLTextContainer_iface;
|
|
||||||
} HTMLTextContainer;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
HTMLTextContainer textcont;
|
|
||||||
|
|
||||||
IHTMLBodyElement IHTMLBodyElement_iface;
|
IHTMLBodyElement IHTMLBodyElement_iface;
|
||||||
|
IHTMLTextContainer IHTMLTextContainer_iface;
|
||||||
|
|
||||||
nsIDOMHTMLBodyElement *nsbody;
|
nsIDOMHTMLBodyElement *nsbody;
|
||||||
} HTMLBodyElement;
|
} HTMLBodyElement;
|
||||||
|
@ -225,27 +221,27 @@ static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface,
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
|
|
||||||
return IHTMLDOMNode_QueryInterface(&This->textcont.element.node.IHTMLDOMNode_iface, riid, ppv);
|
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface)
|
static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
|
|
||||||
return IHTMLDOMNode_AddRef(&This->textcont.element.node.IHTMLDOMNode_iface);
|
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
|
static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
|
|
||||||
return IHTMLDOMNode_Release(&This->textcont.element.node.IHTMLDOMNode_iface);
|
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
|
static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
return IDispatchEx_GetTypeInfoCount(&This->textcont.element.node.event_target.dispex.IDispatchEx_iface,
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface,
|
||||||
pctinfo);
|
pctinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +249,7 @@ static HRESULT WINAPI HTMLBodyElement_GetTypeInfo(IHTMLBodyElement *iface, UINT
|
||||||
LCID lcid, ITypeInfo **ppTInfo)
|
LCID lcid, ITypeInfo **ppTInfo)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
return IDispatchEx_GetTypeInfo(&This->textcont.element.node.event_target.dispex.IDispatchEx_iface, iTInfo,
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo,
|
||||||
lcid, ppTInfo);
|
lcid, ppTInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +258,7 @@ static HRESULT WINAPI HTMLBodyElement_GetIDsOfNames(IHTMLBodyElement *iface, REF
|
||||||
LCID lcid, DISPID *rgDispId)
|
LCID lcid, DISPID *rgDispId)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
return IDispatchEx_GetIDsOfNames(&This->textcont.element.node.event_target.dispex.IDispatchEx_iface, riid,
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid,
|
||||||
rgszNames, cNames, lcid, rgDispId);
|
rgszNames, cNames, lcid, rgDispId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +267,7 @@ static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dis
|
||||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
return IDispatchEx_Invoke(&This->textcont.element.node.event_target.dispex.IDispatchEx_iface, dispIdMember,
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember,
|
||||||
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +580,7 @@ static HRESULT WINAPI HTMLBodyElement_put_onload(IHTMLBodyElement *iface, VARIAN
|
||||||
|
|
||||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||||
|
|
||||||
return set_node_event(&This->textcont.element.node, EVENTID_LOAD, &v);
|
return set_node_event(&This->element.node, EVENTID_LOAD, &v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIANT *p)
|
static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIANT *p)
|
||||||
|
@ -593,7 +589,7 @@ static HRESULT WINAPI HTMLBodyElement_get_onload(IHTMLBodyElement *iface, VARIAN
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
return get_node_event(&This->textcont.element.node, EVENTID_LOAD, p);
|
return get_node_event(&This->element.node, EVENTID_LOAD, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLBodyElement_put_onunload(IHTMLBodyElement *iface, VARIANT v)
|
static HRESULT WINAPI HTMLBodyElement_put_onunload(IHTMLBodyElement *iface, VARIANT v)
|
||||||
|
@ -636,7 +632,7 @@ static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
return set_elem_style(&This->textcont.element, STYLEID_OVERFLOW, val);
|
return set_elem_style(&This->element, STYLEID_OVERFLOW, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
||||||
|
@ -649,7 +645,7 @@ static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
/* Emulate with CSS visibility attribute */
|
/* Emulate with CSS visibility attribute */
|
||||||
hres = get_elem_style(&This->textcont.element, STYLEID_OVERFLOW, &overflow);
|
hres = get_elem_style(&This->element, STYLEID_OVERFLOW, &overflow);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
|
@ -714,21 +710,21 @@ static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, I
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, range);
|
TRACE("(%p)->(%p)\n", This, range);
|
||||||
|
|
||||||
if(!This->textcont.element.node.doc->nsdoc) {
|
if(!This->element.node.doc->nsdoc) {
|
||||||
WARN("No nsdoc\n");
|
WARN("No nsdoc\n");
|
||||||
return E_UNEXPECTED;
|
return E_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsres = nsIDOMHTMLDocument_CreateRange(This->textcont.element.node.doc->nsdoc, &nsrange);
|
nsres = nsIDOMHTMLDocument_CreateRange(This->element.node.doc->nsdoc, &nsrange);
|
||||||
if(NS_SUCCEEDED(nsres)) {
|
if(NS_SUCCEEDED(nsres)) {
|
||||||
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->textcont.element.node.nsnode);
|
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->element.node.nsnode);
|
||||||
if(NS_FAILED(nsres))
|
if(NS_FAILED(nsres))
|
||||||
ERR("SelectNodeContents failed: %08x\n", nsres);
|
ERR("SelectNodeContents failed: %08x\n", nsres);
|
||||||
}else {
|
}else {
|
||||||
ERR("CreateRange failed: %08x\n", nsres);
|
ERR("CreateRange failed: %08x\n", nsres);
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = HTMLTxtRange_Create(This->textcont.element.node.doc->basedoc.doc_node, nsrange, range);
|
hres = HTMLTxtRange_Create(This->element.node.doc->basedoc.doc_node, nsrange, range);
|
||||||
|
|
||||||
nsIDOMRange_Release(nsrange);
|
nsIDOMRange_Release(nsrange);
|
||||||
return hres;
|
return hres;
|
||||||
|
@ -779,40 +775,40 @@ static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
|
||||||
HTMLBodyElement_createTextRange
|
HTMLBodyElement_createTextRange
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline HTMLTextContainer *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
|
static inline HTMLBodyElement *impl_from_IHTMLTextContainer(IHTMLTextContainer *iface)
|
||||||
{
|
{
|
||||||
return CONTAINING_RECORD(iface, HTMLTextContainer, IHTMLTextContainer_iface);
|
return CONTAINING_RECORD(iface, HTMLBodyElement, IHTMLTextContainer_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
|
static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface,
|
||||||
REFIID riid, void **ppv)
|
REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
|
return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
|
static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
|
return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
|
static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IHTMLElement_Release(&This->element.IHTMLElement_iface);
|
return IHTMLElement_Release(&This->element.IHTMLElement_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
|
static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
|
||||||
LCID lcid, ITypeInfo **ppTInfo)
|
LCID lcid, ITypeInfo **ppTInfo)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
|
||||||
ppTInfo);
|
ppTInfo);
|
||||||
}
|
}
|
||||||
|
@ -821,7 +817,7 @@ static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface,
|
||||||
LPOLESTR *rgszNames, UINT cNames,
|
LPOLESTR *rgszNames, UINT cNames,
|
||||||
LCID lcid, DISPID *rgDispId)
|
LCID lcid, DISPID *rgDispId)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
|
||||||
cNames, lcid, rgDispId);
|
cNames, lcid, rgDispId);
|
||||||
}
|
}
|
||||||
|
@ -830,7 +826,7 @@ static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID
|
||||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
|
||||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||||
}
|
}
|
||||||
|
@ -838,14 +834,14 @@ static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID
|
||||||
static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
|
static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
|
||||||
IDispatch **range)
|
IDispatch **range)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, range);
|
FIXME("(%p)->(%p)\n", This, range);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
|
static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *iface, LONG *p)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
@ -854,7 +850,7 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollHeight(IHTMLTextContainer *ifa
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
|
static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *iface, LONG *p)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
@ -863,7 +859,7 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollWidth(IHTMLTextContainer *ifac
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
|
static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface, LONG v)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%d)\n", This, v);
|
TRACE("(%p)->(%d)\n", This, v);
|
||||||
|
|
||||||
|
@ -872,7 +868,7 @@ static HRESULT WINAPI HTMLTextContainer_put_scrollTop(IHTMLTextContainer *iface,
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
|
static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface, LONG *p)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
@ -881,7 +877,7 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollTop(IHTMLTextContainer *iface,
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
|
static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface, LONG v)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%d)\n", This, v);
|
TRACE("(%p)->(%d)\n", This, v);
|
||||||
|
|
||||||
|
@ -890,7 +886,7 @@ static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
|
static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, LONG *p)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
|
@ -899,14 +895,14 @@ static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
|
static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
FIXME("(%p)->()\n", This);
|
FIXME("(%p)->()\n", This);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
|
static HRESULT WINAPI HTMLTextContainer_get_onscroll(IHTMLTextContainer *iface, VARIANT *p)
|
||||||
{
|
{
|
||||||
HTMLTextContainer *This = impl_from_IHTMLTextContainer(iface);
|
HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, p);
|
FIXME("(%p)->(%p)\n", This, p);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
@ -930,17 +926,9 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
|
||||||
HTMLTextContainer_get_onscroll
|
HTMLTextContainer_get_onscroll
|
||||||
};
|
};
|
||||||
|
|
||||||
static void HTMLTextContainer_Init(HTMLTextContainer *This, HTMLDocumentNode *doc, nsIDOMElement *nselem,
|
|
||||||
dispex_static_data_t *dispex_data)
|
|
||||||
{
|
|
||||||
This->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
|
|
||||||
|
|
||||||
HTMLElement_Init(&This->element, doc, nselem, dispex_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline HTMLBodyElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
static inline HTMLBodyElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
|
||||||
{
|
{
|
||||||
return CONTAINING_RECORD(iface, HTMLBodyElement, textcont.element.node);
|
return CONTAINING_RECORD(iface, HTMLBodyElement, element.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||||
|
@ -959,8 +947,8 @@ static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||||
TRACE("(%p)->(IID_IHTMLBodyElement %p)\n", This, ppv);
|
TRACE("(%p)->(IID_IHTMLBodyElement %p)\n", This, ppv);
|
||||||
*ppv = &This->IHTMLBodyElement_iface;
|
*ppv = &This->IHTMLBodyElement_iface;
|
||||||
}else if(IsEqualGUID(&IID_IHTMLTextContainer, riid)) {
|
}else if(IsEqualGUID(&IID_IHTMLTextContainer, riid)) {
|
||||||
TRACE("(%p)->(IID_IHTMLTextContainer %p)\n", &This->textcont, ppv);
|
TRACE("(%p)->(IID_IHTMLTextContainer %p)\n", This, ppv);
|
||||||
*ppv = &This->textcont.IHTMLTextContainer_iface;
|
*ppv = &This->IHTMLTextContainer_iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*ppv) {
|
if(*ppv) {
|
||||||
|
@ -968,7 +956,7 @@ static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HTMLElement_QI(&This->textcont.element.node, riid, ppv);
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HTMLBodyElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
static void HTMLBodyElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
||||||
|
@ -1000,11 +988,11 @@ static EventTarget *HTMLBodyElement_get_event_prop_target(HTMLDOMNode *iface, in
|
||||||
case EVENTID_FOCUS:
|
case EVENTID_FOCUS:
|
||||||
case EVENTID_LOAD:
|
case EVENTID_LOAD:
|
||||||
case EVENTID_SCROLL:
|
case EVENTID_SCROLL:
|
||||||
return This->textcont.element.node.doc && This->textcont.element.node.doc->window
|
return This->element.node.doc && This->element.node.doc->window
|
||||||
? &This->textcont.element.node.doc->window->event_target
|
? &This->element.node.doc->window->event_target
|
||||||
: &This->textcont.element.node.event_target;
|
: &This->element.node.event_target;
|
||||||
default:
|
default:
|
||||||
return &This->textcont.element.node.event_target;
|
return &This->element.node.event_target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1077,17 +1065,14 @@ HRESULT HTMLBodyElement_Create(HTMLDocumentNode *doc, nsIDOMElement *nselem, HTM
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
ret->IHTMLBodyElement_iface.lpVtbl = &HTMLBodyElementVtbl;
|
ret->IHTMLBodyElement_iface.lpVtbl = &HTMLBodyElementVtbl;
|
||||||
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
|
ret->IHTMLTextContainer_iface.lpVtbl = &HTMLTextContainerVtbl;
|
||||||
|
ret->element.node.vtbl = &HTMLBodyElementImplVtbl;
|
||||||
|
|
||||||
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLBodyElement_dispex);
|
||||||
|
|
||||||
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement, (void**)&ret->nsbody);
|
nsres = nsIDOMElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement, (void**)&ret->nsbody);
|
||||||
if(NS_FAILED(nsres)) {
|
assert(nsres == NS_OK);
|
||||||
ERR("Could not get nsDOMHTMLBodyElement: %08x\n", nsres);
|
|
||||||
heap_free(ret);
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
HTMLTextContainer_Init(&ret->textcont, doc, nselem, &HTMLBodyElement_dispex);
|
*elem = &ret->element;
|
||||||
|
|
||||||
*elem = &ret->textcont.element;
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue