Commit d631268f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Properly expose IHTMLDocument6 interface to scripts.

parent f84d1f0a
...@@ -4887,19 +4887,32 @@ static const tid_t HTMLDocumentNode_iface_tids[] = { ...@@ -4887,19 +4887,32 @@ static const tid_t HTMLDocumentNode_iface_tids[] = {
IHTMLDOMNode_tid, IHTMLDOMNode_tid,
IHTMLDOMNode2_tid, IHTMLDOMNode2_tid,
IHTMLDocument2_tid, IHTMLDocument2_tid,
IHTMLDocument3_tid,
IHTMLDocument4_tid, IHTMLDocument4_tid,
IHTMLDocument5_tid, IHTMLDocument5_tid,
IHTMLDocument6_tid,
IDocumentSelector_tid, IDocumentSelector_tid,
0 0
}; };
void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t mode)
{
HTMLDOMNode_init_dispex_info(info, mode);
/* Depending on compatibility version, we add interfaces in different order
* so that the right getElementById implementation is used. */
if(mode < COMPAT_MODE_IE8) {
dispex_info_add_interface(info, IHTMLDocument3_tid, NULL);
dispex_info_add_interface(info, IHTMLDocument6_tid, NULL);
}else {
dispex_info_add_interface(info, IHTMLDocument6_tid, NULL);
dispex_info_add_interface(info, IHTMLDocument3_tid, NULL);
}
}
static dispex_static_data_t HTMLDocumentNode_dispex = { static dispex_static_data_t HTMLDocumentNode_dispex = {
&HTMLDocumentNode_dispex_vtbl, &HTMLDocumentNode_dispex_vtbl,
DispHTMLDocument_tid, DispHTMLDocument_tid,
HTMLDocumentNode_iface_tids, HTMLDocumentNode_iface_tids,
HTMLDOMNode_init_dispex_info HTMLDocumentNode_init_dispex_info
}; };
static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window) static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window)
......
...@@ -55,6 +55,21 @@ function test_doc_props() { ...@@ -55,6 +55,21 @@ function test_doc_props() {
next_test(); next_test();
} }
function test_elem_by_id() {
document.body.innerHTML = '<form id="testid" name="testname"></form>';
var id_elem = document.getElementById("testid");
ok(id_elem.tagName === "FORM", "id_elem.tagName = " + id_elem.tagName);
var name_elem = document.getElementById("testname");
if(document.documentMode < 8)
ok(id_elem === name_elem, "id_elem != id_elem");
else
ok(name_elem === null, "name_elem != null");
next_test();
}
function test_doc_mode() { function test_doc_mode() {
compat_version = parseInt(document.location.search.substring(1)); compat_version = parseInt(document.location.search.substring(1));
...@@ -116,5 +131,6 @@ var tests = [ ...@@ -116,5 +131,6 @@ var tests = [
test_doc_mode, test_doc_mode,
test_elem_props, test_elem_props,
test_doc_props, test_doc_props,
test_elem_by_id,
test_conditional_comments test_conditional_comments
]; ];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment