mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision 71a0d51d14d8b0f1b53cda3a7d39ef8765164485
This commit is contained in:
parent
d504015496
commit
163009575a
290 changed files with 2928 additions and 972 deletions
|
@ -5,8 +5,7 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="testlib/testlib.js"></script>
|
||||
<script>
|
||||
// add a script that looks for document.body as first child of HEAD
|
||||
testlib.addScript('',{src:'scripts/find-body.js'},document.getElementsByTagName('head')[0], true );
|
||||
testlib.addScript('',{src:'scripts/find-body.js?pipe=trickle(d1)'},document.getElementsByTagName('head')[0], true );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -23,7 +22,9 @@
|
|||
if(!(window.findFooLoaded && window.findBodyLoaded)) {
|
||||
return setTimeout(t.step_func(test), 200);
|
||||
}
|
||||
assert_array_equals(eventOrder, ['document.body: <BODY>', 'found #foo element: YES']);
|
||||
assert_any(assert_array_equals, eventOrder,
|
||||
[['document.body: <BODY>', 'found #foo element: YES'],
|
||||
['found #foo element: YES', 'document.body: <BODY>']]);
|
||||
t.done();
|
||||
}
|
||||
onload = t.step_func(test)
|
||||
|
|
|
@ -1,32 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<title> scheduler: defer script after initial onload event</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="testlib/testlib.js"></script>
|
||||
<title> scheduler: defer script after initial onload event</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>
|
||||
<iframe id="myFrame"></iframe>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
<iframe id="myFrame"></iframe>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
var t = async_test();
|
||||
onload = t.step_func(
|
||||
function() {
|
||||
var doc = document.getElementById("myFrame").contentDocument;
|
||||
var win = document.getElementById("myFrame").contentWindow;
|
||||
doc.open();
|
||||
doc.write("<title> scheduler: defer script after initial onload event</title><script src='/resources/testharness.js'><\/script><script src='/resources/testharnessreport.js'><\/script><script src='testlib/testlib.js'><\/script><div id='log'>document.written content</div><script>log('inline script #1'); t = async_test();<\/script><script src='scripts/include-1.js'><\/script><script defer src='scripts/include-2.js'><\/script>");
|
||||
doc.write("<title> scheduler: defer script after initial onload event</title><script src='testlib/testlib.js'><\/script><div id='log'>document.written content</div><script>log('inline script #1');<\/script><script src='scripts/include-1.js'><\/script><script defer src='scripts/include-2.js'><\/script>");
|
||||
doc.close();
|
||||
//Note that the *window* object has changed but the *global scope* of the script has not.
|
||||
win.setTimeout(
|
||||
function() {
|
||||
window.t.step(
|
||||
function() {
|
||||
var run_t = window.t.step_func(function() {
|
||||
if (!win.eventOrder || win.eventOrder.length != 3) {
|
||||
window.setTimeout(run_t, 100);
|
||||
return;
|
||||
}
|
||||
window.assert_array_equals(win.eventOrder, ['inline script #1', 'external script #1', 'external script #2']);
|
||||
window.t.done();
|
||||
})}, 1000);
|
||||
});
|
||||
run_t();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -1,27 +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>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
<div id="test">Test</div>
|
||||
|
||||
<script>
|
||||
var t = async_test();
|
||||
var t0 = Date.now();
|
||||
</script>
|
||||
|
||||
<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/import.css?pipe=trickle(d2)">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
<div id="test">Test</div>
|
||||
|
||||
<script>
|
||||
t.step(function() {
|
||||
var t1 = Date.now();
|
||||
assert_true(t1 - t0 > 1000, "Delayed by " + (t1-t0) + "ms expected > 1000ms");
|
||||
t.done();
|
||||
test(function() {
|
||||
assert_equals(getComputedStyle(document.getElementById("test")).position,
|
||||
"fixed");
|
||||
});
|
||||
</script>
|
||||
</body></html>
|
||||
|
|
|
@ -1,27 +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>
|
||||
<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="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
<div id="test">Test</div>
|
||||
|
||||
<script>
|
||||
var t = async_test();
|
||||
var t0 = Date.now();
|
||||
</script>
|
||||
|
||||
<!-- this stylesheet blocks scripts -->
|
||||
<script>
|
||||
t.step(function() {
|
||||
test(function() {
|
||||
document.write("<link rel='stylesheet' href='css/import.css?pipe=trickle(d2)'>");
|
||||
var t1 = Date.now();
|
||||
<!-- note that the pass condition here is not per spec (but does match implementations) as of 2012-06-26 -->
|
||||
assert_true(t1-t0 < 1000, "Stylesheet blocked scripts, delayed by " + (t1-t0) + "ms expected < 1000ms");
|
||||
t.done();
|
||||
assert_equals(getComputedStyle(document.getElementById("test")).position,
|
||||
"static");
|
||||
});
|
||||
</script>
|
||||
</body></html>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div id="test"></div>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
|
||||
<script id="async-script" async src="scripts/include-2.js?pipe=trickle(d2)"></script>
|
||||
<script id="async-script" async src="scripts/include-2.js?pipe=trickle(d3)"></script>
|
||||
|
||||
<script>
|
||||
var t = async_test();
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<title> scheduler: removing async attribute at runtime, script also has defer attribute</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="testlib/testlib.js"></script>
|
||||
<title> scheduler: removing async attribute at runtime, script also has defer attribute</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="testlib/testlib.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="test"></div>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
<div id="log">FAILED (This TC requires JavaScript enabled)</div>
|
||||
|
||||
<script id="async-script" async defer src="scripts/include-1.js?pipe=trickle(d1)"></script>
|
||||
<script id="async-script" async defer src="scripts/include-1.js?pipe=trickle(d3)"></script>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
var t = async_test();
|
||||
document.getElementById("async-script").removeAttribute("async");
|
||||
|
||||
addEventListener("DOMContentLoaded", t.step_func(function () {
|
||||
assert_array_equals(eventOrder, []);
|
||||
t.done();
|
||||
}), false);
|
||||
|
||||
addEventListener("load", t.step_func(function () {
|
||||
assert_array_equals(eventOrder, ["external script #1"]);
|
||||
t.done();
|
||||
}), false);
|
||||
|
||||
|
||||
</script>
|
||||
</body></html>
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
#test {background-image:url("1x1-green.png?pipe=trickle(d2)");
|
||||
background-repeat:repeat;
|
||||
background-color:orange;}
|
||||
#test {position:fixed}
|
|
@ -1 +1 @@
|
|||
@import("background.css")
|
||||
@import url("background.css")
|
Loading…
Add table
Add a link
Reference in a new issue