Update cssparser to fix CSS.escape test failures

Fixed failing tests #10685
This commit is contained in:
Maciej Skrzypkowski 2016-05-06 12:41:27 +02:00
parent 0558687d71
commit 43b72537dc
6 changed files with 31 additions and 43 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use cssparser::serialize_identifier;
use dom::bindings::error::{Error, Fallible};
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::reflector::Reflector;
use util::str::DOMString;
@ -16,9 +16,6 @@ pub struct CSS {
impl CSS {
// http://dev.w3.org/csswg/cssom/#serialize-an-identifier
pub fn Escape(_: GlobalRef, ident: DOMString) -> Fallible<DOMString> {
if ident.bytes().any(|b| b == b'\0') {
return Err(Error::InvalidCharacter);
}
let mut escaped = String::new();
serialize_identifier(&ident, &mut escaped).unwrap();
Ok(DOMString::from(escaped))