Navigation Menu

Skip to content

Commit

Permalink
style: Rename ScrollSnapType to ScrollSnapStrictness.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hiroyuki Ikezoe authored and emilio committed Apr 12, 2019
1 parent 0a84073 commit 2f457ed
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/style/properties/data.py
Expand Up @@ -341,7 +341,7 @@ def specified_is_copy(self):
"SVGOpacity",
"SVGPaintOrder",
"ScrollSnapAlign",
"ScrollSnapType",
"ScrollSnapStrictness",
"TextAlign",
"TextDecorationLine",
"TextEmphasisPosition",
Expand Down
4 changes: 2 additions & 2 deletions components/style/properties/longhands/box.mako.rs
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/computed/box.rs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/computed/mod.rs
Expand Up @@ -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};
Expand Down
3 changes: 2 additions & 1 deletion components/style/values/specified/box.rs
Expand Up @@ -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(
Expand All @@ -396,7 +397,7 @@ impl Parse for AnimationName {
ToShmem,
)]
#[repr(u8)]
pub enum ScrollSnapType {
pub enum ScrollSnapStrictness {
None,
Mandatory,
Proximity,
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/specified/mod.rs
Expand Up @@ -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;
Expand Down

0 comments on commit 2f457ed

Please sign in to comment.