mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Add forgotten test for Element.attributes.
This commit is contained in:
parent
f9f9c42ab7
commit
b502f03fd6
1 changed files with 21 additions and 0 deletions
21
src/test/html/content/test_element_attributes.html
Normal file
21
src/test/html/content/test_element_attributes.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<html>
|
||||||
|
<head id="foo">
|
||||||
|
<script src="harness.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div></div>
|
||||||
|
<script>
|
||||||
|
var attrs = [];
|
||||||
|
for (var i = 'a'.charCodeAt(0); i != 'z'.charCodeAt(0); i++) {
|
||||||
|
document.getElementsByTagName('div')[0].setAttribute(String.fromCharCode(i),
|
||||||
|
i.toString());
|
||||||
|
}
|
||||||
|
var attributes = document.getElementsByTagName('div')[0].attributes;
|
||||||
|
for (var i = 0; i < attributes.length; i++) {
|
||||||
|
is(attributes[i].name, String.fromCharCode(i + 'a'.charCodeAt(0)));
|
||||||
|
is(attributes[i].value, (i + 'a'.charCodeAt(0)).toString());
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue