Jacek Caban : mshtml: Support semicolon in UA compatible string.

Alexandre Julliard julliard at winehq.org
Mon Aug 12 18:51:09 CDT 2019


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Aug 12 14:02:21 2019 +0200

mshtml: Support semicolon in UA compatible string.

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

---

 dlls/mshtml/mutation.c     | 9 ++++++---
 dlls/mshtml/tests/script.c | 4 ++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c
index ab748c7..6903fe8 100644
--- a/dlls/mshtml/mutation.c
+++ b/dlls/mshtml/mutation.c
@@ -405,7 +405,7 @@ BOOL parse_compat_version(const WCHAR *version_string, compat_mode_t *r)
 
     for(p = version_string; '0' <= *p && *p <= '9'; p++)
         version = version * 10 + *p-'0';
-    if(*p || p == version_string)
+    if((*p && *p != ';') || p == version_string)
         return FALSE;
 
     switch(version){
@@ -434,7 +434,7 @@ BOOL parse_compat_version(const WCHAR *version_string, compat_mode_t *r)
 static BOOL parse_ua_compatible(const WCHAR *p, compat_mode_t *r)
 {
     static const WCHAR ie_eqW[] = {'I','E','='};
-    static const WCHAR edgeW[] = {'e','d','g','e',0};
+    static const WCHAR edgeW[] = {'e','d','g','e'};
 
     TRACE("%s\n", debugstr_w(p));
 
@@ -442,7 +442,10 @@ static BOOL parse_ua_compatible(const WCHAR *p, compat_mode_t *r)
         return FALSE;
     p += 3;
 
-    if(!wcsicmp(p, edgeW)) {
+    if(!wcsnicmp(p, edgeW, ARRAY_SIZE(edgeW))) {
+        p += ARRAY_SIZE(edgeW);
+        if(*p && *p != ';')
+            return FALSE;
         *r = COMPAT_MODE_IE11;
         return TRUE;
     }
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index d4c53cd..e62b83d 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -3493,9 +3493,9 @@ static void run_js_tests(void)
     run_script_as_http_with_mode("documentmode.js", "7", "7");
     run_script_as_http_with_mode("documentmode.js", "8", "8");
     run_script_as_http_with_mode("documentmode.js", "9", "9");
-    run_script_as_http_with_mode("documentmode.js", "10", "10");
+    run_script_as_http_with_mode("documentmode.js", "10", "10;abc");
     run_script_as_http_with_mode("documentmode.js", "11", "11");
-    run_script_as_http_with_mode("documentmode.js", "11", "edge");
+    run_script_as_http_with_mode("documentmode.js", "11", "edge;123");
 
     run_script_as_http_with_mode("asyncscriptload.js", NULL, "9");
 }




More information about the wine-cvs mailing list