Jacek Caban : mshtml: Added HTMLAnchorElement dispex data.
Alexandre Julliard
julliard at winehq.org
Fri Oct 2 11:02:23 CDT 2009
Module: wine
Branch: master
Commit: df90f665bb11e2d01ff3e061d6f989ce2589cadb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=df90f665bb11e2d01ff3e061d6f989ce2589cadb
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Oct 2 13:51:19 2009 +0200
mshtml: Added HTMLAnchorElement dispex data.
---
dlls/mshtml/dispex.c | 2 ++
dlls/mshtml/htmlanchor.c | 24 ++++++++++++++++++++++--
dlls/mshtml/mshtml_private.h | 2 ++
dlls/mshtml/tests/dom.c | 10 ++++++----
4 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index a2d3468..3cfae67 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -79,6 +79,7 @@ static REFIID tid_ids[] = {
&IID_NULL,
&DIID_DispCEventObj,
&DIID_DispDOMChildrenCollection,
+ &DIID_DispHTMLAnchorElement,
&DIID_DispHTMLBody,
&DIID_DispHTMLCommentElement,
&DIID_DispHTMLCurrentStyle,
@@ -98,6 +99,7 @@ static REFIID tid_ids[] = {
&DIID_DispHTMLTableRow,
&DIID_DispHTMLUnknownElement,
&DIID_DispHTMLWindow2,
+ &IID_IHTMLAnchorElement,
&IID_IHTMLBodyElement,
&IID_IHTMLBodyElement2,
&IID_IHTMLCommentElement,
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c
index 7e5fd3f..7797e7e 100644
--- a/dlls/mshtml/htmlanchor.c
+++ b/dlls/mshtml/htmlanchor.c
@@ -474,14 +474,34 @@ static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
HTMLAnchorElement_destructor
};
+static const tid_t HTMLAnchorElement_iface_tids[] = {
+ IHTMLAnchorElement_tid,
+ IHTMLDOMNode_tid,
+ IHTMLDOMNode2_tid,
+ IHTMLElement_tid,
+ IHTMLElement2_tid,
+ IHTMLElement3_tid,
+ IHTMLElement4_tid,
+ IHTMLTextContainer_tid,
+ IHTMLUniqueName_tid,
+ 0
+};
+
+static dispex_static_data_t HTMLAnchorElement_dispex = {
+ NULL,
+ DispHTMLAnchorElement_tid,
+ NULL,
+ HTMLAnchorElement_iface_tids
+};
+
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
- HTMLElement_Init(&ret->element, NULL);
-
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
+ HTMLElement_Init(&ret->element, &HTMLAnchorElement_dispex);
+
return &ret->element;
}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 085dd1d..18719fe 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -59,6 +59,7 @@ typedef enum {
NULL_tid,
DispCEventObj_tid,
DispDOMChildrenCollection_tid,
+ DispHTMLAnchorElement_tid,
DispHTMLBody_tid,
DispHTMLCommentElement_tid,
DispHTMLCurrentStyle_tid,
@@ -78,6 +79,7 @@ typedef enum {
DispHTMLTableRow_tid,
DispHTMLUnknownElement_tid,
DispHTMLWindow2_tid,
+ IHTMLAnchorElement_tid,
IHTMLBodyElement_tid,
IHTMLBodyElement2_tid,
IHTMLCommentElement_tid,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 626445e..b8a7e8a 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -353,7 +353,7 @@ static const elem_type_info_t elem_type_infos[] = {
{"HEAD", elem_iids, NULL},
{"TITLE", elem_iids, NULL},
{"BODY", body_iids, &DIID_DispHTMLBody},
- {"A", anchor_iids, NULL},
+ {"A", anchor_iids, &DIID_DispHTMLAnchorElement},
{"INPUT", input_iids, &DIID_DispHTMLInputElement},
{"SELECT", select_iids, &DIID_DispHTMLSelectElement},
{"TEXTAREA", textarea_iids, NULL},
@@ -527,7 +527,8 @@ static void _test_disp(unsigned line, IUnknown *unk, const IID *diid, const char
if(_test_get_dispid(line, unk, &iid))
ok_(__FILE__,line) (IsEqualGUID(&iid, diid), "unexpected guid %s\n", dbgstr_guid(&iid));
- _test_disp_value(line, unk, val);
+ if(val)
+ _test_disp_value(line, unk, val);
}
#define test_disp2(u,id,id2,v) _test_disp2(__LINE__,u,id,id2,v)
@@ -539,7 +540,8 @@ static void _test_disp2(unsigned line, IUnknown *unk, const IID *diid, const IID
ok_(__FILE__,line) (IsEqualGUID(&iid, diid) || broken(IsEqualGUID(&iid, diid2)),
"unexpected guid %s\n", dbgstr_guid(&iid));
- _test_disp_value(line, unk, val);
+ if(val)
+ _test_disp_value(line, unk, val);
}
#define get_elem_iface(u) _get_elem_iface(__LINE__,u)
@@ -664,7 +666,7 @@ static void _test_elem_type(unsigned line, IUnknown *unk, elem_type_t type)
_test_elem_tag(line, unk, elem_type_infos[type].tag);
_test_ifaces(line, unk, elem_type_infos[type].iids);
- if(elem_type_infos[type].dispiid)
+ if(elem_type_infos[type].dispiid && type != ET_A)
_test_disp(line, unk, elem_type_infos[type].dispiid, "[object]");
}
More information about the wine-cvs
mailing list