Skip to content

Commit

Permalink
style: Make various border-image-* properties interpolable.
Browse files Browse the repository at this point in the history
  • Loading branch information
birtles authored and emilio committed Oct 9, 2019
1 parent 877c6ac commit c349dbb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/style/properties/longhands/border.mako.rs
Expand Up @@ -126,7 +126,7 @@ ${helpers.predefined_type(
initial_value="generics::rect::Rect::all(computed::NonNegativeLengthOrNumber::zero())",
initial_specified_value="generics::rect::Rect::all(specified::NonNegativeLengthOrNumber::zero())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset",
animation_value_type="discrete",
animation_value_type="NonNegativeLengthOrNumberRect",
boxed=True,
)}

Expand All @@ -147,7 +147,7 @@ ${helpers.predefined_type(
initial_value="computed::BorderImageWidth::all(computed::BorderImageSideWidth::one())",
initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-width",
animation_value_type="discrete",
animation_value_type="BorderImageWidth",
boxed=True,
)}

Expand All @@ -158,6 +158,6 @@ ${helpers.predefined_type(
initial_value="computed::BorderImageSlice::hundred_percent()",
initial_specified_value="specified::BorderImageSlice::hundred_percent()",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice",
animation_value_type="discrete",
animation_value_type="BorderImageSlice",
boxed=True,
)}
11 changes: 10 additions & 1 deletion components/style/values/computed/mod.rs
Expand Up @@ -577,7 +577,16 @@ impl From<GreaterThanOrEqualToOneNumber> for CSSFloat {

#[allow(missing_docs)]
#[derive(
Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue,
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
PartialEq,
ToAnimatedZero,
ToCss,
ToResolvedValue,
)]
#[repr(C, u8)]
pub enum NumberOrPercentage {
Expand Down
9 changes: 9 additions & 0 deletions components/style/values/generics/border.rs
Expand Up @@ -12,13 +12,17 @@ use style_traits::{CssWriter, ToCss};

/// A generic value for a single side of a `border-image-width` property.
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
Expand All @@ -41,12 +45,16 @@ pub use self::GenericBorderImageSideWidth as BorderImageSideWidth;

/// A generic value for the `border-image-slice` property.
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
Expand All @@ -58,6 +66,7 @@ pub struct GenericBorderImageSlice<NumberOrPercentage> {
#[css(field_bound)]
pub offsets: Rect<NumberOrPercentage>,
/// Whether to fill the middle part.
#[animation(constant)]
#[css(represents_keyword)]
pub fill: bool,
}
Expand Down
1 change: 1 addition & 0 deletions components/style/values/generics/rect.rs
Expand Up @@ -21,6 +21,7 @@ use style_traits::{CssWriter, ParseError, ToCss};
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToResolvedValue,
ToShmem,
Expand Down

0 comments on commit c349dbb

Please sign in to comment.