mirror of
https://github.com/servo/servo.git
synced 2025-08-13 09:25:32 +01:00
style: Refactor to pass animations cleanly, land animation-name parsing as experimental
This commit is contained in:
parent
c1fd7432e9
commit
60192bb830
12 changed files with 152 additions and 30 deletions
|
@ -1561,8 +1561,10 @@ pub mod specified {
|
|||
pub mod computed {
|
||||
use app_units::Au;
|
||||
use euclid::size::Size2D;
|
||||
use keyframes::Keyframe;
|
||||
use properties::ComputedValues;
|
||||
use properties::style_struct_traits::Font;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use super::LocalToCss;
|
||||
use super::specified::AngleOrCorner;
|
||||
|
@ -1578,6 +1580,7 @@ pub mod computed {
|
|||
fn inherited_style(&self) -> &Self::ConcreteComputedValues;
|
||||
fn style(&self) -> &Self::ConcreteComputedValues;
|
||||
fn mutate_style(&mut self) -> &mut Self::ConcreteComputedValues;
|
||||
fn animations(&self) -> Option<&HashMap<String, Vec<Keyframe>>>;
|
||||
}
|
||||
|
||||
pub struct Context<'a, C: ComputedValues> {
|
||||
|
@ -1585,6 +1588,7 @@ pub mod computed {
|
|||
pub viewport_size: Size2D<Au>,
|
||||
pub inherited_style: &'a C,
|
||||
|
||||
pub animations: Option<&'a HashMap<String, Vec<Keyframe>>>,
|
||||
/// Values access through this need to be in the properties "computed early":
|
||||
/// color, text-decoration, font-size, display, position, float, border-*-style, outline-style
|
||||
pub style: C,
|
||||
|
@ -1597,6 +1601,7 @@ pub mod computed {
|
|||
fn inherited_style(&self) -> &C { &self.inherited_style }
|
||||
fn style(&self) -> &C { &self.style }
|
||||
fn mutate_style(&mut self) -> &mut C { &mut self.style }
|
||||
fn animations(&self) -> Option<&HashMap<String, Vec<Keyframe>>> { self.animations }
|
||||
}
|
||||
|
||||
pub trait ToComputedValue {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue