mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Use cbindgen for text-overflow.
Differential Revision: https://phabricator.services.mozilla.com/D32285
This commit is contained in:
parent
73b0b7c477
commit
e66e612452
3 changed files with 6 additions and 79 deletions
|
@ -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())),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue