style: Use cbindgen for text-overflow.

Differential Revision: https://phabricator.services.mozilla.com/D32285
This commit is contained in:
violet 2019-05-24 04:48:46 +00:00 committed by Emilio Cobos Álvarez
parent 73b0b7c477
commit e66e612452
3 changed files with 6 additions and 79 deletions

View file

@ -134,14 +134,16 @@ impl ToComputedValue for LineHeight {
}
/// A generic value for the `text-overflow` property.
/// cbindgen:derive-tagged-enum-copy-constructor=true
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
#[repr(C, u8)]
pub enum TextOverflowSide {
/// Clip inline content.
Clip,
/// Render ellipsis to represent clipped inline content.
Ellipsis,
/// Render a given string to represent clipped inline content.
String(Box<str>),
String(crate::OwnedStr),
}
impl Parse for TextOverflowSide {
@ -161,7 +163,7 @@ impl Parse for TextOverflowSide {
}
},
Token::QuotedString(ref v) => Ok(TextOverflowSide::String(
v.as_ref().to_owned().into_boxed_str(),
v.as_ref().to_owned().into(),
)),
ref t => Err(location.new_unexpected_token_error(t.clone())),
}