diff --git a/components/style/properties/counted_unknown_properties.py b/components/style/properties/counted_unknown_properties.py index 473f2f599d2..997fd167a07 100644 --- a/components/style/properties/counted_unknown_properties.py +++ b/components/style/properties/counted_unknown_properties.py @@ -73,7 +73,6 @@ COUNTED_UNKNOWN_PROPERTIES = [ "-webkit-perspective-origin-y", "-webkit-margin-before-collapse", "-webkit-border-before-style", - "scroll-snap-stop", "-webkit-margin-bottom-collapse", "-webkit-ruby-position", "-webkit-column-break-after", diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 426b03276d0..ac1de39f877 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -492,6 +492,7 @@ class Longhand(Property): "ScrollbarGutter", "ScrollSnapAlign", "ScrollSnapAxis", + "ScrollSnapStop", "ScrollSnapStrictness", "ScrollSnapType", "TextAlign", diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index 7765b7e71e1..6598885c3a1 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -285,6 +285,15 @@ ${helpers.predefined_type( animation_value_type="discrete", )} +${helpers.predefined_type( + "scroll-snap-stop", + "ScrollSnapStop", + "computed::ScrollSnapStop::Normal", + engines="gecko", + spec="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-stop", + animation_value_type="discrete", +)} + % for (axis, logical) in ALL_AXES: ${helpers.predefined_type( "overscroll-behavior-" + axis, diff --git a/components/style/values/computed/box.rs b/components/style/values/computed/box.rs index f4d3a4f5a35..f05870d6ead 100644 --- a/components/style/values/computed/box.rs +++ b/components/style/values/computed/box.rs @@ -15,8 +15,9 @@ pub use crate::values::specified::box_::{ AnimationName, AnimationTimeline, Appearance, BreakBetween, BreakWithin, Clear as SpecifiedClear, Contain, ContainerName, ContainerType, ContentVisibility, Display, Float as SpecifiedFloat, Overflow, OverflowAnchor, OverflowClipBox, - OverscrollBehavior, ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, - ScrollSnapType, ScrollbarGutter, TouchAction, TransitionProperty, WillChange, + OverscrollBehavior, ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStop, + ScrollSnapStrictness, ScrollSnapType, ScrollbarGutter, TouchAction, + TransitionProperty, WillChange, }; /// A computed value for the `vertical-align` property. diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index d8011094711..68256cdd20f 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -49,7 +49,8 @@ pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, ContentVisibility, Float}; pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty}; pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter}; -pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType}; +pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStop}; +pub use self::box_::{ScrollSnapStrictness, ScrollSnapType}; pub use self::box_::{TouchAction, VerticalAlign, WillChange}; pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme, PrintColorAdjust}; pub use self::column::ColumnCount; diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 0a2d2bb9b19..1289fc6eaa8 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -1080,6 +1080,28 @@ impl ToCss for ScrollSnapAlign { } } +#[allow(missing_docs)] +#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] +#[derive( + Clone, + Copy, + Debug, + Eq, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, + ToResolvedValue, + ToShmem, +)] +#[repr(u8)] +pub enum ScrollSnapStop { + Normal, + Always, +} + #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 43d1cf780b4..c06386ef97d 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -40,7 +40,8 @@ pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, pub use self::box_::{Appearance, BreakBetween, BreakWithin, ContainerName, ContainerType}; pub use self::box_::{Clear, ContentVisibility, Float, Overflow, OverflowAnchor}; pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter}; -pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType}; +pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStop}; +pub use self::box_::{ScrollSnapStrictness, ScrollSnapType}; pub use self::box_::{TouchAction, TransitionProperty, VerticalAlign, WillChange}; pub use self::color::{Color, ColorOrAuto, ColorPropertyValue, ColorScheme, PrintColorAdjust}; pub use self::column::ColumnCount;