diff options
author | Martin Robinson <mrobinson@igalia.com> | 2020-06-15 11:51:23 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2020-06-16 16:33:55 +0200 |
commit | f3e373bc623fd355cb08122d31a76f6548e6827a (patch) | |
tree | 94d416bc55b50b1e343ab02fad79a513d4cd418d /components/style/dom.rs | |
parent | ba5568a0a60cbd4bbedd3b766b7182824d75b131 (diff) | |
download | servo-f3e373bc623fd355cb08122d31a76f6548e6827a.tar.gz servo-f3e373bc623fd355cb08122d31a76f6548e6827a.zip |
Add animation and transition support for pseudo-elements
This change extends the DocumentAnimationSet to hold animations for
pseudo-elements. Since pseudo-elements in Servo are not in the DOM like
in Gecko, they need to be handled a bit carefully in stylo. When a
pseudo-element has an animation, recascade the style. Finally, this
change passes the pseudo-element string properly to animation events.
Fixes: #10316
Diffstat (limited to 'components/style/dom.rs')
-rw-r--r-- | components/style/dom.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/components/style/dom.rs b/components/style/dom.rs index 9b61cfbd3af..83908cf00cd 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -750,12 +750,23 @@ pub trait TElement: /// or are scheduled to do so in the future. fn has_animations(&self, context: &SharedStyleContext) -> bool; - /// Returns true if the element has a CSS animation. - fn has_css_animations(&self, context: &SharedStyleContext) -> bool; + /// Returns true if the element has a CSS animation. The `context` and `pseudo_element` + /// arguments are only used by Servo, since it stores animations globally and pseudo-elements + /// are not in the DOM. + fn has_css_animations( + &self, + context: &SharedStyleContext, + pseudo_element: Option<PseudoElement>, + ) -> bool; /// Returns true if the element has a CSS transition (including running transitions and - /// completed transitions). - fn has_css_transitions(&self, context: &SharedStyleContext) -> bool; + /// completed transitions). The `context` and `pseudo_element` arguments are only used + /// by Servo, since it stores animations globally and pseudo-elements are not in the DOM. + fn has_css_transitions( + &self, + context: &SharedStyleContext, + pseudo_element: Option<PseudoElement>, + ) -> bool; /// Returns true if the element has animation restyle hints. fn has_animation_restyle_hints(&self) -> bool { |