mirror of
https://github.com/servo/servo
synced 2026-04-29 02:47:55 +02:00
It should just return its associated attribute's value, if any. https://github.com/whatwg/dom/issues/105
26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset=utf-8>
|
|
<title>DOMTokenList stringifier</title>
|
|
<link rel=help href="https://dom.spec.whatwg.org/#dom-domtokenlist-stringifier">
|
|
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<div id=log></div>
|
|
<span class=" a a b "></span>
|
|
<script>
|
|
test(function() {
|
|
assert_equals(String(document.createElement("span").classList), "",
|
|
"String(classList) should return the empty list for an undefined class attribute");
|
|
var span = document.querySelector("span");
|
|
assert_equals(span.getAttribute("class"), " a a b ",
|
|
"getAttribute should return the literal value");
|
|
assert_equals(span.className, " a a b ",
|
|
"className should return the literal value");
|
|
assert_equals(String(span.classList), " a a b ",
|
|
"String(classList) should return the literal value");
|
|
assert_equals(span.classList.toString(), " a a b ",
|
|
"classList.toString() should return the literal value");
|
|
assert_class_string(span.classList, "DOMTokenList");
|
|
});
|
|
</script>
|