mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +00:00
LibWeb: Parse CSS fit-content(<length-percentage>) values
Before this change, we only parsed fit-content as a standalone keyword, but CSS-SIZING-3 added it as a function as well. I don't know of anything else in CSS that is overloaded like this, so it ends up looking a little awkward in the implementation. Note that a lot of code had already been prepped for fit-content values to have an argument, we just weren't parsing it.
This commit is contained in:
parent
6fc19ec059
commit
8ab61843be
Notes:
github-actions[bot]
2025-02-26 23:45:14 +00:00
Author: https://github.com/awesomekling
Commit: 8ab61843be
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3706
Reviewed-by: https://github.com/AtkinsSJ
25 changed files with 185 additions and 67 deletions
|
@ -54,7 +54,7 @@ Size Size::make_max_content()
|
|||
return Size { Type::MaxContent, Length::make_auto() };
|
||||
}
|
||||
|
||||
Size Size::make_fit_content(Length available_space)
|
||||
Size Size::make_fit_content(LengthPercentage available_space)
|
||||
{
|
||||
return Size { Type::FitContent, move(available_space) };
|
||||
}
|
||||
|
@ -78,6 +78,10 @@ bool Size::contains_percentage() const
|
|||
case Type::MaxContent:
|
||||
case Type::None:
|
||||
return false;
|
||||
case Type::FitContent:
|
||||
// FIXME: This should return m_length_percentage.contains_percentage()
|
||||
// but we have to update a lot of code to handle this.
|
||||
return false;
|
||||
default:
|
||||
return m_length_percentage.contains_percentage();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue