Auto merge of #15287 - hiikezoe:css-animation, r=heycam

Counter part of bug 1328787 - Stylo: Convert Servo's animation keyframes and store them into Gecko's keyframes

<!-- Please describe your changes on the following line: -->
Reviewed by @heycam, An exception is auto-generated bindgen stuff, I did not include it in patches on bugzilla.  The bindgen diff included in this PR was generated with  b5c94bad37.  It might be bit-rotted.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because gecko has test cases.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15287)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-28 21:24:04 -08:00 committed by GitHub
commit 0459e1a6dd
13 changed files with 7228 additions and 9083 deletions

View file

@ -737,16 +737,6 @@ enum StaticId {
Shorthand(ShorthandId),
}
include!(concat!(env!("OUT_DIR"), "/static_ids.rs"));
<%
def alias_to_nscsspropertyid(alias):
if alias == "word-wrap":
return "nsCSSPropertyID_eCSSPropertyAlias_WordWrap"
return "nsCSSPropertyID::eCSSPropertyAlias_%s" % to_camel_case(alias)
def to_nscsspropertyid(ident):
if ident == "float":
ident = "float_"
return "nsCSSPropertyID::eCSSProperty_%s" % ident
%>
impl PropertyId {
/// Returns a given property from the string `s`.
///
@ -771,21 +761,21 @@ impl PropertyId {
use gecko_bindings::structs::*;
match id {
% for property in data.longhands:
${to_nscsspropertyid(property.ident)} => {
${helpers.to_nscsspropertyid(property.ident)} => {
Ok(PropertyId::Longhand(LonghandId::${property.camel_case}))
}
% for alias in property.alias:
${alias_to_nscsspropertyid(alias)} => {
${helpers.alias_to_nscsspropertyid(alias)} => {
Ok(PropertyId::Longhand(LonghandId::${property.camel_case}))
}
% endfor
% endfor
% for property in data.shorthands:
${to_nscsspropertyid(property.ident)} => {
${helpers.to_nscsspropertyid(property.ident)} => {
Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case}))
}
% for alias in property.alias:
${alias_to_nscsspropertyid(alias)} => {
${helpers.alias_to_nscsspropertyid(alias)} => {
Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case}))
}
% endfor
@ -804,14 +794,14 @@ impl PropertyId {
PropertyId::Longhand(id) => match id {
% for property in data.longhands:
LonghandId::${property.camel_case} => {
Ok(${to_nscsspropertyid(property.ident)})
Ok(${helpers.to_nscsspropertyid(property.ident)})
}
% endfor
},
PropertyId::Shorthand(id) => match id {
% for property in data.shorthands:
ShorthandId::${property.camel_case} => {
Ok(${to_nscsspropertyid(property.ident)})
Ok(${helpers.to_nscsspropertyid(property.ident)})
}
% endfor
},
@ -921,7 +911,7 @@ impl ToCss for PropertyDeclaration {
pref_ident = "float_"
%>
if structs::root::mozilla::SERVO_PREF_ENABLED_${pref_ident} {
let id = structs::${to_nscsspropertyid(property.ident)};
let id = structs::${helpers.to_nscsspropertyid(property.ident)};
let enabled = unsafe { bindings::Gecko_PropertyId_IsPrefEnabled(id) };
if !enabled {
return PropertyDeclarationParseResult::ExperimentalProperty