style: Move line-clamp out of mako and do some adjacent clean-up

No behavior change, but simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D155180
This commit is contained in:
Emilio Cobos Álvarez 2022-08-31 12:39:19 +00:00 committed by Martin Robinson
parent 3fa76ff2e8
commit a44db17432
12 changed files with 101 additions and 99 deletions

View file

@ -65,46 +65,6 @@ macro_rules! try_match_ident_ignore_ascii_case {
}}
}
macro_rules! define_keyword_type {
($name:ident, $css:expr) => {
#[allow(missing_docs)]
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
pub struct $name;
impl fmt::Debug for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str($css)
}
}
impl $crate::parser::Parse for $name {
fn parse<'i, 't>(
_context: &$crate::parser::ParserContext,
input: &mut ::cssparser::Parser<'i, 't>,
) -> Result<$name, ::style_traits::ParseError<'i>> {
input
.expect_ident_matching($css)
.map(|_| $name)
.map_err(|e| e.into())
}
}
};
}
#[cfg(feature = "servo")]
macro_rules! local_name {
($s:tt) => {