From c987c934d0197c13dffd109aa6776b5c61ecf676 Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Sun, 23 Apr 2023 17:03:12 +0200 Subject: LibWeb: Fix grid size when intrinsically sized This fixes a bug that was seen when a combination of the grid having been floated with `float: left` and a `minmax()` column size were used. The issue was that a grid track size should be considered intrinsically sized if both the min and max sizes are intrinsic, not just one of them. --- .../expected/grid/intrinsic-sized-column.txt | 14 +++++++++++++ .../Layout/expected/grid/intrinsic-sized-grid.txt | 9 ++++++++ .../Layout/input/grid/intrinsic-sized-column.html | 24 ++++++++++++++++++++++ .../Layout/input/grid/intrinsic-sized-grid.html | 18 ++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 Tests/LibWeb/Layout/expected/grid/intrinsic-sized-column.txt create mode 100644 Tests/LibWeb/Layout/expected/grid/intrinsic-sized-grid.txt create mode 100644 Tests/LibWeb/Layout/input/grid/intrinsic-sized-column.html create mode 100644 Tests/LibWeb/Layout/input/grid/intrinsic-sized-grid.html (limited to 'Tests/LibWeb/Layout') diff --git a/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-column.txt b/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-column.txt new file mode 100644 index 0000000000..4ce9fb924e --- /dev/null +++ b/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-column.txt @@ -0,0 +1,14 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x35.46875 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 0x19.46875 floating children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline + TextNode <#text> + Box at (8,8) content-size 0x19.46875 children: not-inline + BlockContainer <(anonymous)> children: inline + TextNode <#text> + BlockContainer at (9,9) content-size 18x17.46875 children: inline + line 0 width: 37.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 4, rect: [9,9 37.953125x17.46875] + "whee" + TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-grid.txt b/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-grid.txt new file mode 100644 index 0000000000..ad400613e9 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/grid/intrinsic-sized-grid.txt @@ -0,0 +1,9 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (1,1) content-size 798x39.46875 children: not-inline + BlockContainer at (10,10) content-size 2x21.46875 floating children: not-inline + Box at (11,11) content-size 0x19.46875 children: not-inline + BlockContainer at (12,12) content-size 35.953125x17.46875 children: inline + line 0 width: 37.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 4, rect: [12,12 37.953125x17.46875] + "whee" + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/grid/intrinsic-sized-column.html b/Tests/LibWeb/Layout/input/grid/intrinsic-sized-column.html new file mode 100644 index 0000000000..f40127616e --- /dev/null +++ b/Tests/LibWeb/Layout/input/grid/intrinsic-sized-column.html @@ -0,0 +1,24 @@ + + + + + + + + +
+
whee diff --git a/Tests/LibWeb/Layout/input/grid/intrinsic-sized-grid.html b/Tests/LibWeb/Layout/input/grid/intrinsic-sized-grid.html new file mode 100644 index 0000000000..1da9823c59 --- /dev/null +++ b/Tests/LibWeb/Layout/input/grid/intrinsic-sized-grid.html @@ -0,0 +1,18 @@ +
whee \ No newline at end of file -- cgit v1.2.3