mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Make 'display' animatable
But not by CSS animations or Web Animations.
This commit is contained in:
parent
d249c61c0d
commit
e6bd750702
3 changed files with 9 additions and 3 deletions
|
@ -12,7 +12,7 @@
|
||||||
// TODO(SimonSapin): don't parse `inline-table`, since we don't support it
|
// TODO(SimonSapin): don't parse `inline-table`, since we don't support it
|
||||||
<%helpers:longhand name="display"
|
<%helpers:longhand name="display"
|
||||||
need_clone="True"
|
need_clone="True"
|
||||||
animation_value_type="none"
|
animation_value_type="discrete"
|
||||||
custom_cascade="${product == 'servo'}"
|
custom_cascade="${product == 'servo'}"
|
||||||
spec="https://drafts.csswg.org/css-display/#propdef-display">
|
spec="https://drafts.csswg.org/css-display/#propdef-display">
|
||||||
<%
|
<%
|
||||||
|
|
|
@ -356,7 +356,10 @@ fn get_animated_properties(keyframes: &[Arc<Locked<Keyframe>>], guard: &SharedRw
|
||||||
assert!(!importance.important());
|
assert!(!importance.important());
|
||||||
|
|
||||||
if let Some(property) = AnimatableLonghand::from_declaration(declaration) {
|
if let Some(property) = AnimatableLonghand::from_declaration(declaration) {
|
||||||
if !seen.has_animatable_longhand_bit(&property) {
|
// Skip the 'display' property because although it is animatable from SMIL,
|
||||||
|
// it should not be animatable from CSS Animations or Web Animations.
|
||||||
|
if property != AnimatableLonghand::Display &&
|
||||||
|
!seen.has_animatable_longhand_bit(&property) {
|
||||||
seen.set_animatable_longhand_bit(&property);
|
seen.set_animatable_longhand_bit(&property);
|
||||||
ret.push(property);
|
ret.push(property);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2938,7 +2938,10 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB
|
||||||
let mut index = unsafe { (*keyframe).mPropertyValues.len() };
|
let mut index = unsafe { (*keyframe).mPropertyValues.len() };
|
||||||
for &(ref declaration, _) in animatable {
|
for &(ref declaration, _) in animatable {
|
||||||
let property = AnimatableLonghand::from_declaration(declaration).unwrap();
|
let property = AnimatableLonghand::from_declaration(declaration).unwrap();
|
||||||
if !properties_set_at_current_offset.has_animatable_longhand_bit(&property) {
|
// Skip the 'display' property because although it is animatable from SMIL,
|
||||||
|
// it should not be animatable from CSS Animations.
|
||||||
|
if property != AnimatableLonghand::Display &&
|
||||||
|
!properties_set_at_current_offset.has_animatable_longhand_bit(&property) {
|
||||||
properties_set_at_current_offset.set_animatable_longhand_bit(&property);
|
properties_set_at_current_offset.set_animatable_longhand_bit(&property);
|
||||||
if current_offset == 0.0 {
|
if current_offset == 0.0 {
|
||||||
properties_set_at_start.set_animatable_longhand_bit(&property);
|
properties_set_at_start.set_animatable_longhand_bit(&property);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue