mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Use cbindgen for clip / -moz-image-region.
This also fixes some of the issues with -moz-image-region, where we just minted an auto out of the blue. Differential Revision: https://phabricator.services.mozilla.com/D43474
This commit is contained in:
parent
53cd37ce39
commit
b238698691
5 changed files with 52 additions and 194 deletions
|
@ -272,9 +272,47 @@ pub struct ZeroToOne<T>(pub T);
|
|||
ToShmem,
|
||||
)]
|
||||
#[css(function = "rect", comma)]
|
||||
pub struct ClipRect<LengthOrAuto> {
|
||||
#[repr(C)]
|
||||
pub struct GenericClipRect<LengthOrAuto> {
|
||||
pub top: LengthOrAuto,
|
||||
pub right: LengthOrAuto,
|
||||
pub bottom: LengthOrAuto,
|
||||
pub left: LengthOrAuto,
|
||||
}
|
||||
|
||||
pub use self::GenericClipRect as ClipRect;
|
||||
|
||||
/// Either a clip-rect or `auto`.
|
||||
#[allow(missing_docs)]
|
||||
#[derive(
|
||||
Animate,
|
||||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
Parse,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedValue,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C, u8)]
|
||||
pub enum GenericClipRectOrAuto<R> {
|
||||
Auto,
|
||||
Rect(R),
|
||||
}
|
||||
|
||||
pub use self::GenericClipRectOrAuto as ClipRectOrAuto;
|
||||
|
||||
impl<L> ClipRectOrAuto<L> {
|
||||
/// Returns the `auto` value.
|
||||
#[inline]
|
||||
pub fn auto() -> Self {
|
||||
ClipRectOrAuto::Auto
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue