mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +00:00
LibWeb/CSS: Use Optional instead of auto lengths in Size
Any type of Size which has no LengthPercentage value now uses an empty optional instead of making an auto Length as before. We also now serialize a `fit-content` Size as `fit-content` instead of `fit-content(auto)`, though this doesn't affect test results and I didn't identify where it's actually used.
This commit is contained in:
parent
d10eaa996e
commit
60fc23e916
Notes:
github-actions[bot]
2025-09-04 12:33:22 +00:00
Author: https://github.com/AtkinsSJ
Commit: 60fc23e916
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6043
3 changed files with 28 additions and 22 deletions
|
@ -55,22 +55,22 @@ public:
|
|||
CalculatedStyleValue const& calculated() const
|
||||
{
|
||||
VERIFY(is_calculated());
|
||||
return m_length_percentage.calculated();
|
||||
return m_length_percentage->calculated();
|
||||
}
|
||||
|
||||
CSS::Length const& length() const
|
||||
Length const& length() const
|
||||
{
|
||||
VERIFY(is_length());
|
||||
return m_length_percentage.length();
|
||||
return m_length_percentage->length();
|
||||
}
|
||||
|
||||
CSS::Percentage const& percentage() const
|
||||
Percentage const& percentage() const
|
||||
{
|
||||
VERIFY(is_percentage());
|
||||
return m_length_percentage.percentage();
|
||||
return m_length_percentage->percentage();
|
||||
}
|
||||
|
||||
CSS::LengthPercentage const& fit_content_available_space() const
|
||||
Optional<LengthPercentage> const& fit_content_available_space() const
|
||||
{
|
||||
VERIFY(is_fit_content());
|
||||
return m_length_percentage;
|
||||
|
@ -80,10 +80,10 @@ public:
|
|||
bool operator==(Size const&) const = default;
|
||||
|
||||
private:
|
||||
Size(Type type, LengthPercentage);
|
||||
explicit Size(Type type, Optional<LengthPercentage> = {});
|
||||
|
||||
Type m_type {};
|
||||
CSS::LengthPercentage m_length_percentage;
|
||||
Optional<LengthPercentage> m_length_percentage;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue