Bug 1328787 - Part 9: Set Keyframe.mPropertyValues for the case where keyframe is specified. r=heycam

MozReview-Commit-ID: Ayt7IsYShl4
This commit is contained in:
Hiroyuki Ikezoe 2017-01-28 18:57:27 +09:00
parent e20a3ad9b5
commit aa6372d99d
4 changed files with 75 additions and 20 deletions

View file

@ -2,9 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
use app_units::Au;
use cssparser::{Color as CSSParserColor, Parser, RGBA};
use euclid::{Point2D, Size2D};
#[cfg(feature = "gecko")] use gecko_bindings::structs::nsCSSPropertyID;
use properties::{DeclaredValue, PropertyDeclaration};
use properties::longhands;
use properties::longhands::background_position_x::computed_value::T as BackgroundPositionX;
@ -101,6 +104,23 @@ impl ToCss for TransitionProperty {
}
}
/// Convert to nsCSSPropertyID.
#[cfg(feature = "gecko")]
#[allow(non_upper_case_globals)]
impl From<TransitionProperty> for nsCSSPropertyID {
fn from(transition_property: TransitionProperty) -> nsCSSPropertyID {
match transition_property {
% for prop in data.longhands:
% if prop.animatable:
TransitionProperty::${prop.camel_case}
=> ${helpers.to_nscsspropertyid(prop.ident)},
% endif
% endfor
TransitionProperty::All => nsCSSPropertyID::eCSSPropertyExtra_all_properties,
}
}
}
/// An animated property interpolation between two computed values for that
/// property.
#[derive(Clone, Debug, PartialEq)]