mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
style: Remove old CSS scroll snap implementation.
This will save us some time from figuring out what's the best thing to do in bug 1552587, so that other patches I have in flight (mainly bug 1552708) can land, since we cannot add a single byte to nsStyleDisplay right now otherwise. The code removed here is well isolated and not that complicated, so it seems to me that should be easy to bring back should we have an emergency (and I commit to doing that while preserving the nsStyleDisplay size limit if we need to :)). Differential Revision: https://phabricator.services.mozilla.com/D32026
This commit is contained in:
parent
44926adde7
commit
8bf0f82ddc
9 changed files with 2 additions and 192 deletions
|
@ -696,28 +696,6 @@ def set_gecko_property(ffi_name, expr):
|
|||
}
|
||||
</%def>
|
||||
|
||||
<%def name="impl_style_coord(ident, gecko_ffi_name)">
|
||||
#[allow(non_snake_case)]
|
||||
pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) {
|
||||
v.to_gecko_style_coord(&mut self.gecko.${gecko_ffi_name});
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
pub fn copy_${ident}_from(&mut self, other: &Self) {
|
||||
self.gecko.${gecko_ffi_name}.copy_from(&other.gecko.${gecko_ffi_name});
|
||||
}
|
||||
#[allow(non_snake_case)]
|
||||
pub fn reset_${ident}(&mut self, other: &Self) {
|
||||
self.copy_${ident}_from(other)
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
|
||||
use crate::properties::longhands::${ident}::computed_value::T;
|
||||
T::from_gecko_style_coord(&self.gecko.${gecko_ffi_name})
|
||||
.expect("clone for ${ident} failed")
|
||||
}
|
||||
</%def>
|
||||
|
||||
<%def name="copy_sides_style_coord(ident)">
|
||||
<% gecko_ffi_name = "m" + to_camel_case(ident) %>
|
||||
#[allow(non_snake_case)]
|
||||
|
@ -2184,9 +2162,8 @@ fn static_assert() {
|
|||
animation-iteration-count animation-timing-function
|
||||
clear transition-duration transition-delay
|
||||
transition-timing-function transition-property
|
||||
transform-style scroll-snap-points-x
|
||||
scroll-snap-points-y scroll-snap-coordinate
|
||||
-moz-binding shape-outside -webkit-line-clamp""" %>
|
||||
transform-style -moz-binding shape-outside
|
||||
-webkit-line-clamp""" %>
|
||||
<%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
|
||||
#[inline]
|
||||
pub fn set_display(&mut self, v: longhands::display::computed_value::T) {
|
||||
|
@ -2226,33 +2203,7 @@ fn static_assert() {
|
|||
gecko_inexhaustive=True,
|
||||
) %>
|
||||
${impl_keyword('clear', 'mBreakType', clear_keyword)}
|
||||
|
||||
${impl_style_coord("scroll_snap_points_x", "mScrollSnapPointsX")}
|
||||
${impl_style_coord("scroll_snap_points_y", "mScrollSnapPointsY")}
|
||||
|
||||
pub fn set_scroll_snap_coordinate<I>(&mut self, v: I)
|
||||
where I: IntoIterator<Item = longhands::scroll_snap_coordinate::computed_value::single_value::T>,
|
||||
I::IntoIter: ExactSizeIterator
|
||||
{
|
||||
self.gecko.mScrollSnapCoordinate.assign_from_iter_pod(v.into_iter());
|
||||
}
|
||||
|
||||
pub fn copy_scroll_snap_coordinate_from(&mut self, other: &Self) {
|
||||
let iter = other.gecko.mScrollSnapCoordinate.iter().map(|c| *c);
|
||||
self.gecko.mScrollSnapCoordinate.assign_from_iter_pod(iter);
|
||||
}
|
||||
|
||||
pub fn reset_scroll_snap_coordinate(&mut self, other: &Self) {
|
||||
self.copy_scroll_snap_coordinate_from(other)
|
||||
}
|
||||
|
||||
pub fn clone_scroll_snap_coordinate(&self) -> longhands::scroll_snap_coordinate::computed_value::T {
|
||||
let vec = self.gecko.mScrollSnapCoordinate.iter().cloned().collect();
|
||||
longhands::scroll_snap_coordinate::computed_value::List(vec)
|
||||
}
|
||||
|
||||
${impl_css_url('_moz_binding', 'mBinding')}
|
||||
|
||||
${impl_transition_time_value('delay', 'Delay')}
|
||||
${impl_transition_time_value('duration', 'Duration')}
|
||||
${impl_transition_timing_function()}
|
||||
|
|
|
@ -309,41 +309,6 @@ ${helpers.predefined_type(
|
|||
allowed_in_keyframe_block=False,
|
||||
)}
|
||||
|
||||
% for axis in ["x", "y"]:
|
||||
${helpers.predefined_type(
|
||||
"scroll-snap-points-" + axis,
|
||||
"ScrollSnapPoint",
|
||||
"computed::ScrollSnapPoint::none()",
|
||||
animation_value_type="discrete",
|
||||
gecko_pref="layout.css.scroll-snap.enabled",
|
||||
products="gecko",
|
||||
spec="Nonstandard (https://www.w3.org/TR/2015/WD-css-snappoints-1-20150326/#scroll-snap-points)",
|
||||
)}
|
||||
% endfor
|
||||
|
||||
${helpers.predefined_type(
|
||||
"scroll-snap-destination",
|
||||
"Position",
|
||||
"computed::Position::zero()",
|
||||
products="gecko",
|
||||
gecko_pref="layout.css.scroll-snap.enabled",
|
||||
boxed=True,
|
||||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
|
||||
animation_value_type="discrete",
|
||||
)}
|
||||
|
||||
${helpers.predefined_type(
|
||||
"scroll-snap-coordinate",
|
||||
"Position",
|
||||
"computed::Position::zero()",
|
||||
vector=True,
|
||||
allow_empty=True,
|
||||
products="gecko",
|
||||
gecko_pref="layout.css.scroll-snap.enabled",
|
||||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
|
||||
animation_value_type="discrete",
|
||||
)}
|
||||
|
||||
<% transform_extra_prefixes = "moz:layout.css.prefixes.transforms webkit" %>
|
||||
|
||||
${helpers.predefined_type(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue