diff --git a/Userland/Libraries/LibWeb/CSS/PercentageOr.h b/Userland/Libraries/LibWeb/CSS/PercentageOr.h index ed575b28df..2e29be2096 100644 --- a/Userland/Libraries/LibWeb/CSS/PercentageOr.h +++ b/Userland/Libraries/LibWeb/CSS/PercentageOr.h @@ -114,18 +114,21 @@ public: ErrorOr to_string() const { + if (is_calculated()) + return m_value.template get>()->to_string(); if (is_percentage()) return m_value.template get().to_string(); - return m_value.template get().to_string(); } bool operator==(PercentageOr const& other) const { - if (is_calculated()) + if (is_calculated() != other.is_calculated()) return false; if (is_percentage() != other.is_percentage()) return false; + if (is_calculated()) + return (*m_value.template get>() == *other.m_value.template get>()); if (is_percentage()) return (m_value.template get() == other.m_value.template get()); return (m_value.template get() == other.m_value.template get());