Jacek Caban : mshtml: Added IDispatchEx support to HTMLSelectElement.

Alexandre Julliard julliard at winehq.org
Wed Jun 18 12:56:17 CDT 2008


Module: wine
Branch: master
Commit: 1741e652b31eb718674e74336e6fb9e775dc10cb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1741e652b31eb718674e74336e6fb9e775dc10cb

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jun 18 00:09:53 2008 +0200

mshtml: Added IDispatchEx support to HTMLSelectElement.

---

 dlls/mshtml/dispex.c         |    2 ++
 dlls/mshtml/htmlselect.c     |   23 ++++++++++++++++++++---
 dlls/mshtml/mshtml_private.h |    2 ++
 dlls/mshtml/tests/dom.c      |    2 +-
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 06fdf19..4de3d86 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -59,6 +59,7 @@ static REFIID tid_ids[] = {
     &DIID_DispHTMLImg,
     &DIID_DispHTMLInputElement,
     &DIID_DispHTMLOptionElement,
+    &DIID_DispHTMLSelectElement,
     &DIID_DispHTMLStyle,
     &DIID_DispHTMLUnknownElement,
     &DIID_DispHTMLWindow2,
@@ -77,6 +78,7 @@ static REFIID tid_ids[] = {
     &IID_IHTMLImgElement,
     &IID_IHTMLInputElement,
     &IID_IHTMLOptionElement,
+    &IID_IHTMLSelectElement,
     &IID_IHTMLStyle,
     &IID_IHTMLWindow2,
     &IID_IHTMLWindow3,
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c
index 03fcb8f..1783bab 100644
--- a/dlls/mshtml/htmlselect.c
+++ b/dlls/mshtml/htmlselect.c
@@ -420,16 +420,33 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = {
     HTMLSelectElement_destructor
 };
 
+static const tid_t HTMLSelectElement_tids[] = {
+    IHTMLDOMNode_tid,
+    IHTMLDOMNode2_tid,
+    IHTMLElement_tid,
+    IHTMLElement2_tid,
+    IHTMLSelectElement_tid,
+    0
+};
+
+static dispex_static_data_t HTMLSelectElement_dispex = {
+    NULL,
+    DispHTMLSelectElement_tid,
+    NULL,
+    HTMLSelectElement_tids
+};
+
 HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
 {
     HTMLSelectElement *ret = heap_alloc_zero(sizeof(HTMLSelectElement));
     nsresult nsres;
 
-    HTMLElement_Init(&ret->element);
-
     ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
     ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
-    
+
+    init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLSELECT(ret), &HTMLSelectElement_dispex);
+    HTMLElement_Init(&ret->element);
+
     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
                                              (void**)&ret->nsselect);
     if(NS_FAILED(nsres))
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 7ad2325..87d29ac 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -69,6 +69,7 @@ typedef enum {
     DispHTMLImg_tid,
     DispHTMLInputElement_tid,
     DispHTMLOptionElement_tid,
+    DispHTMLSelectElement_tid,
     DispHTMLStyle_tid,
     DispHTMLUnknownElement_tid,
     DispHTMLWindow2_tid,
@@ -87,6 +88,7 @@ typedef enum {
     IHTMLImgElement_tid,
     IHTMLInputElement_tid,
     IHTMLOptionElement_tid,
+    IHTMLSelectElement_tid,
     IHTMLStyle_tid,
     IHTMLWindow2_tid,
     IHTMLWindow3_tid,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 27cb3aa..45a5383 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -248,7 +248,7 @@ static const elem_type_info_t elem_type_infos[] = {
     {"BODY",      body_iids,        NULL},
     {"A",         anchor_iids,      NULL},
     {"INPUT",     input_iids,       &DIID_DispHTMLInputElement},
-    {"SELECT",    select_iids,      NULL},
+    {"SELECT",    select_iids,      &DIID_DispHTMLSelectElement},
     {"TEXTAREA",  textarea_iids,    NULL},
     {"OPTION",    option_iids,      &DIID_DispHTMLOptionElement},
     {"STYLE",     elem_iids,        NULL},




More information about the wine-cvs mailing list