mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
dom: add WPT tests for HTMLCollection
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML>
|
||||
<meta charset=utf-8>
|
||||
<title>NamedNodeMap Test: Supported property names</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="simple" class="fancy">Simple</div>
|
||||
<input id="result" type="text" value="" width="200px">
|
||||
<script>
|
||||
|
||||
test(function() {
|
||||
var elt = document.querySelector('#simple');
|
||||
assert_array_equals(Object.getOwnPropertyNames(elt.attributes),
|
||||
['0','1','id','class']);
|
||||
}, "Object.getOwnPropertyNames on NamedNodeMap");
|
||||
|
||||
test(function() {
|
||||
var result = document.getElementById("result");
|
||||
assert_array_equals(Object.getOwnPropertyNames(result.attributes),
|
||||
['0','1','2','3','id','type','value','width']);
|
||||
}, "Object.getOwnPropertyNames on NamedNodeMap of input");
|
||||
|
||||
test(function() {
|
||||
var result = document.getElementById("result");
|
||||
result.removeAttribute("width");
|
||||
assert_array_equals(Object.getOwnPropertyNames(result.attributes),
|
||||
['0','1','2','id','type','value']);
|
||||
}, "Object.getOwnPropertyNames on NamedNodeMap after attribute removal");
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user