mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Add computed value ZeroToOneNumber.
Correctly handle clamping to 1 behavior of grayscale(), invert(), opacity() and sepia(). Differential Revision: https://phabricator.services.mozilla.com/D35509
This commit is contained in:
parent
9939c1ee07
commit
2fba62aba9
6 changed files with 132 additions and 73 deletions
|
@ -227,6 +227,28 @@ impl<T: Zero> Zero for NonNegative<T> {
|
|||
)]
|
||||
pub struct GreaterThanOrEqualToOne<T>(pub T);
|
||||
|
||||
/// A wrapper of values between zero and one.
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(
|
||||
Animate,
|
||||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
Debug,
|
||||
Hash,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
PartialOrd,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(transparent)]
|
||||
pub struct ZeroToOne<T>(pub T);
|
||||
|
||||
/// A clip rect for clip and image-region
|
||||
#[allow(missing_docs)]
|
||||
#[derive(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue