mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update web-platform-tests to revision cf8340b5fae7b820788ffc31f8cc6b6b04978002
This commit is contained in:
parent
a547ae6826
commit
538f8f0ef9
41 changed files with 270 additions and 295 deletions
|
@ -21,7 +21,11 @@ var data = {
|
|||
"xhr-test" : [],
|
||||
"script-svg" : [],
|
||||
"script-async" : [],
|
||||
"script-defer" : []
|
||||
"script-defer" : [],
|
||||
"script-async-false" : [],
|
||||
"iframe-src" : [],
|
||||
"cross-origin" : [null],
|
||||
"document-write" : []
|
||||
};
|
||||
|
||||
var expected = {};
|
||||
|
@ -189,3 +193,38 @@ function testLoadFail() {
|
|||
<script id='script-async' async src='data:text/plain,verify("script-async"),finish("script-async")'></script>
|
||||
|
||||
<script id='script-defer' defer src='data:text/plain,verify("script-defer"),finish("script-defer")'></script>
|
||||
|
||||
<!-- Test async = false dynamic script loading -->
|
||||
<script>
|
||||
var s = document.createElement("script");
|
||||
s.id = "script-async-false";
|
||||
s.src = "data:text/plain,verify('script-async-false');"
|
||||
s.onload = function() {
|
||||
finish('script-async-false');
|
||||
}
|
||||
s.async = false;
|
||||
document.body.appendChild(s);
|
||||
</script>
|
||||
|
||||
<!-- Verify in iframe javascript uri scheme -->
|
||||
<iframe src="javascript:parent.verify('iframe-src'),parent.finish('iframe-src')"
|
||||
style="visibility:hidden;display:none">
|
||||
</iframe>
|
||||
|
||||
<!-- Testing cross origin script -->
|
||||
<script>
|
||||
var s = document.createElement("script");
|
||||
s.id = "cross-origin";
|
||||
s.src = "http://{{domains[www1]}}:{{ports[http][1]}}/html/dom/documents/dom-tree-accessors/cross-domain.js"
|
||||
s.onload = function() {
|
||||
verify('cross-origin')
|
||||
finish('cross-origin');
|
||||
}
|
||||
document.body.appendChild(s);
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Testing document.write -->
|
||||
<script>
|
||||
document.write('<script id="document-write">verify("document-write"); finish("document-write");</' + 'script>');
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
//test script to check cross-domain script execution as in Document.currentScript.sub.html
|
|
@ -34,10 +34,15 @@ test(function() {
|
|||
assert_equals(document.forms.item(1).id, "form2");
|
||||
assert_equals(document.forms.namedItem("form1").id, "form1");
|
||||
assert_equals(document.forms.namedItem("form2").id, "form2");
|
||||
assert_equals(document.forms.item("form1").id, "form1");
|
||||
assert_equals(document.forms.item("form2").id, "form2");
|
||||
}, "document.forms")
|
||||
|
||||
test(function() {
|
||||
// The `item` method takes one *numeric* argument. Passing a string to `item`
|
||||
// results in that string getting converted to 0
|
||||
assert_equals(document.forms.item("form1").id, "form1");
|
||||
assert_equals(document.forms.item("form2").id, "form1");
|
||||
}, "document.forms.item with string arg")
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.forms[""], undefined);
|
||||
assert_equals(document.forms.namedItem(""), null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue