mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Use Arc<PropertyDeclarationBlock> everwhere it’s appropriate.
This commit is contained in:
parent
c50e6add4a
commit
acc38aa8c2
13 changed files with 85 additions and 68 deletions
|
@ -6,7 +6,7 @@ use cssparser::Parser;
|
|||
use selectors::parser::{LocalName, ParserContext, parse_selector_list};
|
||||
use std::sync::Arc;
|
||||
use string_cache::Atom;
|
||||
use style::properties::Importance;
|
||||
use style::properties::{Importance, PropertyDeclarationBlock};
|
||||
use style::selector_matching::{DeclarationBlock, Rule, SelectorMap};
|
||||
|
||||
/// Helper method to get some Rules from selector strings.
|
||||
|
@ -19,7 +19,10 @@ fn get_mock_rules(css_selectors: &[&str]) -> Vec<Vec<Rule>> {
|
|||
Rule {
|
||||
selector: s.complex_selector.clone(),
|
||||
declarations: DeclarationBlock {
|
||||
mixed_declarations: Arc::new(Vec::new()),
|
||||
mixed_declarations: Arc::new(PropertyDeclarationBlock {
|
||||
declarations: Arc::new(Vec::new()),
|
||||
important_count: 0,
|
||||
}),
|
||||
importance: Importance::Normal,
|
||||
specificity: s.specificity,
|
||||
source_order: i,
|
||||
|
|
|
@ -236,24 +236,30 @@ fn test_parse_stylesheet() {
|
|||
Arc::new(Keyframe {
|
||||
selector: KeyframeSelector::new_for_unit_testing(
|
||||
vec![KeyframePercentage::new(0.)]),
|
||||
declarations: Arc::new(vec![
|
||||
(PropertyDeclaration::Width(DeclaredValue::Value(
|
||||
LengthOrPercentageOrAuto::Percentage(Percentage(0.)))),
|
||||
Importance::Normal),
|
||||
]),
|
||||
block: Arc::new(PropertyDeclarationBlock {
|
||||
declarations: Arc::new(vec![
|
||||
(PropertyDeclaration::Width(DeclaredValue::Value(
|
||||
LengthOrPercentageOrAuto::Percentage(Percentage(0.)))),
|
||||
Importance::Normal),
|
||||
]),
|
||||
important_count: 0,
|
||||
})
|
||||
}),
|
||||
Arc::new(Keyframe {
|
||||
selector: KeyframeSelector::new_for_unit_testing(
|
||||
vec![KeyframePercentage::new(1.)]),
|
||||
declarations: Arc::new(vec![
|
||||
(PropertyDeclaration::Width(DeclaredValue::Value(
|
||||
LengthOrPercentageOrAuto::Percentage(Percentage(1.)))),
|
||||
Importance::Normal),
|
||||
(PropertyDeclaration::AnimationPlayState(DeclaredValue::Value(
|
||||
animation_play_state::SpecifiedValue(
|
||||
vec![animation_play_state::SingleSpecifiedValue::running]))),
|
||||
Importance::Normal),
|
||||
]),
|
||||
block: Arc::new(PropertyDeclarationBlock {
|
||||
declarations: Arc::new(vec![
|
||||
(PropertyDeclaration::Width(DeclaredValue::Value(
|
||||
LengthOrPercentageOrAuto::Percentage(Percentage(1.)))),
|
||||
Importance::Normal),
|
||||
(PropertyDeclaration::AnimationPlayState(DeclaredValue::Value(
|
||||
animation_play_state::SpecifiedValue(
|
||||
vec![animation_play_state::SingleSpecifiedValue::running]))),
|
||||
Importance::Normal),
|
||||
]),
|
||||
important_count: 0,
|
||||
}),
|
||||
}),
|
||||
]
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue