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

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

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

View file

@ -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 ParsingMode;
use PARSING_MODE_DEFAULT;
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 ParsingMode::DEFAULT directly.
// is_ok() instead of using PARSING_MODE_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(ParsingMode::DEFAULT, unit_value) => {
Token::Percentage { unit_value, .. } if NonNegative.is_ok(PARSING_MODE_DEFAULT, unit_value) => {
Ok(Zoom::Percentage(unit_value))
}
Token::Number { value, .. } if NonNegative.is_ok(ParsingMode::DEFAULT, value) => {
Token::Number { value, .. } if NonNegative.is_ok(PARSING_MODE_DEFAULT, value) => {
Ok(Zoom::Number(value))
}
Token::Ident(ref value) if value.eq_ignore_ascii_case("auto") => {