mirror of
https://github.com/servo/servo.git
synced 2025-09-03 11:38:22 +01:00
Update web-platform-tests to revision bd951736b4d7dbfd862dfa0f27271b544e35ca30
This commit is contained in:
parent
461bce1241
commit
74f3bef690
110 changed files with 2556 additions and 363 deletions
|
@ -1,13 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Make sure browsers throw when getting .length on some random object whose proto is an HTMLCollection</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
test(function() {
|
||||
var obj = Object.create(document.getElementsByTagName("script"));
|
||||
assert_throws(new TypeError(), function() {
|
||||
obj.length;
|
||||
});
|
||||
}, "HTMLcollection as a prototype should not allow getting .length on the base object")
|
||||
</script>
|
|
@ -0,0 +1,29 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Objects whose prototype is an HTMLCollection</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var obj = Object.create(document.getElementsByTagName("script"));
|
||||
assert_throws(new TypeError(), function() {
|
||||
obj.length;
|
||||
});
|
||||
}, "HTMLCollection as a prototype should not allow getting .length on the base object")
|
||||
|
||||
test(function() {
|
||||
var element = document.createElement("p");
|
||||
element.id = "named";
|
||||
document.body.appendChild(element);
|
||||
this.add_cleanup(function() { element.remove() });
|
||||
|
||||
var collection = document.getElementsByTagName("p");
|
||||
assert_equals(collection.named, element);
|
||||
var object = Object.create(collection);
|
||||
assert_equals(object.named, element);
|
||||
object.named = "foo";
|
||||
assert_equals(object.named, "foo");
|
||||
assert_equals(collection.named, element);
|
||||
}, "HTMLCollection as a prototype and setting own properties")
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue