From 928914c81ebbbb21ff66e3b044036bf7a4172d08 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 29 Apr 2008 01:39:38 +0200 Subject: [PATCH] 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 37a3b3d624..6f17a9db3c 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 7252ddeadf..a642295a8d 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 911abe0d9a..55c0090ea9 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 7d607d76f7..7a9b05d3f0 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},