mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Derive more stuff for clip rects.
I feel a bit weird for using LenghtPercentageOrAuto to implement LengthOrAuto, but I don't think much other code will use it so it seemed a bit better to me. Differential Revision: https://phabricator.services.mozilla.com/D21863
This commit is contained in:
parent
e723a5b7d6
commit
e0b3e5f691
8 changed files with 143 additions and 254 deletions
|
@ -212,3 +212,14 @@ impl<T: Zero> Zero for NonNegative<T> {
|
|||
ToCss,
|
||||
)]
|
||||
pub struct GreaterThanOrEqualToOne<T>(pub T);
|
||||
|
||||
/// A clip rect for clip and image-region
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
|
||||
#[css(function = "rect", comma)]
|
||||
pub struct ClipRect<LengthOrAuto> {
|
||||
pub top: LengthOrAuto,
|
||||
pub right: LengthOrAuto,
|
||||
pub bottom: LengthOrAuto,
|
||||
pub left: LengthOrAuto,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue