1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:27:35 +00:00

LibWeb: Make StyleProperties::property() always return a value

By the time that property() gets called, we've already given every
single property a value, so we can just return it. This simplifies a
lot of places that were manually handling a lack of value
unnecessarily.
This commit is contained in:
Sam Atkins 2022-04-14 11:52:35 +01:00 committed by Andreas Kling
parent a20188cd91
commit e941f07931
5 changed files with 110 additions and 190 deletions

View file

@ -39,7 +39,7 @@ public:
auto const& properties() const { return m_property_values; }
void set_property(CSS::PropertyID, NonnullRefPtr<StyleValue> value);
Optional<NonnullRefPtr<StyleValue>> property(CSS::PropertyID) const;
NonnullRefPtr<StyleValue> property(CSS::PropertyID) const;
Length length_or_fallback(CSS::PropertyID, Length const& fallback) const;
LengthPercentage length_percentage_or_fallback(CSS::PropertyID, LengthPercentage const& fallback) const;