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:
atbrakhi 2023-11-08 15:23:43 +01:00 committed by GitHub
parent e44f17c3df
commit 3c57f2cb44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 29 deletions

View file

@ -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