diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/domtokenlist.rs | 17 | ||||
-rw-r--r-- | components/script/dom/webidls/DOMTokenList.webidl | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs index dabf3bf4cb9..1fb53e6ce06 100644 --- a/components/script/dom/domtokenlist.rs +++ b/components/script/dom/domtokenlist.rs @@ -70,15 +70,14 @@ impl DOMTokenListMethods for DOMTokenList { } // https://dom.spec.whatwg.org/#dom-domtokenlist-contains - fn Contains(&self, token: DOMString) -> Fallible<bool> { - self.check_token_exceptions(&token).map(|token| { - self.attribute().map_or(false, |attr| { - let attr = attr.r(); - attr.value() - .as_tokens() - .iter() - .any(|atom: &Atom| *atom == token) - }) + fn Contains(&self, token: DOMString) -> bool { + let token = Atom::from(token); + self.attribute().map_or(false, |attr| { + let attr = attr.r(); + attr.value() + .as_tokens() + .iter() + .any(|atom: &Atom| *atom == token) }) } diff --git a/components/script/dom/webidls/DOMTokenList.webidl b/components/script/dom/webidls/DOMTokenList.webidl index 1b50c34c918..2b7da5dea74 100644 --- a/components/script/dom/webidls/DOMTokenList.webidl +++ b/components/script/dom/webidls/DOMTokenList.webidl @@ -9,7 +9,7 @@ interface DOMTokenList { [Pure] getter DOMString? item(unsigned long index); - [Pure, Throws] + [Pure] boolean contains(DOMString token); [Throws] void add(DOMString... tokens); |