summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authormartinfalisse <martinmotteditfalisse@gmail.com>2022-09-26 11:41:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-06 21:16:01 +0200
commit9051a565547642207d88fce11bedf73f63ca2dc2 (patch)
treee8b424e68c61bce72debc4dd36b6f2bf6ada00b2 /Userland
parenta764e43db3b6c9b06cd0f628b3649399a6950d98 (diff)
downloadserenity-9051a565547642207d88fce11bedf73f63ca2dc2.zip
Base+LibWeb: Stub out negative spans
Ensure that when a grid item is passed with a span and a fixed end position, that if the resulting start of this item is less than 0 then it won't throw. This is a temporary measure until the correct functionality is implemented.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
index dbacea653a..7b607cd0fd 100644
--- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
@@ -225,6 +225,9 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const
if (child_box.computed_values().grid_row_end().is_position() && child_box.computed_values().grid_row_start().is_span()) {
row_span = child_box.computed_values().grid_row_start().raw_value();
row_start = row_end - row_span;
+ // FIXME: Remove me once have implemented spans overflowing into negative indexes, e.g., grid-row: span 2 / 1
+ if (row_start < 0)
+ row_start = 1;
}
// If a name is given as a <custom-ident>, only lines with that name are counted. If not enough
@@ -354,6 +357,9 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const
if (child_box.computed_values().grid_column_end().is_position() && child_box.computed_values().grid_column_start().is_span()) {
column_span = child_box.computed_values().grid_column_start().raw_value();
column_start = column_end - column_span;
+ // FIXME: Remove me once have implemented spans overflowing into negative indexes, e.g., grid-column: span 2 / 1
+ if (column_start < 0)
+ column_start = 1;
}
// If a name is given as a <custom-ident>, only lines with that name are counted. If not enough