Jacek Caban : mshtml: Added IDispatchEx support to HTMLOptionElement.

Alexandre Julliard julliard at winehq.org
Tue Apr 29 08:54:35 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Apr 29 01:39:38 2008 +0200

mshtml: Added IDispatchEx support to HTMLOptionElement.

---

 dlls/mshtml/dispex.c         |    2 ++
 dlls/mshtml/htmloption.c     |   16 ++++++++++++++++
 dlls/mshtml/mshtml_private.h |    2 ++
 dlls/mshtml/tests/dom.c      |    4 ++--
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 37a3b3d..6f17a9d 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -55,6 +55,7 @@ static REFIID tid_ids[] = {
     &DIID_DispHTMLDOMTextNode,
     &DIID_DispHTMLElementCollection,
     &DIID_DispHTMLInputElement,
+    &DIID_DispHTMLOptionElement,
     &DIID_DispHTMLUnknownElement,
     &DIID_DispHTMLWindow2,
     &IID_IHTMLDocument2,
@@ -68,6 +69,7 @@ static REFIID tid_ids[] = {
     &IID_IHTMLElement2,
     &IID_IHTMLElementCollection,
     &IID_IHTMLInputElement,
+    &IID_IHTMLOptionElement,
     &IID_IHTMLWindow2,
     &IID_IHTMLWindow3,
     &IID_IOmNavigator
diff --git a/dlls/mshtml/htmloption.c b/dlls/mshtml/htmloption.c
index 7252dde..a642295 100644
--- a/dlls/mshtml/htmloption.c
+++ b/dlls/mshtml/htmloption.c
@@ -331,6 +331,20 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
     HTMLOptionElement_destructor
 };
 
+static dispex_static_data_t HTMLOptionElement_dispex = {
+    NULL,
+    DispHTMLOptionElement_tid,
+    NULL,
+    {
+        IHTMLDOMNode_tid,
+        IHTMLDOMNode2_tid,
+        IHTMLElement_tid,
+        IHTMLElement2_tid,
+        IHTMLOptionElement_tid,
+        0
+    }
+};
+
 HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
 {
     HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
@@ -345,6 +359,8 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
     if(NS_FAILED(nsres))
         ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres);
 
+    init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLOPTION(ret), &HTMLOptionElement_dispex);
+
     return &ret->element;
 }
 
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 911abe0..55c0090 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -65,6 +65,7 @@ typedef enum {
     DispHTMLDOMTextNode_tid,
     DispHTMLElementCollection_tid,
     DispHTMLInputElement_tid,
+    DispHTMLOptionElement_tid,
     DispHTMLUnknownElement_tid,
     DispHTMLWindow2_tid,
     IHTMLDocument2_tid,
@@ -78,6 +79,7 @@ typedef enum {
     IHTMLElement2_tid,
     IHTMLElementCollection_tid,
     IHTMLInputElement_tid,
+    IHTMLOptionElement_tid,
     IHTMLWindow2_tid,
     IHTMLWindow3_tid,
     IOmNavigator_tid,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 7d607d7..7a9b05d 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -221,10 +221,10 @@ static const elem_type_info_t elem_type_infos[] = {
     {"TITLE",     elem_iids,        NULL},
     {"BODY",      body_iids,        NULL},
     {"A",         anchor_iids,      NULL},
-    {"INPUT",     input_iids,       NULL},
+    {"INPUT",     input_iids,       &DIID_DispHTMLInputElement},
     {"SELECT",    select_iids,      NULL},
     {"TEXTAREA",  textarea_iids,    NULL},
-    {"OPTION",    option_iids,      NULL},
+    {"OPTION",    option_iids,      &DIID_DispHTMLOptionElement},
     {"STYLE",     elem_iids,        NULL},
     {"BLOCKQUOTE",elem_iids,        NULL},
     {"P",         elem_iids,        NULL},




More information about the wine-cvs mailing list