mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Derive ToCss for VectorValues
This commit is contained in:
parent
51a54e1a60
commit
be820092ad
1 changed files with 2 additions and 19 deletions
|
@ -118,7 +118,8 @@ impl ToGeckoFontFeatureValues for PairValues {
|
|||
}
|
||||
|
||||
/// A @font-feature-values block declaration value that keeps a list of values.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[css(iterable)]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub struct VectorValues(pub Vec<u32>);
|
||||
|
||||
impl Parse for VectorValues {
|
||||
|
@ -145,24 +146,6 @@ impl Parse for VectorValues {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToCss for VectorValues {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
W: Write,
|
||||
{
|
||||
let mut iter = self.0.iter();
|
||||
let first = iter.next();
|
||||
if let Some(first) = first {
|
||||
first.to_css(dest)?;
|
||||
for value in iter {
|
||||
dest.write_char(' ')?;
|
||||
value.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl ToGeckoFontFeatureValues for VectorValues {
|
||||
fn to_gecko_font_feature_values(&self, array: &mut nsTArray<u32>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue