From: Gabriel Ivăncescu gabrielopcode@gmail.com
For some reason it's exposed higher up the chain in various other prototypes, but not the doctype.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 4 +--- dlls/mshtml/htmlnode.c | 13 ++++++++----- dlls/mshtml/tests/documentmode.js | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 70bc028f3a0..e8470c0d4cb 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -316,9 +316,6 @@ static const event_target_vtbl_t DocumentType_event_target_vtbl = {
static const tid_t DocumentType_iface_tids[] = { IDOMDocumentType_tid, - IHTMLDOMNode_tid, - IHTMLDOMNode2_tid, - IHTMLDOMNode3_tid, 0 };
@@ -328,6 +325,7 @@ dispex_static_data_t DocumentType_dispex = { .vtbl = &DocumentType_event_target_vtbl.dispex_vtbl, .disp_tid = DispDOMDocumentType_tid, .iface_tids = DocumentType_iface_tids, + .init_info = HTMLDOMNode_init_dispex_info, };
HRESULT create_doctype_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNode **ret) diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 7fad8f22357..64a5b6c85ea 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -24,6 +24,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h"
#include "wine/debug.h"
@@ -1252,6 +1253,13 @@ static HRESULT HTMLDOMNode_clone(HTMLDOMNode *This, nsIDOMNode *nsnode, HTMLDOMN
void HTMLDOMNode_init_dispex_info(dispex_data_t *info, compat_mode_t mode) { + static const dispex_hook_t ie9_hooks[] = { + {DISPID_IHTMLDOMNODE_REMOVENODE, NULL}, + {DISPID_UNKNOWN} + }; + + dispex_info_add_interface(info, IHTMLDOMNode_tid, mode >= COMPAT_MODE_IE9 ? ie9_hooks : NULL); + if(mode >= COMPAT_MODE_IE9) dispex_info_add_interface(info, IHTMLDOMNode3_tid, NULL);
@@ -1293,15 +1301,10 @@ static const dispex_static_data_vtbl_t Node_dispex_vtbl = { .unlink = HTMLDOMNode_unlink };
-static const tid_t HTMLDOMNode_iface_tids[] = { - IHTMLDOMNode_tid, - 0 -}; dispex_static_data_t Node_dispex = { .id = PROT_Node, .vtbl = &Node_dispex_vtbl, .disp_tid = IHTMLDOMNode_tid, - .iface_tids = HTMLDOMNode_iface_tids, .init_info = HTMLDOMNode_init_dispex_info, };
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 0ee20de7a90..91e5ad1c2fb 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -512,6 +512,7 @@ sync_test("elem_props", function() { test_exposed("readyState", v < 11); test_exposed("clientTop", true); test_exposed("title", true); + test_exposed("removeNode", true); test_exposed("querySelectorAll", v >= 8); test_exposed("textContent", v >= 9); test_exposed("prefix", v >= 9); @@ -586,6 +587,27 @@ sync_test("docfrag_props", function() { test_exposed("compareDocumentPosition", v >= 9); });
+sync_test("textnode_props", function() { + var node = document.createTextNode("testNode"); + + function test_exposed(prop, expect) { + if(expect) + ok(prop in node, prop + " not found in text node."); + else + ok(!(prop in node), prop + " found in text node."); + } + + var v = document.documentMode; + + test_exposed("childNodes", true); + test_exposed("nodeName", true); + test_exposed("nodeValue", true); + test_exposed("removeNode", true); + test_exposed("compareDocumentPosition", v >= 9); + test_exposed("isEqualNode", v >= 9); + test_exposed("prefix", v >= 9); +}); + sync_test("window_props", function() { function test_exposed(prop, expect, is_todo) { var ok_ = is_todo ? todo_wine.ok : ok; @@ -1180,6 +1202,7 @@ sync_test("doctype", function() { }
ok(doctype.name === "html", "doctype.name = " + doctype.name); + ok(!("removeNode" in doctype), "removeNode found in doctype."); });
async_test("iframe_doc_mode", function() {