Jacek Caban : mshtml: Inherit document mode from parent document.

Alexandre Julliard julliard at winehq.org
Fri Sep 29 13:32:38 CDT 2017


Module: wine
Branch: master
Commit: e6778fe0238e33b924c863105ca21940098ab5c6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e6778fe0238e33b924c863105ca21940098ab5c6

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Sep 29 17:14:36 2017 +0200

mshtml: Inherit document mode from parent document.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmldoc.c             |  9 +++++++++
 dlls/mshtml/tests/documentmode.js | 17 +++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index f4ff2f7..e32385e 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -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;
 
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 77f6993..aaf052b 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -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,




More information about the wine-cvs mailing list