mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
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:
commit
0459e1a6dd
13 changed files with 7228 additions and 9083 deletions
|
@ -51,11 +51,14 @@ use gecko::values::GeckoStyleCoordConvertible;
|
|||
use gecko::values::round_border_to_device_pixels;
|
||||
use logical_geometry::WritingMode;
|
||||
use properties::longhands;
|
||||
use properties::{DeclaredValue, Importance, LonghandId};
|
||||
use properties::{PropertyDeclaration, PropertyDeclarationBlock, PropertyDeclarationId};
|
||||
use std::fmt::{self, Debug};
|
||||
use std::mem::{transmute, zeroed};
|
||||
use std::ptr;
|
||||
use std::sync::Arc;
|
||||
use std::cmp;
|
||||
use values::computed::ToComputedValue;
|
||||
|
||||
pub mod style_structs {
|
||||
% for style_struct in data.style_structs:
|
||||
|
@ -154,6 +157,28 @@ impl ComputedValues {
|
|||
// FIXME(bholley): Implement this properly.
|
||||
#[inline]
|
||||
pub fn is_multicol(&self) -> bool { false }
|
||||
|
||||
pub fn to_declaration_block(&self, property: PropertyDeclarationId) -> PropertyDeclarationBlock {
|
||||
match property {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
PropertyDeclarationId::Longhand(LonghandId::${prop.camel_case}) => {
|
||||
PropertyDeclarationBlock {
|
||||
declarations: vec![
|
||||
(PropertyDeclaration::${prop.camel_case}(DeclaredValue::Value(
|
||||
longhands::${prop.ident}::SpecifiedValue::from_computed_value(
|
||||
&self.get_${prop.style_struct.ident.strip("_")}().clone_${prop.ident}()))),
|
||||
Importance::Normal)
|
||||
],
|
||||
important_count: 0
|
||||
}
|
||||
},
|
||||
% endif
|
||||
% endfor
|
||||
PropertyDeclarationId::Custom(_name) => unimplemented!(),
|
||||
_ => unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<%def name="declare_style_struct(style_struct)">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue