style: Add ::marker when checking may_have_animations() during traversal.

When unhidding a ::marker element, we construct its generated item, and
then call StyleNewSubtree() on this generated item. During traversal, we
may update any animation related values in Gecko_UpdateAnimations(), which
may update the base styles for animation properties.

The test case is an animation segment from "null" to "inital" value. We
replace the "null" value with the base style value for the specific animation
property, so we can do interpolation properly.
(e.g. opacity: "null => initial" becomes "1.0 => initial")
If we don't update the animation related values in
Gecko_UpdateAnimations after generating ::marker, we may do
interpolation from "null" to "initial", which causes a panic.

Differential Revision: https://phabricator.services.mozilla.com/D73408
This commit is contained in:
Boris Chiou 2020-05-04 19:15:43 +00:00 committed by Emilio Cobos Álvarez
parent c67c9fdcee
commit 6a7c0b7e9c
2 changed files with 7 additions and 1 deletions

View file

@ -92,6 +92,12 @@ impl PseudoElement {
EAGER_PSEUDOS[i].clone()
}
/// Whether the current pseudo element is animatable.
#[inline]
pub fn is_animatable(&self) -> bool {
matches!(*self, Self::Before | Self::After | Self::Marker)
}
/// Whether the current pseudo element is ::before or ::after.
#[inline]
pub fn is_before_or_after(&self) -> bool {

View file

@ -1446,7 +1446,7 @@ impl<'le> TElement for GeckoElement<'le> {
#[inline]
fn may_have_animations(&self) -> bool {
if let Some(pseudo) = self.implemented_pseudo_element() {
if !pseudo.is_before_or_after() {
if !pseudo.is_animatable() {
return false;
}
// FIXME(emilio): When would the parent of a ::before / ::after