diff options
author | Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | 2023-06-02 18:31:39 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-06-02 19:02:31 +0200 |
commit | 2ade229f272aaa49826b3b94c418cd1e532cf91d (patch) | |
tree | 768817009345cc8038cdb21bd53d4b1a2b23d9e5 /Userland | |
parent | b40b1c8d937af9fc257244853a682952aa3d675f (diff) | |
download | serenity-2ade229f272aaa49826b3b94c418cd1e532cf91d.zip |
LibWeb: Fix crashing when grid track size is calc() with percentage
Use contains_percentage() that works for calc() values instead of
is_percentage().
This fixes issue when tracks with calc() that has percentages where
considered as "fixed" tracks with resolvable size which led to
incorrectly resolved infinite final track sizes.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp b/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp index 939d476b95..304fcdbe61 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp +++ b/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp @@ -39,7 +39,7 @@ GridSize::~GridSize() = default; bool GridSize::is_auto(Layout::AvailableSize const& available_size) const { if (m_type == Type::LengthPercentage) { - if (m_length_percentage.is_percentage()) + if (m_length_percentage.contains_percentage()) return !available_size.is_definite(); return m_length_percentage.is_auto(); } @@ -50,7 +50,7 @@ bool GridSize::is_auto(Layout::AvailableSize const& available_size) const bool GridSize::is_fixed(Layout::AvailableSize const& available_size) const { if (m_type == Type::LengthPercentage) { - if (m_length_percentage.is_percentage()) + if (m_length_percentage.contains_percentage()) return available_size.is_definite(); return !m_length_percentage.is_auto(); } |