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 | 27 ++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 9 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 ad22ef9dc48..3b5db6115f4 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, IHTMLDOMNode2_tid, NULL); dispex_info_add_interface(info, IHTMLDOMNode3_tid, NULL); @@ -1295,15 +1303,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 fc28ac80f75..546393a6e4a 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,28 @@ 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("ownerDocument", 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 +1203,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() { @@ -3631,6 +3655,7 @@ sync_test("prototype props", function() {
check(CSSStyleRule, [ "readOnly", "selectorText", "style" ]); check(CustomEvent, [ "detail", "initCustomEvent" ]); + check(DocumentType, [ "entities", "internalSubset", "name", "notations", "publicId", "systemId" ]); check(Event, [ "AT_TARGET", "BUBBLING_PHASE", "CAPTURING_PHASE", "bubbles", "cancelBubble", "cancelable", "currentTarget", "defaultPrevented", "eventPhase", "initEvent", "isTrusted", "preventDefault", "srcElement", @@ -3658,7 +3683,7 @@ sync_test("prototype props", function() { "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", "DOCUMENT_POSITION_PRECEDING", "DOCUMENT_TYPE_NODE", "ELEMENT_NODE", "ENTITY_NODE", "ENTITY_REFERENCE_NODE", "NOTATION_NODE", - "PROCESSING_INSTRUCTION_NODE", "TEXT_NODE", "hasAttributes", "normalize", "removeNode", + "PROCESSING_INSTRUCTION_NODE", "TEXT_NODE", "hasAttributes", "normalize", "replaceNode", "swapNode" ]); check(StorageEvent, [ "initStorageEvent", "key", "newValue", "oldValue", "storageArea", "url" ]);