mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Test that any call to classList.add() create the class attribute
This commit is contained in:
parent
4341dc5fb4
commit
feddb52e59
1 changed files with 7 additions and 0 deletions
|
@ -245,6 +245,13 @@ test(function () {
|
||||||
WebIDL creates actual OwnProperties and then [] just acts as a normal property lookup */
|
WebIDL creates actual OwnProperties and then [] just acts as a normal property lookup */
|
||||||
assert_equals( elem.classList[0], undefined );
|
assert_equals( elem.classList[0], undefined );
|
||||||
}, 'classList[0] must be undefined when all classes have been removed');
|
}, 'classList[0] must be undefined when all classes have been removed');
|
||||||
|
test(function () {
|
||||||
|
var foo = document.createElement('div');
|
||||||
|
foo.classList.add();
|
||||||
|
assert_true( foo.hasAttribute('class') );
|
||||||
|
assert_equals( foo.classList + '', '', 'implicit' );
|
||||||
|
assert_equals( foo.classList.toString(), '', 'explicit' );
|
||||||
|
}, 'Invoking add or remove should set the class attribute');
|
||||||
// The ordered set parser must skip ASCII whitespace (U+0009, U+000A, U+000C, U+000D, and U+0020.)
|
// The ordered set parser must skip ASCII whitespace (U+0009, U+000A, U+000C, U+000D, and U+0020.)
|
||||||
test(function () {
|
test(function () {
|
||||||
var foo = document.createElement('div');
|
var foo = document.createElement('div');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue