Revision 4ed222f683a26ea90dcb5eef36cf3ea9c8ef65a0 authored by Josh Matthews on 12 September 2018, 16:20:36 UTC, committed by GitHub on 12 September 2018, 16:20:36 UTC
1 parent af3dc21
DOMTokenList-Iterable.html
<!doctype html>
<meta charset="utf-8">
<title>DOMTokenList Iterable Test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<span class="foo Foo foo "></span>
<script>
var elementClasses;
setup(function() {
elementClasses = document.querySelector("span").classList;
})
test(function() {
assert_true('length' in elementClasses);
}, 'DOMTokenList has length method.');
test(function() {
assert_true('values' in elementClasses);
}, 'DOMTokenList has values method.');
test(function() {
assert_true('entries' in elementClasses);
}, 'DOMTokenList has entries method.');
test(function() {
assert_true('forEach' in elementClasses);
}, 'DOMTokenList has forEach method.');
test(function() {
assert_true(Symbol.iterator in elementClasses);
}, 'DOMTokenList has Symbol.iterator.');
test(function() {
var classList = [];
for (var className of elementClasses){
classList.push(className);
}
assert_array_equals(classList, ['foo', 'Foo']);
}, 'DOMTokenList is iterable via for-of loop.');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...