aboutsummaryrefslogtreecommitdiffstats
path: root/components/style_traits/lib.rs
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/lib.rs
parentb6475cf433747a8b0cd177f0a16abae9d795e41c (diff)
downloadservo-29b4eec14187c96a1518af6a954bd00194375382.tar.gz
servo-29b4eec14187c96a1518af6a954bd00194375382.zip
Bump bitflags to 1.0 in every servo crate
Diffstat (limited to 'components/style_traits/lib.rs')
-rw-r--r--components/style_traits/lib.rs18
1 files changed, 9 insertions, 9 deletions
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)
}
}