Jacek Caban : mshtml: Set compatibility mode based on doctype.

Alexandre Julliard julliard at winehq.org
Wed Jul 6 09:57:30 CDT 2016


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jul  5 22:47:33 2016 +0200

mshtml: Set compatibility mode based on doctype.

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

---

 dlls/mshtml/mutation.c  | 11 +++++++++++
 dlls/mshtml/nsiface.idl | 15 ++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c
index dd3d119..a298ecb 100644
--- a/dlls/mshtml/mutation.c
+++ b/dlls/mshtml/mutation.c
@@ -729,6 +729,17 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
         return;
     }
 
+    if(This->document_mode == COMPAT_MODE_QUIRKS) {
+        nsIDOMDocumentType *nsdoctype;
+        nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMDocumentType, (void**)&nsdoctype);
+        if(NS_SUCCEEDED(nsres)) {
+            TRACE("doctype node\n");
+            /* FIXME: We should set it to something higher for internet zone. */
+            set_document_mode(This, COMPAT_MODE_IE7);
+            nsIDOMDocumentType_Release(nsdoctype);
+        }
+    }
+
     nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLElement, (void**)&nselem);
     if(NS_FAILED(nsres))
         return;
diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl
index 1b6104a..e9c717d 100644
--- a/dlls/mshtml/nsiface.idl
+++ b/dlls/mshtml/nsiface.idl
@@ -134,7 +134,6 @@ typedef nsISupports nsISHistory;
 typedef nsISupports nsIWidget;
 typedef nsISupports nsIPrompt;
 typedef nsISupports nsIAuthPrompt;
-typedef nsISupports nsIDOMDocumentType;
 typedef nsISupports nsIDOMDOMImplementation;
 typedef nsISupports nsIDOMCDATASection;
 typedef nsISupports nsIDOMProcessingInstruction;
@@ -1201,6 +1200,20 @@ interface nsIDOMComment : nsIDOMCharacterData
 
 [
     object,
+    uuid(cd7467b9-0f26-4787-a359-66e80ba8db92),
+    local
+]
+interface nsIDOMDocumentType : nsIDOMNode
+{
+    nsresult GetName(nsAString *aName);
+    nsresult GetPublicId(nsAString *aPublicId);
+    nsresult GetSystemId(nsAString *aSystemId);
+    nsresult GetInternalSubset(nsAString *aInternalSubset);
+    nsresult MozRemove();
+}
+
+[
+    object,
     uuid(48eb8d72-95bb-402e-a8fc-f2b187abcbdb),
     local
 ]




More information about the wine-cvs mailing list