mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use Au
instead of Length
in flexbox code (#30704)
* convert border and padding to app units in flexbox * convert margin to app units in flexbox * cleanup, fmt * add todo comment * fmt * add comment * use Length instead of CSSPixelLength: they are same
This commit is contained in:
parent
e44f17c3df
commit
3c57f2cb44
3 changed files with 78 additions and 29 deletions
|
@ -63,6 +63,16 @@ impl<T> FlexRelativeSides<T> {
|
|||
cross: self.cross_start + self.cross_end,
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(#29819): Check if this function can be removed after we convert everything to Au.
|
||||
pub fn map<U>(&self, f: impl Fn(&T) -> U) -> FlexRelativeSides<U> {
|
||||
FlexRelativeSides {
|
||||
main_start: f(&self.main_start),
|
||||
main_end: f(&self.main_end),
|
||||
cross_start: f(&self.cross_start),
|
||||
cross_end: f(&self.cross_end),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// One of the two bits set by the `flex-direction` property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue