Add reftest for the correct restyling of containers that match slow selectors.

This commit is contained in:
Emilio Cobos Álvarez 2016-08-30 13:40:08 -07:00
parent 468b329645
commit ccb4e958e5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 65 additions and 0 deletions

View file

@ -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",

View file

@ -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>

View file

@ -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>