mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Derive the most trivial ToCss implementations 🌋
For now, all variants get serialised as the space-separated serialisations of their fields. Unit variants are not supported.
This commit is contained in:
parent
6d6f03974d
commit
c4f1d647a0
18 changed files with 113 additions and 263 deletions
|
@ -1074,8 +1074,6 @@
|
|||
predefined_type=length_type,
|
||||
logical=logical,
|
||||
**kwargs)">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
% if not logical:
|
||||
use values::specified::AllowQuirks;
|
||||
% endif
|
||||
|
@ -1085,8 +1083,8 @@
|
|||
pub type T = ::values::computed::${length_type};
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, HasViewportPercentage, PartialEq, ToCss)]
|
||||
pub struct SpecifiedValue(pub ${length_type});
|
||||
|
||||
% if length_type == "MozLength":
|
||||
|
@ -1131,12 +1129,6 @@
|
|||
ret.map(SpecifiedValue)
|
||||
}
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
self.0.to_css(dest)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToComputedValue for SpecifiedValue {
|
||||
type ComputedValue = computed_value::T;
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue