stylo: Create error reporters linked to documents (bug 1352669)

This commit is contained in:
Josh Matthews 2017-07-06 13:18:36 -04:00
parent 901525c911
commit dc2a500f4b
12 changed files with 5713 additions and 4361 deletions

View file

@ -8,6 +8,7 @@
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;
@ -522,8 +523,8 @@ impl AnimationValue {
/// Construct an AnimationValue from a property declaration
pub fn from_declaration(decl: &PropertyDeclaration, context: &mut Context,
initial: &ComputedValues) -> Option<Self> {
use error_reporting::create_error_reporter;
initial: &ComputedValues,
reporter: &ParseErrorReporter) -> Option<Self> {
use properties::LonghandId;
use properties::DeclaredValue;
@ -587,7 +588,6 @@ 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,9 +610,13 @@ impl AnimationValue {
},
DeclaredValue::WithVariables(_) => unreachable!(),
};
result = AnimationValue::from_declaration(&declaration, context, initial);
result = AnimationValue::from_declaration(
&declaration,
context,
initial,
reporter);
},
&reporter,
reporter,
quirks_mode);
result
},