From 2f457ed144bf8960f54671c2e27705e59610e0dd Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 11 Apr 2019 06:19:13 +0000 Subject: [PATCH] style: Rename ScrollSnapType to ScrollSnapStrictness. The scroll snap strictness is defined in the new spec [1], and the structure is the exactly same as the old scroll snap type structure. [1] https://drafts.csswg.org/css-scroll-snap-1/#snap-strictness Differential Revision: https://phabricator.services.mozilla.com/D21621 --- components/style/properties/data.py | 2 +- components/style/properties/longhands/box.mako.rs | 4 ++-- components/style/values/computed/box.rs | 2 +- components/style/values/computed/mod.rs | 2 +- components/style/values/specified/box.rs | 3 ++- components/style/values/specified/mod.rs | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 52cdcf15d22b..b6d42d8ecd5b 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -341,7 +341,7 @@ def specified_is_copy(self): "SVGOpacity", "SVGPaintOrder", "ScrollSnapAlign", - "ScrollSnapType", + "ScrollSnapStrictness", "TextAlign", "TextDecorationLine", "TextEmphasisPosition", diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index dcfcb343040d..9d18753f53fb 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -430,8 +430,8 @@ ${helpers.predefined_type( % for axis in ["x", "y"]: ${helpers.predefined_type( "scroll-snap-type-" + axis, - "ScrollSnapType", - "computed::ScrollSnapType::None", + "ScrollSnapStrictness", + "computed::ScrollSnapStrictness::None", products="gecko", needs_context=False, gecko_pref="layout.css.scroll-snap.enabled", diff --git a/components/style/values/computed/box.rs b/components/style/values/computed/box.rs index 1fb92bec13ab..fc7df203d54d 100644 --- a/components/style/values/computed/box.rs +++ b/components/style/values/computed/box.rs @@ -15,7 +15,7 @@ pub use crate::values::specified::box_::{AnimationName, Appearance, BreakBetween pub use crate::values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat}; pub use crate::values::specified::box_::{Contain, Display, Overflow}; pub use crate::values::specified::box_::{OverflowAnchor, OverflowClipBox}; -pub use crate::values::specified::box_::{OverscrollBehavior, ScrollSnapAlign, ScrollSnapType}; +pub use crate::values::specified::box_::{OverscrollBehavior, ScrollSnapAlign, ScrollSnapStrictness}; pub use crate::values::specified::box_::{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 f01661cbc9cc..74df937904d3 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -42,7 +42,7 @@ pub use self::box_::{AnimationIterationCount, AnimationName, Contain}; pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, Float}; pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty}; pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize}; -pub use self::box_::{ScrollSnapAlign, ScrollSnapType, TouchAction, VerticalAlign, WillChange}; +pub use self::box_::{ScrollSnapAlign, ScrollSnapStrictness, TouchAction, VerticalAlign, WillChange}; pub use self::color::{Color, ColorOrAuto, ColorPropertyValue}; pub use self::column::ColumnCount; pub use self::counters::{Content, ContentItem, CounterIncrement, CounterSetOrReset}; diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 86bb824748c8..29e2272f6b11 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -379,6 +379,7 @@ impl Parse for AnimationName { } } +/// https://drafts.csswg.org/css-scroll-snap-1/#snap-strictness #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( @@ -396,7 +397,7 @@ impl Parse for AnimationName { ToShmem, )] #[repr(u8)] -pub enum ScrollSnapType { +pub enum ScrollSnapStrictness { None, Mandatory, Proximity, diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index ea69fd5c5779..09675d01fe25 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -40,7 +40,7 @@ pub use self::box_::{AnimationIterationCount, AnimationName, Contain, Display}; pub use self::box_::{Appearance, BreakBetween, BreakWithin}; pub use self::box_::{Clear, Float, Overflow, OverflowAnchor}; pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize}; -pub use self::box_::{ScrollSnapAlign, ScrollSnapType}; +pub use self::box_::{ScrollSnapAlign, ScrollSnapStrictness}; pub use self::box_::{TouchAction, TransitionProperty, VerticalAlign, WillChange}; pub use self::color::{Color, ColorOrAuto, ColorPropertyValue}; pub use self::column::ColumnCount;