From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlelem.c | 7 +++++++ dlls/mshtml/htmlnode.c | 17 +++++++++-------- dlls/mshtml/mshtml_private.h | 4 +++- dlls/mshtml/tests/documentmode.js | 3 +++ dlls/mshtml/tests/es5.js | 7 +++++++ 5 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 9a86c7f2f65..7001ff3b7da 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7235,9 +7235,16 @@ static const IWineHTMLElementPrivateVtbl WineHTMLElementPrivateVtbl = { htmlelement_private_get_classList, };
+dispex_static_data_t Element_dispex = { + .name = "Element", + .id = PROT_Element, + .prototype_id = PROT_Node, +}; + dispex_static_data_t HTMLElement_dispex = { .name = "HTMLElement", .id = PROT_HTMLElement, + .prototype_id = PROT_Element, .vtbl = &HTMLElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .iface_tids = HTMLElement_iface_tids, diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 8f9de03fd93..263c04c4485 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1286,7 +1286,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno assert(nsres == NS_OK); }
-static const dispex_static_data_vtbl_t HTMLDOMNode_dispex_vtbl = { +static const dispex_static_data_vtbl_t Node_dispex_vtbl = { .query_interface = HTMLDOMNode_query_interface, .destructor = HTMLDOMNode_destructor, .traverse = HTMLDOMNode_traverse, @@ -1297,12 +1297,13 @@ static const tid_t HTMLDOMNode_iface_tids[] = { IHTMLDOMNode_tid, 0 }; -static dispex_static_data_t HTMLDOMNode_dispex = { - "Node", - &HTMLDOMNode_dispex_vtbl, - IHTMLDOMNode_tid, - HTMLDOMNode_iface_tids, - HTMLDOMNode_init_dispex_info +dispex_static_data_t Node_dispex = { + .name = "Node", + .id = PROT_Node, + .vtbl = &Node_dispex_vtbl, + .disp_tid = IHTMLDOMNode_tid, + .iface_tids = HTMLDOMNode_iface_tids, + .init_info = HTMLDOMNode_init_dispex_info, };
static HRESULT create_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNode **ret) @@ -1356,7 +1357,7 @@ static HRESULT create_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNod return E_OUTOFMEMORY;
node->vtbl = &HTMLDOMNodeImplVtbl; - HTMLDOMNode_Init(doc, node, nsnode, &HTMLDOMNode_dispex); + HTMLDOMNode_Init(doc, node, nsnode, &Node_dispex); *ret = node; } } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 78387532fb5..7662558fffd 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -408,9 +408,11 @@ typedef struct {
#define ALL_PROTOTYPES \ X(DOMImplementation) \ + X(Element) \ X(HTMLBodyElement) \ X(HTMLElement) \ - X(Navigator) + X(Navigator) \ + X(Node)
typedef enum { PROT_NONE, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 96e3aa878fa..15a2fbc83a0 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3124,4 +3124,7 @@ sync_test("prototypes", function() { check(Navigator.prototype, Object.prototype, "navigator prototype"); check(document.body, HTMLBodyElement.prototype, "body element"); check(HTMLBodyElement.prototype, HTMLElement.prototype, "body prototype"); + check(HTMLElement.prototype, Element.prototype, "html element prototype"); + check(Element.prototype, Node.prototype, "element prototype"); + check(Node.prototype, Object.prototype, "node prototype"); }); diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index ec05974432c..b5fdbdf708a 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -2756,9 +2756,16 @@ sync_test("prototypes", function() { ok(!HTMLBodyElement.prototype.hasOwnProperty("click"), "HTMLBodyElement prototype has own click property"); ok(HTMLElement.prototype.hasOwnProperty("click"), "HTMLElement prototype does not have own click property");
+ ok(!HTMLBodyElement.prototype.hasOwnProperty("removeChild"), "HTMLBodyElement prototype has own removeChild property"); + ok(!HTMLElement.prototype.hasOwnProperty("removeChild"), "HTMLElement prototype has own removeChild property"); + ok(!Element.prototype.hasOwnProperty("removeChild"), "Element prototype has own removeChild property"); + ok(Node.prototype.hasOwnProperty("removeChild"), "Node prototype does not have own removeChild property"); + ok(document.implementation instanceof DOMImplementation, "document.implementation is not an instance of DOMImplementation"); ok(navigator instanceof Navigator, "navigator is not an instance of Navigator"); ok(!(navigator instanceof DOMImplementation), "navigator is an instance of DOMImplementation"); ok(document.body instanceof HTMLBodyElement, "body is not an instance of HTMLBodyElement"); ok(document.body instanceof HTMLElement, "body is not an instance of HTMLElement"); + ok(document.body instanceof Element, "body is not an instance of Element"); + ok(document.body instanceof Node, "body is not an instance of Node"); });