Update bitflags to 1.0 in every servo crate

It still needs dependencies update to remove all the other bitflags
versions.
This commit is contained in:
Bastien Orivel 2017-10-09 17:03:40 +02:00
parent 4cf2ce66fc
commit e8e2d0a4b2
142 changed files with 1685 additions and 1635 deletions

View file

@ -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)
}
}