add tests for stylesheet responses coming out-of-order for the same element

This commit is contained in:
SwagColoredKitteh 2017-01-23 19:14:58 +01:00
parent bb2826e41f
commit 068f9608dc
7 changed files with 56 additions and 0 deletions

View file

@ -8750,6 +8750,18 @@
"url": "/_mozilla/mozilla/node_replaceChild.html"
}
],
"mozilla/out-of-order-stylesheet-loads-and-imports.html": [
{
"path": "mozilla/out-of-order-stylesheet-loads-and-imports.html",
"url": "/_mozilla/mozilla/out-of-order-stylesheet-loads-and-imports.html"
}
],
"mozilla/out-of-order-stylesheet-loads.html": [
{
"path": "mozilla/out-of-order-stylesheet-loads.html",
"url": "/_mozilla/mozilla/out-of-order-stylesheet-loads.html"
}
],
"mozilla/parentNode_querySelector.html": [
{
"path": "mozilla/parentNode_querySelector.html",

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset="utf-8">
<title>Out-of-order stylesheet loads for the same element happen correctly, even with imports (issue #15101)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = "resources/imports-background-red.css?pipe=trickle(d3)";
document.head.appendChild(link);
link.href = "resources/imports-background-green.css";
t.step_timeout(function() {
assert_equals(getComputedStyle(document.body).getPropertyValue("background-color"), "rgb(0, 128, 0)");
t.done();
}, 4000);
}, "out-of-order stylesheet loads for the same element happen correctly, even with imports");
</script>

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset="utf-8">
<title>Out-of-order stylesheet loads for the same element happen correctly (issue #15101)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
var link = document.createElement("link");
link.rel = "stylesheet";
link.href = "resources/background-red.css?pipe=trickle(d3)";
document.head.appendChild(link);
link.href = "resources/background-green.css";
t.step_timeout(function() {
assert_equals(getComputedStyle(document.body).getPropertyValue("background-color"), "rgb(0, 128, 0)");
t.done();
}, 4000);
}, "out-of-order stylesheet loads for the same element happen correctly");
</script>

View file

@ -0,0 +1,3 @@
body {
background-color: green;
}

View file

@ -0,0 +1,3 @@
body {
background-color: red;
}

View file

@ -0,0 +1 @@
@import url("background-green.css");

View file

@ -0,0 +1 @@
@import url("background-red.css");