Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-08-11 03:14:27 +02:00 committed by Martin Robinson
parent 679a69defb
commit 989f8d89c4

View file

@ -555,13 +555,17 @@ impl TimelineOrKeyframesName {
return dest.write_str("none")
}
self.0.with_str(|s| {
let mut serialize = |s: &_| {
if CustomIdent::is_valid(s, invalid) {
serialize_identifier(s, dest)
} else {
s.to_css(dest)
}
})
};
#[cfg(feature = "gecko")]
return self.0.with_str(|s| serialize(s));
#[cfg(feature = "servo")]
return serialize(self.0.as_ref());
}
}
@ -616,6 +620,11 @@ impl KeyframesName {
Self(TimelineOrKeyframesName::from_atom(atom))
}
/// <https://drafts.csswg.org/css-animations/#dom-csskeyframesrule-name>
pub fn from_ident(value: &str) -> Self {
Self(TimelineOrKeyframesName::from_ident(value))
}
/// Returns the `none` value.
pub fn none() -> Self {
Self(TimelineOrKeyframesName::none())