Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE

Backs out https://github.com/servo/servo/pull/18809
This commit is contained in:
Gecko Backout 2017-10-19 21:26:51 +00:00 committed by moz-servo-sync
parent fe16c1d5c3
commit 11c64178d8
142 changed files with 1635 additions and 1685 deletions

View file

@ -197,29 +197,29 @@ impl<'i> StyleParseErrorKind<'i> {
bitflags! {
/// The mode to use when parsing values.
pub struct ParsingMode: u8 {
/// In CSS; lengths must have units, except for zero values, where the unit can be omitted.
pub flags 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 DEFAULT = 0x00;
/// In SVG; a coordinate or length value without a unit identifier (e.g., "25") is assumed
const PARSING_MODE_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 ALLOW_UNITLESS_LENGTH = 0x01;
/// In SVG; out-of-range values are not treated as an error in parsing.
const PARSING_MODE_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 ALLOW_ALL_NUMERIC_VALUES = 0x02;
const PARSING_MODE_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(ParsingMode::ALLOW_UNITLESS_LENGTH)
self.intersects(PARSING_MODE_ALLOW_UNITLESS_LENGTH)
}
/// Whether the parsing mode allows all numeric values.
pub fn allows_all_numeric_values(&self) -> bool {
self.intersects(ParsingMode::ALLOW_ALL_NUMERIC_VALUES)
self.intersects(PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES)
}
}