mirror of
https://github.com/servo/servo.git
synced 2025-10-17 16:59:27 +01:00
Implement "outer min/max-content" (based on a given min/max-content)
https://dbaron.org/css/intrinsic/#outer-intrinsic
This commit is contained in:
parent
aa925a5984
commit
8fe37f3ed6
3 changed files with 80 additions and 1 deletions
|
@ -92,7 +92,7 @@ where
|
|||
}
|
||||
|
||||
/// Maps the length of this value.
|
||||
pub fn map(&self, f: impl FnOnce(LengthPercentage) -> LengthPercentage) -> Self {
|
||||
pub fn map<T>(&self, f: impl FnOnce(LengthPercentage) -> T) -> LengthPercentageOrAuto<T> {
|
||||
match self {
|
||||
LengthPercentageOrAuto::LengthPercentage(l) => {
|
||||
LengthPercentageOrAuto::LengthPercentage(f(l.clone()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue