Truly independent web browser
Tests/LibWeb: Add a test for a fixed-layout table in a flex item
Andreas Klingb7dabe1e9b92
diff --git a/Tests/LibWeb/Layout/expected/table/fixed-layout-percentage-width-in-flex-item.txt b/Tests/LibWeb/Layout/expected/table/fixed-layout-percentage-width-in-flex-item.txtnew file mode 100644index 00000000000..6d4b50378ce--- /dev/null+++ b/Tests/LibWeb/Layout/expected/table/fixed-layout-percentage-width-in-flex-item.txt@@ -0,0 +1,60 @@+Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 240 0+0+0] [BFC] children: not-inline+ BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 224 0+0+8] children: not-inline+ Box <div.flex> at [8,8] flex-container(row) [0+0+0 400 0+0+384] [0+0+0 112 0+0+0] [FFC] children: not-inline+ BlockContainer <div> at [8,8] flex-item [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: not-inline+ TableWrapper <(anonymous)> at [8,8] [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: not-inline+ Box <div.table> at [8,8] table-box [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [TFC] children: not-inline+ Box <(anonymous)> at [8,8] table-row [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] children: not-inline+ BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: inline+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 10.3125x16] baseline: 12.796875+ "C"+ frag 1 from TextNode start: 1, length: 1, rect: [8,24 8.71875x16] baseline: 12.796875+ "e"+ frag 2 from TextNode start: 2, length: 1, rect: [8,40 8.828125x16] baseline: 12.796875+ "r"+ frag 3 from TextNode start: 3, length: 1, rect: [8,56 9.34375x16] baseline: 12.796875+ "a"+ frag 4 from TextNode start: 4, length: 1, rect: [8,72 12.203125x16] baseline: 12.796875+ "m"+ frag 5 from TextNode start: 5, length: 1, rect: [8,88 4.5625x16] baseline: 12.796875+ "i"+ frag 6 from TextNode start: 6, length: 1, rect: [8,104 8.890625x16] baseline: 12.796875+ "c"+ TextNode <#text> (not painted)+ BlockContainer <div> at [8,8] flex-item [0+0+0 41.96875 0+0+0] [0+0+0 112 0+0+0] [BFC] children: inline+ frag 0 from TextNode start: 0, length: 5, rect: [8,8 41.96875x16] baseline: 12.796875+ "Right"+ TextNode <#text> (not painted)+ BlockContainer <(anonymous)> at [8,120] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline+ TextNode <#text> (not painted)+ Box <div.flex> at [8,120] flex-container(row) [0+0+0 400 0+0+384] [0+0+0 112 0+0+0] [FFC] children: not-inline+ BlockContainer <div> at [8,120] flex-item [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: not-inline+ TableWrapper <(anonymous)> at [8,120] [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: not-inline+ Box <div.table> at [8,120] table-box [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [TFC] children: not-inline+ Box <(anonymous)> at [8,120] table-row [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] children: not-inline+ BlockContainer <(anonymous)> at [8,120] table-cell [0+0+0 0 0+0+0] [0+0+0 112 0+0+0] [BFC] children: inline+ frag 0 from TextNode start: 0, length: 1, rect: [8,120 10.3125x16] baseline: 12.796875+ "C"+ frag 1 from TextNode start: 1, length: 1, rect: [8,136 8.71875x16] baseline: 12.796875+ "e"+ frag 2 from TextNode start: 2, length: 1, rect: [8,152 8.828125x16] baseline: 12.796875+ "r"+ frag 3 from TextNode start: 3, length: 1, rect: [8,168 9.34375x16] baseline: 12.796875+ "a"+ frag 4 from TextNode start: 4, length: 1, rect: [8,184 12.203125x16] baseline: 12.796875+ "m"+ frag 5 from TextNode start: 5, length: 1, rect: [8,200 4.5625x16] baseline: 12.796875+ "i"+ frag 6 from TextNode start: 6, length: 1, rect: [8,216 8.890625x16] baseline: 12.796875+ "c"+ TextNode <#text> (not painted)+ BlockContainer <div> at [8,120] flex-item [0+0+0 41.96875 0+0+0] [0+0+0 112 0+0+0] [BFC] children: inline+ frag 0 from TextNode start: 0, length: 5, rect: [8,120 41.96875x16] baseline: 12.796875+ "Right"+ TextNode <#text> (not painted)+ BlockContainer <(anonymous)> at [8,232] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline+ TextNode <#text> (not painted)++SC for Viewport<#document> [0,0 800x600] (z-index: auto)+ SC for BlockContainer<HTML> [0,0 800x240] (z-index: auto)diff --git a/Tests/LibWeb/Layout/input/table/fixed-layout-percentage-width-in-flex-item.html b/Tests/LibWeb/Layout/input/table/fixed-layout-percentage-width-in-flex-item.htmlnew file mode 100644index 00000000000..6663956628c--- /dev/null+++ b/Tests/LibWeb/Layout/input/table/fixed-layout-percentage-width-in-flex-item.html@@ -0,0 +1,14 @@+<!DOCTYPE html><style>+.flex {+ display: flex;+ width: 400px;+ font: 16px SerenitySans;+}+.table {+ display: table;+ table-layout: fixed;+ width: 100%;+ overflow-wrap: break-word;+}+</style><div class="flex"><div><div class="table">Ceramic</div></div><div>Right</div></div>+<div class="flex"><div><div class="table" style="max-width: 200px">Ceramic</div></div><div>Right</div></div>