mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Only expose longhands to rust via iterators.
The key here is that we only filter longhands if the shorthand is accessible to content and vice-versa. This prevents the bug that prevented me to land this patch before, which was us not expanding properly chrome-only shorthands. Again, this is incomplete, and I need to teach LonghandsToSerialize to get a potentially incomplete list of properties, and all that.
This commit is contained in:
parent
6fbf2c1e3c
commit
8c4b401dd3
8 changed files with 95 additions and 59 deletions
|
@ -285,9 +285,9 @@ impl PropertyAnimation {
|
|||
match transition_property {
|
||||
TransitionProperty::Unsupported(_) => result,
|
||||
TransitionProperty::Shorthand(ref shorthand_id) => {
|
||||
shorthand_id.longhands().iter().filter_map(|longhand| {
|
||||
shorthand_id.longhands().filter_map(|longhand| {
|
||||
PropertyAnimation::from_longhand(
|
||||
&longhand,
|
||||
longhand,
|
||||
timing_function,
|
||||
duration,
|
||||
old_style,
|
||||
|
@ -295,7 +295,7 @@ impl PropertyAnimation {
|
|||
)
|
||||
}).collect()
|
||||
}
|
||||
TransitionProperty::Longhand(ref longhand_id) => {
|
||||
TransitionProperty::Longhand(longhand_id) => {
|
||||
let animation = PropertyAnimation::from_longhand(
|
||||
longhand_id,
|
||||
timing_function,
|
||||
|
@ -313,7 +313,7 @@ impl PropertyAnimation {
|
|||
}
|
||||
|
||||
fn from_longhand(
|
||||
longhand: &LonghandId,
|
||||
longhand: LonghandId,
|
||||
timing_function: TimingFunction,
|
||||
duration: Time,
|
||||
old_style: &ComputedValues,
|
||||
|
@ -751,7 +751,7 @@ where
|
|||
debug!("update_style_for_animation: scanning prop {:?} for animation \"{}\"",
|
||||
property, name);
|
||||
let animation = PropertyAnimation::from_longhand(
|
||||
&property,
|
||||
property,
|
||||
timing_function,
|
||||
Time::from_seconds(relative_duration as f32),
|
||||
&from_style,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue