mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Move transitions and animations to nsStyleUIReset
This mostly just moves code around, to minimize potential behavior changes. There are some cleanups that we should try to do long term (this "have an array with n different counts" is pretty weird). But for now this should unblock people. The destination struct (nsStyleUIReset) was chosen mainly because it's small and non-inherited, and it doesn't seem like a worse place than nsStyleDisplay. Differential Revision: https://phabricator.services.mozilla.com/D144183
This commit is contained in:
parent
fdff95b9c8
commit
76847f7b45
11 changed files with 781 additions and 783 deletions
|
@ -254,8 +254,8 @@ trait PrivateMatchMethods: TElement {
|
|||
new_style: &ComputedValues,
|
||||
pseudo_element: Option<PseudoElement>,
|
||||
) -> bool {
|
||||
let new_box_style = new_style.get_box();
|
||||
let new_style_specifies_animations = new_box_style.specifies_animations();
|
||||
let new_ui_style = new_style.get_ui();
|
||||
let new_style_specifies_animations = new_ui_style.specifies_animations();
|
||||
|
||||
let has_animations = self.has_css_animations(&context.shared, pseudo_element);
|
||||
if !new_style_specifies_animations && !has_animations {
|
||||
|
@ -282,7 +282,7 @@ trait PrivateMatchMethods: TElement {
|
|||
},
|
||||
};
|
||||
|
||||
let old_box_style = old_style.get_box();
|
||||
let old_ui_style = old_style.get_ui();
|
||||
|
||||
let keyframes_or_timeline_could_have_changed = context
|
||||
.shared
|
||||
|
@ -301,12 +301,12 @@ trait PrivateMatchMethods: TElement {
|
|||
}
|
||||
|
||||
// If the animations changed, well...
|
||||
if !old_box_style.animations_equals(new_box_style) {
|
||||
if !old_ui_style.animations_equals(new_ui_style) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let old_display = old_box_style.clone_display();
|
||||
let new_display = new_box_style.clone_display();
|
||||
let old_display = old_style.clone_display();
|
||||
let new_display = new_style.clone_display();
|
||||
|
||||
// If we were display: none, we may need to trigger animations.
|
||||
if old_display == Display::None && new_display != Display::None {
|
||||
|
@ -341,14 +341,13 @@ trait PrivateMatchMethods: TElement {
|
|||
None => return false,
|
||||
};
|
||||
|
||||
let new_box_style = new_style.get_box();
|
||||
if !self.has_css_transitions(context.shared, pseudo_element) &&
|
||||
!new_box_style.specifies_transitions()
|
||||
!new_style.get_ui().specifies_transitions()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if new_box_style.clone_display().is_none() || old_style.clone_display().is_none() {
|
||||
if new_style.clone_display().is_none() || old_style.clone_display().is_none() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -765,8 +764,8 @@ trait PrivateMatchMethods: TElement {
|
|||
},
|
||||
}
|
||||
|
||||
let old_display = old_values.get_box().clone_display();
|
||||
let new_display = new_values.get_box().clone_display();
|
||||
let old_display = old_values.clone_display();
|
||||
let new_display = new_values.clone_display();
|
||||
|
||||
if old_display != new_display {
|
||||
// If we used to be a display: none element, and no longer are, our
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue