Revert "Backport several style changes from Gecko (5) (#30099)" (#30104)

This reverts commit 8e15389cae.
This commit is contained in:
Oriol Brufau 2023-08-16 08:24:42 +02:00 committed by GitHub
parent 8e15389cae
commit d6ae8dc112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
152 changed files with 4622 additions and 5862 deletions

View file

@ -455,8 +455,8 @@ pub struct Animation {
impl Animation {
/// Whether or not this animation is cancelled by changes from a new style.
fn is_cancelled_in_new_style(&self, new_style: &Arc<ComputedValues>) -> bool {
let new_ui = new_style.get_ui();
let index = new_ui
let index = new_style
.get_box()
.animation_name_iter()
.position(|animation_name| Some(&self.name) == animation_name.as_atom());
let index = match index {
@ -464,7 +464,7 @@ impl Animation {
None => return true,
};
new_ui.animation_duration_mod(index).seconds() == 0.
new_style.get_box().animation_duration_mod(index).seconds() == 0.
}
/// Given the current time, advances this animation to the next iteration,
@ -1073,10 +1073,10 @@ impl ElementAnimationSet {
old_style: &ComputedValues,
new_style: &Arc<ComputedValues>,
) {
let style = new_style.get_ui();
let timing_function = style.transition_timing_function_mod(index);
let duration = style.transition_duration_mod(index);
let delay = style.transition_delay_mod(index).seconds() as f64;
let box_style = new_style.get_box();
let timing_function = box_style.transition_timing_function_mod(index);
let duration = box_style.transition_duration_mod(index);
let delay = box_style.transition_delay_mod(index).seconds() as f64;
let now = context.current_time_for_animations;
// Only start a new transition if the style actually changes between
@ -1344,15 +1344,15 @@ pub fn maybe_start_animations<E>(
) where
E: TElement,
{
let style = new_style.get_ui();
for (i, name) in style.animation_name_iter().enumerate() {
let box_style = new_style.get_box();
for (i, name) in box_style.animation_name_iter().enumerate() {
let name = match name.as_atom() {
Some(atom) => atom,
None => continue,
};
debug!("maybe_start_animations: name={}", name);
let duration = style.animation_duration_mod(i).seconds() as f64;
let duration = box_style.animation_duration_mod(i).seconds() as f64;
if duration == 0. {
continue;
}
@ -1375,14 +1375,14 @@ pub fn maybe_start_animations<E>(
// NB: This delay may be negative, meaning that the animation may be created
// in a state where we have advanced one or more iterations or even that the
// animation begins in a finished state.
let delay = style.animation_delay_mod(i).seconds();
let delay = box_style.animation_delay_mod(i).seconds();
let iteration_state = match style.animation_iteration_count_mod(i) {
let iteration_state = match box_style.animation_iteration_count_mod(i) {
AnimationIterationCount::Infinite => KeyframesIterationState::Infinite(0.0),
AnimationIterationCount::Number(n) => KeyframesIterationState::Finite(0.0, n.into()),
};
let animation_direction = style.animation_direction_mod(i);
let animation_direction = box_style.animation_direction_mod(i);
let initial_direction = match animation_direction {
AnimationDirection::Normal | AnimationDirection::Alternate => {
@ -1396,7 +1396,7 @@ pub fn maybe_start_animations<E>(
let now = context.current_time_for_animations;
let started_at = now + delay as f64;
let mut starting_progress = (now - started_at) / duration;
let state = match style.animation_play_state_mod(i) {
let state = match box_style.animation_play_state_mod(i) {
AnimationPlayState::Paused => AnimationState::Paused(starting_progress),
AnimationPlayState::Running => AnimationState::Pending,
};
@ -1406,7 +1406,7 @@ pub fn maybe_start_animations<E>(
&keyframe_animation,
context,
new_style,
style.animation_timing_function_mod(i),
new_style.get_box().animation_timing_function_mod(i),
resolver,
);
@ -1416,7 +1416,7 @@ pub fn maybe_start_animations<E>(
computed_steps,
started_at,
duration,
fill_mode: style.animation_fill_mode_mod(i),
fill_mode: box_style.animation_fill_mode_mod(i),
delay: delay as f64,
iteration_state,
state,