DOMTokenList-stringifier.html (1174B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>DOMTokenList stringifier</title> 4 <link rel=help href="https://dom.spec.whatwg.org/#dom-domtokenlist-stringifier"> 5 <link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <div id=log></div> 9 <span class=" a a b "></span> 10 <script> 11 test(function() { 12 assert_equals(String(document.createElement("span").classList), "", 13 "String(classList) should return the empty list for an undefined class attribute"); 14 var span = document.querySelector("span"); 15 assert_equals(span.getAttribute("class"), " a a b ", 16 "getAttribute should return the literal value"); 17 assert_equals(span.className, " a a b ", 18 "className should return the literal value"); 19 assert_equals(String(span.classList), " a a b ", 20 "String(classList) should return the literal value"); 21 assert_equals(span.classList.toString(), " a a b ", 22 "classList.toString() should return the literal value"); 23 assert_class_string(span.classList, "DOMTokenList"); 24 }); 25 </script>