Skip to content

Commit 94e563e

Browse files
author
bors-servo
authored
Auto merge of #15735 - servo:cssparserup, r=emilio
Update cssparser to 0.11 <!-- Please describe your changes on the following line: --> <s>Depends on https://github.com/servo/rust-cssparser/pull/122.</s> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15735) <!-- Reviewable:end -->
2 parents f8f7b37 + 2f996e3 commit 94e563e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+143
-175
lines changed

Cargo.lock

Lines changed: 32 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/canvas/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ path = "lib.rs"
1212
[dependencies]
1313
azure = {git = "https://github.com/servo/rust-azure"}
1414
canvas_traits = {path = "../canvas_traits"}
15-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
15+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
1616
euclid = "0.11"
1717
gleam = "0.2.8"
1818
ipc-channel = "0.7"

components/canvas_traits/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "canvas_traits"
1010
path = "lib.rs"
1111

1212
[dependencies]
13-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
13+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
1414
euclid = "0.11"
1515
heapsize = "0.3.0"
1616
heapsize_derive = "0.1"

components/layout/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ app_units = "0.4"
1414
atomic_refcell = "0.1"
1515
bitflags = "0.7"
1616
canvas_traits = {path = "../canvas_traits"}
17-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
17+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
1818
euclid = "0.11"
1919
fnv = "1.0"
2020
gfx = {path = "../gfx"}

components/msg/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ path = "lib.rs"
1111

1212
[dependencies]
1313
bitflags = "0.7"
14-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
14+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
1515
heapsize = "0.3.0"
1616
heapsize_derive = "0.1"
1717
serde = "0.9"

components/script/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ byteorder = "1.0"
3434
canvas_traits = {path = "../canvas_traits"}
3535
caseless = "0.1.0"
3636
cookie = "0.2.5"
37-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
37+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
38+
cssparser-macros = "0.1.0"
3839
deny_public_fields = {path = "../deny_public_fields"}
3940
devtools_traits = {path = "../devtools_traits"}
4041
dom_struct = {path = "../dom_struct"}

components/script/dom/csskeyframesrule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl CSSKeyframesRuleMethods for CSSKeyframesRule {
115115
// https://github.com/w3c/csswg-drafts/issues/801
116116
// Setting this property to a CSS-wide keyword or `none` will
117117
// throw a Syntax Error.
118-
match_ignore_ascii_case! { value,
118+
match_ignore_ascii_case! { &value,
119119
"initial" => return Err(Error::Syntax),
120120
"inherit" => return Err(Error::Syntax),
121121
"unset" => return Err(Error::Syntax),

components/script/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ extern crate canvas_traits;
3636
extern crate caseless;
3737
extern crate cookie as cookie_rs;
3838
extern crate core;
39-
#[macro_use]
40-
extern crate cssparser;
41-
#[macro_use]
42-
extern crate deny_public_fields;
39+
#[macro_use] extern crate cssparser;
40+
#[macro_use] extern crate cssparser_macros;
41+
#[macro_use] extern crate deny_public_fields;
4342
extern crate devtools_traits;
4443
extern crate dom_struct;
4544
#[macro_use]

components/script_layout_interface/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path = "lib.rs"
1313
app_units = "0.4"
1414
atomic_refcell = "0.1"
1515
canvas_traits = {path = "../canvas_traits"}
16-
cssparser = {version = "0.10", features = ["heapsize", "serde"]}
16+
cssparser = {version = "0.11", features = ["heapsize", "serde"]}
1717
euclid = "0.11"
1818
gfx_traits = {path = "../gfx_traits"}
1919
heapsize = "0.3.0"

components/selectors/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ path = "lib.rs"
1818
[dependencies]
1919
bitflags = "0.7"
2020
matches = "0.1"
21-
cssparser = "0.10"
21+
cssparser = "0.11"
22+
cssparser-macros = "0.1.0"
2223
fnv = "1.0"

components/selectors/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#[macro_use] extern crate bitflags;
66
#[macro_use] extern crate cssparser;
7+
#[macro_use] extern crate cssparser_macros;
78
#[macro_use] extern crate matches;
89
extern crate fnv;
910

components/style/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ app_units = "0.4"
2626
atomic_refcell = "0.1"
2727
bitflags = "0.7"
2828
cfg-if = "0.1.0"
29-
cssparser = "0.10"
29+
cssparser = "0.11"
30+
cssparser-macros = "0.1.0"
3031
encoding = "0.2"
3132
euclid = "0.11"
3233
fnv = "1.0"
@@ -62,6 +63,5 @@ kernel32-sys = "0.2"
6263
[build-dependencies]
6364
lazy_static = "0.2"
6465
bindgen = { version = "0.22", optional = true }
65-
phf_codegen = "0.7.20"
6666
regex = {version = "0.2", optional = true}
6767
walkdir = "1.0"

components/style/build.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ extern crate bindgen;
1010
#[cfg(feature = "bindgen")]
1111
extern crate regex;
1212
extern crate walkdir;
13-
extern crate phf_codegen;
1413

1514
use std::env;
16-
use std::fs::File;
17-
use std::io::{BufWriter, BufReader, BufRead, Write};
1815
use std::path::Path;
1916
use std::process::{Command, exit};
2017
use walkdir::WalkDir;
@@ -78,23 +75,6 @@ fn generate_properties() {
7875
if !status.success() {
7976
exit(1)
8077
}
81-
82-
let path = Path::new(&env::var("OUT_DIR").unwrap()).join("static_ids.rs");
83-
let static_ids = Path::new(&env::var("OUT_DIR").unwrap()).join("static_ids.txt");
84-
let mut file = BufWriter::new(File::create(&path).unwrap());
85-
let static_ids = BufReader::new(File::open(&static_ids).unwrap());
86-
87-
write!(&mut file, "static STATIC_IDS: ::phf::Map<&'static str, StaticId> = ").unwrap();
88-
let mut map = phf_codegen::Map::new();
89-
for result in static_ids.lines() {
90-
let line = result.unwrap();
91-
let mut split = line.split('\t');
92-
let key = split.next().unwrap().to_owned();
93-
let value = split.next().unwrap();
94-
map.entry(key, value);
95-
}
96-
map.build(&mut file).unwrap();
97-
write!(&mut file, ";\n").unwrap();
9878
}
9979

10080
fn main() {

components/style/gecko/media_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl Resolution {
165165
_ => return Err(()),
166166
};
167167

168-
Ok(match_ignore_ascii_case! { unit,
168+
Ok(match_ignore_ascii_case! { &unit,
169169
"dpi" => Resolution::Dpi(value),
170170
"dppx" => Resolution::Dppx(value),
171171
"dpcm" => Resolution::Dpcm(value),

components/style/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ extern crate atomic_refcell;
4242
#[macro_use]
4343
extern crate bitflags;
4444
#[cfg(feature = "gecko")] #[macro_use] #[no_link] extern crate cfg_if;
45-
#[macro_use]
46-
extern crate cssparser;
45+
#[macro_use] extern crate cssparser;
46+
#[macro_use] extern crate cssparser_macros;
4747
extern crate encoding;
4848
extern crate euclid;
4949
extern crate fnv;

components/style/properties/build.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def main():
3333
rust = render(template, product=product, data=properties, __file__=template)
3434
if output == "style-crate":
3535
write(os.environ["OUT_DIR"], "properties.rs", rust)
36-
write(os.environ["OUT_DIR"], "static_ids.txt", static_ids(properties))
3736
if product == "gecko":
3837
template = os.path.join(BASE, "gecko.mako.rs")
3938
rust = render(template, data=properties)
@@ -72,19 +71,6 @@ def write(directory, filename, content):
7271
open(os.path.join(directory, filename), "wb").write(content)
7372

7473

75-
def static_id_generator(properties):
76-
for kind, props in [("Longhand", properties.longhands),
77-
("Shorthand", properties.shorthands)]:
78-
for p in props:
79-
yield "%s\tStaticId::%s(%sId::%s)" % (p.name, kind, kind, p.camel_case)
80-
for alias in p.alias:
81-
yield "%s\tStaticId::%s(%sId::%s)" % (alias, kind, kind, p.camel_case)
82-
83-
84-
def static_ids(properties):
85-
return '\n'.join(static_id_generator(properties))
86-
87-
8874
def write_html(properties):
8975
properties = dict(
9076
(p.name, {

components/style/properties/helpers/animated_properties.mako.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl TransitionProperty {
6969

7070
/// Parse a transition-property value.
7171
pub fn parse(input: &mut Parser) -> Result<Self, ()> {
72-
match_ignore_ascii_case! { try!(input.expect_ident()),
72+
match_ignore_ascii_case! { &try!(input.expect_ident()),
7373
"all" => Ok(TransitionProperty::All),
7474
% for prop in data.longhands:
7575
% if prop.animatable:

0 commit comments

Comments
 (0)