Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE

Backs out https://github.com/servo/servo/pull/17624
This commit is contained in:
Gecko Backout 2017-07-06 21:58:15 +00:00 committed by moz-servo-sync
parent 585468da9a
commit 32269fa7cc
30 changed files with 5277 additions and 6865 deletions

View file

@ -111,19 +111,16 @@ pub struct AnimationValueIterator<'a, 'cx, 'cx_a:'cx> {
iter: Iter<'a, (PropertyDeclaration, Importance)>,
context: &'cx mut Context<'cx_a>,
default_values: &'a Arc<ComputedValues>,
reporter: &'a ParseErrorReporter,
}
impl<'a, 'cx, 'cx_a:'cx> AnimationValueIterator<'a, 'cx, 'cx_a> {
fn new(declarations: &'a PropertyDeclarationBlock,
context: &'cx mut Context<'cx_a>,
default_values: &'a Arc<ComputedValues>,
reporter: &'a ParseErrorReporter) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
default_values: &'a Arc<ComputedValues>) -> AnimationValueIterator<'a, 'cx, 'cx_a> {
AnimationValueIterator {
iter: declarations.declarations().iter(),
context: context,
default_values: default_values,
reporter: reporter
}
}
}
@ -141,8 +138,7 @@ impl<'a, 'cx, 'cx_a:'cx> Iterator for AnimationValueIterator<'a, 'cx, 'cx_a> {
if importance == Importance::Normal {
let property = AnimatableLonghand::from_declaration(decl);
let animation = AnimationValue::from_declaration(decl, &mut self.context,
self.default_values,
self.reporter);
self.default_values);
debug_assert!(property.is_none() == animation.is_none(),
"The failure condition of AnimatableLonghand::from_declaration \
and AnimationValue::from_declaration should be the same");
@ -208,10 +204,9 @@ impl PropertyDeclarationBlock {
/// Return an iterator of (AnimatableLonghand, AnimationValue).
pub fn to_animation_value_iter<'a, 'cx, 'cx_a:'cx>(&'a self,
context: &'cx mut Context<'cx_a>,
default_values: &'a Arc<ComputedValues>,
reporter: &'a ParseErrorReporter)
default_values: &'a Arc<ComputedValues>)
-> AnimationValueIterator<'a, 'cx, 'cx_a> {
AnimationValueIterator::new(self, context, default_values, reporter)
AnimationValueIterator::new(self, context, default_values)
}
/// Returns whether this block contains any declaration with `!important`.
@ -913,17 +908,10 @@ pub fn parse_one_declaration_into(declarations: &mut SourcePropertyDeclaration,
parsing_mode,
quirks_mode);
let mut input = ParserInput::new(input);
let mut parser = Parser::new(&mut input);
let start = parser.position();
parser.parse_entirely(|parser| {
Parser::new(&mut input).parse_entirely(|parser| {
PropertyDeclaration::parse_into(declarations, id, &context, parser)
.map_err(|e| e.into())
}).map_err(|err| {
let end = parser.position();
let error = ContextualParseError::UnsupportedPropertyDeclaration(
parser.slice(start..end), err);
log_css_error(&mut parser, start, error, &context);
})
}).map_err(|_| ())
}
/// A struct to parse property declarations.

View file

@ -8,7 +8,6 @@
use app_units::Au;
use cssparser::{Parser, RGBA};
use error_reporting::ParseErrorReporter;
use euclid::{Point2D, Size2D};
#[cfg(feature = "gecko")] use gecko_bindings::bindings::RawServoAnimationValueMap;
#[cfg(feature = "gecko")] use gecko_bindings::structs::RawGeckoGfxMatrix4x4;
@ -523,8 +522,8 @@ impl AnimationValue {
/// Construct an AnimationValue from a property declaration
pub fn from_declaration(decl: &PropertyDeclaration, context: &mut Context,
initial: &ComputedValues,
reporter: &ParseErrorReporter) -> Option<Self> {
initial: &ComputedValues) -> Option<Self> {
use error_reporting::create_error_reporter;
use properties::LonghandId;
use properties::DeclaredValue;
@ -588,6 +587,7 @@ impl AnimationValue {
},
PropertyDeclaration::WithVariables(id, ref variables) => {
let custom_props = context.style().custom_properties();
let reporter = create_error_reporter();
match id {
% for prop in data.longhands:
% if prop.animatable:
@ -610,13 +610,9 @@ impl AnimationValue {
},
DeclaredValue::WithVariables(_) => unreachable!(),
};
result = AnimationValue::from_declaration(
&declaration,
context,
initial,
reporter);
result = AnimationValue::from_declaration(&declaration, context, initial);
},
reporter,
&reporter,
quirks_mode);
result
},

View file

@ -37,8 +37,7 @@ use properties::animated_properties::AnimatableLonghand;
use selectors::parser::SelectorParseError;
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
use shared_lock::StylesheetGuards;
use style_traits::{PARSING_MODE_DEFAULT, HasViewportPercentage, ToCss, ParseError};
use style_traits::{PropertyDeclarationParseError, StyleParseError};
use style_traits::{PARSING_MODE_DEFAULT, HasViewportPercentage, ToCss, ParseError, PropertyDeclarationParseError};
use stylesheets::{CssRuleType, MallocSizeOf, MallocSizeOfFn, Origin, UrlExtraData};
#[cfg(feature = "servo")] use values::Either;
use values::generics::text::LineHeight;
@ -1015,7 +1014,7 @@ impl PropertyId {
match static_id(&property_name) {
Some(&StaticId::Longhand(id)) => Ok(PropertyId::Longhand(id)),
Some(&StaticId::Shorthand(id)) => Ok(PropertyId::Shorthand(id)),
None => Err(StyleParseError::UnknownProperty(property_name).into()),
None => Err(SelectorParseError::UnexpectedIdent(property_name).into()),
}
}
@ -1420,7 +1419,7 @@ impl PropertyDeclaration {
Ok(keyword) => DeclaredValueOwned::CSSWideKeyword(keyword),
Err(_) => match ::custom_properties::SpecifiedValue::parse(context, input) {
Ok(value) => DeclaredValueOwned::Value(value),
Err(_) => return Err(PropertyDeclarationParseError::InvalidValue(name.to_string())),
Err(_) => return Err(PropertyDeclarationParseError::InvalidValue),
}
};
declarations.push(PropertyDeclaration::Custom(name, value));
@ -1448,7 +1447,7 @@ impl PropertyDeclaration {
declarations.push(value);
Ok(())
},
Err(_) => Err(PropertyDeclarationParseError::InvalidValue("${property.ident}".into())),
Err(_) => Err(PropertyDeclarationParseError::InvalidValue),
}
% else:
Err(PropertyDeclarationParseError::UnknownProperty)
@ -1488,7 +1487,7 @@ impl PropertyDeclaration {
},
Err(_) => {
shorthands::${shorthand.ident}::parse_into(declarations, context, input)
.map_err(|_| PropertyDeclarationParseError::InvalidValue("${shorthand.ident}".into()))
.map_err(|_| PropertyDeclarationParseError::InvalidValue)
}
}
}