Jacek Caban : mshtml: Use proper document mode for document fragment objects.

Alexandre Julliard julliard at winehq.org
Wed May 30 15:30:51 CDT 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed May 30 19:49:51 2018 +0200

mshtml: Use proper document mode for document fragment objects.

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

---

 dlls/mshtml/htmldoc.c             |  1 +
 dlls/mshtml/tests/documentmode.js | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 8cee880..6030681 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -5197,6 +5197,7 @@ static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *do
 
     HTMLDOMNode_Init(doc_node, &doc_frag->node, nsnode, &HTMLDocumentNode_dispex);
     doc_frag->node.vtbl = &HTMLDocumentFragmentImplVtbl;
+    doc_frag->document_mode = lock_document_mode(doc_node);
 
     *ret = doc_frag;
     return S_OK;
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 663cce7..aa5954b 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -70,6 +70,23 @@ function test_doc_props() {
     next_test();
 }
 
+function test_docfrag_props() {
+    var docfrag = document.createDocumentFragment();
+
+    function test_exposed(prop, expect) {
+        if(expect)
+            ok(prop in docfrag, prop + " not found in document fragent.");
+        else
+            ok(!(prop in docfrag), prop + " found in document fragent.");
+    }
+
+    var v = document.documentMode;
+
+    test_exposed("compareDocumentPosition", v >= 9);
+
+    next_test();
+}
+
 function test_window_props() {
     function test_exposed(prop, expect) {
         if(expect)
@@ -247,6 +264,7 @@ var tests = [
     test_iframe_doc_mode,
     test_elem_props,
     test_doc_props,
+    test_docfrag_props,
     test_window_props,
     test_javascript,
     test_xhr_props,




More information about the wine-cvs mailing list