1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 06:18:12 +00:00

LibWeb: Resolve cyclic declaration/definitions involving Length

This remained undetected for a long time as HeaderCheck is disabled by
default. This commit makes the following file compile again:

    // file: compile_me.cpp
    #include <LibWeb/CSS/GridTrackSize.h>
    // That's it, this was enough to cause a compilation error.
This commit is contained in:
Ben Wiederhake 2022-09-13 17:42:39 +02:00 committed by Sam Atkins
parent 53eb35caba
commit 8deced39a8
15 changed files with 192 additions and 125 deletions

View file

@ -28,6 +28,7 @@ Length::Length(float value, Type type)
, m_value(value)
{
}
Length::~Length() = default;
Length Length::make_auto()
{
@ -204,4 +205,11 @@ NonnullRefPtr<CalculatedStyleValue> Length::calculated_style_value() const
return *m_calculated_style;
}
bool Length::operator==(Length const& other) const
{
if (is_calculated())
return m_calculated_style == other.m_calculated_style;
return m_type == other.m_type && m_value == other.m_value;
}
}