aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/wpt/mozilla/meta/MANIFEST.json24
-rw-r--r--tests/wpt/mozilla/tests/css/restyle-nth-child-ref.html17
-rw-r--r--tests/wpt/mozilla/tests/css/restyle-nth-child.html24
3 files changed, 65 insertions, 0 deletions
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json
index d94defbd2d7..3297053b159 100644
--- a/tests/wpt/mozilla/meta/MANIFEST.json
+++ b/tests/wpt/mozilla/meta/MANIFEST.json
@@ -4636,6 +4636,18 @@
"url": "/_mozilla/css/removeproperty.html"
}
],
+ "css/restyle-nth-child.html": [
+ {
+ "path": "css/restyle-nth-child.html",
+ "references": [
+ [
+ "/_mozilla/css/restyle-nth-child-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/_mozilla/css/restyle-nth-child.html"
+ }
+ ],
"css/restyle_hints_attr.html": [
{
"path": "css/restyle_hints_attr.html",
@@ -14006,6 +14018,18 @@
"url": "/_mozilla/css/removeproperty.html"
}
],
+ "css/restyle-nth-child.html": [
+ {
+ "path": "css/restyle-nth-child.html",
+ "references": [
+ [
+ "/_mozilla/css/restyle-nth-child-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/_mozilla/css/restyle-nth-child.html"
+ }
+ ],
"css/restyle_hints_attr.html": [
{
"path": "css/restyle_hints_attr.html",
diff --git a/tests/wpt/mozilla/tests/css/restyle-nth-child-ref.html b/tests/wpt/mozilla/tests/css/restyle-nth-child-ref.html
new file mode 100644
index 00000000000..c59c9fde35c
--- /dev/null
+++ b/tests/wpt/mozilla/tests/css/restyle-nth-child-ref.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS test reference.</title>
+<style>
+ .container div {
+ width: 50px;
+ height: 50px;
+ background: blue;
+ }
+ .container div:nth-child(2) {
+ background: green;
+ }
+</style>
+<div class="container">
+ <div></div>
+ <div></div>
+</div>
diff --git a/tests/wpt/mozilla/tests/css/restyle-nth-child.html b/tests/wpt/mozilla/tests/css/restyle-nth-child.html
new file mode 100644
index 00000000000..b7e1fb4b461
--- /dev/null
+++ b/tests/wpt/mozilla/tests/css/restyle-nth-child.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Restyling of a child of a parent that didn't match nth-child but now
+ does should be correct.</title>
+<link rel="match" href="restyle-nth-child-ref.html">
+<style>
+ .container div {
+ width: 50px;
+ height: 50px;
+ background: blue;
+ }
+ .container div:nth-child(2) {
+ background: green;
+ }
+</style>
+<div class="container">
+ <div></div>
+</div>
+<script>
+ let container = document.querySelector('.container');
+ window.onload = function() {
+ container.insertBefore(document.createElement('div'), container.firstChild);
+ }
+</script>