mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
~[] to Vec in style/properties.rs.mako and selector_matching.rs
This commit is contained in:
parent
58bbe651a0
commit
093e9fdd19
2 changed files with 10 additions and 10 deletions
|
@ -527,7 +527,7 @@ pub mod longhands {
|
||||||
pub enum T {
|
pub enum T {
|
||||||
normal,
|
normal,
|
||||||
none,
|
none,
|
||||||
Content(~[Content]),
|
Content(Vec<Content>),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub type SpecifiedValue = computed_value::T;
|
pub type SpecifiedValue = computed_value::T;
|
||||||
|
@ -549,7 +549,7 @@ pub mod longhands {
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
let mut content = ~[];
|
let mut content = Vec::new();
|
||||||
for component_value in input.skip_whitespace() {
|
for component_value in input.skip_whitespace() {
|
||||||
match component_value {
|
match component_value {
|
||||||
&String(ref value)
|
&String(ref value)
|
||||||
|
@ -1332,8 +1332,8 @@ pub mod shorthands {
|
||||||
|
|
||||||
|
|
||||||
pub struct PropertyDeclarationBlock {
|
pub struct PropertyDeclarationBlock {
|
||||||
pub important: Arc<~[PropertyDeclaration]>,
|
pub important: Arc<Vec<PropertyDeclaration>>,
|
||||||
pub normal: Arc<~[PropertyDeclaration]>,
|
pub normal: Arc<Vec<PropertyDeclaration>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E, S: Encoder<E>> Encodable<S, E> for PropertyDeclarationBlock {
|
impl<E, S: Encoder<E>> Encodable<S, E> for PropertyDeclarationBlock {
|
||||||
|
@ -1349,8 +1349,8 @@ pub fn parse_style_attribute(input: &str, base_url: &Url) -> PropertyDeclaration
|
||||||
|
|
||||||
|
|
||||||
pub fn parse_property_declaration_list<I: Iterator<Node>>(input: I, base_url: &Url) -> PropertyDeclarationBlock {
|
pub fn parse_property_declaration_list<I: Iterator<Node>>(input: I, base_url: &Url) -> PropertyDeclarationBlock {
|
||||||
let mut important = ~[];
|
let mut important = Vec::new();
|
||||||
let mut normal = ~[];
|
let mut normal = Vec::new();
|
||||||
for item in ErrorLoggerIterator(parse_declaration_list(input)) {
|
for item in ErrorLoggerIterator(parse_declaration_list(input)) {
|
||||||
match item {
|
match item {
|
||||||
DeclAtRule(rule) => log_css_error(
|
DeclAtRule(rule) => log_css_error(
|
||||||
|
@ -1418,7 +1418,7 @@ pub enum PropertyDeclarationParseResult {
|
||||||
|
|
||||||
impl PropertyDeclaration {
|
impl PropertyDeclaration {
|
||||||
pub fn parse(name: &str, value: &[ComponentValue],
|
pub fn parse(name: &str, value: &[ComponentValue],
|
||||||
result_list: &mut ~[PropertyDeclaration],
|
result_list: &mut Vec<PropertyDeclaration>,
|
||||||
base_url: &Url) -> PropertyDeclarationParseResult {
|
base_url: &Url) -> PropertyDeclarationParseResult {
|
||||||
// FIXME: local variable to work around Rust #10683
|
// FIXME: local variable to work around Rust #10683
|
||||||
let name_lower = name.to_ascii_lower();
|
let name_lower = name.to_ascii_lower();
|
||||||
|
|
|
@ -481,14 +481,14 @@ struct Rule {
|
||||||
/// we can sort them.
|
/// we can sort them.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct MatchedProperty {
|
pub struct MatchedProperty {
|
||||||
pub declarations: Arc<~[PropertyDeclaration]>,
|
pub declarations: Arc<Vec<PropertyDeclaration>>,
|
||||||
source_order: uint,
|
source_order: uint,
|
||||||
specificity: u32,
|
specificity: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MatchedProperty {
|
impl MatchedProperty {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_declarations(declarations: Arc<~[PropertyDeclaration]>) -> MatchedProperty {
|
pub fn from_declarations(declarations: Arc<Vec<PropertyDeclaration>>) -> MatchedProperty {
|
||||||
MatchedProperty {
|
MatchedProperty {
|
||||||
declarations: declarations,
|
declarations: declarations,
|
||||||
source_order: 0,
|
source_order: 0,
|
||||||
|
@ -960,7 +960,7 @@ mod tests {
|
||||||
selector: s.compound_selectors.clone(),
|
selector: s.compound_selectors.clone(),
|
||||||
property: MatchedProperty {
|
property: MatchedProperty {
|
||||||
specificity: s.specificity,
|
specificity: s.specificity,
|
||||||
declarations: Arc::new(~[]),
|
declarations: Arc::new(Vec::new()),
|
||||||
source_order: i,
|
source_order: i,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue