Skip to content

Commit

Permalink
Add tests for using replaceData to change CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
CYBAI committed Nov 28, 2017
1 parent 3a74014 commit 96ba56c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -154981,6 +154981,18 @@
{}
]
],
"css/cssom/stylesheet-replacedata-dynamic.html": [
[
"/css/cssom/stylesheet-replacedata-dynamic.html",
[
[
"/css/cssom/stylesheet-replacedata-dynamic-ref.html",
"=="
]
],
{}
]
],
"css/filter-effects/css-filters-animation-blur.html": [
[
"/css/filter-effects/css-filters-animation-blur.html",
Expand Down Expand Up @@ -253079,6 +253091,11 @@
{}
]
],
"css/cssom/stylesheet-replacedata-dynamic-ref.html": [
[
{}
]
],
"css/cssom/stylesheet-same-origin.css": [
[
{}
Expand Down Expand Up @@ -511223,6 +511240,14 @@
"875598ca4271d4adaa11fbb01981b290e6235019",
"testharness"
],
"css/cssom/stylesheet-replacedata-dynamic-ref.html": [
"e733dc40a41b899ab6c184211d75def5e52af3d4",
"support"
],
"css/cssom/stylesheet-replacedata-dynamic.html": [
"defc259c76eb8ab8b7e3c6ad90951bf4c6f18ab3",
"reftest"
],
"css/cssom/stylesheet-same-origin.css": [
"268fb9a72d33b3d18bbb82aaaac48bb15c89a88e",
"support"
Expand Down
@@ -0,0 +1,7 @@
<!doctype html>
<title>(Ref #1) CSS Test Reference</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com">
<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com">
<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata">
<style>.pass { color: green }</style>
<div class="pass">Should be green</div>
@@ -0,0 +1,12 @@
<!doctype html>
<title>(Test #1) CSS Test: Dynamic changes to the stylesheet contents using replaceData are reflected</title>
<link rel="match" href="stylesheet-replacedata-dynamic-ref.html">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com">
<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com">
<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata">
<style>.fail { color: green }</style>
<div class="pass">Should be green</div>
<script>
document.body.offsetTop;
document.querySelector('style').firstChild.replaceData(1, 4, "pass");
</script>

0 comments on commit 96ba56c

Please sign in to comment.