mirror of
https://github.com/servo/servo.git
synced 2025-09-06 21:18:20 +01:00
Unreverse declarations in memory.
This commit is contained in:
parent
31864954ed
commit
477cae67df
4 changed files with 29 additions and 25 deletions
|
@ -39,8 +39,6 @@ fn property_declaration_block_should_serialize_correctly() {
|
|||
let height = DeclaredValue::Value(LengthOrPercentageOrAuto::Length(Length::from_px(20f32)));
|
||||
important.push(PropertyDeclaration::Height(height));
|
||||
|
||||
normal.reverse();
|
||||
important.reverse();
|
||||
let block = PropertyDeclarationBlock {
|
||||
normal: Arc::new(normal),
|
||||
important: Arc::new(important)
|
||||
|
|
|
@ -39,6 +39,16 @@ fn test_parse_stylesheet() {
|
|||
let stylesheet = Stylesheet::from_str(css, url, Origin::UserAgent,
|
||||
Box::new(CSSErrorReporterTest),
|
||||
ParserContextExtraData::default());
|
||||
macro_rules! assert_eq {
|
||||
($left: expr, $right: expr) => {
|
||||
let left = $left;
|
||||
let right = $right;
|
||||
if left != right {
|
||||
panic!("{:#?} != {:#?}", left, right)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(stylesheet, Stylesheet {
|
||||
origin: Origin::UserAgent,
|
||||
media: None,
|
||||
|
@ -157,13 +167,6 @@ fn test_parse_stylesheet() {
|
|||
],
|
||||
declarations: PropertyDeclarationBlock {
|
||||
normal: Arc::new(vec![
|
||||
PropertyDeclaration::BackgroundClip(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundOrigin(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundSize(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundImage(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundAttachment(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundRepeat(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundPosition(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundColor(DeclaredValue::Value(
|
||||
longhands::background_color::SpecifiedValue {
|
||||
authored: Some("blue".to_owned()),
|
||||
|
@ -172,6 +175,13 @@ fn test_parse_stylesheet() {
|
|||
}),
|
||||
}
|
||||
)),
|
||||
PropertyDeclaration::BackgroundPosition(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundRepeat(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundAttachment(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundImage(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundSize(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundOrigin(DeclaredValue::Initial),
|
||||
PropertyDeclaration::BackgroundClip(DeclaredValue::Initial),
|
||||
]),
|
||||
important: Arc::new(vec![]),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue