aboutsummaryrefslogtreecommitdiffstats
path: root/components/style_traits
diff options
context:
space:
mode:
authorBastien Orivel <eijebong@bananium.fr>2017-10-30 12:15:30 +0100
committerBastien Orivel <eijebong@bananium.fr>2017-10-30 23:36:06 +0100
commit29b4eec14187c96a1518af6a954bd00194375382 (patch)
treec49cf779948919fb4a21c93986395ae1fd149b0b /components/style_traits
parentb6475cf433747a8b0cd177f0a16abae9d795e41c (diff)
downloadservo-29b4eec14187c96a1518af6a954bd00194375382.tar.gz
servo-29b4eec14187c96a1518af6a954bd00194375382.zip
Bump bitflags to 1.0 in every servo crate
Diffstat (limited to 'components/style_traits')
-rw-r--r--components/style_traits/Cargo.toml2
-rw-r--r--components/style_traits/lib.rs18
-rw-r--r--components/style_traits/viewport.rs8
3 files changed, 14 insertions, 14 deletions
diff --git a/components/style_traits/Cargo.toml b/components/style_traits/Cargo.toml
index 36677df3a43..99c80c1aa58 100644
--- a/components/style_traits/Cargo.toml
+++ b/components/style_traits/Cargo.toml
@@ -15,8 +15,8 @@ gecko = []
[dependencies]
app_units = "0.5"
-bitflags = "0.7"
cssparser = "0.22.0"
+bitflags = "1.0"
euclid = "0.15"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs
index 98940a5411c..e0f1993c5a8 100644
--- a/components/style_traits/lib.rs
+++ b/components/style_traits/lib.rs
@@ -197,29 +197,29 @@ impl<'i> StyleParseErrorKind<'i> {
bitflags! {
/// The mode to use when parsing values.
- pub flags ParsingMode: u8 {
- /// In CSS, lengths must have units, except for zero values, where the unit can be omitted.
+ pub struct ParsingMode: u8 {
+ /// In CSS; lengths must have units, except for zero values, where the unit can be omitted.
/// <https://www.w3.org/TR/css3-values/#lengths>
- const PARSING_MODE_DEFAULT = 0x00,
- /// In SVG, a coordinate or length value without a unit identifier (e.g., "25") is assumed
+ const DEFAULT = 0x00;
+ /// In SVG; a coordinate or length value without a unit identifier (e.g., "25") is assumed
/// to be in user units (px).
/// <https://www.w3.org/TR/SVG/coords.html#Units>
- const PARSING_MODE_ALLOW_UNITLESS_LENGTH = 0x01,
- /// In SVG, out-of-range values are not treated as an error in parsing.
+ const ALLOW_UNITLESS_LENGTH = 0x01;
+ /// In SVG; out-of-range values are not treated as an error in parsing.
/// <https://www.w3.org/TR/SVG/implnote.html#RangeClamping>
- const PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES = 0x02,
+ const ALLOW_ALL_NUMERIC_VALUES = 0x02;
}
}
impl ParsingMode {
/// Whether the parsing mode allows unitless lengths for non-zero values to be intpreted as px.
pub fn allows_unitless_lengths(&self) -> bool {
- self.intersects(PARSING_MODE_ALLOW_UNITLESS_LENGTH)
+ self.intersects(ParsingMode::ALLOW_UNITLESS_LENGTH)
}
/// Whether the parsing mode allows all numeric values.
pub fn allows_all_numeric_values(&self) -> bool {
- self.intersects(PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES)
+ self.intersects(ParsingMode::ALLOW_ALL_NUMERIC_VALUES)
}
}
diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs
index 183c41c2a80..4ed09130d7b 100644
--- a/components/style_traits/viewport.rs
+++ b/components/style_traits/viewport.rs
@@ -105,7 +105,7 @@ impl Zoom {
///
/// <https://drafts.csswg.org/css-device-adapt/#descdef-viewport-zoom>
pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Zoom, ParseError<'i>> {
- use PARSING_MODE_DEFAULT;
+ use ParsingMode;
use cssparser::Token;
use values::specified::AllowedNumericType::NonNegative;
@@ -113,12 +113,12 @@ impl Zoom {
match *input.next()? {
// TODO: This parse() method should take ParserContext as an
// argument, and pass ParsingMode owned by the ParserContext to
- // is_ok() instead of using PARSING_MODE_DEFAULT directly.
+ // is_ok() instead of using ParsingMode::DEFAULT directly.
// In order to do so, we might want to move these stuff into style::stylesheets::viewport_rule.
- Token::Percentage { unit_value, .. } if NonNegative.is_ok(PARSING_MODE_DEFAULT, unit_value) => {
+ Token::Percentage { unit_value, .. } if NonNegative.is_ok(ParsingMode::DEFAULT, unit_value) => {
Ok(Zoom::Percentage(unit_value))
}
- Token::Number { value, .. } if NonNegative.is_ok(PARSING_MODE_DEFAULT, value) => {
+ Token::Number { value, .. } if NonNegative.is_ok(ParsingMode::DEFAULT, value) => {
Ok(Zoom::Number(value))
}
Token::Ident(ref value) if value.eq_ignore_ascii_case("auto") => {