mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Compute content sizes lazily in layout 2020
This commit is contained in:
parent
ba5568a0a6
commit
235df94f2e
11 changed files with 176 additions and 247 deletions
|
@ -75,7 +75,7 @@ where
|
|||
{
|
||||
/// Resolves `auto` values by calling `f`.
|
||||
#[inline]
|
||||
pub fn auto_is(&self, f: impl Fn() -> LengthPercentage) -> LengthPercentage {
|
||||
pub fn auto_is(&self, f: impl FnOnce() -> LengthPercentage) -> LengthPercentage {
|
||||
match self {
|
||||
LengthPercentageOrAuto::LengthPercentage(length) => length.clone(),
|
||||
LengthPercentageOrAuto::Auto => f(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue