style: Share custom property declarations if they don't contain variable references.

This commit is contained in:
Emilio Cobos Álvarez 2017-10-08 23:31:46 +02:00
parent 7e143372bd
commit a6eaa0812a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 180 additions and 135 deletions

View file

@ -7,6 +7,7 @@
use app_units::Au;
use cssparser::{BasicParseError, ParseError, Parser, Token, UnicodeRange, serialize_string};
use cssparser::ToCss as CssparserToCss;
use servo_arc::Arc;
use std::fmt::{self, Write};
/// Serialises a value according to its CSS representation.
@ -343,6 +344,14 @@ impl<T> ToCss for Box<T> where T: ?Sized + ToCss {
}
}
impl<T> ToCss for Arc<T> where T: ?Sized + ToCss {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result
where W: Write,
{
(**self).to_css(dest)
}
}
impl ToCss for Au {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: Write {
self.to_f64_px().to_css(dest)?;