aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-02-14 22:35:08 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-02-15 12:42:14 +0100
commitc3cad2d6c79965449f3754ae9d02b48ffb39490f (patch)
tree042f896930c15ff248cbaa06282c88216ed50e8e
parent9702d6920a7cf6506fa26c042eb4b9f7cd061713 (diff)
downloadservo-c3cad2d6c79965449f3754ae9d02b48ffb39490f.tar.gz
servo-c3cad2d6c79965449f3754ae9d02b48ffb39490f.zip
Update cssparser to 0.9
-rw-r--r--Cargo.lock29
-rw-r--r--components/canvas/Cargo.toml2
-rw-r--r--components/canvas_traits/Cargo.toml2
-rw-r--r--components/layout/Cargo.toml2
-rw-r--r--components/msg/Cargo.toml2
-rw-r--r--components/script/Cargo.toml2
-rw-r--r--components/script_layout_interface/Cargo.toml2
-rw-r--r--components/selectors/Cargo.toml2
-rw-r--r--components/style/Cargo.toml2
-rw-r--r--components/style/font_face.rs57
-rw-r--r--components/style/parser.rs8
-rw-r--r--components/style/stylesheets.rs32
-rw-r--r--components/style_traits/Cargo.toml2
-rw-r--r--components/style_traits/values.rs4
-rw-r--r--ports/geckolib/Cargo.toml2
-rw-r--r--tests/unit/style/Cargo.toml2
-rw-r--r--tests/unit/stylo/Cargo.toml2
17 files changed, 72 insertions, 82 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 37d905f21c6..a9b455bce88 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -285,7 +285,7 @@ version = "0.0.1"
dependencies = [
"azure 0.11.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -301,7 +301,7 @@ dependencies = [
name = "canvas_traits"
version = "0.0.1"
dependencies = [
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -543,10 +543,9 @@ dependencies = [
[[package]]
name = "cssparser"
-version = "0.8.0"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -942,7 +941,7 @@ version = "0.0.1"
dependencies = [
"app_units 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1351,7 +1350,7 @@ dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
@@ -1662,7 +1661,7 @@ name = "msg"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
@@ -2264,7 +2263,7 @@ dependencies = [
"caseless 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"deny_public_fields 0.0.1",
"devtools_traits 0.0.1",
"domobject_derive 0.0.1",
@@ -2333,7 +2332,7 @@ dependencies = [
"app_units 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2401,7 +2400,7 @@ name = "selectors"
version = "0.18.0"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -2754,7 +2753,7 @@ dependencies = [
"bindgen 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2796,7 +2795,7 @@ name = "style_tests"
version = "0.0.1"
dependencies = [
"app_units 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2817,7 +2816,7 @@ name = "style_traits"
version = "0.0.1"
dependencies = [
"app_units 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2832,7 +2831,7 @@ version = "0.0.1"
dependencies = [
"app_units 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
"geckoservo 0.0.1",
@@ -3397,7 +3396,7 @@ dependencies = [
"checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624"
"checksum core-graphics 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b205856aba54bfd36e69a1058f45fbe0d3c37be7375309dcff4a22a2a631fea"
"checksum core-text 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9703f459a41e622b15ca612dbc5fa4b30b6545a32864a83e0fdc538cfa08969c"
-"checksum cssparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03414777f8f1b026d920f7f96e4a19d0237456a0485fb6135847b7699c258ec2"
+"checksum cssparser 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e99bbf5004f7a9cbba7cac7b83320b88eea4008f227c842d4ff2de4b99147352"
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
"checksum dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "94d266a872aaf68b50d02083c429a3686935ab6ab54824290509cdc422673eaf"
"checksum debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3"
diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml
index f964e0cab10..1ac27478f69 100644
--- a/components/canvas/Cargo.toml
+++ b/components/canvas/Cargo.toml
@@ -12,7 +12,7 @@ path = "lib.rs"
[dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
canvas_traits = {path = "../canvas_traits"}
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
gleam = "0.2.8"
ipc-channel = "0.5"
diff --git a/components/canvas_traits/Cargo.toml b/components/canvas_traits/Cargo.toml
index ac67df0e81e..d90ed49880c 100644
--- a/components/canvas_traits/Cargo.toml
+++ b/components/canvas_traits/Cargo.toml
@@ -10,7 +10,7 @@ name = "canvas_traits"
path = "lib.rs"
[dependencies]
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
heapsize = "0.3.0"
heapsize_derive = "0.1"
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index 214aed60637..5e981b526fa 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -14,7 +14,7 @@ app_units = "0.3"
atomic_refcell = "0.1"
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
fnv = "1.0"
gfx = {path = "../gfx"}
diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml
index 6300a7a0587..33abb5cdaac 100644
--- a/components/msg/Cargo.toml
+++ b/components/msg/Cargo.toml
@@ -11,7 +11,7 @@ path = "lib.rs"
[dependencies]
bitflags = "0.7"
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
heapsize = "0.3.0"
heapsize_derive = "0.1"
plugins = {path = "../plugins"}
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index 84ead24b21f..9eb4af38f4d 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -34,7 +34,7 @@ byteorder = "1.0"
canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]}
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
domobject_derive = {path = "../domobject_derive"}
diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml
index aded2413ff1..e6b18ff0517 100644
--- a/components/script_layout_interface/Cargo.toml
+++ b/components/script_layout_interface/Cargo.toml
@@ -13,7 +13,7 @@ path = "lib.rs"
app_units = "0.3"
atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"}
-cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
+cssparser = {version = "0.9", features = ["heap_size", "serde-serialization"]}
euclid = "0.10.1"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
diff --git a/components/selectors/Cargo.toml b/components/selectors/Cargo.toml
index c62ac79a7fa..573811a6c51 100644
--- a/components/selectors/Cargo.toml
+++ b/components/selectors/Cargo.toml
@@ -18,5 +18,5 @@ path = "lib.rs"
[dependencies]
bitflags = "0.7"
matches = "0.1"
-cssparser = ">=0.6, <0.9"
+cssparser = "0.9"
fnv = "1.0"
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index 8ee6089b56e..702cf9f2486 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -26,7 +26,7 @@ app_units = "0.3"
atomic_refcell = "0.1"
bitflags = "0.7"
cfg-if = "0.1.0"
-cssparser = "0.8"
+cssparser = "0.9"
encoding = "0.2"
euclid = "0.10.1"
fnv = "1.0"
diff --git a/components/style/font_face.rs b/components/style/font_face.rs
index c5e9e330f82..4b3f6934f90 100644
--- a/components/style/font_face.rs
+++ b/components/style/font_face.rs
@@ -12,6 +12,7 @@
use computed_values::{font_style, font_weight, font_stretch};
use computed_values::font_family::FamilyName;
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
+#[cfg(feature = "gecko")] use cssparser::UnicodeRange;
use parser::{ParserContext, log_css_error, Parse};
use std::fmt;
use std::iter;
@@ -238,7 +239,7 @@ macro_rules! font_face_descriptors {
dest.write_str("@font-face {\n")?;
$(
dest.write_str(concat!(" ", $m_name, ": "))?;
- self.$m_ident.to_css(dest)?;
+ ToCss::to_css(&self.$m_ident, dest)?;
dest.write_str(";\n")?;
)*
$(
@@ -247,7 +248,7 @@ macro_rules! font_face_descriptors {
// But it can be false for other descriptors.
if self.$o_ident != $o_initial {
dest.write_str(concat!(" ", $o_name, ": "))?;
- self.$o_ident.to_css(dest)?;
+ ToCss::to_css(&self.$o_ident, dest)?;
dest.write_str(";\n")?;
}
)*
@@ -298,8 +299,8 @@ font_face_descriptors! {
"font-stretch" stretch: font_stretch::T = font_stretch::T::normal,
/// The ranges of code points outside of which this font face should not be used.
- "unicode-range" unicode_range: Vec<unicode_range::Range> = vec![
- unicode_range::Range { start: 0, end: unicode_range::MAX }
+ "unicode-range" unicode_range: Vec<UnicodeRange> = vec![
+ UnicodeRange { start: 0, end: 0x10FFFF }
],
]
}
@@ -316,51 +317,3 @@ font_face_descriptors! {
optional descriptors = [
]
}
-
-/// https://drafts.csswg.org/css-fonts/#unicode-range-desc
-#[cfg(feature = "gecko")]
-pub mod unicode_range {
- use cssparser::{Parser, Token};
- use parser::{ParserContext, Parse};
- use std::fmt;
- use style_traits::{ToCss, OneOrMoreCommaSeparated};
-
- /// Maximum value of the end of a range
- pub const MAX: u32 = ::std::char::MAX as u32;
-
- /// A single range: https://drafts.csswg.org/css-fonts/#urange-value
- #[derive(Debug, PartialEq, Eq)]
- pub struct Range {
- /// Start of the range, inclusive
- pub start: u32,
-
- /// End of the range, inclusive
- pub end: u32,
- }
-
- impl OneOrMoreCommaSeparated for Range {}
-
- impl Parse for Range {
- fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
- // FIXME: The unicode-range token has been removed from the CSS Syntax spec,
- // cssparser should be updated accordingly
- // and implement https://drafts.csswg.org/css-syntax/#urange instead
- match input.next() {
- Ok(Token::UnicodeRange(start, end)) => {
- if end <= MAX && start <= end {
- Ok(Range { start: start, end: end })
- } else {
- Err(())
- }
- }
- _ => Err(())
- }
- }
- }
-
- impl ToCss for Range {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- Token::UnicodeRange(self.start, self.end).to_css(dest)
- }
- }
-}
diff --git a/components/style/parser.rs b/components/style/parser.rs
index a9d15352984..12e6290304f 100644
--- a/components/style/parser.rs
+++ b/components/style/parser.rs
@@ -6,7 +6,7 @@
#![deny(missing_docs)]
-use cssparser::{Parser, SourcePosition};
+use cssparser::{Parser, SourcePosition, UnicodeRange};
use error_reporting::ParseErrorReporter;
#[cfg(feature = "gecko")]
use gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI};
@@ -109,3 +109,9 @@ impl<T> Parse for Vec<T> where T: Parse + OneOrMoreCommaSeparated {
input.parse_comma_separated(|input| T::parse(context, input))
}
}
+
+impl Parse for UnicodeRange {
+ fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
+ UnicodeRange::parse(input)
+ }
+}
diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs
index 78867e81862..be88e22ea7e 100644
--- a/components/style/stylesheets.rs
+++ b/components/style/stylesheets.rs
@@ -7,10 +7,10 @@
#![deny(missing_docs)]
use {Atom, Prefix, Namespace};
-use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, decode_stylesheet_bytes};
+use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, stylesheet_encoding, EncodingSupport};
use cssparser::{AtRuleType, RuleListParser, SourcePosition, Token, parse_one_rule};
use cssparser::ToCss as ParserToCss;
-use encoding::EncodingRef;
+use encoding::{self, EncodingRef, DecoderTrap};
use error_reporting::ParseErrorReporter;
use font_face::{FontFaceRule, parse_font_face_block};
use keyframes::{Keyframe, parse_keyframe_list};
@@ -24,6 +24,7 @@ use servo_config::prefs::PREFS;
use servo_url::ServoUrl;
use std::cell::Cell;
use std::fmt;
+use std::str;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use style_traits::ToCss;
@@ -543,6 +544,33 @@ impl ToCss for StyleRule {
}
}
+struct RustEncoding;
+
+impl EncodingSupport for RustEncoding {
+ type Encoding = EncodingRef;
+
+ fn utf8() -> Self::Encoding {
+ encoding::all::UTF_8
+ }
+
+ fn is_utf16_be_or_le(encoding: &Self::Encoding) -> bool {
+ matches!(encoding.name(), "utf-16be" | "utf-16le")
+ }
+
+ fn from_label(ascii_label: &[u8]) -> Option<Self::Encoding> {
+ str::from_utf8(ascii_label).ok().and_then(encoding::label::encoding_from_whatwg_label)
+ }
+}
+
+fn decode_stylesheet_bytes(css: &[u8], protocol_encoding_label: Option<&str>,
+ environment_encoding: Option<EncodingRef>)
+ -> (String, EncodingRef) {
+ let fallback_encoding = stylesheet_encoding::<RustEncoding>(
+ css, protocol_encoding_label.map(str::as_bytes), environment_encoding);
+ let (result, used_encoding) = encoding::decode(css, DecoderTrap::Replace, fallback_encoding);
+ (result.unwrap(), used_encoding)
+}
+
impl Stylesheet {
/// Parse a stylesheet from a set of bytes, potentially received over the
/// network.
diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml
index 1466f8e5923..1d60a8c5d14 100644
--- a/components/style_traits/Cargo.toml
+++ b/components/style_traits/Cargo.toml
@@ -15,7 +15,7 @@ servo = ["heapsize", "heapsize_derive", "serde", "serde_derive",
[dependencies]
app_units = "0.3"
-cssparser = "0.8"
+cssparser = "0.9"
euclid = "0.10.1"
heapsize = {version = "0.3.0", optional = true}
heapsize_derive = {version = "0.1", optional = true}
diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs
index ab730508bce..707c35f711e 100644
--- a/components/style_traits/values.rs
+++ b/components/style_traits/values.rs
@@ -5,6 +5,7 @@
//! Helper types and traits for the handling of CSS values.
use app_units::Au;
+use cssparser::UnicodeRange;
use std::fmt;
/// The real `ToCss` trait can't be implemented for types in crates that don't
@@ -27,6 +28,8 @@ pub trait ToCss {
/// Marker trait to automatically implement ToCss for Vec<T>.
pub trait OneOrMoreCommaSeparated {}
+impl OneOrMoreCommaSeparated for UnicodeRange {}
+
impl<T> ToCss for Vec<T> where T: ToCss + OneOrMoreCommaSeparated {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
let mut iter = self.iter();
@@ -69,6 +72,7 @@ impl_to_css_for_predefined_type!(u32);
impl_to_css_for_predefined_type!(::cssparser::Token<'a>);
impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
+impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
#[macro_export]
macro_rules! define_css_keyword_enum {
diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml
index f0671cb4c2f..94b6ec720dd 100644
--- a/ports/geckolib/Cargo.toml
+++ b/ports/geckolib/Cargo.toml
@@ -15,7 +15,7 @@ bindgen = ["style/use_bindgen"]
[dependencies]
app_units = "0.3"
atomic_refcell = "0.1"
-cssparser = {version = "0.8"}
+cssparser = {version = "0.9"}
env_logger = {version = "0.4", default-features = false} # disable `regex` to reduce code size
euclid = "0.10.1"
lazy_static = "0.2"
diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml
index c134cfb5579..3a1bf592945 100644
--- a/tests/unit/style/Cargo.toml
+++ b/tests/unit/style/Cargo.toml
@@ -14,7 +14,7 @@ testing = ["style/testing"]
[dependencies]
app_units = "0.3"
-cssparser = {version = "0.8", features = ["heap_size"]}
+cssparser = {version = "0.9", features = ["heap_size"]}
euclid = "0.10.1"
html5ever-atoms = "0.1"
matches = "0.1"
diff --git a/tests/unit/stylo/Cargo.toml b/tests/unit/stylo/Cargo.toml
index 556c5652c29..53590c81baa 100644
--- a/tests/unit/stylo/Cargo.toml
+++ b/tests/unit/stylo/Cargo.toml
@@ -14,7 +14,7 @@ doctest = false
[dependencies]
app_units = "0.3"
atomic_refcell = "0.1"
-cssparser = {version = "0.8"}
+cssparser = "0.9"
env_logger = "0.4"
euclid = "0.10.1"
lazy_static = "0.2"