Bug 1453442 [wpt PR 10429] - [cssom] Add a test for mutation records when CSSStyleDeclaration.setPropertyValue is invoked., a=testonly
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 22 Apr 2018 14:57:44 +0000
changeset 415263 b4c37d148d52084ef1d0c3563cc75bee1632b337
parent 415262 64574b6ba265941a1ca3e1d1fbcbb058751780bf
child 415264 f65230bf509558277ddedffa43e9518dcd48adef
push id102533
push userwptsync@mozilla.com
push dateTue, 24 Apr 2018 12:30:46 +0000
treeherdermozilla-inbound@2342a0a0052f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1453442, 10429
milestone61.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 1453442 [wpt PR 10429] - [cssom] Add a test for mutation records when CSSStyleDeclaration.setPropertyValue is invoked., a=testonly Automatic update from web-platform-testsMerge pull request #10429 from emilio/mutation-record [cssom] Add a test for mutation records when CSSStyleDeclaration.setPropertyValue is invoked. -- wpt-commits: ab9fc1edc3f464617d6ed72a2336d064f9cdcfcc wpt-pr: 10429
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-001.html
testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-002.html
testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-003.html
testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-004.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -321734,16 +321734,40 @@
     ]
    ],
    "css/cssom/cssstyledeclaration-mutability.html": [
     [
      "/css/cssom/cssstyledeclaration-mutability.html",
      {}
     ]
    ],
+   "css/cssom/cssstyledeclaration-mutationrecord-001.html": [
+    [
+     "/css/cssom/cssstyledeclaration-mutationrecord-001.html",
+     {}
+    ]
+   ],
+   "css/cssom/cssstyledeclaration-mutationrecord-002.html": [
+    [
+     "/css/cssom/cssstyledeclaration-mutationrecord-002.html",
+     {}
+    ]
+   ],
+   "css/cssom/cssstyledeclaration-mutationrecord-003.html": [
+    [
+     "/css/cssom/cssstyledeclaration-mutationrecord-003.html",
+     {}
+    ]
+   ],
+   "css/cssom/cssstyledeclaration-mutationrecord-004.html": [
+    [
+     "/css/cssom/cssstyledeclaration-mutationrecord-004.html",
+     {}
+    ]
+   ],
    "css/cssom/cssstyledeclaration-setter-order.html": [
     [
      "/css/cssom/cssstyledeclaration-setter-order.html",
      {}
     ]
    ],
    "css/cssom/escape.html": [
     [
@@ -537607,16 +537631,32 @@
   "css/cssom/cssstyledeclaration-csstext.html": [
    "aa2adbfcc58f3a844e2e1f2c96e5efed2c81f2c3",
    "testharness"
   ],
   "css/cssom/cssstyledeclaration-mutability.html": [
    "5f29436964d01c57f61d513cee5b83281643ac54",
    "testharness"
   ],
+  "css/cssom/cssstyledeclaration-mutationrecord-001.html": [
+   "5d455757e4c80b4781ea4263fa78bced1d6b8632",
+   "testharness"
+  ],
+  "css/cssom/cssstyledeclaration-mutationrecord-002.html": [
+   "f21e4ba8d5195a66a0a5e64c72731bab75a44ea4",
+   "testharness"
+  ],
+  "css/cssom/cssstyledeclaration-mutationrecord-003.html": [
+   "a7968f4e7d85d778425f584d2a42bf74b8583bdb",
+   "testharness"
+  ],
+  "css/cssom/cssstyledeclaration-mutationrecord-004.html": [
+   "958b71b8f1c58a809590459e6f085f3e1217e9c7",
+   "testharness"
+  ],
   "css/cssom/cssstyledeclaration-setter-order.html": [
    "3e0e768c466011bb3d91b3f0eff55e029a2aec0f",
    "testharness"
   ],
   "css/cssom/escape.html": [
    "c9ed57c7ef7a035c25feff4ea60547a57d727f31",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-001.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: CSSStyleDeclaration.setPropertyValue queues a mutation record when not actually mutated</title>
+<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue">
+<link rel="help" href="https://drafts.csswg.org/cssom/#update-style-attribute-for">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  document.documentElement.style.top = "0px";
+
+  let test = async_test("CSSStyleDeclaration.setPropertyValue queues a mutation record, even if not mutated");
+  let m = new MutationObserver(function(r) {
+    assert_equals(r.length, 1);
+    test.done();
+  });
+
+  m.observe(document.documentElement,  { attributes: true });
+  document.documentElement.style.top = "0px";
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-002.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: CSSStyleDeclaration.setPropertyValue doesn't queue a mutation record for invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  let test = async_test("CSSStyleDeclaration.setPropertyValue doesn't queue a mutation record when setting invalid values");
+  let m = new MutationObserver(test.unreached_func("shouldn't queue a mutation record"));
+  m.observe(document.documentElement,  { attributes: true });
+
+  document.documentElement.style.width = "-100px";
+  requestAnimationFrame(() => test.done());
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-003.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: CSSStyleDeclaration.removeProperty doesn't queue a mutation record when not actually removed, invoked from setPropertyValue</title>
+<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  let test = async_test("CSSStyleDeclaration.removeProperty doesn't queue a mutation record when not actually removed, invoked from setPropertyValue");
+  document.documentElement.style.top = "0";
+  let m = new MutationObserver(test.unreached_func("shouldn't queue a mutation record"));
+  m.observe(document.documentElement,  { attributes: true });
+
+  document.documentElement.style.width = "";
+  requestAnimationFrame(() => test.done());
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/cssstyledeclaration-mutationrecord-004.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: CSSStyleDeclaration.removeProperty doesn't queue a mutation record when not actually removed</title>
+<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue">
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+  let test = async_test("CSSStyleDeclaration.removeProperty doesn't queue a mutation record when not actually removed");
+  document.documentElement.style.top = "0";
+  let m = new MutationObserver(test.unreached_func("shouldn't queue a mutation record"));
+  m.observe(document.documentElement,  { attributes: true });
+
+  document.documentElement.style.removeProperty("width");
+  requestAnimationFrame(() => test.done());
+</script>