mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Avoid the generic writer parameter for PropertyDeclaration serialization.
MozReview-Commit-ID: JR3IcL1NRHO
This commit is contained in:
parent
f5dd50dcfd
commit
5526947500
21 changed files with 227 additions and 108 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue