style: Ensure we cancel transitions without the need of an extra flush

When something switches to display: none, right now we rely on
StopAnimationsForElementsWithoutFrames(), which posts a restyle and the
previous ProcessPendingRestyles call was papering over it.

For other elements in the display none subtree it doesn't matter,
because we don't keep their styles around, but for the display: none
element themselves we do need to update transitions on time.

We could, possibly more generally, remove
StopAnimationsForElementsWithoutFrames() altogether and cancel
animations when we clear style data, perhaps... But that's probably
worth a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D151600
This commit is contained in:
Emilio Cobos Álvarez 2022-07-14 12:45:14 +00:00 committed by Martin Robinson
parent a961519a56
commit 2a1e89468a
2 changed files with 7 additions and 1 deletions

View file

@ -347,7 +347,7 @@ trait PrivateMatchMethods: TElement {
return false;
}
if new_style.clone_display().is_none() || old_style.clone_display().is_none() {
if old_style.clone_display().is_none() {
return false;
}