Skip to content

Commit

Permalink
Update cssparser
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Sep 7, 2016
1 parent 72279cc commit 8bfe978
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 70 deletions.
2 changes: 1 addition & 1 deletion components/canvas_traits/Cargo.toml
Expand Up @@ -11,7 +11,7 @@ path = "lib.rs"

[dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
cssparser = {version = "0.6", features = ["heap_size", "serde-serialization"]}
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion components/layout/Cargo.toml
Expand Up @@ -14,7 +14,7 @@ app_units = "0.3"
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.6", features = ["heap_size", "serde-serialization"]}
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
fnv = "1.0"
gfx = {path = "../gfx"}
Expand Down
2 changes: 1 addition & 1 deletion components/msg/Cargo.toml
Expand Up @@ -11,7 +11,7 @@ path = "lib.rs"

[dependencies]
bitflags = "0.7"
cssparser = {version = "0.6", features = ["heap_size", "serde-serialization"]}
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = "0.9.9"
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -27,7 +27,7 @@ bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]}
cssparser = {version = "0.6", features = ["heap_size", "serde-serialization"]}
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
devtools_traits = {path = "../devtools_traits"}
encoding = "0.2"
euclid = "0.10.1"
Expand Down
2 changes: 1 addition & 1 deletion components/script_layout_interface/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
app_units = "0.3"
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.6", features = ["heap_size", "serde-serialization"]}
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
Expand Down
36 changes: 18 additions & 18 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/style/Cargo.toml
Expand Up @@ -22,7 +22,7 @@ servo = ["serde", "serde/unstable", "serde_macros", "heapsize", "heapsize_plugin
[dependencies]
app_units = "0.3"
bitflags = "0.7"
cssparser = "0.6"
cssparser = "0.7"
deque = "0.3.1"
encoding = "0.2"
euclid = "0.10.1"
Expand Down
2 changes: 1 addition & 1 deletion components/style/font_face.rs
Expand Up @@ -119,7 +119,7 @@ impl<'a, 'b> AtRuleParser for FontFaceRuleParser<'a, 'b> {
impl<'a, 'b> DeclarationParser for FontFaceRuleParser<'a, 'b> {
type Declaration = FontFaceDescriptorDeclaration;

fn parse_value(&self, name: &str, input: &mut Parser) -> Result<FontFaceDescriptorDeclaration, ()> {
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<FontFaceDescriptorDeclaration, ()> {
match_ignore_ascii_case! { name,
"font-family" => {
Ok(FontFaceDescriptorDeclaration::Family(try!(
Expand Down
6 changes: 3 additions & 3 deletions components/style/keyframes.rs
Expand Up @@ -232,7 +232,7 @@ impl<'a> QualifiedRuleParser for KeyframeListParser<'a> {
type Prelude = KeyframeSelector;
type QualifiedRule = Arc<Keyframe>;

fn parse_prelude(&self, input: &mut Parser) -> Result<Self::Prelude, ()> {
fn parse_prelude(&mut self, input: &mut Parser) -> Result<Self::Prelude, ()> {
let start = input.position();
match input.parse_comma_separated(|input| KeyframePercentage::parse(input)) {
Ok(percentages) => Ok(KeyframeSelector(percentages)),
Expand All @@ -244,7 +244,7 @@ impl<'a> QualifiedRuleParser for KeyframeListParser<'a> {
}
}

fn parse_block(&self, prelude: Self::Prelude, input: &mut Parser)
fn parse_block(&mut self, prelude: Self::Prelude, input: &mut Parser)
-> Result<Self::QualifiedRule, ()> {
let mut declarations = Vec::new();
let parser = KeyframeDeclarationParser {
Expand Down Expand Up @@ -286,7 +286,7 @@ impl<'a, 'b> AtRuleParser for KeyframeDeclarationParser<'a, 'b> {
impl<'a, 'b> DeclarationParser for KeyframeDeclarationParser<'a, 'b> {
type Declaration = Vec<PropertyDeclaration>;

fn parse_value(&self, name: &str, input: &mut Parser) -> Result<Vec<PropertyDeclaration>, ()> {
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<Vec<PropertyDeclaration>, ()> {
let mut results = Vec::new();
match PropertyDeclaration::parse(name, self.context, input, &mut results, true) {
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => {}
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/properties.mako.rs
Expand Up @@ -544,7 +544,7 @@ impl<'a, 'b> AtRuleParser for PropertyDeclarationParser<'a, 'b> {
impl<'a, 'b> DeclarationParser for PropertyDeclarationParser<'a, 'b> {
type Declaration = (Vec<PropertyDeclaration>, Importance);

fn parse_value(&self, name: &str, input: &mut Parser)
fn parse_value(&mut self, name: &str, input: &mut Parser)
-> Result<(Vec<PropertyDeclaration>, Importance), ()> {
let mut results = vec![];
try!(input.parse_until_before(Delimiter::Bang, |input| {
Expand Down
26 changes: 14 additions & 12 deletions components/style/stylesheets.rs
Expand Up @@ -427,7 +427,7 @@ impl<'a> AtRuleParser for TopLevelRuleParser<'a> {
type Prelude = AtRulePrelude;
type AtRule = CSSRule;

fn parse_prelude(&self, name: &str, input: &mut Parser)
fn parse_prelude(&mut self, name: &str, input: &mut Parser)
-> Result<AtRuleType<AtRulePrelude, CSSRule>, ()> {
match_ignore_ascii_case! { name,
"import" => {
Expand Down Expand Up @@ -460,12 +460,12 @@ impl<'a> AtRuleParser for TopLevelRuleParser<'a> {
}

self.state.set(State::Body);
AtRuleParser::parse_prelude(&NestedRuleParser { context: &self.context }, name, input)
AtRuleParser::parse_prelude(&mut NestedRuleParser { context: &self.context }, name, input)
}

#[inline]
fn parse_block(&self, prelude: AtRulePrelude, input: &mut Parser) -> Result<CSSRule, ()> {
AtRuleParser::parse_block(&NestedRuleParser { context: &self.context }, prelude, input)
fn parse_block(&mut self, prelude: AtRulePrelude, input: &mut Parser) -> Result<CSSRule, ()> {
AtRuleParser::parse_block(&mut NestedRuleParser { context: &self.context }, prelude, input)
}
}

Expand All @@ -475,14 +475,15 @@ impl<'a> QualifiedRuleParser for TopLevelRuleParser<'a> {
type QualifiedRule = CSSRule;

#[inline]
fn parse_prelude(&self, input: &mut Parser) -> Result<Vec<Selector<TheSelectorImpl>>, ()> {
fn parse_prelude(&mut self, input: &mut Parser) -> Result<Vec<Selector<TheSelectorImpl>>, ()> {
self.state.set(State::Body);
QualifiedRuleParser::parse_prelude(&NestedRuleParser { context: &self.context }, input)
QualifiedRuleParser::parse_prelude(&mut NestedRuleParser { context: &self.context }, input)
}

#[inline]
fn parse_block(&self, prelude: Vec<Selector<TheSelectorImpl>>, input: &mut Parser) -> Result<CSSRule, ()> {
QualifiedRuleParser::parse_block(&NestedRuleParser { context: &self.context },
fn parse_block(&mut self, prelude: Vec<Selector<TheSelectorImpl>>, input: &mut Parser)
-> Result<CSSRule, ()> {
QualifiedRuleParser::parse_block(&mut NestedRuleParser { context: &self.context },
prelude, input)
}
}
Expand All @@ -497,7 +498,7 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
type Prelude = AtRulePrelude;
type AtRule = CSSRule;

fn parse_prelude(&self, name: &str, input: &mut Parser)
fn parse_prelude(&mut self, name: &str, input: &mut Parser)
-> Result<AtRuleType<AtRulePrelude, CSSRule>, ()> {
match_ignore_ascii_case! { name,
"media" => {
Expand Down Expand Up @@ -527,7 +528,7 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
}
}

fn parse_block(&self, prelude: AtRulePrelude, input: &mut Parser) -> Result<CSSRule, ()> {
fn parse_block(&mut self, prelude: AtRulePrelude, input: &mut Parser) -> Result<CSSRule, ()> {
match prelude {
AtRulePrelude::FontFace => {
Ok(CSSRule::FontFace(Arc::new(try!(parse_font_face_block(self.context, input)))))
Expand Down Expand Up @@ -555,11 +556,12 @@ impl<'a, 'b> QualifiedRuleParser for NestedRuleParser<'a, 'b> {
type Prelude = Vec<Selector<TheSelectorImpl>>;
type QualifiedRule = CSSRule;

fn parse_prelude(&self, input: &mut Parser) -> Result<Vec<Selector<TheSelectorImpl>>, ()> {
fn parse_prelude(&mut self, input: &mut Parser) -> Result<Vec<Selector<TheSelectorImpl>>, ()> {
parse_selector_list(&self.context.selector_context, input)
}

fn parse_block(&self, prelude: Vec<Selector<TheSelectorImpl>>, input: &mut Parser) -> Result<CSSRule, ()> {
fn parse_block(&mut self, prelude: Vec<Selector<TheSelectorImpl>>, input: &mut Parser)
-> Result<CSSRule, ()> {
Ok(CSSRule::Style(Arc::new(StyleRule {
selectors: prelude,
declarations: Arc::new(parse_property_declaration_list(self.context, input))
Expand Down
2 changes: 1 addition & 1 deletion components/style/viewport.rs
Expand Up @@ -225,7 +225,7 @@ impl<'a, 'b> AtRuleParser for ViewportRuleParser<'a, 'b> {
impl<'a, 'b> DeclarationParser for ViewportRuleParser<'a, 'b> {
type Declaration = Vec<ViewportDescriptorDeclaration>;

fn parse_value(&self, name: &str, input: &mut Parser) -> Result<Vec<ViewportDescriptorDeclaration>, ()> {
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<Vec<ViewportDescriptorDeclaration>, ()> {
macro_rules! declaration {
($declaration:ident($parse:path)) => {
declaration!($declaration(value: try!($parse(input)),
Expand Down
2 changes: 1 addition & 1 deletion components/style_traits/Cargo.toml
Expand Up @@ -15,7 +15,7 @@ servo = ["heapsize", "heapsize_plugin", "serde", "serde_macros",

[dependencies]
app_units = "0.3"
cssparser = "0.6"
cssparser = "0.7"
euclid = "0.10.1"
heapsize = {version = "0.3.0", optional = true}
heapsize_plugin = {version = "0.1.2", optional = true}
Expand Down

0 comments on commit 8bfe978

Please sign in to comment.