diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2022-09-13 17:42:39 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-09-15 14:45:38 +0100 |
commit | 8deced39a87125603e082b2481448557b7f4f92b (patch) | |
tree | fe687a66ff45d292f12fc2bc7f8d8842d7c82b84 /Userland/Libraries/LibWeb/CSS/GridTrackSize.h | |
parent | 53eb35caba9ea5ffb21bc7117636adf938fa54c0 (diff) | |
download | serenity-8deced39a87125603e082b2481448557b7f4f92b.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/GridTrackSize.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/GridTrackSize.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h index 88f3a65c24..bce71af1c4 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h +++ b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h @@ -25,6 +25,7 @@ public: GridTrackSize(Length); GridTrackSize(Percentage); GridTrackSize(float); + ~GridTrackSize(); static GridTrackSize make_auto(); @@ -34,7 +35,7 @@ public: bool is_percentage() const { return m_type == Type::Percentage; } bool is_flexible_length() const { return m_type == Type::FlexibleLength; } - Length length() const { return m_length; } + Length length() const; Percentage percentage() const { return m_percentage; } float flexible_length() const { return m_flexible_length; } @@ -57,7 +58,9 @@ public: private: Type m_type; - Length m_length { Length::make_px(0) }; + // Length includes a RefPtr<CalculatedStyleValue> member, but we can't include the header StyleValue.h as it includes + // this file already. To break the cyclic dependency, we must initialize m_length in the constructor. + Length m_length; Percentage m_percentage { Percentage(0) }; float m_flexible_length { 0 }; }; |