forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1496558 - Part 2: Move MozLength and MaxLength into generics r=em…
…ilio Move MozLength and MaxLength into generics, and drop the manual implementation of ToComputedValue. Depends on D8290 Differential Revision: https://phabricator.services.mozilla.com/D8291 --HG-- extra : moz-landing-system : lando
- Loading branch information
1 parent
09a7c9a
commit 8ad4fbf
Showing
8 changed files
with
93 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
//! Generic types for CSS values related to length. | ||
use values::computed::ExtremumLength; | ||
|
||
/// A generic value for the `width`, `height`, `min-width`, or `min-height` property. | ||
/// | ||
/// Unlike `max-width` or `max-height` properties, a MozLength can be `auto`, | ||
/// and cannot be `none`. | ||
/// | ||
/// Note that it only accepts non-negative values. | ||
#[allow(missing_docs)] | ||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))] | ||
#[derive( | ||
Animate, | ||
Clone, | ||
ComputeSquaredDistance, | ||
Copy, | ||
Debug, | ||
PartialEq, | ||
SpecifiedValueInfo, | ||
ToAnimatedZero, | ||
ToComputedValue, | ||
ToCss, | ||
)] | ||
pub enum MozLength<LengthOrPercentageOrAuto> { | ||
LengthOrPercentageOrAuto(LengthOrPercentageOrAuto), | ||
#[animation(error)] | ||
ExtremumLength(ExtremumLength), | ||
} | ||
|
||
/// A generic value for the `max-width` or `max-height` property. | ||
#[allow(missing_docs)] | ||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))] | ||
#[derive( | ||
Animate, | ||
Clone, | ||
ComputeSquaredDistance, | ||
Copy, | ||
Debug, | ||
PartialEq, | ||
SpecifiedValueInfo, | ||
ToAnimatedZero, | ||
ToComputedValue, | ||
ToCss | ||
)] | ||
pub enum MaxLength<LengthOrPercentageOrNone> { | ||
LengthOrPercentageOrNone(LengthOrPercentageOrNone), | ||
#[animation(error)] | ||
ExtremumLength(ExtremumLength), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.