summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartinfalisse <martinmotteditfalisse@gmail.com>2022-09-07 15:12:38 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-14 00:09:14 +0200
commitdf88e2bd8e10138d85aebe7dcf68926b908b0b5d (patch)
treed0d54560267089918edb69de8c5f8c4d22a4392a
parent9681eb89a6625256453a010304da4836952fddbf (diff)
downloadserenity-df88e2bd8e10138d85aebe7dcf68926b908b0b5d.zip
LibWeb: Add spec utility function for GridTrackSize
Often in the spec they talk about intrinsic_track_sizes and this way can have a clearer way of checking if a GridTrackSize is indeed an "intrinsic track size".
-rw-r--r--Userland/Libraries/LibWeb/CSS/GridTrackSize.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h
index 46aa047791..88f3a65c24 100644
--- a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h
+++ b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h
@@ -38,6 +38,14 @@ public:
Percentage percentage() const { return m_percentage; }
float flexible_length() const { return m_flexible_length; }
+ // https://drafts.csswg.org/css-grid/#layout-algorithm
+ // Intrinsic sizing function - min-content, max-content, auto, fit-content()
+ // FIXME: Add missing properties once implemented.
+ bool is_intrinsic_track_sizing() const
+ {
+ return (m_type == Type::Length && m_length.is_auto());
+ }
+
String to_string() const;
bool operator==(GridTrackSize const& other) const
{