aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/domtokenlist.rs7
-rw-r--r--tests/wpt/metadata/dom/lists/DOMTokenList-stringifier.html.ini5
-rw-r--r--tests/wpt/metadata/dom/nodes/Element-classlist.html.ini3
3 files changed, 6 insertions, 9 deletions
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs
index b3656ae4b7c..f863996e9ca 100644
--- a/components/script/dom/domtokenlist.rs
+++ b/components/script/dom/domtokenlist.rs
@@ -157,6 +157,11 @@ impl<'a> DOMTokenListMethods for &'a DOMTokenList {
// https://dom.spec.whatwg.org/#stringification-behavior
fn Stringifier(self) -> DOMString {
- self.element.root().r().get_string_attribute(&self.local_name)
+ let tokenlist = self.element.root().r().get_tokenlist_attribute(&self.local_name);
+ tokenlist.iter().fold(String::new(), |mut s, atom| {
+ if !s.is_empty() { s.push('\x20'); }
+ s.push_str(atom);
+ s
+ })
}
}
diff --git a/tests/wpt/metadata/dom/lists/DOMTokenList-stringifier.html.ini b/tests/wpt/metadata/dom/lists/DOMTokenList-stringifier.html.ini
deleted file mode 100644
index fa87a8bd09b..00000000000
--- a/tests/wpt/metadata/dom/lists/DOMTokenList-stringifier.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DOMTokenList-stringifier.html]
- type: testharness
- [DOMTokenList stringifier]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/dom/nodes/Element-classlist.html.ini b/tests/wpt/metadata/dom/nodes/Element-classlist.html.ini
index 2526f96f80b..de405c47bc8 100644
--- a/tests/wpt/metadata/dom/nodes/Element-classlist.html.ini
+++ b/tests/wpt/metadata/dom/nodes/Element-classlist.html.ini
@@ -3,9 +3,6 @@
[CSS .foo selectors must not match elements without any class]
expected: FAIL
- [empty classList should return the empty string since the ordered set parser skip the whitespaces]
- expected: FAIL
-
[computed style must update when setting .className]
expected: FAIL