From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlnode.c | 4 +- dlls/mshtml/tests/documentmode.js | 77 ++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 703bbd43262..7df7b5bdc6a 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1262,8 +1262,10 @@ void HTMLDOMNode_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
dispex_info_add_interface(info, IHTMLDOMNode_tid, mode >= COMPAT_MODE_IE9 ? ie9_hooks : NULL);
- if(mode >= COMPAT_MODE_IE9) + if(mode >= COMPAT_MODE_IE9) { + dispex_info_add_interface(info, IHTMLDOMNode2_tid, NULL); dispex_info_add_interface(info, IHTMLDOMNode3_tid, NULL); + }
EventTarget_init_dispex_info(info, mode); } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 49b8a0656fb..d2db9d0fd20 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -604,6 +604,7 @@ sync_test("textnode_props", function() { test_exposed("childNodes", true); test_exposed("nodeName", true); test_exposed("nodeValue", true); + test_exposed("ownerDocument", true); test_exposed("removeNode", true); test_exposed("replaceNode", true); test_exposed("swapNode", true); @@ -3381,7 +3382,7 @@ sync_test("form", function() { });
sync_test("prototypes", function() { - var v = document.documentMode; + var v = document.documentMode, i, j, k; if(v < 9) return;
@@ -3595,4 +3596,78 @@ sync_test("prototypes", function() { check(Attr.prototype, Node.prototype, "attr prototype"); check(document.createDocumentFragment(), DocumentFragment.prototype, "fragment"); check(DocumentFragment.prototype, Node.prototype, "fragment prototype"); + + var props = [ + [ "CSSStyleRule", [ "readOnly", "selectorText", "style" ] ], + [ "CustomEvent", [ "detail", "initCustomEvent" ] ], + [ "DocumentType", [ "entities", "internalSubset", "name", "notations", "publicId", "systemId" ] ], + [ "Event", [ + ["AT_TARGET",true], ["BUBBLING_PHASE",true], ["CAPTURING_PHASE",true], + "bubbles", "cancelBubble", "cancelable", "currentTarget", "defaultPrevented", "eventPhase", "initEvent", "isTrusted", + "preventDefault", "srcElement", "stopImmediatePropagation", "stopPropagation", "target", "timeStamp", "type" + ] ], + [ "HTMLUnknownElement", [ "namedRecordset", "recordset" ] ], + [ "MessageEvent", [ "data", "initMessageEvent", "origin", ["ports",10,v >= 10], "source" ] ], + [ "MouseEvent", [ + "altKey", "button", "buttons", "clientX", "clientY", "ctrlKey", "fromElement", "getModifierState", + "initMouseEvent", "layerX", "layerY", "metaKey", "offsetX", "offsetY", "pageX", "pageY", "relatedTarget", + "screenX", "screenY", "shiftKey", "toElement", "which", "x", "y" + ] ], + [ "Node", [ + ["ATTRIBUTE_NODE",true], ["CDATA_SECTION_NODE",true], ["COMMENT_NODE",true], ["DOCUMENT_FRAGMENT_NODE",true], + ["DOCUMENT_NODE",true], ["DOCUMENT_POSITION_CONTAINED_BY",true], ["DOCUMENT_POSITION_CONTAINS",true], + ["DOCUMENT_POSITION_DISCONNECTED",true], ["DOCUMENT_POSITION_FOLLOWING",true], + ["DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC",true], ["DOCUMENT_POSITION_PRECEDING",true], + ["DOCUMENT_TYPE_NODE",true], ["ELEMENT_NODE",true], ["ENTITY_NODE",true], ["ENTITY_REFERENCE_NODE",true], + ["NOTATION_NODE",true], ["PROCESSING_INSTRUCTION_NODE",true], ["TEXT_NODE",true], + "addEventListener", "appendChild", "attributes", "childNodes", "cloneNode", "compareDocumentPosition", + "dispatchEvent", "firstChild", ["hasAttributes",true], "hasChildNodes", "insertBefore", "isDefaultNamespace", + "isEqualNode", "isSameNode", "isSupported", "lastChild", "localName", "lookupNamespaceURI", "lookupPrefix", + "namespaceURI", "nextSibling", "nodeName", "nodeType", "nodeValue", ["normalize",true], "ownerDocument", + "parentNode", "prefix", "previousSibling", "removeChild", "removeEventListener", "replaceChild", "textContent" + ] ], + [ "StorageEvent", [ "initStorageEvent", "key", "newValue", "oldValue", "storageArea", "url" ] ], + [ "UIEvent", [ "detail", "initUIEvent", "view" ] ] + ]; + + for(i = 0; i < props.length; i++) { + var proto = props[i][0], seen_constructor = false; + var expected = props[i][1], enumerated = Object.getOwnPropertyNames(window[proto].prototype).sort(); + + for(k = 0, j = 0; j < expected.length; j++) { + var name = expected[j], minv = 0, maxv = 11, ok_ = ok; + if(Array.isArray(name)) { + if(typeof(name[1]) === "number") { + minv = name[1]; + if(name.length > 2 && typeof(name[2]) === "number") + maxv = name[2]; + } + if(typeof(name[name.length-1]) === "boolean" && name[name.length-1]) + ok_ = todo_wine.ok; + name = name[0]; + } + if(enumerated[k] === "constructor") { + seen_constructor = true; + k++; + } + while(enumerated[k] < name && k < enumerated.length) { + ok(false, enumerated[k] + " is a prop of " + proto + ".prototype"); + k++; + } + if(enumerated[k] !== name) + ok_(v < minv || v > maxv, name + " not a prop of " + proto + ".prototype"); + else { + ok_(v >= minv && v <= maxv, name + " is a prop of " + proto + ".prototype"); + k++; + } + } + while(k < enumerated.length) { + if(enumerated[k] === "constructor") + seen_constructor = true; + else + ok(false, enumerated[k] + " is a prop of " + proto + ".prototype"); + k++; + } + if(broken(true) /* todo_wine */) ok(seen_constructor, "constructor not a prop of " + proto + ".prototype"); + } });