mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update cssparser to 0.9
This commit is contained in:
parent
9702d6920a
commit
c3cad2d6c7
17 changed files with 72 additions and 82 deletions
|
@ -5,6 +5,7 @@
|
|||
//! Helper types and traits for the handling of CSS values.
|
||||
|
||||
use app_units::Au;
|
||||
use cssparser::UnicodeRange;
|
||||
use std::fmt;
|
||||
|
||||
/// The real `ToCss` trait can't be implemented for types in crates that don't
|
||||
|
@ -27,6 +28,8 @@ pub trait ToCss {
|
|||
/// Marker trait to automatically implement ToCss for Vec<T>.
|
||||
pub trait OneOrMoreCommaSeparated {}
|
||||
|
||||
impl OneOrMoreCommaSeparated for UnicodeRange {}
|
||||
|
||||
impl<T> ToCss for Vec<T> where T: ToCss + OneOrMoreCommaSeparated {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
let mut iter = self.iter();
|
||||
|
@ -69,6 +72,7 @@ impl_to_css_for_predefined_type!(u32);
|
|||
impl_to_css_for_predefined_type!(::cssparser::Token<'a>);
|
||||
impl_to_css_for_predefined_type!(::cssparser::RGBA);
|
||||
impl_to_css_for_predefined_type!(::cssparser::Color);
|
||||
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! define_css_keyword_enum {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue