Expand var() references in single_value_to_css

This is a temporary step needed to support Gecko's getKeyframes() API
until we implement bug 1391537. It only takes effect when
a ComputedValues object is supplied and only for longhand declarations.
This commit is contained in:
Brian Birtles 2017-08-21 12:59:53 +09:00
parent 87206bd68e
commit 4f53ca2e39
3 changed files with 33 additions and 7 deletions

View file

@ -564,7 +564,8 @@ pub extern "C" fn Servo_AnimationValue_Serialize(value: RawServoAnimationValueBo
let uncomputed_value = AnimationValue::as_arc(&value).uncompute();
let mut string = String::new();
let rv = PropertyDeclarationBlock::with_one(uncomputed_value, Importance::Normal)
.single_value_to_css(&get_property_id_from_nscsspropertyid!(property, ()), &mut string);
.single_value_to_css(&get_property_id_from_nscsspropertyid!(property, ()), &mut string,
None);
debug_assert!(rv.is_ok());
let buffer = unsafe { buffer.as_mut().unwrap() };
@ -2142,12 +2143,13 @@ pub extern "C" fn Servo_DeclarationBlock_GetCssText(declarations: RawServoDeclar
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
declarations: RawServoDeclarationBlockBorrowed,
property_id: nsCSSPropertyID, buffer: *mut nsAString)
property_id: nsCSSPropertyID, buffer: *mut nsAString,
computed_values: ServoStyleContextBorrowedOrNull)
{
let property_id = get_property_id_from_nscsspropertyid!(property_id, ());
read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
let mut string = String::new();
let rv = decls.single_value_to_css(&property_id, &mut string);
let rv = decls.single_value_to_css(&property_id, &mut string, computed_values);
debug_assert!(rv.is_ok());
let buffer = unsafe { buffer.as_mut().unwrap() };