diff --git a/components/style/gecko/arc_types.rs b/components/style/gecko/arc_types.rs index 788f75f2b2f..05fcdb5b12d 100644 --- a/components/style/gecko/arc_types.rs +++ b/components/style/gecko/arc_types.rs @@ -10,13 +10,11 @@ use crate::gecko::url::CssUrlData; use crate::gecko_bindings::structs::{ - RawServoAnimationValue, RawServoCounterStyleRule, RawServoCssUrlData, - RawServoDeclarationBlock, RawServoFontFaceRule, - RawServoFontFeatureValuesRule, RawServoImportRule, RawServoKeyframe, - RawServoKeyframesRule, RawServoLayerRule, RawServoMediaList, - RawServoMediaRule, RawServoMozDocumentRule, RawServoNamespaceRule, - RawServoPageRule, RawServoStyleRule, RawServoStyleSheetContents, - RawServoSupportsRule, ServoCssRules + RawServoAnimationValue, RawServoCounterStyleRule, RawServoCssUrlData, RawServoDeclarationBlock, + RawServoFontFaceRule, RawServoFontFeatureValuesRule, RawServoImportRule, RawServoKeyframe, + RawServoKeyframesRule, RawServoLayerRule, RawServoMediaList, RawServoMediaRule, + RawServoMozDocumentRule, RawServoNamespaceRule, RawServoPageRule, RawServoScrollTimelineRule, + RawServoStyleRule, RawServoStyleSheetContents, RawServoSupportsRule, ServoCssRules, }; use crate::gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI, Strong}; use crate::media_queries::MediaList; @@ -25,9 +23,9 @@ use crate::properties::{ComputedValues, PropertyDeclarationBlock}; use crate::shared_lock::Locked; use crate::stylesheets::keyframes_rule::Keyframe; use crate::stylesheets::{ - CounterStyleRule, CssRules, FontFaceRule, FontFeatureValuesRule, - DocumentRule, ImportRule, KeyframesRule, LayerRule, MediaRule, - NamespaceRule, PageRule, StyleRule, StylesheetContents, SupportsRule + CounterStyleRule, CssRules, DocumentRule, FontFaceRule, FontFeatureValuesRule, ImportRule, + KeyframesRule, LayerRule, MediaRule, NamespaceRule, PageRule, ScrollTimelineRule, StyleRule, + StylesheetContents, SupportsRule, }; use servo_arc::{Arc, ArcBorrow}; use std::{mem, ptr}; @@ -90,6 +88,9 @@ impl_arc_ffi!(Locked => RawServoNamespaceRule impl_arc_ffi!(Locked => RawServoPageRule [Servo_PageRule_AddRef, Servo_PageRule_Release]); +impl_arc_ffi!(Locked => RawServoScrollTimelineRule + [Servo_ScrollTimelineRule_AddRef, Servo_ScrollTimelineRule_Release]); + impl_arc_ffi!(Locked => RawServoSupportsRule [Servo_SupportsRule_AddRef, Servo_SupportsRule_Release]); diff --git a/components/style/stylesheets/scroll_timeline_rule.rs b/components/style/stylesheets/scroll_timeline_rule.rs index f11e469f958..bbc5d9caf8f 100644 --- a/components/style/stylesheets/scroll_timeline_rule.rs +++ b/components/style/stylesheets/scroll_timeline_rule.rs @@ -169,6 +169,12 @@ pub enum Source { None, } +impl Default for Source { + fn default() -> Self { + Source::Auto + } +} + /// The scroll-timeline orientation. /// https://drafts.csswg.org/scroll-animations/#descdef-scroll-timeline-orientation /// @@ -189,11 +195,17 @@ pub enum Orientation { Vertical, } +impl Default for Orientation { + fn default() -> Self { + Orientation::Auto + } +} + /// Scroll-timeline offsets. We treat None as an empty vector. /// value: none | # /// /// https://drafts.csswg.org/scroll-animations/#descdef-scroll-timeline-scroll-offsets -#[derive(Clone, Debug, ToCss, ToShmem)] +#[derive(Clone, Default, Debug, ToCss, ToShmem)] #[css(comma)] pub struct ScrollOffsets(#[css(if_empty = "none", iterable)] Box<[ScrollTimelineOffset]>);