From 9fd51a59ffcd6e7982af86991a870324dff2eb4b Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 28 Apr 2023 19:26:04 +0300 Subject: LibWeb: Fix division by zero in table columns width distribution If total max columns width (grid_max) is zero then available width should be divided equally between columns. Previously there was division by zero: `column.max_width / grid_max`. --- .../LibWeb/Layout/expected/table/zero-columns-gridmax.txt | 7 +++++++ Tests/LibWeb/Layout/input/table/zero-columns-gridmax.html | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Tests/LibWeb/Layout/expected/table/zero-columns-gridmax.txt create mode 100644 Tests/LibWeb/Layout/input/table/zero-columns-gridmax.html (limited to 'Tests/LibWeb/Layout') diff --git a/Tests/LibWeb/Layout/expected/table/zero-columns-gridmax.txt b/Tests/LibWeb/Layout/expected/table/zero-columns-gridmax.txt new file mode 100644 index 0000000000..22f0923aa2 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/zero-columns-gridmax.txt @@ -0,0 +1,7 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x16 children: not-inline + BlockContainer at (8,8) content-size 784x0 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 200x0 children: not-inline + TableBox at (8,8) content-size 200x0 children: not-inline + TableRowBox at (8,8) content-size 200x0 children: not-inline + TableCellBox at (8,8) content-size 200x0 children: not-inline diff --git a/Tests/LibWeb/Layout/input/table/zero-columns-gridmax.html b/Tests/LibWeb/Layout/input/table/zero-columns-gridmax.html new file mode 100644 index 0000000000..63bfe96918 --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/zero-columns-gridmax.html @@ -0,0 +1,15 @@ + +
\ No newline at end of file -- cgit v1.2.3