Avoid the generic writer parameter for PropertyDeclaration serialization.

MozReview-Commit-ID: JR3IcL1NRHO
This commit is contained in:
Bobby Holley 2018-01-16 09:20:23 -08:00
parent f5dd50dcfd
commit 5526947500
21 changed files with 227 additions and 108 deletions

View file

@ -5,6 +5,7 @@
use properties::{parse, parse_input};
use style::computed_values::display::T as Display;
use style::properties::{PropertyDeclaration, Importance};
use style::properties::declaration_block::PropertyDeclarationBlock;
use style::properties::parse_property_declaration_list;
use style::values::{CustomIdent, RGBA};
use style::values::generics::flex::FlexBasis;
@ -15,6 +16,18 @@ use style::values::specified::url::SpecifiedUrl;
use style_traits::ToCss;
use stylesheets::block_from;
trait ToCssString {
fn to_css_string(&self) -> String;
}
impl ToCssString for PropertyDeclarationBlock {
fn to_css_string(&self) -> String {
let mut css = String::new();
self.to_css(&mut css).unwrap();
css
}
}
#[test]
fn property_declaration_block_should_serialize_correctly() {
use style::properties::longhands::overflow_x::SpecifiedValue as OverflowValue;