From 0160d921e910376dc19a37a06169014aa53ae679 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 10 Sep 2023 22:14:25 +0200 Subject: [PATCH] LibWeb: Set children of button layout box to be non-inline When modifying the button layout during tree building to use flex for vertical alignment, let's explicitly set the button box's children to be non-inline. It doesn't make sense to layout the button as an IFC when its only child is a flex container. --- .../button-baseline-align.txt | 32 +++++++++---------- .../block-and-inline/button-image-only.txt | 14 ++++---- ...on-with-multiple-words-text-node-label.txt | 6 ++-- ...ton-with-text-node-label-and-font-size.txt | 6 ++-- .../button-with-text-node-label.txt | 6 ++-- .../Libraries/LibWeb/Layout/TreeBuilder.cpp | 1 + 6 files changed, 28 insertions(+), 37 deletions(-) diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/button-baseline-align.txt b/Tests/LibWeb/Layout/expected/block-and-inline/button-baseline-align.txt index bb858e0dd6..57deefd9c6 100644 --- a/Tests/LibWeb/Layout/expected/block-and-inline/button-baseline-align.txt +++ b/Tests/LibWeb/Layout/expected/block-and-inline/button-baseline-align.txt @@ -1,24 +1,22 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x47.671875 children: inline - line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 35.84375 - frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.671875] - BlockContainer at (8,8) content-size 61.1875x47.671875 inline-block [BFC] children: inline - line 0 width: 61.1875, height: 47.671875, bottom: 47.671875, baseline: 35.84375 - frag 0 from BlockContainer start: 0, length: 0, rect: [9,26 17.828125x21.84375] - frag 1 from TextNode start: 0, length: 1, rect: [28,30 8x17.46875] + BlockContainer at (8,8) content-size 784x47.6875 children: inline + line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375 + frag 0 from BlockContainer start: 0, length: 0, rect: [8,8 61.1875x47.6875] + BlockContainer at (8,8) content-size 61.1875x47.6875 inline-block [BFC] children: inline + line 0 width: 61.1875, height: 47.6875, bottom: 47.6875, baseline: 33.84375 + frag 0 from BlockContainer start: 0, length: 0, rect: [9,24 17.828125x21.84375] + frag 1 from TextNode start: 0, length: 1, rect: [28,28 8x17.46875] " " - frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.671875] + frag 2 from BlockContainer start: 0, length: 0, rect: [41,10 23.359375x43.6875] TextNode <#text> - BlockContainer at (9,26) content-size 17.828125x21.84375 inline-block [BFC] children: inline + BlockContainer at (9,24) content-size 17.828125x21.84375 inline-block [BFC] children: inline line 0 width: 17.828125, height: 21.84375, bottom: 21.84375, baseline: 16.921875 - frag 0 from TextNode start: 0, length: 1, rect: [9,26 17.828125x21.84375] + frag 0 from TextNode start: 0, length: 1, rect: [9,24 17.828125x21.84375] "A" TextNode <#text> TextNode <#text> - BlockContainer