Backed out changeset 5c65378feacd (bug 1298818)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 01 Sep 2016 20:45:29 +0200
changeset 312344 f8252a5b57fd3bfc0274413173dfcb55059ddb5f
parent 312343 1e7eb0625d3e5e7073b3978dcf900cbc83e7ce71
child 312345 488c4013ece13ea7ae090e6b9a8cd279405e14dd
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1298818
milestone51.0a1
backs out5c65378feacd8a66b9ef84fc36b551d0e25218d1
Backed out changeset 5c65378feacd (bug 1298818)
parser/expat/lib/moz_extensions.c
testing/web-platform/meta/dom/nodes/DOMImplementation-createDocument.html.ini
testing/web-platform/meta/dom/nodes/Document-createElementNS.html.ini
--- a/parser/expat/lib/moz_extensions.c
+++ b/parser/expat/lib/moz_extensions.c
@@ -40,24 +40,27 @@ int MOZ_XMLCheckQName(const char* ptr, c
           or we've already seen a colon. */
       if (ns_aware && (nmstrt || *colon || ptr + 2 == end)) {
         return MOZ_EXPAT_MALFORMED;
       }
       *colon = ptr;
       nmstrt = ns_aware; /* e.g. "a:0" should be valid if !ns_aware */
       break;
     case BT_NONASCII:
-      if (!IS_NAME_CHAR_MINBPC(ptr) ||
-          (nmstrt && !*colon && !IS_NMSTRT_CHAR_MINBPC(ptr))) {
-        return MOZ_EXPAT_INVALID_CHARACTER;
+      if (nmstrt && !IS_NMSTRT_CHAR_MINBPC(ptr)) {
+        /* If this is a valid name character and we're namespace-aware, the
+           QName is malformed.  Otherwise, this character's invalid at the
+           start of a name (or, if we're namespace-aware, at the start of a
+           localpart). */
+        return (IS_NAME_CHAR_MINBPC(ptr) && ns_aware) ?
+               MOZ_EXPAT_MALFORMED :
+               MOZ_EXPAT_INVALID_CHARACTER;
       }
-      if (nmstrt && *colon && !IS_NMSTRT_CHAR_MINBPC(ptr)) {
-        /* If a non-starting character like a number is right after the colon,
-           this is a namespace error, not invalid character */
-        return MOZ_EXPAT_MALFORMED;
+      if (!IS_NAME_CHAR_MINBPC(ptr)) {
+        return MOZ_EXPAT_INVALID_CHARACTER;
       }
       nmstrt = 0;
       break;
     case BT_NMSTRT:
     case BT_HEX:
       nmstrt = 0;
       break;
     case BT_DIGIT:
--- a/testing/web-platform/meta/dom/nodes/DOMImplementation-createDocument.html.ini
+++ b/testing/web-platform/meta/dom/nodes/DOMImplementation-createDocument.html.ini
@@ -1,14 +1,22 @@
 [DOMImplementation-createDocument.html]
   type: testharness
+  [createDocument test 7: null,"ெfoo",null,"INVALID_CHARACTER_ERR"]
+    expected: FAIL
+    bug: 1298818
+
   [createDocument test 67: "http://example.com/","a:0",null,"NAMESPACE_ERR"]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/319
 
+  [createDocument test 71: "http://example.com/","ெ:a",null,"INVALID_CHARACTER_ERR"]
+    expected: FAIL
+    bug: 1298818
+
   [createDocument test 197: metadata for null,null,DocumentType node]
     expected: FAIL
     bug: 520969
 
   [createDocument test 197: null,null,DocumentType node,null]
     expected: FAIL
     bug: 520969
 
--- a/testing/web-platform/meta/dom/nodes/Document-createElementNS.html.ini
+++ b/testing/web-platform/meta/dom/nodes/Document-createElementNS.html.ini
@@ -1,14 +1,32 @@
 [Document-createElementNS.html]
   type: testharness
+  [createElementNS test 7 in HTML document: null,"ெfoo","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+
+  [createElementNS test 7 in XML document: null,"ெfoo","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+
+  [createElementNS test 7 in XHTML document: null,"ெfoo","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+
   [createElementNS test 67 in HTML document: "http://example.com/","a:0","NAMESPACE_ERR"]
     bug: https://github.com/whatwg/dom/issues/319
     expected: FAIL
 
   [createElementNS test 67 in XML document: "http://example.com/","a:0","NAMESPACE_ERR"]
     bug: https://github.com/whatwg/dom/issues/319
     expected: FAIL
 
   [createElementNS test 67 in XHTML document: "http://example.com/","a:0","NAMESPACE_ERR"]
     bug: https://github.com/whatwg/dom/issues/319
     expected: FAIL
 
+  [createElementNS test 71 in HTML document: "http://example.com/","ெ:a","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+
+  [createElementNS test 71 in XML document: "http://example.com/","ெ:a","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+
+  [createElementNS test 71 in XHTML document: "http://example.com/","ெ:a","INVALID_CHARACTER_ERR"]
+    expected: FAIL
+