Jacek Caban : mshtml: Added script element IDispatchEx support.

Alexandre Julliard julliard at winehq.org
Thu Jan 28 11:15:34 CST 2010


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan 28 02:10:24 2010 +0100

mshtml: Added script element IDispatchEx support.

---

 dlls/mshtml/dispex.c         |    2 ++
 dlls/mshtml/htmlscript.c     |   15 ++++++++++++++-
 dlls/mshtml/mshtml_private.h |    2 ++
 dlls/mshtml/tests/dom.c      |    2 +-
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index ca09313..d7220d7 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -100,6 +100,7 @@ static REFIID tid_ids[] = {
     &DIID_DispHTMLNavigator,
     &DIID_DispHTMLOptionElement,
     &DIID_DispHTMLScreen,
+    &DIID_DispHTMLScriptElement,
     &DIID_DispHTMLSelectElement,
     &DIID_DispHTMLStyle,
     &DIID_DispHTMLTable,
@@ -142,6 +143,7 @@ static REFIID tid_ids[] = {
     &IID_IHTMLLocation,
     &IID_IHTMLOptionElement,
     &IID_IHTMLScreen,
+    &IID_IHTMLScriptElement,
     &IID_IHTMLSelectElement,
     &IID_IHTMLStyle,
     &IID_IHTMLStyle2,
diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c
index d86f398..2427309 100644
--- a/dlls/mshtml/htmlscript.c
+++ b/dlls/mshtml/htmlscript.c
@@ -319,6 +319,19 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
     HTMLScriptElement_get_readystate
 };
 
+static const tid_t HTMLScriptElement_iface_tids[] = {
+    HTMLELEMENT_TIDS,
+    IHTMLScriptElement_tid,
+    0
+};
+
+static dispex_static_data_t HTMLScriptElement_dispex = {
+    NULL,
+    DispHTMLScriptElement_tid,
+    NULL,
+    HTMLScriptElement_iface_tids
+};
+
 HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
 {
     HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
@@ -327,7 +340,7 @@ HTMLElement *HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *
     ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl;
     ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
 
-    HTMLElement_Init(&ret->element, doc, nselem, NULL);
+    HTMLElement_Init(&ret->element, doc, nselem, &HTMLScriptElement_dispex);
 
     nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
     if(NS_FAILED(nsres))
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 30b47e8..8a1ff01 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -76,6 +76,7 @@ typedef enum {
     DispHTMLNavigator_tid,
     DispHTMLOptionElement_tid,
     DispHTMLScreen_tid,
+    DispHTMLScriptElement_tid,
     DispHTMLSelectElement_tid,
     DispHTMLStyle_tid,
     DispHTMLTable_tid,
@@ -118,6 +119,7 @@ typedef enum {
     IHTMLLocation_tid,
     IHTMLOptionElement_tid,
     IHTMLScreen_tid,
+    IHTMLScriptElement_tid,
     IHTMLSelectElement_tid,
     IHTMLStyle_tid,
     IHTMLStyle2_tid,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index c818a1d..581d9d4 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -412,7 +412,7 @@ static const elem_type_info_t elem_type_infos[] = {
     {"BR",        elem_iids,        NULL},
     {"TABLE",     table_iids,       &DIID_DispHTMLTable},
     {"TBODY",     elem_iids,        NULL},
-    {"SCRIPT",    script_iids,      NULL},
+    {"SCRIPT",    script_iids,      &DIID_DispHTMLScriptElement},
     {"TEST",      elem_iids,        &DIID_DispHTMLUnknownElement},
     {"TEST",      generic_iids,     &DIID_DispHTMLGenericElement},
     {"!",         comment_iids,     &DIID_DispHTMLCommentElement},




More information about the wine-cvs mailing list