Skip to content

Commit

Permalink
Merge pull request #2483 from Ms2ger/script-blocking-style
Browse files Browse the repository at this point in the history
Add tests for stylesheets blocking scripts without @import.
  • Loading branch information
jgraham committed Jan 18, 2016
2 parents 967dfa7 + 53b8542 commit 8c3c479
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
20 changes: 20 additions & 0 deletions old-tests/submission/Opera/script_scheduling/106-noimport.html
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html><head>
<title> scheduler: stylesheets blocking scripts</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="testlib/testlib.js"></script>
<!-- this stylesheet blocks scripts -->
<link rel="stylesheet" href="css/background.css?pipe=trickle(d2)">
</head>
<body>
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
<div id="test">Test</div>

<script>
test(function() {
assert_equals(getComputedStyle(document.getElementById("test")).position,
"fixed");
});
</script>
</body></html>
Expand Up @@ -13,7 +13,7 @@
<script>
test(function() {
document.write("<link rel='stylesheet' href='css/import.css?pipe=trickle(d2)'>");
<!-- note that the pass condition here is not per spec (but does match implementations) as of 2012-06-26 -->
// note that the pass condition here is not per spec (but does match implementations) as of 2012-06-26
assert_equals(getComputedStyle(document.getElementById("test")).position,
"static");
});
Expand Down
21 changes: 21 additions & 0 deletions old-tests/submission/Opera/script_scheduling/107-noimport.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html><head>
<title> scheduler: stylesheets blocking scripts document.write</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="testlib/testlib.js"></script>
</head>
<body>
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
<div id="test">Test</div>

<!-- this stylesheet blocks scripts -->
<script>
test(function() {
document.write("<link rel='stylesheet' href='css/background.css?pipe=trickle(d2)'>");
// note that the pass condition here is not per spec (but does match implementations) as of 2012-06-26
assert_equals(getComputedStyle(document.getElementById("test")).position,
"static");
});
</script>
</body></html>

0 comments on commit 8c3c479

Please sign in to comment.