Bug 1361303 - Part 1: Add test for serialization of CSS Custom Property names. r=xidorn
authorCameron McCormack <cam@mcc.id.au>
Tue, 02 May 2017 15:03:53 +0800
changeset 356010 dc77087efa2edb596be4c4bc2ce54613d426f362
parent 356009 785f1ade7dc2e8cc0b82b6df2eb29d86333337c8
child 356011 545f5678ceaf25aa1d6be4dcb364453ec4e042ff
push id31754
push userkwierso@gmail.com
push dateWed, 03 May 2017 00:28:51 +0000
treeherdermozilla-central@5eaf2d70eded [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1361303
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1361303 - Part 1: Add test for serialization of CSS Custom Property names. r=xidorn MozReview-Commit-ID: E1nwZzB8hRK
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/cssom/variable-names.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -86407,16 +86407,22 @@
     ]
    ],
    "cssom/stylesheet-same-origin.sub.html": [
     [
      "/cssom/stylesheet-same-origin.sub.html",
      {}
     ]
    ],
+   "cssom/variable-names.html": [
+    [
+     "/cssom/variable-names.html",
+     {}
+    ]
+   ],
    "custom-elements/CustomElementRegistry.html": [
     [
      "/custom-elements/CustomElementRegistry.html",
      {}
     ]
    ],
    "custom-elements/Document-createElement.html": [
     [
@@ -165050,16 +165056,20 @@
   "cssom/stylesheet-same-origin.css": [
    "268fb9a72d33b3d18bbb82aaaac48bb15c89a88e",
    "support"
   ],
   "cssom/stylesheet-same-origin.sub.html": [
    "719c525b1af3b6b46dfeeb0627034d799bab50b5",
    "testharness"
   ],
+  "cssom/variable-names.html": [
+   "5ab67b9e86fd700a556d153898c2896448cc1759",
+   "testharness"
+  ],
   "custom-elements/CustomElementRegistry.html": [
    "d1661ab1734f7d1a252030aeac7e9842a7a4cb3b",
    "testharness"
   ],
   "custom-elements/Document-createElement.html": [
    "d9582ab3867b02e98da9b0da8e3398303d1833ab",
    "testharness"
   ],
@@ -165779,17 +165789,17 @@
    "c2882d5007a804e5c0f9ecf307b0367d1ff49aef",
    "testharness"
   ],
   "dom/nodes/DOMImplementation-createDocument.html": [
    "b03938e18d60802ba8ba3c0c7e8fd7714dd72768",
    "testharness"
   ],
   "dom/nodes/DOMImplementation-createDocumentType.html": [
-   "09a9749b83780791c66d8695023165cd544ec23c",
+   "515a2a4dc52fafb890899ff340201ed87418fc1f",
    "testharness"
   ],
   "dom/nodes/DOMImplementation-createHTMLDocument.html": [
    "90be3c69aaccfa46c4ac0e2eb04921f19999f1dd",
    "testharness"
   ],
   "dom/nodes/DOMImplementation-createHTMLDocument.js": [
    "e2487daf724039c3a5c740ff0b51392d7a56058f",
@@ -166111,17 +166121,17 @@
    "e3c4288a4ad551c7b3f269b48a5a734207b39766",
    "testharness"
   ],
   "dom/nodes/Document-createElementNS.html": [
    "6a08de4ca3515d9e59043642c0654dc9a8fc310e",
    "testharness"
   ],
   "dom/nodes/Document-createElementNS.js": [
-   "9b6cf141da4b259fd2a032d47082b70ccfe4a59b",
+   "a0cb73e1bef92ce357f50e03c74794ec25a98c2e",
    "support"
   ],
   "dom/nodes/Document-createEvent.html": [
    "00da7c85dab7a6f6414d4c58205ac501be0c588d",
    "testharness"
   ],
   "dom/nodes/Document-createEvent.js": [
    "6e7d9350e2fd9ffad36fddd4d90438d620c7dbf3",
@@ -166587,17 +166597,17 @@
    "bb30c12cea7ffaaadcebeb71b4267b6d04e4e499",
    "testharness"
   ],
   "dom/nodes/append-on-Document.html": [
    "8af56db026eb164f45b6004404cdf280c5977026",
    "testharness"
   ],
   "dom/nodes/attributes.html": [
-   "29d028e5c450d4e4939f19bb79cd596ddebb3a6f",
+   "2e68d3bc430dcd87b826327ead2f8b89c0abdef6",
    "testharness"
   ],
   "dom/nodes/attributes.js": [
    "f0f896ef5355dc3f3ad37d2d7453271fe2641686",
    "support"
   ],
   "dom/nodes/case.html": [
    "179a53fc539c9bc9e6d609997247dace0d1197a7",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/cssom/variable-names.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Tests for handling of CSS Custom Property names</title>
+<meta name="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+
+// Valid custom property names, before and after CSS escaping.
+var valid_names = [
+  ["--a", "--a"],
+  ["--a;b", "--a\\;b"],
+  ["---", "---"],
+  ["--\\", "--\\\\"],
+  ["--ab", "--\\61 b"],
+  ["--0", "--\\30 "],
+];
+
+valid_names.forEach(function(t) {
+  var name = t[0];
+  var escaped_name = t[1];
+
+  test(function() {
+    var e = document.createElement("span");
+    e.style = escaped_name + ":value";
+
+    for (var after_refeeding = 0; after_refeeding <= 1; ++after_refeeding) {
+      var desc_suffix = (after_refeeding ? " (after " : " (before ") +
+                        "serialization/re-parsing)";
+
+      assert_equals(e.style.length, 1,
+                    "appears on specified style" + desc_suffix);
+
+      assert_equals(e.style[0], name,
+                    "name returned correctly from specified " +
+                    "style indexed getter" + desc_suffix);
+
+      assert_equals(e.style.getPropertyValue(name), "value",
+                    "property value returned correctly from " +
+                    "specified style getPropertyValue" + desc_suffix);
+
+      e.style = e.style.cssText;
+    }
+  }, "custom property '" + name + "'");
+});
+</script>