From d7a3b65a44541931a9330817f3090ba4dd36ed28 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 6 Aug 2023 15:59:40 +0200 Subject: [PATCH] LibWeb: Vertically align HTML Button content --- ...should-have-vertically-aligned-content.txt | 45 ++++++++++ ...hould-have-vertically-aligned-content.html | 18 ++++ .../Libraries/LibWeb/Layout/TreeBuilder.cpp | 83 ++++++++++++++----- 3 files changed, 125 insertions(+), 21 deletions(-) create mode 100644 Tests/LibWeb/Layout/expected/block-and-inline/button-should-have-vertically-aligned-content.txt create mode 100644 Tests/LibWeb/Layout/input/block-and-inline/button-should-have-vertically-aligned-content.html diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/button-should-have-vertically-aligned-content.txt b/Tests/LibWeb/Layout/expected/block-and-inline/button-should-have-vertically-aligned-content.txt new file mode 100644 index 0000000000..2e1d2bbf25 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/block-and-inline/button-should-have-vertically-aligned-content.txt @@ -0,0 +1,45 @@ +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 784x200 children: inline + line 0 width: 76.6875, height: 200, bottom: 200, baseline: 200 + frag 0 from BlockContainer start: 0, length: 0, rect: [22,19 48.6875x178] + TextNode <#text> + BlockContainer at (22,19) content-size 48.6875x178 inline-block [BFC] children: not-inline + BlockContainer <(anonymous)> at (22,19) content-size 48.6875x0 children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (22,19) content-size 48.6875x0 children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (22,19) content-size 48.6875x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (22,19) content-size 48.6875x178 [BFC] children: not-inline + BlockContainer <(anonymous)> at (22,19) content-size 48.6875x178 table-box [TFC] children: not-inline + Box <(anonymous)> at (22,19) content-size 48.6875x178 table-row children: not-inline + BlockContainer <(anonymous)> at (22,29.265625) content-size 48.6875x157.46875 table-cell [BFC] children: not-inline + BlockContainer <(anonymous)> at (22,29.265625) content-size 48.6875x157.46875 inline-block [BFC] children: not-inline + BlockContainer at (32,39.265625) content-size 28.6875x17.46875 children: inline + line 0 width: 28.6875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 1, length: 3, rect: [32,39.265625 28.6875x17.46875] + "one" + TextNode <#text> + BlockContainer at (32,76.734375) content-size 28.6875x100 children: inline + line 0 width: 28.4375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 1, length: 3, rect: [32,76.734375 28.4375x17.46875] + "two" + TextNode <#text> + +PaintableWithLines (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x600] + PaintableWithLines (BlockContainer) [8,8 784x200] + PaintableWithLines (BlockContainer