mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Auto merge of #16496 - BorisChiou:stylo/transition/trigger, r=heycam
stylo: Bug 1341372 - Detect new transitions and let it run. These are interdependent patches of Bug 1341372. We let animation-only restyle also work for RESTYLE_CSS_TRANSITIONS, and check if we need to update transitions by each transition property. If it is necessary to create/replace/cancel transitions, we create a SequentialTask for CSS_TRANSITIONS. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix Bug 1341372 - [X] These changes do not require tests because there are tests in Gecko already. <!-- 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/16496) <!-- Reviewable:end -->
This commit is contained in:
commit
4d8c9c10cb
11 changed files with 461 additions and 70 deletions
|
@ -66,6 +66,19 @@ impl TransitionProperty {
|
|||
% endfor
|
||||
}
|
||||
|
||||
/// Iterates over every property that is not TransitionProperty::All, stopping and returning
|
||||
/// true when the provided callback returns true for the first time.
|
||||
pub fn any<F: FnMut(TransitionProperty) -> bool>(mut cb: F) -> bool {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
if cb(TransitionProperty::${prop.camel_case}) {
|
||||
return true;
|
||||
}
|
||||
% endif
|
||||
% endfor
|
||||
false
|
||||
}
|
||||
|
||||
/// Parse a transition-property value.
|
||||
pub fn parse(input: &mut Parser) -> Result<Self, ()> {
|
||||
match_ignore_ascii_case! { &try!(input.expect_ident()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue