mshtml: Added IHTMLObjectElement::get_vspace implementation.

This commit is contained in:
Jacek Caban 2010-11-12 12:30:49 +01:00 committed by Alexandre Julliard
parent c7e37fd675
commit 6e796da748
3 changed files with 102 additions and 3 deletions

View File

@ -36,6 +36,8 @@ typedef struct {
HTMLElement element;
const IHTMLObjectElementVtbl *lpIHTMLObjectElementVtbl;
nsIDOMHTMLObjectElement *nsobject;
} HTMLObjectElement;
#define HTMLOBJECT(x) (&(x)->lpIHTMLObjectElementVtbl)
@ -314,8 +316,19 @@ static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LO
static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
{
HTMLObjectElement *This = HTMLOBJECT_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
PRInt32 vspace;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, &vspace);
if(NS_FAILED(nsres)) {
ERR("GetVspace failed: %08x\n", nsres);
return E_FAIL;
}
*p = vspace;
return S_OK;
}
static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
@ -405,6 +418,9 @@ static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
{
HTMLObjectElement *This = HTMLOBJECT_NODE_THIS(iface);
if(This->nsobject)
nsIDOMHTMLObjectElement_Release(This->nsobject);
HTMLElement_destructor(&This->element.node);
}
@ -430,10 +446,16 @@ static dispex_static_data_t HTMLObjectElement_dispex = {
HTMLElement *HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
{
HTMLObjectElement *ret = heap_alloc_zero(sizeof(*ret));
nsresult nsres;
ret->lpIHTMLObjectElementVtbl = &HTMLObjectElementVtbl;
ret->element.node.vtbl = &HTMLObjectElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLObjectElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLObjectElement iface: %08x\n", nsres);
return &ret->element;
}

View File

@ -1638,6 +1638,51 @@ interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
nsresult GetContentDocument(nsIDOMDocument **aContentDocument);
}
[
object,
uuid(a6cf90ac-15b3-11d2-932e-00805f8add32),
local
]
interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
{
nsresult GetForm(nsIDOMHTMLFormElement **aForm);
nsresult GetCode(nsAString *aCode);
nsresult SetCode(const nsAString *aCode);
nsresult GetAlign(nsAString *aAlign);
nsresult SetAlign(const nsAString *aAlign);
nsresult GetArchive(nsAString *aArchive);
nsresult SetArchive(const nsAString *aArchive);
nsresult GetBorder(nsAString *aBorder);
nsresult SetBorder(const nsAString *aBorder);
nsresult GetCodeBase(nsAString *aCodeBase);
nsresult SetCodeBase(const nsAString *aCodeBase);
nsresult GetCodeType(nsAString *aCodeType);
nsresult SetCodeType(const nsAString *aCodeType);
nsresult GetData(nsAString *aData);
nsresult SetData(const nsAString *aData);
nsresult GetDeclare(PRBool *aDeclare);
nsresult SetDeclare(PRBool aDeclare);
nsresult GetHeight(nsAString *aHeight);
nsresult SetHeight(const nsAString *aHeight);
nsresult GetHspace(PRInt32 *aHspace);
nsresult SetHspace(PRInt32 aHspace);
nsresult GetName(nsAString *aName);
nsresult SetName(const nsAString *aName);
nsresult GetStandby(nsAString *aStandby);
nsresult SetStandby(const nsAString *aStandby);
nsresult GetTabIndex(PRInt32 *aTabIndex);
nsresult SetTabIndex(PRInt32 aTabIndex);
nsresult GetType(nsAString *aType);
nsresult SetType(const nsAString *aType);
nsresult GetUseMap(nsAString *aUseMap);
nsresult SetUseMap(const nsAString *aUseMap);
nsresult GetVspace(PRInt32 *aVspace);
nsresult SetVspace(PRInt32 aVspace);
nsresult GetWidth(nsAString *aWidth);
nsresult SetWidth(const nsAString *aWidth);
nsresult GetContentDocument(nsIDOMDocument **aContentDocument);
}
[
object,
uuid(94928ab3-8b63-11d3-989d-001083010e9b),

View File

@ -48,7 +48,7 @@ static const char elem_test_str[] =
"<textarea id=\"X\">text text</textarea>"
"<table id=\"tbl\"><tbody><tr></tr><tr id=\"row2\"><td>td1 text</td><td>td2 text</td></tr></tbody></table>"
"<script id=\"sc\" type=\"text/javascript\"><!--\nfunction Testing() {}\n// -->\n</script>"
"<test /><object></object><embed />"
"<test /><object id=\"objid\" vspace=100></object><embed />"
"<img id=\"imgid\" name=\"WineImg\"/>"
"<iframe src=\"about:blank\" id=\"ifr\"></iframe>"
"<form id=\"frm\"></form>"
@ -756,6 +756,17 @@ static IHTMLCommentElement *_get_comment_iface(unsigned line, IUnknown *unk)
return comment;
}
#define get_object_iface(u) _get_object_iface(__LINE__,u)
static IHTMLObjectElement *_get_object_iface(unsigned line, IUnknown *unk)
{
IHTMLObjectElement *obj;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IHTMLObjectElement, (void**)&obj);
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLObjectElement: %08x\n", hres);
return obj;
}
#define test_node_name(u,n) _test_node_name(__LINE__,u,n)
static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
{
@ -1284,6 +1295,20 @@ static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext)
SysFreeString(text);
}
#define test_object_vspace(u,s) _test_object_vspace(__LINE__,u,s)
static void _test_object_vspace(unsigned line, IUnknown *unk, LONG exl)
{
IHTMLObjectElement *object = _get_object_iface(line, unk);
LONG l;
HRESULT hres;
l = 0xdeadbeef;
hres = IHTMLObjectElement_get_vspace(object, &l);
ok_(__FILE__,line)(hres == S_OK, "get_vspace failed: %08x\n", hres);
ok_(__FILE__,line)(l == exl, "vspace=%d, expected %d\n", l, exl);
IHTMLObjectElement_Release(object);
}
#define create_option_elem(d,t,v) _create_option_elem(__LINE__,d,t,v)
static IHTMLOptionElement *_create_option_elem(unsigned line, IHTMLDocument2 *doc,
const char *txt, const char *val)
@ -6224,6 +6249,13 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
}
elem = get_doc_elem_by_id(doc, "objid");
ok(elem != NULL, "elem == NULL\n");
if(elem) {
test_object_vspace((IUnknown*)elem, 100);
IHTMLElement_Release(elem);
}
elem = get_elem_by_id(doc, "a", TRUE);
if(elem) {
test_anchor_href((IUnknown*)elem, "http://test/");