mshtml: Inherit document mode from parent document.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-09-29 17:14:36 +02:00 committed by Alexandre Julliard
parent af07789cdc
commit e6778fe023
2 changed files with 26 additions and 0 deletions

View File

@ -5044,6 +5044,15 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
if(!doc)
return E_OUTOFMEMORY;
if(window->base.outer_window->parent) {
compat_mode_t parent_mode = window->base.outer_window->parent->base.inner_window->doc->document_mode;
TRACE("parent mode %u\n", parent_mode);
if(parent_mode >= COMPAT_MODE_IE9) {
doc->document_mode_locked = TRUE;
doc->document_mode = parent_mode;
}
}
if(!doc_obj->basedoc.window || window->base.outer_window == doc_obj->basedoc.window)
doc->basedoc.cp_container.forward_container = &doc_obj->basedoc.cp_container;

View File

@ -99,6 +99,22 @@ function test_doc_mode() {
next_test();
}
function test_iframe_doc_mode() {
var iframe = document.createElement("iframe");
iframe.onload = function() {
var iframe_mode = iframe.contentWindow.document.documentMode;
if(document.documentMode < 9)
ok(iframe_mode === 5, "iframe_mode = " + iframe_mode);
else
ok(iframe_mode === document.documentMode, "iframe_mode = " + iframe_mode);
next_test();
}
iframe.src = "about:blank";
document.body.appendChild(iframe);
}
function test_conditional_comments() {
var div = document.createElement("div");
document.body.appendChild(div);
@ -137,6 +153,7 @@ function test_conditional_comments() {
var tests = [
test_doc_mode,
test_iframe_doc_mode,
test_elem_props,
test_doc_props,
test_elem_by_id,