mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Share custom property declarations if they don't contain variable references.
This commit is contained in:
parent
7e143372bd
commit
a6eaa0812a
8 changed files with 180 additions and 135 deletions
|
@ -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)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue