Truly independent web browser
Tests/LibWeb: Add table layout interoperability tests
Andreas Kling20dbabccb1b1
diff --git a/Tests/LibWeb/Text/expected/table-calc-interop.txt b/Tests/LibWeb/Text/expected/table-calc-interop.txtnew file mode 100644index 00000000000..29f13141666--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-calc-interop.txt@@ -0,0 +1,40 @@+1: 0,0 150x20 | 0,0 150x20+2: 0,0 220x20 | 0,0 220x20+3: 0,0 20x20 | 0,0 20x20+4: 0,0 150x20 | 0,0 150x20+5: 0,0 150x20 | 0,0 150x20+6: 0,0 250x20 | 0,0 250x20+7: 0,0 110x20 | 0,0 110x20+8: 0,0 300x20 | 0,0 300x20+9: 0,0 400x20 | 0,0 100x20 | 100,0 300x20+10: 0,0 400x20 | 0,0 200x20 | 200,0 200x20+11: 0,0 70x20 | 0,0 20x20 | 20,0 50x20+12: 0,0 400x20 | 0,0 100x20 | 100,0 300x20+13: 0,0 400x20 | 0,0 200x20 | 200,0 200x20+14: 0,0 400x20 | 0,0 200x20 | 200,0 200x20+15: 0,0 80x20 | 0,0 60x20 | 60,0 20x20+16: 0,0 400x10 | 0,0 200x10 | 200,0 200x10+17: 0,0 400x10 | 0,0 80x10 | 80,0 100x10 | 180,0 220x10+18: 0,0 400x10 | 0,0 200x10 | 200,0 200x10+19: 0,0 200x20 | 0,0 200x10 | 0,10 75x10 | 75,10 125x10+20: 0,0 20x80 | 0,0 20x80+21: 0,0 20x110 | 0,0 20x110+22: 0,0 20x70 | 0,0 20x60 | 0,0 20x60 | 0,60 20x10 | 0,60 20x10+23: 0,0 20x200 | 0,0 20x100 | 0,0 20x100 | 0,100 20x100 | 0,100 20x100+24: 0,0 40x50 | 0,0 20x50 | 20,0 20x50+25: 0,0 20x150 | 0,0 20x75 | 0,75 20x75+26: 0,0 32x40 | 0,0 32x40+27: 0,0 400x20 | 0,0 210x20 | 210,0 190x20+28: 0,0 55x58 | 5,6 20x20 | 30,6 20x20 | 5,32 20x20 | 30,32 20x20+29: 0,0 56x32 | 3,3 25x26 | 28,3 25x26+30: 50,0 20x20 | 50,0 20x20+31: 0,0 100x30 | 0,0 70x10 | 0,10 100x20+32: 0,0 220x20 | 0,0 200x20 | 0,0 110x10 | 200,0 20x20+33: 0,0 10x100 | 0,0 10x100 | 0,0 10x55+34: 0,0 30x80 | 0,0 10x80 | 0,0 10x0 | 10,0 20x80+35: 0,3 130x10 | 0,3 130x10+36: 0,0 180x20 | 0,0 180x20+37: 0,0 250x20 | 0,0 250x20+38: 165,0 210x20 | 165,0 210x20+39: 0,0 210x55 | 0,0 56x55 | 56,0 154x55+40: 0,0 320x10 | 0,0 107x10 | 107,0 107x10 | 213,0 107x10diff --git a/Tests/LibWeb/Text/expected/table-interop-with-other-layout-modes.txt b/Tests/LibWeb/Text/expected/table-interop-with-other-layout-modes.txtnew file mode 100644index 00000000000..80cd576b24b--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-interop-with-other-layout-modes.txt@@ -0,0 +1,82 @@+1: 0,0 100x30 | 100,0 400x30 | 100,0 400x30+2: 0,0 200x30 | 200,0 100x30 | 200,0 100x30+3: 0,0 400x170 | 0,0 400x170 | 0,170 400x30+4: 0,0 50x150 | 0,0 50x150 | 50,0 50x150+5: 0,0 400x50 | 0,0 300x50 | 0,0 300x50 | 0,0 97x30 | 107,0 193x50 | 300,0 100x50+6: 0,0 300x150 | 0,0 200x40 | 0,0 40x40 | 200,0 100x150+7: 0,0 100x30 | 100,0 400x30 | 100,0 400x30+8: 0,0 300x120 | 0,0 300x120+9: 0,0 140x30 | 0,0 80x30 | 80,0 60x30 | 140,0 360x10+10: 0,0 400x60 | 0,0 250x60 | 0,0 250x60 | 0,0 120x30 | 130,0 120x60 | 250,0 150x60+11: 0,0 120x20 | 0,0 120x20 | 0,0 120x20+12: 0,0 100x50 | 100,0 200x20 | 100,0 200x20+13: 0,0 100x50 | 100,0 80x20 | 100,0 80x20+14: 0,0 100x50 | 0,50 400x20 | 0,50 400x20+15: 0,0 140x70 | 0,0 90x70 | 0,0 60x40 | 60,0 30x70 | 90,0 50x70+16: 310,0 90x40 | 310,0 90x40 | 0,0 400x20+17: 20,10 50x20 | 20,10 50x20+18: 330,0 70x20 | 330,0 70x20+19: 0,0 300x100 | 0,0 150x100 | 110,60 30x30 | 150,0 150x100+20: 0,0 300x80 | 0,0 200x80 | 0,0 100x40 | 200,0 100x80+21: 0,20 50x40 | 50,40 60x20 | 50,40 60x20 | 110,0 50x60+22: 0,20 50x40 | 50,0 60x20 | 50,0 60x20 | 110,0 50x60+23: 0,0 400x30 | 0,0 300x30 | 0,10 150x20 | 150,0 150x30 | 300,0 100x30+24: 0,0 250x100 | 0,0 200x100 | 0,0 200x100 | 200,0 50x100+25: 0,0 400x75 | 0,0 300x75 | 0,0 300x75 | 300,0 100x75+26: 0,0 300x100 | 0,0 300x100+27: 0,0 150x10 | 0,0 100x10 | 100,0 50x10+28: 0,0 150x50 | 0,0 150x50 | 0,0 150x50+29: 0,0 400x150 | 0,0 300x150 | 0,0 300x150 | 300,0 100x150+30: 0,0 150x60 | 0,0 120x60 | 0,0 120x60 | 120,0 30x60+31: 0,0 150x75 | 0,0 150x75 | 0,0 150x75+32: 0,0 400x30 | 0,0 100x30 | 100,0 300x30 | 100,0 300x30+33: 0,0 300x60 | 0,0 80x60 | 0,0 80x30 | 80,0 120x60 | 80,0 120x25 | 200,0 100x60 | 200,0 100x60+34: 0,0 300x120 | 0,0 300x120 | 0,0 300x60+35: 0,0 400x20 | 0,0 100x20 | 0,0 100x20 | 100,0 200x20 | 100,0 200x20 | 300,0 100x20 | 300,0 100x20+36: 0,0 200x20 | 0,0 200x20 | 0,0 200x20+37: 0,0 200x40 | 0,0 200x40+38: 0,0 100x20 | 0,0 60x20 | 60,0 40x20+39: 100,0 200x20 | 100,0 200x20+40: 0,0 250x20 | 0,0 250x20+41: 0,0 200x20 | 0,0 200x20+42: 0,0 300x100 | 15,15 270x70 | 15,15 270x70+43: 0,0 200x40 | 0,0 200x20 | 0,20 200x20+44: 0,0 200x50 | 0,30 200x20 | 0,0 200x30+45: 0,0 400x20 | 0,0 300x20 | 0,0 300x20 | 0,0 0x20 | 0,0 300x20 | 300,0 100x20+46: 0,0 100x40 | 0,0 70x40 | 0,0 70x20 | 0,0 70x20 | 70,0 30x40 | 70,0 30x40 | 70,0 30x40+47: 0,0 300x20 | 0,0 150x20 | 0,0 150x20 | 150,0 150x20+48: 0,0 50x200 | 0,0 50x133 | 0,133 50x67+49: 0,0 100x50 | 100,0 200x50+50: 0,0 80x50 | 80,0 40x50+51: 0,0 90x100 | 0,0 30x100 | 0,40 30x20 | 30,0 30x100 | 30,80 30x20 | 60,0 30x100+52: 0,0 180x80 | 0,0 150x40 | 150,0 30x80 | 0,40 75x40 | 75,40 75x40+53: 0,0 400x10 | 0,0 266x10 | 266,0 114x10 | 380,0 20x10+54: 0,0 400x10 | 0,0 50x10 | 50,0 120x10 | 170,0 230x10+55: 0,0 105x64 | 3,3 47x26 | 50,3 50x26 | 3,29 47x30 | 50,29 50x30+56: 0,0 300x220 | 0,0 300x20 | 0,20 300x200+57: 0,0 200x20 | 0,0 200x20 | 0,0 200x20+58: 0,0 100x20 | 0,0 100x20 | 0,0 90x20 | 90,0 10x20+59: 0,0 140x100 | 0,0 100x100 | 100,0 40x100+60: 0,0 100x30 | 0,0 40x30 | 40,0 60x30+61: 50,0 80x30 | 50,0 80x10 | 50,10 80x20+62: -30,0 30x80 | -10,0 10x80 | -30,0 20x80+63: -40,-15 160x60 | -40,-15 160x20 | -40,5 160x40+64: 30,5 80x20 | 30,5 80x20+65: 0,0 10x100 | 0,0 10x80 | 0,0 10x80 | 0,0 10x80 | 0,80 10x20 | 0,80 10x20 | 0,80 10x20+66: 0,0 300x100 | 0,0 300x100+67: 0,0 300x200 | 0,0 300x200+68: 0,0 500x20 | 0,0 500x20+69: 0,3 200x20 | 0,3 200x20 | 0,3 30x10+70: 0,0 30x60 | 0,0 30x60+71: 0,0 100x20 | 25,0 50x20+72: 7,0 87x20 | 13,0 75x20+73: 0,0 10x30 | 0,0 10x30 | 0,0 10x0+74: 0,0 10x200 | 0,0 10x50 | 0,0 10x50 | 0,0 10x50 | 0,50 10x150 | 0,50 10x150+75: 0,0 10x200 | 0,0 10x50 | 0,0 10x50 | 0,0 10x50 | 0,50 10x150 | 0,50 10x150+76: 0,0 300x100 | 0,0 300x100+77: 0,0 300x150 | 0,0 300x150+78: 0,0 300x160 | 0,0 300x10 | 0,10 300x150+79: 0,0 0x300 | 0,0 0x10 | 0,10 0x145 | 0,155 0x145+80: 0,0 0x300 | 0,290 0x10 | 0,0 0x145 | 0,145 0x145+81: 0,0 20x100 | 0,0 10x100 | 0,0 10x100 | 10,0 10x100+82: 0,0 20x80 | 0,0 10x80 | 0,0 10x80 | 10,0 10x80diff --git a/Tests/LibWeb/Text/expected/table-legacy-markup-interop-quirks-mode.txt b/Tests/LibWeb/Text/expected/table-legacy-markup-interop-quirks-mode.txtnew file mode 100644index 00000000000..ab7dbfa69d0--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-legacy-markup-interop-quirks-mode.txt@@ -0,0 +1,62 @@+1: 0,0 600x46 | 3,3 110x40 | 115,3 482x40+2: 0,0 200x60 | 0,0 150x60 | 150,0 50x60+3: 0,0 200x300 | 0,0 200x50 | 0,50 200x230 | 0,280 200x20+4: 0,0 121x40 | 0,0 120x40 | 0,20 120x1 | 120,0 1x40 | 120,0 1x40+5: 150,0 200x22 | 150,0 200x22+6: 350,0 150x42 | 350,0 150x42 | 0,0 500x20+7: 100,0 200x22 | 100,0 200x22+8: 0,0 100x100 | 0,0 20x100 | 0,0 20x20 | 20,0 20x100 | 20,40 20x20 | 40,0 20x100 | 40,80 20x20 | 60,0 20x100 | 60,40 20x20 | 80,0 20x100+9: 0,0 300x20 | 0,0 150x20 | 50,0 50x20 | 150,0 150x20 | 250,0 50x20+10: 0,0 500x40 | 0,0 120x40 | 120,0 380x40 | 120,0 380x40 | 120,0 300x40 | 120,0 300x40 | 120,0 210x40 | 330,0 90x40 | 420,0 80x40+11: 0,0 400x10 | 0,0 100x10 | 100,0 100x10 | 200,0 200x10+12: 0,0 90x28 | 3,3 42x22 | 45,3 42x22+13: 0,0 230x80 | 0,0 200x80 | 0,0 200x80 | 200,0 30x80+14: 0,0 400x50 | 0,0 300x50 | 0,0 300x50 | 300,0 100x50+15: 0,0 60x90 | 0,0 30x90 | 30,0 30x45 | 30,45 30x45+16: 0,0 200x40 | 0,0 200x20 | 0,20 100x20 | 100,20 100x20+17: 0,0 110x40 | 0,0 30x20 | 0,20 30x20 | 30,20 70x20 | 100,20 10x20+18: 0,0 300x46 | 3,3 146x28 | 151,3 146x28 | 3,33 294x0 | 3,35 146x8 | 151,35 146x8+19: 0,0 300x57 | 0,0 300x15 | 0,15 150x30 | 150,15 150x30 | 0,45 150x12 | 150,45 150x12+20: 0,0 300x22 | 0,0 52x22 | 52,0 72x22+21: 0,0 300x54 | 0,0 300x22 | 0,22 300x32+22: 0,0 300x22 | 0,0 300x22 | 0,0 52x22 | 52,0 52x22+23: 0,0 400x20 | 0,0 100x10 | 100,0 300x10 | 0,10 50x10 | 50,10 50x10 | 100,10 300x10+24: 0,0 180x10 | 0,0 100x10 | 100,0 80x10+25: 0,0 80x20 | 0,0 30x20 | 30,0 0x20 | 30,0 50x20 | 0,20 30x0+26: 0,0 350x22 | 0,0 350x22+27: 0,0 250x20 | 0,0 250x20+28: 0,0 240x20 | 0,0 240x20 | 240,0 0x20+29: 0,0 200x60 | 0,0 150x60 | 150,0 50x60+30: 0,0 84x40 | 0,0 50x40 | 50,0 34x40+31: 0,0 200x32 | 0,0 200x32 | 0,0 200x32 | 0,0 400x10+32: 0,0 314x36 | 7,7 300x22 | 7,7 300x22+33: 0,0 400x28 | 0,0 120x28 | 120,0 280x28 | 122,2 262x24+34: 0,0 200x32 | 0,0 200x10 | 0,10 200x22 | 0,10 200x22+35: 0,0 120x30 | 0,0 120x30 | 0,0 120x30+36: 0,0 34x18 | 0,0 16x18 | 0,1 16x16 | 16,0 18x18 | 16,0 18x18+37: 0,0 300x70 | 0,0 300x70 | 0,0 300x70+38: 0,0 160x12 | 0,0 100x12 | 0,0 100x12 | 100,0 60x12 | 100,0 60x12+39: 0,0 200x45 | 0,0 90x45 | 0,0 90x45 | 90,0 60x45 | 90,8 60x30 | 150,0 50x45+40: 0,0 300x25 | 0,0 100x25 | 0,0 100x25 | 100,0 200x25+41: 0,0 100x100 | 0,0 100x100 | 0,0 100x100+42: 0,0 400x180 | 0,0 320x180 | 0,0 320x180 | 320,0 80x180+43: 0,0 360x20 | 0,0 60x20 | 60,0 300x20+44: 160,0 80x20 | 160,0 80x20+45: 105,0 90x20 | 105,0 90x20+46: 0,10 200x22 | 0,10 200x22 | 200,0 200x32 | 200,0 200x32+47: 50,0 80x20 | 50,0 80x20+48: 0,0 80x20 | 5,10 40x20 | 40,0 40x20+49: 0,0 400x10 | 0,0 333x10 | 333,0 67x10 | 400,0 0x10+50: 0,0 230x40 | 0,0 100x40 | 100,0 130x40+51: 50,0 200x22+52: 150,0 200x22+53: 150,0 200x22+54: 150,0 150x22+55: 200,0 200x22+56: 0,50 400x22+57: 0,0 300x300 | 0,0 300x270 | 0,0 300x270 | 0,0 300x270 | 0,270 300x30 | 0,270 300x30+58: 0,0 300x200 | 0,0 300x200+59: 0,0 200x200 | 0,0 200x50 | 0,50 200x150+60: 0,0 80x50 | 0,0 60x50 | 0,10 60x30 | 60,0 20x50 | 60,0 20x50+61: 0,0 40x150 | 0,0 40x150 | 0,38 40x75+62: 0,0 30x80 | 0,0 10x80 | 10,0 20x80 | 10,40 20x0diff --git a/Tests/LibWeb/Text/expected/table-legacy-markup-interop.txt b/Tests/LibWeb/Text/expected/table-legacy-markup-interop.txtnew file mode 100644index 00000000000..7afd7c90f19--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-legacy-markup-interop.txt@@ -0,0 +1,56 @@+1: 0,0 600x46 | 3,3 110x40 | 115,3 482x40+2: 0,0 200x60 | 0,0 150x60 | 150,0 50x60+3: 0,0 200x300 | 0,0 200x50 | 0,50 200x230 | 0,280 200x20+4: 0,0 121x40 | 0,0 120x40 | 0,20 120x1 | 120,0 1x40 | 120,0 1x40+5: 150,0 200x22 | 150,0 200x22+6: 350,0 150x42 | 350,0 150x42 | 0,0 500x20+7: 100,0 200x22 | 100,0 200x22+8: 0,0 100x100 | 0,0 20x100 | 0,0 20x20 | 20,0 20x100 | 20,40 20x20 | 40,0 20x100 | 40,80 20x20 | 60,0 20x100 | 60,40 20x20 | 80,0 20x100+9: 0,0 300x20 | 0,0 150x20 | 50,0 50x20 | 150,0 150x20 | 250,0 50x20+10: 0,0 500x40 | 0,0 120x40 | 120,0 380x40 | 120,0 380x40 | 120,0 300x40 | 120,0 300x40 | 120,0 210x40 | 330,0 90x40 | 420,0 80x40+11: 0,0 400x10 | 0,0 100x10 | 100,0 100x10 | 200,0 200x10+12: 0,0 90x28 | 3,3 42x22 | 45,3 42x22+13: 0,0 230x80 | 0,0 200x80 | 0,0 200x80 | 200,0 30x80+14: 0,0 400x50 | 0,0 300x50 | 0,0 300x50 | 300,0 100x50+15: 0,0 60x90 | 0,0 30x90 | 30,0 30x45 | 30,45 30x45+16: 0,0 200x40 | 0,0 200x20 | 0,20 100x20 | 100,20 100x20+17: 0,0 110x40 | 0,0 30x20 | 0,20 30x20 | 30,20 70x20 | 100,20 10x20+18: 0,0 300x46 | 3,3 146x28 | 151,3 146x28 | 3,33 294x0 | 3,35 146x8 | 151,35 146x8+19: 0,0 300x57 | 0,0 300x15 | 0,15 150x30 | 150,15 150x30 | 0,45 150x12 | 150,45 150x12+20: 0,0 300x22 | 0,0 52x22 | 52,0 72x22+21: 0,0 300x54 | 0,0 300x22 | 0,22 300x32+22: 0,0 300x22 | 0,0 300x22 | 0,0 52x22 | 52,0 52x22+23: 0,0 400x20 | 0,0 100x10 | 100,0 300x10 | 0,10 50x10 | 50,10 50x10 | 100,10 300x10+24: 0,0 180x10 | 0,0 100x10 | 100,0 80x10+25: 0,0 80x20 | 0,0 30x20 | 30,0 0x20 | 30,0 50x20 | 0,20 30x0+26: 0,0 350x22 | 0,0 350x22+27: 0,0 250x20 | 0,0 250x20+28: 0,0 240x20 | 0,0 240x20 | 240,0 0x20+29: 0,0 200x60 | 0,0 150x60 | 150,0 50x60+30: 0,0 84x40 | 0,0 50x40 | 50,0 34x40+31: 0,0 200x32 | 0,0 200x32 | 0,0 200x32 | 0,0 400x10+32: 0,0 314x36 | 7,7 300x22 | 7,7 300x22+33: 0,0 400x28 | 0,0 120x28 | 120,0 280x28 | 122,2 262x24+34: 0,0 200x32 | 0,0 200x10 | 0,10 200x22 | 0,10 200x22+35: 0,0 120x30 | 0,0 120x30 | 0,0 120x30+36: 0,0 34x18 | 0,0 16x18 | 0,1 16x16 | 16,0 18x18 | 16,0 18x18+37: 0,0 300x70 | 0,0 300x70 | 0,0 300x70+38: 0,0 160x12 | 0,0 100x12 | 0,0 100x12 | 100,0 60x12 | 100,0 60x12+39: 0,0 200x45 | 0,0 90x45 | 0,0 90x45 | 90,0 60x45 | 90,8 60x30 | 150,0 50x45+40: 0,0 300x25 | 0,0 100x25 | 0,0 100x25 | 100,0 200x25+41: 0,0 100x100 | 0,0 100x100 | 0,0 100x100+42: 0,0 400x180 | 0,0 320x180 | 0,0 320x180 | 320,0 80x180+43: 0,0 360x20 | 0,0 60x20 | 60,0 300x20+44: 160,0 80x20 | 160,0 80x20+45: 105,0 90x20 | 105,0 90x20+46: 0,10 200x22 | 0,10 200x22 | 200,0 200x32 | 200,0 200x32+47: 50,0 80x20 | 50,0 80x20+48: 0,0 80x20 | 5,10 40x20 | 40,0 40x20+49: 0,0 400x10 | 0,0 333x10 | 333,0 67x10 | 400,0 0x10+50: 0,0 230x40 | 0,0 100x40 | 100,0 130x40+51: 50,0 200x22+52: 150,0 200x22+53: 150,0 200x22+54: 150,0 150x22+55: 200,0 200x22+56: 0,50 400x22diff --git a/Tests/LibWeb/Text/expected/table-nesting-interop.txt b/Tests/LibWeb/Text/expected/table-nesting-interop.txtnew file mode 100644index 00000000000..8d6a713d58c--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-nesting-interop.txt@@ -0,0 +1,40 @@+1: 0,0 340x40 | 0,0 300x40 | 0,0 300x20 | 0,0 200x20 | 0,0 200x20 | 300,0 40x40+2: 0,0 150x20 | 0,0 150x20 | 0,0 150x20 | 0,0 120x20 | 0,0 120x20 | 120,0 30x10+3: 0,0 200x120 | 0,0 200x120 | 0,0 200x120 | 0,0 200x90 | 0,0 200x90+4: 0,0 400x30 | 0,0 400x30 | 0,0 400x30 | 0,0 133x30 | 0,0 133x30 | 133,0 267x30 | 133,0 267x30+5: 0,0 135x25 | 0,0 115x25 | 0,0 115x25 | 0,0 70x25 | 0,0 70x25 | 75,0 40x25 | 75,0 40x25 | 115,0 20x25+6: 0,0 300x30 | 0,0 300x30 | 0,0 80x30 | 0,0 80x30 | 0,0 80x30 | 0,0 300x10+7: 0,0 300x60 | 0,0 300x60 | 0,40 300x20 | 0,40 300x20+8: 0,0 300x100 | 0,0 300x100 | 230,10 60x20 | 230,10 60x20 | 230,10 60x20+9: 0,0 300x100 | 0,0 300x100 | 20,80 30x20 | 20,80 30x20+10: 0,0 120x50 | 0,0 120x50 | 0,0 120x40 | 0,0 120x40 | 0,0 90x40 | 90,0 30x40+11: 0,0 40x200 | 0,0 40x200 | 0,0 40x100 | 0,0 40x100 | 0,0 40x100+12: 0,0 200x20 | 0,0 200x20 | 0,0 200x20 | 0,0 400x20 | 0,0 400x20+13: 0,0 160x80 | 0,0 160x80 | 0,0 160x80 | 0,0 160x80 | 0,0 160x80+14: 0,0 164x34 | 0,0 114x34 | 0,0 114x34 | 7,7 100x20 | 7,7 100x20 | 114,0 50x34+15: 0,0 70x20 | 0,0 70x20 | 0,0 70x20 | 0,0 70x20 | 0,0 70x20+16: 0,0 400x20 | 0,0 400x20 | 0,0 400x20 | 0,0 200x20 | 0,0 200x20+17: 0,0 80x30 | 0,0 80x30 | 0,0 80x30 | 0,10 80x20 | 0,10 80x20+18: 0,0 90x30 | 0,0 60x30 | 0,0 60x20 | 0,0 60x20 | 60,0 30x30+19: 0,0 94x20 | 0,0 94x20 | 0,0 94x20 | 0,0 70x20 | 0,0 70x20 | 0,0 70x20+20: 0,0 200x60 | 0,0 200x60 | 0,0 200x60 | 0,0 100x60 | 0,0 100x60 | 100,0 100x60+21: 0,0 30x60 | 0,0 30x60 | 0,0 30x60 | 0,0 30x60 | 0,0 30x60+22: 0,0 400x30 | 0,0 300x30 | 0,0 300x30 | 0,0 300x30+23: 0,0 400x30 | 0,0 300x30 | 0,0 300x30 | 0,0 300x30+24: 0,0 600x80 | 0,0 200x80 | 0,0 200x80 | 0,0 50x80 | 200,0 100x80+25: 340,0 60x30 | 340,0 60x30 | 340,0 60x30 | 340,0 30x30+26: 50,10 80x40 | 50,10 80x40 | 50,10 80x40 | 110,40 20x10+27: 0,0 90x30 | 0,0 90x30 | 0,0 90x30 | 0,10 40x20 | 40,0 50x30+28: 0,0 300x200 | 0,0 300x200 | 0,0 300x200 | 0,0 20x0+29: 0,0 420x20 | 0,0 200x20 | 0,0 200x20 | 0,0 200x20 | 30,0 170x20+30: 0,0 200x100 | 0,0 200x100 | 0,0 200x100 | 0,0 100x100+31: 0,0 120x20 | 0,0 120x20 | 0,0 100x20 | 100,0 20x20 | 100,0 20x20 | 100,0 20x20+32: 0,0 200x20 | 0,0 200x20 | 0,0 200x20 | 0,0 100x20+33: 0,0 200x10 | 0,0 200x10 | 0,0 300x10 | 0,0 300x10+34: 0,0 300x10 | 0,0 250x10 | 0,0 250x10+35: 0,0 400x66 | 0,0 400x66 | 0,0 19x23 | 0,3 19x20 | 19,0 381x23 | 19,3 80x20 | 0,23 400x43 | 0,23 400x40+36: 0,0 500x30 | 0,0 500x30 | 0,0 500x30 | 0,0 500x30 | 0,0 250x30 | 0,0 250x30 | 0,0 250x20 | 20,0 230x10+37: 0,0 80x40 | 0,0 80x40 | 0,0 80x40 | 0,0 70x40 | 0,0 70x40 | 0,0 40x20 | 0,0 40x20 | 0,0 40x20+38: 0,0 100x50 | 0,0 100x50 | 0,0 100x50 | 0,0 100x50 | 0,0 100x50 | 10,10 30x15 | 10,10 30x15 | 10,10 30x15+39: 0,0 600x150 | 0,0 150x150 | 0,0 150x150 | 0,0 150x150 | 0,0 150x150 | 0,0 150x150+40: 0,0 400x10 | 0,0 400x10 | 0,0 400x10 | 0,0 200x10 | 0,0 200x10 | 0,0 100x10 | 0,0 100x10diff --git a/Tests/LibWeb/Text/expected/table-positioning-and-svg-interop.txt b/Tests/LibWeb/Text/expected/table-positioning-and-svg-interop.txtnew file mode 100644index 00000000000..9d88a73211b--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-positioning-and-svg-interop.txt@@ -0,0 +1,40 @@+1: 10,5 70x20 | 10,5 70x20+2: 50,0 30x20 | 50,0 30x20+3: 50,0 300x20 | 50,0 300x20+4: 0,10 30x20 | 0,10 30x20+5: 200,50 200x50 | 200,50 200x50+6: 150,30 100x40 | 150,30 100x40+7: 320,70 80x30 | 320,70 80x10 | 320,80 80x20+8: 0,30 40x20 | 0,30 40x20+9: 50,0 40x20 | 50,0 40x20+10: 350,70 40x20 | 350,70 40x20+11: 20,0 40x20 | 20,0 40x20+12: 20,5 60x20 | 20,5 60x20+13: 0,10 60x20 | 0,10 60x20+14: 0,0 60x20 | 0,0 60x20 | 0,0 400x10+15: 300,0 100x20 | 300,0 100x20 | 0,0 400x10+16: 0,0 120x20 | 0,0 120x20 | 0,20 120x20 | 0,20 120x20+17: 110,0 60x20 | 110,0 60x20+18: 0,50 400x20 | 0,50 400x20+19: 340,0 60x30 | 340,20 60x10 | 340,0 60x20+20: 0,30 150x20 | 0,30 150x20+21: 10,20 200x100 | 10,20 200x100+22: 0,0 40x20 | 0,0 40x20+23: 0,0 150x20 | 0,0 150x20+24: 0,0 100x43 | 0,0 80x43 | 0,0 80x40 | 80,0 20x43+25: 0,0 20x20 | 0,0 0x20 | 0,0 0x0 | 0,0 20x20+26: 0,0 300x20 | 0,0 0x20 | 0,0 0x0 | 0,0 300x20+27: 0,0 300x150 | 0,0 300x150 | 0,0 300x150+28: 0,0 300x75 | 0,0 150x75 | 0,0 150x75 | 150,0 150x75+29: 0,0 200x100 | 0,0 200x100 | 0,0 200x100+30: 0,0 100x50 | 0,0 100x50 | 0,0 100x50+31: 0,0 300x20 | 0,0 200x20 | 0,0 100x20 | 200,0 100x20+32: 0,0 90x30 | 0,0 90x30 | 0,0 90x30+33: 0,0 200x50 | 0,0 200x50 | 0,0 200x50+34: 0,0 60x20 | 0,0 60x20 | 0,0 60x20+35: 0,0 200x150 | 0,0 200x150 | 0,0 200x150 | 0,0 150x150+36: 0,0 200x80 | 0,0 200x80 | 0,0 200x80 | 0,0 200x20 | 0,0 200x20+37: 0,0 300x100 | 0,0 200x100 | 0,0 200x100 | 200,0 100x100+38: 260,130 40x20 | 260,130 40x20+39: 0,0 200x50 | 0,0 200x50 | 0,0 200x50+40: 0,0 30x30 | 0,0 0x30 | 0,0 0x0 | 0,0 30x30diff --git a/Tests/LibWeb/Text/expected/table-row-block-size-distribution.txt b/Tests/LibWeb/Text/expected/table-row-block-size-distribution.txtnew file mode 100644index 00000000000..d9af7a499db--- /dev/null+++ b/Tests/LibWeb/Text/expected/table-row-block-size-distribution.txt@@ -0,0 +1,49 @@+1: 0+400 0+200 200+200+2: 0+300 0+150 150+150+3: 0+300 0+250 250+50+4: 0+300 0+280 280+20+5: 0+300 0+90 90+140 230+70+6: 0+200 0+150 150+50+7: 0+300 0+50 50+250+8: 0+300 0+180 180+120+9: 0+300 0+120 120+180+10: 0+300 0+10 10+240 250+40 290+10+11: 0+300 10+100 120+170+12: 0+300 0+130 130+170+13: 0+300 10+100 110+180+14: 0+300 0+150 150+150+15: 0+80 0+30 30+50+16: 0+100 0+40 40+60+17: 0+300 0+100 100+200+18: 0+300 0+100 100+200+19: 0+500 0+150 150+350 150+350 180+75 285+215+20: 0+200 0+50 50+150+21: 0+400 0+200 200+100 300+100+22: 0+300 0+210 210+50 260+40+23: 0+500 0+250 250+250+24: 0+300 0+120 120+80 200+100+25: 0+300 0+30 30+230 260+40+26: 0+300 0+120 120+180+27: 0+300 0+90 90+210+28: 0+300 2+104 106+192+29: 0+200 0+50 50+150+30: 0+300 0+150 150+150+31: 0+300 0+280 280+10 290+10+32: 0+300 0+200 200+100+33: 0+300 0+0 0+300+34: 0+300 0+188 188+113+35: 0+300 0+30 30+135 165+135+36: 0+250 0+83 83+83 167+83+37: 0+300 0+50 50+100 150+150+38: 0+400 0+300 300+100+39: 0+400 0+333 333+67 333+67+40: 0+400 0+100 100+300 100+300+41: 0+400 0+100 100+300 100+300+42: 0+120 0+100 100+20 100+20+43: 0+300 0+250 0+125 250+50+44: 0+300 0+75 75+225+45: 0+100 0+100 0+20+46: 0+100 0+100 0+0+47: 0+100 0+100 0+100+48: 0+300 0+100 0+100 100+200+49: 0+20 0+20 0+20diff --git a/Tests/LibWeb/Text/input/table-calc-interop.html b/Tests/LibWeb/Text/input/table-calc-interop.htmlnew file mode 100644index 00000000000..1d7257e54e1--- /dev/null+++ b/Tests/LibWeb/Text/input/table-calc-interop.html@@ -0,0 +1,167 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ table {+ border-spacing: 0;+ }+ td {+ padding: 0;+ vertical-align: top;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+ .b {+ background: lightblue;+ }+ input, select, textarea, button {+ box-sizing: border-box;+ margin: 0;+ padding: 0;+ border: 2px solid black;+ font-size: 0;+ appearance: none;+ }+</style>+<div id="cases">+<!-- 1: table width calc with a length -->+<div class="case"><table class="m" style="width: calc(100px + 50px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 2: table width calc with a percentage and a length -->+<div class="case"><div style="width: 400px"><table class="m" style="width: calc(50% + 20px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 3: table width calc with a negative result -->+<div class="case"><div style="width: 400px"><table class="m" style="width: calc(10% - 100px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 4: table width min() -->+<div class="case"><div style="width: 400px"><table class="m" style="width: min(50%, 150px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 5: table width max() -->+<div class="case"><div style="width: 400px"><table class="m" style="width: max(25%, 150px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 6: table width clamp() -->+<div class="case"><div style="width: 400px"><table class="m" style="width: clamp(100px, 80%, 250px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 7: table min-width and max-width calc -->+<div class="case"><div style="width: 400px"><table class="m" style="min-width: calc(25% + 10px); max-width: calc(50% - 10px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 8: table max-width calc smaller than content -->+<div class="case"><div style="width: 400px"><table class="m" style="max-width: calc(25% + 10px)"><tr><td class="m" style=""><div style="width: 300px; height: 20px"></div></td></tr></table></div></div>++<!-- 9: cell width calc with a length -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="width: calc(50px * 2)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 10: cell width calc with a percentage and a length -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="width: calc(25% + 20px)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 11: cell width calc with a percentage and a length in an auto table -->+<div class="case"><div style="width: 400px"><table class="m" style=""><tr><td class="m" style="width: calc(25% + 20px)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 50px; height: 20px"></div></td></tr></table></div></div>++<!-- 12: cell width calc with only percentages -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="width: calc(10% + 15%)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 13: cell width min() of a percentage and a length -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="width: min(30%, 80px)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 14: cell width max() of a percentage and a length -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="width: max(10%, 80px)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 15: cell width calc smaller than content -->+<div class="case"><div style="width: 400px"><table class="m" style=""><tr><td class="m" style="width: calc(10px + 5px)"><div style="width: 60px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 16: col width calc -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><col style="width: calc(40px + 10%)"><col><tr><td class="m"><div style="width: 10px; height: 10px"></div></td><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></div></div>++<!-- 17: fixed layout with calc col widths -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%; table-layout: fixed"><col style="width: calc(100px - 20px)"><col style="width: calc(25%)"><col><tr><td class="m"><div style="width: 10px; height: 10px"></div></td><td class="m"><div style="width: 10px; height: 10px"></div></td><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></div></div>++<!-- 18: fixed layout with a calc mixing percentage and length on a cell -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%; table-layout: fixed"><tr><td class="m" style="width: calc(50% - 50px)"><div style="width: 10px; height: 10px"></div></td><td class="m" style=""><div style="width: 10px; height: 10px"></div></td></tr></table></div></div>++<!-- 19: colspan cell with a calc width -->+<div class="case"><div style="width: 400px"><table class="m"><tr><td class="m" colspan="2" style="width: calc(150px + 50px)"><div style="width: 10px; height: 10px"></div></td></tr><tr><td class="m"><div style="width: 30px; height: 10px"></div></td><td class="m"><div style="width: 50px; height: 10px"></div></td></tr></table></div></div>++<!-- 20: table height calc with a length -->+<div class="case"><table class="m" style="height: calc(50px + 30px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 21: table height calc with a percentage in a fixed-height container -->+<div class="case"><div style="height: 200px"><table class="m" style="height: calc(50% + 10px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 22: row height calc -->+<div class="case"><table class="m"><tr class="m" style="height: calc(20px * 3)"><td class="m"><div style="width: 20px; height: 10px"></div></td></tr><tr class="m"><td class="m"><div style="width: 20px; height: 10px"></div></td></tr></table></div>++<!-- 23: row height calc with a percentage in a fixed-height table -->+<div class="case"><table class="m" style="height: 200px"><tr class="m" style="height: calc(25% + 10px)"><td class="m"><div style="width: 20px; height: 10px"></div></td></tr><tr class="m"><td class="m"><div style="width: 20px; height: 10px"></div></td></tr></table></div>++<!-- 24: cell height calc -->+<div class="case"><table class="m" style="font-size: 10px"><tr><td class="m" style="height: calc(30px + 2em)"><div style="width: 20px; height: 10px"></div></td><td class="m" style=""><div style="width: 20px; height: 10px"></div></td></tr></table></div>++<!-- 25: cell height min() of a percentage and a length in a fixed-height table -->+<div class="case"><table class="m" style="height: 150px"><tr><td class="m" style="height: min(50%, 40px)"><div style="width: 20px; height: 10px"></div></td></tr><tr><td class="m" style="height: min(50%, 40px)"><div style="width: 20px; height: 10px"></div></td></tr></table></div>++<!-- 26: cell padding calc -->+<div class="case"><table class="m" style=""><tr><td class="m" style="padding: calc(5px + 5px) calc(2px * 3)"><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 27: cell padding calc with a percentage -->+<div class="case"><div style="width: 400px"><table class="m" style="width: 100%"><tr><td class="m" style="padding-left: calc(5% + 2px)"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 28: border-spacing calc -->+<div class="case"><table class="m" style="border-spacing: calc(2px + 3px) calc(10px - 4px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 29: table border calc in collapsed mode -->+<div class="case"><table class="m" style="border-collapse: collapse; border: calc(2px * 3) solid"><tr><td class="m" style="border: calc(1px + 3px) solid"><div style="width: 20px; height: 20px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 30: table margin calc with a percentage -->+<div class="case"><div style="width: 400px"><table class="m" style="margin-left: calc(10% + 10px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 31: caption width calc -->+<div class="case"><div style="width: 400px"><table class="m"><caption class="m" style="width: calc(50% + 20px)"><div style="width: 10px; height: 10px"></div></caption><tr><td class="m"><div style="width: 100px; height: 20px"></div></td></tr></table></div></div>++<!-- 32: calc width in a cell child resolving against the cell -->+<div class="case"><div style="width: 400px"><table class="m" style=""><tr><td class="m" style="width: 200px"><div class="m" style="width: calc(50% + 10px); height: 10px"></div></td><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 33: calc height in a cell child against a fixed-height cell -->+<div class="case"><table class="m" style="height: 100px"><tr><td class="m" style="height: 100px"><div class="m" style="height: calc(50% + 5px); width: 10px"></div></td></tr></table></div>++<!-- 34: calc height in a cell child against an auto-height cell -->+<div class="case"><table class="m" style=""><tr><td class="m" style=""><div class="m" style="height: calc(50% + 5px); width: 10px"></div></td><td class="m" style=""><div style="width: 20px; height: 80px"></div></td></tr></table></div>++<!-- 35: inline-table width calc -->+<div class="case"><div style="width: 400px"><table class="m" style="display: inline-table; width: calc(30% + 10px)"><tr><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></div></div>++<!-- 36: table width calc in a flex item -->+<div class="case"><div style="display: flex; width: 400px"><table class="m" style="width: calc(50% - 20px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table><div style="width: 50px; height: 10px"></div></div></div>++<!-- 37: table width calc in a grid area -->+<div class="case"><div style="display: grid; grid-template-columns: 300px"><table class="m" style="width: calc(100% - 50px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 38: abspos table width calc with a percentage -->+<div class="case"><div style="position: relative; width: 400px; height: 50px"><table class="m" style="position: absolute; width: calc(50% + 10px); right: calc(5% + 5px)"><tr><td class="m" style=""><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 39: calc with em and rem in table and cells -->+<div class="case"><table class="m" style="font-size: 20px; width: calc(10em + 10px)"><tr><td class="m" style="width: calc(2em + 1rem)"><div style="width: 10px; height: 10px"></div></td><td class="m" style="height: calc(3em - 5px)"><div style="width: 10px; height: 10px"></div></td></tr></table></div>++<!-- 40: nested calc() with percentages in a cell and table -->+<div class="case"><div style="width: 400px"><table class="m" style="width: calc(100% - calc(10% + 40px))"><tr><td class="m" style="width: calc((100% - 40px) / 4)"><div style="width: 10px; height: 10px"></div></td><td class="m" style=""><div style="width: 10px; height: 10px"></div></td><td class="m" style=""><div style="width: 10px; height: 10px"></div></td></tr></table></div></div>++</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-interop-with-other-layout-modes.html b/Tests/LibWeb/Text/input/table-interop-with-other-layout-modes.htmlnew file mode 100644index 00000000000..f27b9077ed4--- /dev/null+++ b/Tests/LibWeb/Text/input/table-interop-with-other-layout-modes.html@@ -0,0 +1,454 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ table {+ border-spacing: 0;+ }+ td {+ padding: 0;+ vertical-align: top;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+ .b {+ background: lightblue;+ }+ input, select, textarea, button {+ box-sizing: border-box;+ margin: 0;+ padding: 0;+ border: 2px solid black;+ font-size: 0;+ appearance: none;+ }+</style>+<div id="cases">+<!-- 1: table as a flex item with flex-grow -->+<div class="case"><div style="display: flex; width: 500px">+ <div class="m" style="width: 100px; height: 30px"></div>+ <table class="m" style="flex-grow: 1"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 2: table as a flex item that has to shrink -->+<div class="case"><div style="display: flex; width: 300px">+ <div class="m" style="flex: none; width: 200px; height: 30px"></div>+ <table class="m" style="width: 200px"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 3: table in a stretching column flex container -->+<div class="case"><div style="display: flex; flex-direction: column; width: 400px; height: 200px">+ <table class="m" style="flex-grow: 1"><tr class="m"><td><div style="width: 50px; height: 20px"></div></td></tr></table>+ <div class="m" style="height: 30px"></div>+</div></div>++<!-- 4: table with align-self: stretch in a row flex container -->+<div class="case"><div style="display: flex; width: 400px; height: 150px">+ <table class="m"><tr class="m"><td><div style="width: 50px; height: 20px"></div></td></tr></table>+ <div class="m" style="width: 50px"></div>+</div></div>++<!-- 5: flex container inside a cell -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m"><div class="m" style="display: flex; gap: 10px"><div class="m" style="flex: 1; height: 30px"></div><div class="m" style="flex: 2; height: 50px"></div></div></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 6: cell with display: flex -->+<div class="case"><table class="m" style="width: 300px; height: 150px"><tr>+ <td class="m" style="display: flex; align-items: center"><div class="m" style="width: 40px; height: 40px"></div></td>+ <td class="m"><div style="width: 20px; height: 80px"></div></td>+</tr></table></div>++<!-- 7: table as a grid item in a fr track -->+<div class="case"><div style="display: grid; grid-template-columns: 100px 1fr; width: 500px">+ <div class="m" style="height: 30px"></div>+ <table class="m"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 8: table as a grid item stretched in both axes -->+<div class="case"><div style="display: grid; grid-template: 120px / 300px">+ <table class="m"><tr class="m"><td><div style="width: 50px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 9: table in an auto grid track -->+<div class="case"><div style="display: grid; grid-template-columns: auto 1fr; width: 500px">+ <table class="m"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td><td class="m"><div style="width: 60px; height: 30px"></div></td></tr></table>+ <div class="m" style="height: 10px"></div>+</div></div>++<!-- 10: grid inside a cell -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m"><div class="m" style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px"><div class="m" style="height: 30px"></div><div class="m" style="height: 60px"></div></div></td>+ <td class="m" style="width: 150px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 11: grid with min-content track inside an auto-width cell -->+<div class="case"><table class="m"><tr>+ <td class="m"><div class="m" style="display: grid; grid-template-columns: min-content 50px"><div style="width: 70px; height: 10px"></div><div style="height: 20px"></div></div></td>+</tr></table></div>++<!-- 12: float next to a table -->+<div class="case"><div style="width: 400px">+ <div class="m" style="float: left; width: 100px; height: 50px"></div>+ <table class="m" style="width: 200px"><tr><td class="m"><div style="height: 20px"></div></td></tr></table>+</div></div>++<!-- 13: auto-width table next to a float -->+<div class="case"><div style="width: 400px">+ <div class="m" style="float: left; width: 100px; height: 50px"></div>+ <table class="m"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 14: 100% width table next to a float -->+<div class="case"><div style="width: 400px">+ <div class="m" style="float: left; width: 100px; height: 50px"></div>+ <table class="m" style="width: 100%"><tr><td class="m"><div style="height: 20px"></div></td></tr></table>+</div></div>++<!-- 15: floats inside a cell -->+<div class="case"><table class="m"><tr>+ <td class="m"><div class="m" style="float: left; width: 60px; height: 40px"></div><div class="m" style="float: right; width: 30px; height: 70px"></div></td>+ <td class="m"><div style="width: 50px; height: 10px"></div></td>+</tr></table></div>++<!-- 16: floated table -->+<div class="case"><div style="width: 400px">+ <table class="m" style="float: right"><tr><td class="m"><div style="width: 90px; height: 40px"></div></td></tr></table>+ <div class="m" style="height: 20px"></div>+</div></div>++<!-- 17: absolutely positioned table with insets -->+<div class="case"><div style="position: relative; width: 400px; height: 200px">+ <table class="m" style="position: absolute; left: 20px; right: 30px; top: 10px; bottom: 40px"><tr class="m"><td><div style="width: 50px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 18: absolutely positioned table without width -->+<div class="case"><div style="position: relative; width: 400px; height: 100px">+ <table class="m" style="position: absolute; right: 0; top: 0"><tr><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 19: abspos child of a relatively positioned cell -->+<div class="case"><table class="m" style="width: 300px"><tr>+ <td class="m" style="position: relative; height: 100px"><div class="m" style="position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 20: abspos child with percentage size in a cell -->+<div class="case"><table class="m" style="width: 300px"><tr>+ <td class="m" style="position: relative"><div style="height: 80px"></div><div class="m" style="position: absolute; left: 0; top: 0; width: 50%; height: 50%"></div></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 21: inline-table between inline-blocks -->+<div class="case"><div style="width: 500px; font-size: 0; line-height: 0">+ <div class="m" style="display: inline-block; width: 50px; height: 40px"></div><table class="m" style="display: inline-table"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table><div class="m" style="display: inline-block; width: 50px; height: 60px"></div>+</div></div>++<!-- 22: inline-table with vertical-align: top -->+<div class="case"><div style="width: 500px; font-size: 0; line-height: 0">+ <div class="m" style="display: inline-block; width: 50px; height: 40px"></div><table class="m" style="display: inline-table; vertical-align: top"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table><div class="m" style="display: inline-block; width: 50px; height: 60px; vertical-align: bottom"></div>+</div></div>++<!-- 23: inline-block with percentage width inside a cell -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m" style="font-size: 0"><div class="m" style="display: inline-block; width: 50%; height: 20px"></div><div class="m" style="display: inline-block; width: 50%; height: 30px"></div></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 24: aspect-ratio block inside a fixed-width cell -->+<div class="case"><table class="m"><tr>+ <td class="m" style="width: 200px"><div class="m" style="aspect-ratio: 2 / 1"></div></td>+ <td class="m"><div style="width: 50px; height: 10px"></div></td>+</tr></table></div>++<!-- 25: aspect-ratio block inside an auto-width cell in a fixed-width table -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m"><div class="m" style="aspect-ratio: 4 / 1"></div></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 26: aspect-ratio on the table itself -->+<div class="case"><table class="m" style="width: 300px; aspect-ratio: 3 / 1"><tr class="m"><td><div style="height: 20px"></div></td></tr></table></div>++<!-- 27: aspect-ratio on a cell -->+<div class="case"><table class="m"><tr>+ <td class="m" style="width: 100px; aspect-ratio: 1 / 1"><div style="height: 10px"></div></td>+ <td class="m"><div style="width: 50px; height: 10px"></div></td>+</tr></table></div>++<!-- 28: aspect-ratio block with height in a cell -->+<div class="case"><table class="m"><tr>+ <td class="m"><div class="m" style="height: 50px; aspect-ratio: 3 / 1"></div></td>+</tr></table></div>++<!-- 29: percentage-width image in a cell -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m"><img class="m" style="width: 100%; display: block" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'/%3E"></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 30: intrinsic-size image in an auto-width table -->+<div class="case"><table class="m"><tr>+ <td class="m"><img class="m" style="display: block" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'/%3E"></td>+ <td class="m"><div style="width: 30px; height: 10px"></div></td>+</tr></table></div>++<!-- 31: max-width image in a narrow fixed-width table -->+<div class="case"><table class="m" style="width: 150px"><tr>+ <td class="m"><img class="m" style="max-width: 100%; display: block" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='150'/%3E"></td>+</tr></table></div>++<!-- 32: text input with percentage width in a cell -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+ <td class="m"><input class="m" style="width: 100%; height: 30px; display: block"></td>+</tr></table></div>++<!-- 33: fixed-size form controls in an auto-width table -->+<div class="case"><table class="m"><tr>+ <td class="m"><button class="m" style="width: 80px; height: 30px; display: block"></button></td>+ <td class="m"><select class="m" style="width: 120px; height: 25px; display: block"></select></td>+ <td class="m"><textarea class="m" style="width: 100px; height: 60px; display: block; resize: none"></textarea></td>+</tr></table></div>++<!-- 34: percentage-height textarea in a fixed-height cell -->+<div class="case"><table class="m" style="width: 300px"><tr>+ <td class="m" style="height: 120px"><textarea class="m" style="width: 100%; height: 50%; display: block; resize: none"></textarea></td>+</tr></table></div>++<!-- 35: form controls in a fixed-layout table -->+<div class="case"><table class="m" style="table-layout: fixed; width: 400px"><tr>+ <td class="m" style="width: 25%"><input class="m" style="width: 100%; height: 20px; display: block"></td>+ <td class="m"><select class="m" style="width: 100%; height: 20px; display: block"></select></td>+ <td class="m" style="width: 100px"><button class="m" style="width: 100%; height: 20px; display: block"></button></td>+</tr></table></div>++<!-- 36: wide input without width in a narrow table -->+<div class="case"><table class="m" style="width: 100px"><tr>+ <td class="m"><input class="m" style="width: 200px; height: 20px; display: block"></td>+</tr></table></div>++<!-- 37: table inside a multi-column container -->+<div class="case"><div style="columns: 2; column-gap: 20px; width: 420px">+ <table class="m" style="width: 100%"><tr><td class="m"><div style="height: 40px"></div></td></tr></table>+</div></div>++<!-- 38: table with width: fit-content in a block -->+<div class="case"><div style="width: 400px">+ <table class="m" style="width: fit-content"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 39: table with margin: auto and max-width -->+<div class="case"><div style="width: 400px">+ <table class="m" style="width: 100%; max-width: 200px; margin: 0 auto"><tr><td class="m"><div style="height: 20px"></div></td></tr></table>+</div></div>++<!-- 40: table with min-width larger than its width -->+<div class="case"><div style="width: 400px">+ <table class="m" style="width: 100px; min-width: 250px"><tr><td class="m"><div style="height: 20px"></div></td></tr></table>+</div></div>++<!-- 41: table with max-width smaller than its content -->+<div class="case"><div style="width: 400px">+ <table class="m" style="max-width: 100px"><tr><td class="m"><div style="width: 200px; height: 20px"></div></td></tr></table>+</div></div>++<!-- 42: table with box-sizing: border-box and padding -->+<div class="case"><table class="m" style="box-sizing: border-box; width: 300px; height: 100px; padding: 10px; border: 5px solid"><tr class="m"><td class="m"><div style="height: 20px"></div></td></tr></table></div>++<!-- 43: caption with fixed width and a narrower table -->+<div class="case"><table class="m"><caption class="m"><div style="width: 200px; height: 20px"></div></caption><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></div>++<!-- 44: caption-side bottom -->+<div class="case"><table class="m" style="width: 200px; caption-side: bottom"><caption class="m"><div style="height: 20px"></div></caption><tr><td class="m"><div style="height: 30px"></div></td></tr></table></div>++<!-- 45: nested table with 100% width -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m"><table class="m" style="width: 100%"><tr><td class="m"><div style="height: 20px"></div></td><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></td>+ <td class="m" style="width: 100px"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 46: nested auto tables -->+<div class="case"><table class="m"><tr>+ <td class="m"><table class="m"><tr><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table></td>+ <td class="m"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 30px; height: 40px"></div></td></tr></table></td>+</tr></table></div>++<!-- 47: overflow: hidden cell content with large width -->+<div class="case"><table class="m" style="width: 300px; table-layout: fixed"><tr>+ <td class="m"><div class="m" style="overflow: hidden"><div style="width: 500px; height: 20px"></div></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 48: vertical writing mode table -->+<div class="case"><table class="m" style="writing-mode: vertical-lr; height: 200px"><tr>+ <td class="m"><div style="width: 30px; height: 40px"></div></td>+ <td class="m"><div style="width: 50px; height: 20px"></div></td>+</tr></table></div>++<!-- 49: table with display: block children around it (anonymous table wrapping) -->+<div class="case"><div style="display: table; width: 300px">+ <div class="m" style="display: table-cell; width: 100px"><div style="height: 30px"></div></div>+ <div class="m" style="display: table-cell"><div style="height: 50px"></div></div>+</div></div>++<!-- 50: display: table-cell siblings without table -->+<div class="case"><div style="width: 400px">+ <div class="m" style="display: table-cell"><div style="width: 80px; height: 30px"></div></div>+ <div class="m" style="display: table-cell"><div style="width: 40px; height: 50px"></div></div>+</div></div>++<!-- 51: vertical-align middle and bottom in cells -->+<div class="case"><table class="m"><tr>+ <td class="m" style="vertical-align: middle"><div class="m" style="width: 30px; height: 20px"></div></td>+ <td class="m" style="vertical-align: bottom"><div class="m" style="width: 30px; height: 20px"></div></td>+ <td class="m"><div style="width: 30px; height: 100px"></div></td>+</tr></table></div>++<!-- 52: colspan and rowspan with fixed sizes -->+<div class="case"><table class="m"><tr>+ <td class="m" colspan="2"><div style="width: 150px; height: 20px"></div></td>+ <td class="m" rowspan="2"><div style="width: 30px; height: 80px"></div></td>+</tr><tr>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+</tr></table></div>++<!-- 53: percentage width columns that sum over 100% -->+<div class="case"><table class="m" style="width: 400px"><tr>+ <td class="m" style="width: 70%"><div style="height: 10px"></div></td>+ <td class="m" style="width: 60%"><div style="height: 10px"></div></td>+ <td class="m"><div style="width: 20px; height: 10px"></div></td>+</tr></table></div>++<!-- 54: col elements with widths -->+<div class="case"><table class="m" style="width: 400px"><colgroup><col style="width: 50px"><col style="width: 30%"><col></colgroup><tr>+ <td class="m"><div style="height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 55: border-collapse with differing borders -->+<div class="case"><table class="m" style="border-collapse: collapse"><tr>+ <td class="m" style="border: 6px solid"><div style="width: 40px; height: 20px"></div></td>+ <td class="m" style="border: 2px solid"><div style="width: 40px; height: 20px"></div></td>+</tr><tr>+ <td class="m" style="border: 4px solid"><div style="width: 40px; height: 20px"></div></td>+ <td class="m" style="border: 10px solid"><div style="width: 40px; height: 20px"></div></td>+</tr></table></div>++<!-- 56: sticky header cell in a scroll container -->+<div class="case"><div style="height: 100px; overflow: auto; width: 300px">+ <table class="m" style="width: 100%"><thead><tr><th class="m" style="position: sticky; top: 0; padding: 0"><div style="height: 20px"></div></th></tr></thead>+ <tbody><tr><td class="m"><div style="height: 200px"></div></td></tr></tbody></table>+</div></div>++<!-- 57: table inside an inline-block with percentage width -->+<div class="case"><div style="width: 400px; font-size: 0">+ <div class="m" style="display: inline-block; width: 50%"><table class="m" style="width: 100%"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></div>+</div></div>++<!-- 58: table in a shrink-to-fit abspos container -->+<div class="case"><div style="position: relative; height: 60px">+ <div class="m" style="position: absolute"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 90px; height: 20px"></div></td><td class="m"><div style="width: 10px; height: 20px"></div></td></tr></table></div>+</div></div>++<!-- 59: contain: size on a cell -->+<div class="case"><table class="m"><tr>+ <td class="m" style="contain: size"><div style="width: 100px; height: 100px"></div></td>+ <td class="m"><div style="width: 40px; height: 30px"></div></td>+</tr></table></div>++<!-- 60: display: contents row group -->+<div class="case"><table class="m"><tbody style="display: contents"><tr>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+ <td class="m"><div style="width: 60px; height: 30px"></div></td>+</tr></tbody></table></div>++<!-- 61: translated table with a caption -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="transform: translateX(50px)"><caption class="m"><div style="height: 10px"></div></caption><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>++<!-- 62: rotated table with a caption and a transform-origin -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="transform: rotate(90deg); transform-origin: 0 0"><caption class="m"><div style="height: 10px"></div></caption><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>++<!-- 63: scaled table with a caption -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="transform: scale(2)"><caption class="m"><div style="height: 10px"></div></caption><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>++<!-- 64: table with the translate property -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="translate: 30px 5px"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>+<!-- 65: two rows with 80% height cells holding 100% height contents in a fixed-height table -->+<div class="case"><table class="m" style="height: 100px"><tr class="m"><td class="m" style="height: 80%"><div class="m" style="height: 100%; width: 10px"></div></td></tr><tr class="m"><td class="m" style="height: 80%"><div class="m" style="height: 100%; width: 10px"></div></td></tr></table></div>++<!-- 66: vertical-rl table flexed in a row flex container -->+<div class="case"><div style="display: flex; width: 300px; height: 100px"><table class="m" style="writing-mode: vertical-rl; flex: 1"><tr><td class="m"><div style="width: 20px; height: 30px"></div></td></tr></table></div></div>++<!-- 67: vertical-rl table flexed in a column flex container -->+<div class="case"><div style="display: flex; flex-direction: column; width: 300px; height: 200px"><table class="m" style="writing-mode: vertical-rl; flex: 1"><tr><td class="m"><div style="width: 20px; height: 30px"></div></td></tr></table></div></div>++<!-- 68: abspos table with a width in a flex container -->+<div class="case"><div style="display: flex; position: relative; width: 300px; height: 50px"><table class="m" style="position: absolute; width: 500px"><tr><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></div></div>++<!-- 69: abspos table in an inline-flex container -->+<div class="case"><div style="display: inline-flex; position: relative; height: 50px"><table class="m" style="position: absolute; width: 200px"><tr><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table><div class="m" style="width: 30px; height: 10px"></div></div></div>++<!-- 70: vertical-rl table with an aspect-ratio -->+<div class="case"><table class="m" style="writing-mode: vertical-lr; aspect-ratio: 1 / 2; height: 60px"><tr><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></div>++<!-- 71: vertical-lr table with an aspect-ratio -->+<div class="case"><table class="m" style="perspective: 100px"><tr><td class="m" style="transform: rotateY(60deg)"><div style="width: 100px; height: 20px"></div></td></tr></table></div>++<!-- 72: table with perspective and a rotated cell -->+<div class="case"><table class="m" style="transform-style: preserve-3d; transform: rotateY(30deg)"><tr><td class="m" style="transform: rotateY(30deg)"><div style="width: 100px; height: 20px"></div></td></tr></table></div>++<!-- 73: preserve-3d table with a rotated cell -->+<div class="case"><div><table class="m" style="height: 50%"><tr><td class="m"><div class="m" style="height: 100%; width: 10px"></div><div style="height: 30px; width: 10px"></div></td></tr></table></div></div>++<!-- 74: percentage height table with nothing to resolve against -->+<div class="case"><table class="m" style="height: 200px"><tr class="m"><td class="m" style="height: calc(10% + 15%)"><div class="m" style="height: 100%; width: 10px"></div></td></tr><tr class="m"><td class="m"><div style="height: 10px; width: 10px"></div></td></tr></table></div>++<!-- 75: calc percentage height cell holding a 100% height block -->+<div class="case"><table class="m" style="height: 200px"><tr class="m"><td class="m" style="height: 25%"><div class="m" style="height: 100%; width: 10px"></div></td></tr><tr class="m"><td class="m"><div style="height: 10px; width: 10px"></div></td></tr></table></div>+<!-- 76: vertical-rl table with a definite flex basis in a row flex container -->+<div class="case"><div style="display: flex; width: 400px; height: 100px"><table class="m" style="writing-mode: vertical-rl; flex: 0 0 300px"><tr><td class="m"><div style="width: 20px; height: 30px"></div></td></tr></table></div></div>++<!-- 77: table with a definite flex basis in a column flex container -->+<div class="case"><div style="display: flex; flex-direction: column; width: 300px; height: 300px"><table class="m" style="flex: 0 0 150px"><tr><td class="m"><div style="width: 20px; height: 30px"></div></td></tr></table></div></div>++<!-- 78: table with a caption and a definite flex basis in a column flex container -->+<div class="case"><div style="display: flex; flex-direction: column; width: 300px; height: 300px"><table class="m" style="flex: 0 0 150px"><caption class="m"><div style="height: 10px"></div></caption><tr><td class="m"><div style="width: 20px; height: 30px"></div></td></tr></table></div></div>++<!-- 79: fixed-height table with two header groups -->+<div class="case"><table class="m" style="height: 300px"><thead><tr class="m"><td><div style="height: 10px"></div></td></tr></thead><thead><tr class="m"><td><div style="height: 10px"></div></td></tr></thead><tbody><tr class="m"><td><div style="height: 10px"></div></td></tr></tbody></table></div>++<!-- 80: fixed-height table with two footer groups -->+<div class="case"><table class="m" style="height: 300px"><tfoot><tr class="m"><td><div style="height: 10px"></div></td></tr></tfoot><tfoot><tr class="m"><td><div style="height: 10px"></div></td></tr></tfoot><tbody><tr class="m"><td><div style="height: 10px"></div></td></tr></tbody></table></div>++<!-- 81: 100% height table with nothing to resolve against, with a row another cell stretches -->+<div class="case"><div><table class="m" style="height: 100%"><tr><td class="m"><div class="m" style="height: 100%; width: 10px"></div></td><td class="m"><div style="height: 100px; width: 10px"></div></td></tr></table></div></div>++<!-- 82: 50% height table with nothing to resolve against, with a row another cell stretches -->+<div class="case"><div><table class="m" style="height: 50%"><tr><td class="m"><div class="m" style="height: 100%; width: 10px"></div></td><td class="m"><div style="height: 80px; width: 10px"></div></td></tr></table></div></div>+</div>+<script src="include.js"></script>+<script>+ promiseTest(async () => {+ // The data: URL images decode asynchronously, so wait for them before measuring.+ await Promise.all([...document.images].map(image => image.decode()));+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-legacy-markup-interop-quirks-mode.html b/Tests/LibWeb/Text/input/table-legacy-markup-interop-quirks-mode.htmlnew file mode 100644index 00000000000..274654d612d--- /dev/null+++ b/Tests/LibWeb/Text/input/table-legacy-markup-interop-quirks-mode.html@@ -0,0 +1,311 @@+<!DOCTYPE quirks>+<style>+ body {+ margin: 0;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+</style>+<div id="cases">+<!-- 1: width=100% cellpadding cellspacing border -->+<div class="case"><table class="m" width="100%" cellpadding="4" cellspacing="2" border="1"><tr>+ <td class="m" width="100"><div style="height: 20px"></div></td>+ <td class="m"><div style="height: 30px"></div></td>+</tr></table></div>++<!-- 2: td width and height attributes -->+<div class="case"><table class="m" cellpadding="0" cellspacing="0"><tr>+ <td class="m" width="150" height="60"><div style="height: 10px"></div></td>+ <td class="m" width="50"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 3: table height attribute with td height attributes -->+<div class="case"><table class="m" height="300" cellpadding="0" cellspacing="0" width="200"><tr class="m">+ <td height="50"><div style="height: 10px"></div></td></tr><tr class="m"><td><div style="height: 10px"></div></td></tr><tr class="m"><td height="20"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 4: spacer images -->+<div class="case"><table class="m" cellpadding="0" cellspacing="0" border="0"><tr>+ <td class="m"><img class="m" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" width="120" height="1" style="display: block"></td>+ <td class="m"><img class="m" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" width="1" height="40" style="display: block"></td>+</tr></table></div>++<!-- 5: align=center table -->+<div class="case"><div style="width: 500px"><table class="m" align="center" width="200" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 6: align=right table followed by block content -->+<div class="case"><div style="width: 500px"><table class="m" align="right" width="150" cellspacing="0"><tr><td class="m"><div style="height: 40px"></div></td></tr></table><div class="m" style="height: 20px"></div></div></div>++<!-- 7: center element around a table -->+<div class="case"><div style="width: 400px"><center><table class="m" width="50%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></center></div></div>++<!-- 8: valign attributes -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" valign="top"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m" valign="middle"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m" valign="bottom"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m"><div style="width: 20px; height: 100px"></div></td>+</tr></table></div>++<!-- 9: align attribute on td with a block child -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m" align="center"><div class="m" style="width: 50px; height: 20px"></div></td>+ <td class="m" align="right"><div class="m" style="width: 50px; height: 20px"></div></td>+</tr></table></div>++<!-- 10: three levels of nested layout tables -->+<div class="case"><table class="m" width="500" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="120"><div style="height: 10px"></div></td>+ <td class="m"><table class="m" width="100%" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><table class="m" width="100%" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="height: 40px"></div></td><td class="m" width="30%"><div style="height: 10px"></div></td></tr></table></td>+ <td class="m" width="80"><div style="height: 10px"></div></td>+ </tr></table></td>+</tr></table></div>++<!-- 11: table width attribute with percentage td widths -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="25%"><div style="height: 10px"></div></td>+ <td class="m" width="25%"><div style="height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 12: border attribute with cellspacing 0 -->+<div class="case"><table class="m" border="3" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+</tr></table></div>++<!-- 13: iframe with width and height attributes in a cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" width="200" height="80" style="border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m"><div style="width: 30px; height: 10px"></div></td>+</tr></table></div>++<!-- 14: percentage-width iframe in a cell -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" style="width: 100%; height: 50px; border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m" width="100"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 15: rowspan larger than the number of rows -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" rowspan="5"><div style="width: 30px; height: 90px"></div></td><td class="m"><div style="width: 30px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div>++<!-- 16: colspan larger than the number of columns -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" colspan="10"><div style="width: 200px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div>++<!-- 17: rows with differing cell counts -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 70px; height: 20px"></div></td><td class="m"><div style="width: 10px; height: 20px"></div></td></tr></table></div>++<!-- 18: empty cells and empty rows -->+<div class="case"><table class="m" width="300" cellspacing="2" cellpadding="3" border="1"><tr>+ <td class="m"></td><td class="m"><div style="height: 20px"></div></td>+</tr><tr class="m"></tr><tr><td class="m"></td><td class="m"></td></tr></table></div>++<!-- 19: th elements with padding and a caption -->+<div class="case"><table class="m" width="300" cellspacing="0"><caption class="m"><div style="height: 15px"></div></caption><tr>+ <th class="m" style="padding: 5px"><div style="height: 10px"></div></th><th class="m" style="padding: 5px"><div style="height: 20px"></div></th>+</tr><tr><td class="m"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td></tr></table></div>++<!-- 20: table with display: block -->+<div class="case"><table class="m" style="display: block; width: 300px" cellspacing="0"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table></div>++<!-- 21: td with display: block -->+<div class="case"><table class="m" width="300" cellspacing="0"><tr><td class="m" style="display: block"><div style="height: 20px"></div></td><td class="m" style="display: block"><div style="height: 30px"></div></td></tr></table></div>++<!-- 22: tr with display: block -->+<div class="case"><table class="m" width="300" cellspacing="0"><tr class="m" style="display: block"><td class="m"><div style="width: 50px; height: 20px"></div></td><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></div>++<!-- 23: table-layout fixed with first row colspan -->+<div class="case"><table class="m" style="table-layout: fixed" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" colspan="2" width="100"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td>+</tr><tr><td class="m" width="300"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td></tr></table></div>++<!-- 24: table-layout fixed without width -->+<div class="case"><table class="m" style="table-layout: fixed" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="100"><div style="height: 10px"></div></td><td class="m"><div style="width: 80px; height: 10px"></div></td>+</tr></table></div>++<!-- 25: hidden rows and columns -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><colgroup><col><col style="visibility: collapse"><col></colgroup><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 40px; height: 20px"></div></td><td class="m"><div style="width: 50px; height: 20px"></div></td>+</tr><tr style="visibility: collapse"><td class="m"><div style="width: 30px; height: 40px"></div></td><td></td><td></td></tr><tr style="display: none"><td><div style="height: 50px"></div></td></tr></table></div>++<!-- 26: table width larger than its container -->+<div class="case"><div style="width: 200px"><table class="m" width="350" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 27: unbreakable content wider than a percentage-width table -->+<div class="case"><div style="width: 300px"><table class="m" width="50%" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 250px; height: 20px"></div></td></tr></table></div></div>++<!-- 28: td nowrap with inline-blocks -->+<div class="case"><table class="m" width="200" cellspacing="0" cellpadding="0"><tr>+ <td class="m" nowrap style="font-size: 0"><div style="display: inline-block; width: 120px; height: 20px"></div><div style="display: inline-block; width: 120px; height: 20px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 29: inline-blocks wrapping in a narrow cell -->+<div class="case"><table class="m" width="200" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="font-size: 0"><div style="display: inline-block; width: 80px; height: 20px"></div><div style="display: inline-block; width: 80px; height: 20px"></div><div style="display: inline-block; width: 80px; height: 20px"></div></td>+ <td class="m" width="50"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 30: cellpadding with explicit padding on td overriding it -->+<div class="case"><table class="m" cellpadding="10" cellspacing="0"><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m" style="padding: 2px"><div style="width: 30px; height: 20px"></div></td>+</tr></table></div>++<!-- 31: table inside a float with width percentage -->+<div class="case"><div style="width: 400px"><div class="m" style="float: left; width: 50%"><table class="m" width="100%" cellspacing="0"><tr><td class="m"><div style="height: 30px"></div></td></tr></table></div><div class="m" style="height: 10px"></div></div></div>++<!-- 32: fieldset containing a table -->+<div class="case"><fieldset class="m" style="width: 300px; margin: 0; padding: 5px; border: 2px solid"><table class="m" width="100%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></fieldset></div>++<!-- 33: table in a form with input size and percentage width -->+<div class="case"><form style="margin: 0"><table class="m" width="400" cellspacing="0" cellpadding="2"><tr>+ <td class="m" width="30%"><div style="height: 10px"></div></td><td class="m"><input class="m" style="width: 95%; height: 24px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></td>+</tr></table></form></div>++<!-- 34: select with percentage width in an auto table cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 200px; height: 10px"></div></td></tr><tr><td class="m"><select class="m" style="width: 100%; height: 22px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></select></td>+</tr></table></div>++<!-- 35: button with width 100% inside a fixed-width cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="120"><button class="m" style="width: 100%; height: 30px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></button></td>+</tr></table></div>++<!-- 36: checkboxes sized explicitly in cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><input class="m" type="checkbox" style="width: 16px; height: 16px; margin: 0; display: block; appearance: none; border: 1px solid; box-sizing: border-box"></td>+ <td class="m"><input class="m" type="radio" style="width: 18px; height: 18px; margin: 0; display: block; appearance: none; border: 1px solid; box-sizing: border-box"></td>+</tr></table></div>++<!-- 37: textarea with rows and cols overridden by CSS -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><textarea class="m" rows="5" cols="80" style="width: 100%; height: 70px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; resize: none"></textarea></td>+</tr></table></div>++<!-- 38: progress and meter with explicit sizes -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><progress class="m" value="5" max="10" style="width: 100px; height: 12px; display: block; margin: 0"></progress></td>+ <td class="m"><meter class="m" value="0.5" style="width: 60px; height: 12px; display: block; margin: 0"></meter></td>+</tr></table></div>++<!-- 39: video and canvas with intrinsic sizes in cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><canvas class="m" width="90" height="45" style="display: block"></canvas></td>+ <td class="m"><canvas class="m" style="width: 100%; display: block" width="60" height="30"></canvas></td>+ <td class="m"><div style="width: 50px; height: 10px"></div></td>+</tr></table></div>++<!-- 40: svg with only a viewBox in a fixed-width cell -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="100"><svg class="m" viewBox="0 0 4 1" style="display: block"></svg></td><td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 41: object-fit image with percentage size in a fixed-size cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="width: 100px; height: 100px"><img class="m" style="width: 100%; height: 100%; object-fit: cover; display: block" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'/%3E"></td>+</tr></table></div>++<!-- 42: aspect-ratio iframe in an auto-width cell of a fixed-width table -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" style="width: 100%; aspect-ratio: 16 / 9; border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m" width="80"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 43: sticky first column in a horizontally scrolling container -->+<div class="case"><div style="width: 200px; overflow: auto"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="position: sticky; left: 0"><div style="width: 60px; height: 20px"></div></td><td class="m"><div style="width: 300px; height: 20px"></div></td>+</tr></table></div></div>++<!-- 44: table inside a flex column with align-items: center -->+<div class="case"><div style="display: flex; flex-direction: column; align-items: center; width: 400px"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div></div>++<!-- 45: table with margin auto inside a grid cell with justify-items center -->+<div class="case"><div style="display: grid; grid-template-columns: 300px; justify-items: center"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 90px; height: 20px"></div></td></tr></table></div></div>++<!-- 46: two tables side by side as inline-tables with percentage widths -->+<div class="case"><div style="width: 400px; font-size: 0"><table class="m" style="display: inline-table; width: 50%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table><table class="m" style="display: inline-table; width: 50%" cellspacing="0"><tr><td class="m"><div style="height: 30px"></div></td></tr></table></div></div>++<!-- 47: table with transform -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="transform: translateX(50px)"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>++<!-- 48: table with relatively positioned cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m" style="position: relative; top: 10px; left: 5px"><div style="width: 40px; height: 20px"></div></td><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div>++<!-- 49: min-width and max-width on cells -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="min-width: 150px"><div style="height: 10px"></div></td>+ <td class="m" style="max-width: 50px"><div style="width: 30px; height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 50: box-sizing border-box cell width -->+<div class="case"><table class="m" cellspacing="0"><tr>+ <td class="m" style="box-sizing: border-box; width: 100px; padding: 10px; border: 5px solid"><div style="height: 10px"></div></td>+ <td class="m" style="width: 100px; padding: 10px; border: 5px solid"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 51: center element around a percentage-width table next to a right float -->+<div class="case"><div style="width: 400px"><div style="float: right; width: 100px; height: 50px"></div><center><table class="m" width="50%" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></center></div></div>++<!-- 52: table with auto margins next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" style="margin: 0 auto; width: 200px" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 53: align=center table next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" align="center" width="200" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 54: div align=right around a table next to a right float -->+<div class="case"><div style="width: 400px" align="right"><div style="float: right; width: 100px; height: 50px"></div><table class="m" width="150" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 55: table with margin-left: auto next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" style="margin-left: auto" width="200" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 56: 100% width table next to a right float -->+<div class="case"><div style="width: 400px"><div style="float: right; width: 100px; height: 50px"></div><table class="m" width="100%" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 57: table height=100% and td height=100% inside a fixed-height block -->+<div class="case"><div style="height: 300px; width: 300px"><table class="m" height="100%" width="100%" cellspacing="0" cellpadding="0"><tr class="m"><td class="m" height="100%"><div class="m" style="height: 100%"><div style="height: 10px"></div></div></td></tr><tr class="m"><td class="m"><div style="height: 30px"></div></td></tr></table></div></div>++<!-- 58: table height=100% through an auto-height block -->+<div class="case"><div style="height: 200px; width: 300px"><div><table class="m" height="100%" width="100%" cellspacing="0" cellpadding="0"><tr class="m"><td><div style="height: 10px"></div></td></tr></table></div></div></div>++<!-- 59: percentage td heights in a table with a height attribute -->+<div class="case"><table class="m" height="200" width="200" cellspacing="0" cellpadding="0"><tr class="m"><td height="25%"><div style="height: 10px"></div></td></tr><tr class="m"><td><div style="height: 10px"></div></td></tr></table></div>++<!-- 60: inline image alone in a cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><img class="m" width="60" height="30" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></td><td class="m"><img class="m" width="20" height="50" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></td></tr></table></div>++<!-- 61: inline image in a cell with a percentage-height block child -->+<div class="case"><div style="height: 150px"><table class="m" height="100%" cellspacing="0" cellpadding="0"><tr><td class="m"><div class="m" style="height: 50%; width: 40px"></div></td></tr></table></div></div>++<!-- 62: percentage-height div in a td without height in quirks mode -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="height: 80px; width: 10px"></div></td><td class="m"><div class="m" style="height: 100%; width: 20px"></div></td></tr></table></div>+</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-legacy-markup-interop.html b/Tests/LibWeb/Text/input/table-legacy-markup-interop.htmlnew file mode 100644index 00000000000..48071662873--- /dev/null+++ b/Tests/LibWeb/Text/input/table-legacy-markup-interop.html@@ -0,0 +1,293 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+</style>+<div id="cases">+<!-- 1: width=100% cellpadding cellspacing border -->+<div class="case"><table class="m" width="100%" cellpadding="4" cellspacing="2" border="1"><tr>+ <td class="m" width="100"><div style="height: 20px"></div></td>+ <td class="m"><div style="height: 30px"></div></td>+</tr></table></div>++<!-- 2: td width and height attributes -->+<div class="case"><table class="m" cellpadding="0" cellspacing="0"><tr>+ <td class="m" width="150" height="60"><div style="height: 10px"></div></td>+ <td class="m" width="50"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 3: table height attribute with td height attributes -->+<div class="case"><table class="m" height="300" cellpadding="0" cellspacing="0" width="200"><tr class="m">+ <td height="50"><div style="height: 10px"></div></td></tr><tr class="m"><td><div style="height: 10px"></div></td></tr><tr class="m"><td height="20"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 4: spacer images -->+<div class="case"><table class="m" cellpadding="0" cellspacing="0" border="0"><tr>+ <td class="m"><img class="m" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" width="120" height="1" style="display: block"></td>+ <td class="m"><img class="m" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" width="1" height="40" style="display: block"></td>+</tr></table></div>++<!-- 5: align=center table -->+<div class="case"><div style="width: 500px"><table class="m" align="center" width="200" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 6: align=right table followed by block content -->+<div class="case"><div style="width: 500px"><table class="m" align="right" width="150" cellspacing="0"><tr><td class="m"><div style="height: 40px"></div></td></tr></table><div class="m" style="height: 20px"></div></div></div>++<!-- 7: center element around a table -->+<div class="case"><div style="width: 400px"><center><table class="m" width="50%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></center></div></div>++<!-- 8: valign attributes -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" valign="top"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m" valign="middle"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m" valign="bottom"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m"><div class="m" style="width: 20px; height: 20px"></div></td>+ <td class="m"><div style="width: 20px; height: 100px"></div></td>+</tr></table></div>++<!-- 9: align attribute on td with a block child -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m" align="center"><div class="m" style="width: 50px; height: 20px"></div></td>+ <td class="m" align="right"><div class="m" style="width: 50px; height: 20px"></div></td>+</tr></table></div>++<!-- 10: three levels of nested layout tables -->+<div class="case"><table class="m" width="500" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="120"><div style="height: 10px"></div></td>+ <td class="m"><table class="m" width="100%" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><table class="m" width="100%" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="height: 40px"></div></td><td class="m" width="30%"><div style="height: 10px"></div></td></tr></table></td>+ <td class="m" width="80"><div style="height: 10px"></div></td>+ </tr></table></td>+</tr></table></div>++<!-- 11: table width attribute with percentage td widths -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="25%"><div style="height: 10px"></div></td>+ <td class="m" width="25%"><div style="height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 12: border attribute with cellspacing 0 -->+<div class="case"><table class="m" border="3" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+ <td class="m"><div style="width: 40px; height: 20px"></div></td>+</tr></table></div>++<!-- 13: iframe with width and height attributes in a cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" width="200" height="80" style="border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m"><div style="width: 30px; height: 10px"></div></td>+</tr></table></div>++<!-- 14: percentage-width iframe in a cell -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" style="width: 100%; height: 50px; border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m" width="100"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 15: rowspan larger than the number of rows -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" rowspan="5"><div style="width: 30px; height: 90px"></div></td><td class="m"><div style="width: 30px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div>++<!-- 16: colspan larger than the number of columns -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" colspan="10"><div style="width: 200px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div>++<!-- 17: rows with differing cell counts -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td>+</tr><tr><td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 70px; height: 20px"></div></td><td class="m"><div style="width: 10px; height: 20px"></div></td></tr></table></div>++<!-- 18: empty cells and empty rows -->+<div class="case"><table class="m" width="300" cellspacing="2" cellpadding="3" border="1"><tr>+ <td class="m"></td><td class="m"><div style="height: 20px"></div></td>+</tr><tr class="m"></tr><tr><td class="m"></td><td class="m"></td></tr></table></div>++<!-- 19: th elements with padding and a caption -->+<div class="case"><table class="m" width="300" cellspacing="0"><caption class="m"><div style="height: 15px"></div></caption><tr>+ <th class="m" style="padding: 5px"><div style="height: 10px"></div></th><th class="m" style="padding: 5px"><div style="height: 20px"></div></th>+</tr><tr><td class="m"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td></tr></table></div>++<!-- 20: table with display: block -->+<div class="case"><table class="m" style="display: block; width: 300px" cellspacing="0"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table></div>++<!-- 21: td with display: block -->+<div class="case"><table class="m" width="300" cellspacing="0"><tr><td class="m" style="display: block"><div style="height: 20px"></div></td><td class="m" style="display: block"><div style="height: 30px"></div></td></tr></table></div>++<!-- 22: tr with display: block -->+<div class="case"><table class="m" width="300" cellspacing="0"><tr class="m" style="display: block"><td class="m"><div style="width: 50px; height: 20px"></div></td><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></div>++<!-- 23: table-layout fixed with first row colspan -->+<div class="case"><table class="m" style="table-layout: fixed" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" colspan="2" width="100"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td>+</tr><tr><td class="m" width="300"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td><td class="m"><div style="height: 10px"></div></td></tr></table></div>++<!-- 24: table-layout fixed without width -->+<div class="case"><table class="m" style="table-layout: fixed" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="100"><div style="height: 10px"></div></td><td class="m"><div style="width: 80px; height: 10px"></div></td>+</tr></table></div>++<!-- 25: hidden rows and columns -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><colgroup><col><col style="visibility: collapse"><col></colgroup><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m"><div style="width: 40px; height: 20px"></div></td><td class="m"><div style="width: 50px; height: 20px"></div></td>+</tr><tr style="visibility: collapse"><td class="m"><div style="width: 30px; height: 40px"></div></td><td></td><td></td></tr><tr style="display: none"><td><div style="height: 50px"></div></td></tr></table></div>++<!-- 26: table width larger than its container -->+<div class="case"><div style="width: 200px"><table class="m" width="350" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 27: unbreakable content wider than a percentage-width table -->+<div class="case"><div style="width: 300px"><table class="m" width="50%" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 250px; height: 20px"></div></td></tr></table></div></div>++<!-- 28: td nowrap with inline-blocks -->+<div class="case"><table class="m" width="200" cellspacing="0" cellpadding="0"><tr>+ <td class="m" nowrap style="font-size: 0"><div style="display: inline-block; width: 120px; height: 20px"></div><div style="display: inline-block; width: 120px; height: 20px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 29: inline-blocks wrapping in a narrow cell -->+<div class="case"><table class="m" width="200" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="font-size: 0"><div style="display: inline-block; width: 80px; height: 20px"></div><div style="display: inline-block; width: 80px; height: 20px"></div><div style="display: inline-block; width: 80px; height: 20px"></div></td>+ <td class="m" width="50"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 30: cellpadding with explicit padding on td overriding it -->+<div class="case"><table class="m" cellpadding="10" cellspacing="0"><tr>+ <td class="m"><div style="width: 30px; height: 20px"></div></td><td class="m" style="padding: 2px"><div style="width: 30px; height: 20px"></div></td>+</tr></table></div>++<!-- 31: table inside a float with width percentage -->+<div class="case"><div style="width: 400px"><div class="m" style="float: left; width: 50%"><table class="m" width="100%" cellspacing="0"><tr><td class="m"><div style="height: 30px"></div></td></tr></table></div><div class="m" style="height: 10px"></div></div></div>++<!-- 32: fieldset containing a table -->+<div class="case"><fieldset class="m" style="width: 300px; margin: 0; padding: 5px; border: 2px solid"><table class="m" width="100%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table></fieldset></div>++<!-- 33: table in a form with input size and percentage width -->+<div class="case"><form style="margin: 0"><table class="m" width="400" cellspacing="0" cellpadding="2"><tr>+ <td class="m" width="30%"><div style="height: 10px"></div></td><td class="m"><input class="m" style="width: 95%; height: 24px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></td>+</tr></table></form></div>++<!-- 34: select with percentage width in an auto table cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><div style="width: 200px; height: 10px"></div></td></tr><tr><td class="m"><select class="m" style="width: 100%; height: 22px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></select></td>+</tr></table></div>++<!-- 35: button with width 100% inside a fixed-width cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="120"><button class="m" style="width: 100%; height: 30px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; font-size: 0; appearance: none"></button></td>+</tr></table></div>++<!-- 36: checkboxes sized explicitly in cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><input class="m" type="checkbox" style="width: 16px; height: 16px; margin: 0; display: block; appearance: none; border: 1px solid; box-sizing: border-box"></td>+ <td class="m"><input class="m" type="radio" style="width: 18px; height: 18px; margin: 0; display: block; appearance: none; border: 1px solid; box-sizing: border-box"></td>+</tr></table></div>++<!-- 37: textarea with rows and cols overridden by CSS -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><textarea class="m" rows="5" cols="80" style="width: 100%; height: 70px; box-sizing: border-box; border: 1px solid; padding: 0; margin: 0; display: block; resize: none"></textarea></td>+</tr></table></div>++<!-- 38: progress and meter with explicit sizes -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><progress class="m" value="5" max="10" style="width: 100px; height: 12px; display: block; margin: 0"></progress></td>+ <td class="m"><meter class="m" value="0.5" style="width: 60px; height: 12px; display: block; margin: 0"></meter></td>+</tr></table></div>++<!-- 39: video and canvas with intrinsic sizes in cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><canvas class="m" width="90" height="45" style="display: block"></canvas></td>+ <td class="m"><canvas class="m" style="width: 100%; display: block" width="60" height="30"></canvas></td>+ <td class="m"><div style="width: 50px; height: 10px"></div></td>+</tr></table></div>++<!-- 40: svg with only a viewBox in a fixed-width cell -->+<div class="case"><table class="m" width="300" cellspacing="0" cellpadding="0"><tr>+ <td class="m" width="100"><svg class="m" viewBox="0 0 4 1" style="display: block"></svg></td><td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 41: object-fit image with percentage size in a fixed-size cell -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="width: 100px; height: 100px"><img class="m" style="width: 100%; height: 100%; object-fit: cover; display: block" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'/%3E"></td>+</tr></table></div>++<!-- 42: aspect-ratio iframe in an auto-width cell of a fixed-width table -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m"><iframe class="m" style="width: 100%; aspect-ratio: 16 / 9; border: 0; display: block" src="about:blank"></iframe></td>+ <td class="m" width="80"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 43: sticky first column in a horizontally scrolling container -->+<div class="case"><div style="width: 200px; overflow: auto"><table class="m" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="position: sticky; left: 0"><div style="width: 60px; height: 20px"></div></td><td class="m"><div style="width: 300px; height: 20px"></div></td>+</tr></table></div></div>++<!-- 44: table inside a flex column with align-items: center -->+<div class="case"><div style="display: flex; flex-direction: column; align-items: center; width: 400px"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div></div>++<!-- 45: table with margin auto inside a grid cell with justify-items center -->+<div class="case"><div style="display: grid; grid-template-columns: 300px; justify-items: center"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m"><div style="width: 90px; height: 20px"></div></td></tr></table></div></div>++<!-- 46: two tables side by side as inline-tables with percentage widths -->+<div class="case"><div style="width: 400px; font-size: 0"><table class="m" style="display: inline-table; width: 50%" cellspacing="0"><tr><td class="m"><div style="height: 20px"></div></td></tr></table><table class="m" style="display: inline-table; width: 50%" cellspacing="0"><tr><td class="m"><div style="height: 30px"></div></td></tr></table></div></div>++<!-- 47: table with transform -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0" style="transform: translateX(50px)"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div>++<!-- 48: table with relatively positioned cells -->+<div class="case"><table class="m" cellspacing="0" cellpadding="0"><tr><td class="m" style="position: relative; top: 10px; left: 5px"><div style="width: 40px; height: 20px"></div></td><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div>++<!-- 49: min-width and max-width on cells -->+<div class="case"><table class="m" width="400" cellspacing="0" cellpadding="0"><tr>+ <td class="m" style="min-width: 150px"><div style="height: 10px"></div></td>+ <td class="m" style="max-width: 50px"><div style="width: 30px; height: 10px"></div></td>+ <td class="m"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 50: box-sizing border-box cell width -->+<div class="case"><table class="m" cellspacing="0"><tr>+ <td class="m" style="box-sizing: border-box; width: 100px; padding: 10px; border: 5px solid"><div style="height: 10px"></div></td>+ <td class="m" style="width: 100px; padding: 10px; border: 5px solid"><div style="height: 10px"></div></td>+</tr></table></div>++<!-- 51: center element around a percentage-width table next to a right float -->+<div class="case"><div style="width: 400px"><div style="float: right; width: 100px; height: 50px"></div><center><table class="m" width="50%" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></center></div></div>++<!-- 52: table with auto margins next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" style="margin: 0 auto; width: 200px" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 53: align=center table next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" align="center" width="200" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 54: div align=right around a table next to a right float -->+<div class="case"><div style="width: 400px" align="right"><div style="float: right; width: 100px; height: 50px"></div><table class="m" width="150" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 55: table with margin-left: auto next to a left float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" style="margin-left: auto" width="200" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>++<!-- 56: 100% width table next to a right float -->+<div class="case"><div style="width: 400px"><div style="float: right; width: 100px; height: 50px"></div><table class="m" width="100%" cellspacing="0"><tr><td><div style="height: 20px"></div></td></tr></table></div></div>+</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-nesting-interop.html b/Tests/LibWeb/Text/input/table-nesting-interop.htmlnew file mode 100644index 00000000000..a26b6a0d0d0--- /dev/null+++ b/Tests/LibWeb/Text/input/table-nesting-interop.html@@ -0,0 +1,167 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ table {+ border-spacing: 0;+ }+ td {+ padding: 0;+ vertical-align: top;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+ .b {+ background: lightblue;+ }+ input, select, textarea, button {+ box-sizing: border-box;+ margin: 0;+ padding: 0;+ border: 2px solid black;+ font-size: 0;+ appearance: none;+ }+</style>+<div id="cases">+<!-- 1: flex row inside a cell, with a table that grows -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex; width: 300px"><table class="m" style="flex: 1"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table><div style="width: 100px; height: 10px"></div></div></td><td class="m"><div style="width: 40px; height: 40px"></div></td></tr></table></div>++<!-- 2: flex row inside an auto-width cell, with a shrinkable table -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex"><table class="m"><tr><td class="m"><div style="width: 120px; height: 20px"></div></td></tr></table><div class="m" style="flex: 1; min-width: 30px; height: 10px"></div></div></td></tr></table></div>++<!-- 3: flex column with a definite height inside a cell, with a growing table -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex; flex-direction: column; height: 120px; width: 200px"><table class="m" style="flex: 1"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table><div style="width: 10px; height: 30px"></div></div></td></tr></table></div>++<!-- 4: grid with fr tracks inside a cell, with a table in one track -->+<div class="case"><table class="m" style="width: 400px"><tr><td class="m"><div class="m" style="display: grid; grid-template-columns: 1fr 2fr"><table class="m"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 30px; height: 30px"></div></td></tr></table></div></td></tr></table></div>++<!-- 5: grid with auto tracks inside an auto-width cell -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: grid; grid-template-columns: auto auto; gap: 5px"><table class="m"><tr><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table><table class="m"><tr><td class="m"><div style="width: 40px; height: 25px"></div></td></tr></table></div></td><td class="m"><div style="width: 20px; height: 10px"></div></td></tr></table></div>++<!-- 6: float containing a table inside a cell -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m"><div class="m" style="float: left"><table class="m"><tr><td class="m"><div style="width: 80px; height: 30px"></div></td></tr></table></div><div class="m" style="height: 10px"></div></td></tr></table></div>++<!-- 7: table beside a float inside a cell -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m"><div style="float: left; width: 100px; height: 40px"></div><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></td></tr></table></div>++<!-- 8: abspos box with a table inside a relatively positioned cell -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m" style="position: relative; height: 100px"><div class="m" style="position: absolute; top: 10px; right: 10px"><table class="m"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div></td></tr></table></div>++<!-- 9: abspos table with insets inside a relatively positioned cell -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m" style="position: relative; height: 100px"><div style="width: 10px; height: 10px"></div><table class="m" style="position: absolute; left: 20px; right: 20px; bottom: 0"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></td></tr></table></div>++<!-- 10: inline-block with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m" style="line-height: 0"><div class="m" style="display: inline-block"><table class="m"><tr><td class="m"><div style="width: 90px; height: 20px"></div></td><td class="m"><div style="width: 30px; height: 40px"></div></td></tr></table></div><div style="width: 10px; height: 10px"></div></td></tr></table></div>++<!-- 11: percentage-height block with a 100% height table inside a fixed-height cell -->+<div class="case"><table class="m" style="height: 200px"><tr><td class="m" style="height: 200px"><div class="m" style="height: 50%"><table class="m" style="height: 100%"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></td></tr></table></div>++<!-- 12: overflow: auto block with a wide table inside a fixed-width cell -->+<div class="case"><table class="m" style="width: 200px; table-layout: fixed"><tr><td class="m"><div class="m" style="overflow: auto"><table class="m"><tr><td class="m"><div style="width: 400px; height: 20px"></div></td></tr></table></div></td></tr></table></div>++<!-- 13: aspect-ratio block with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="width: 160px; aspect-ratio: 2"><table class="m" style="width: 100%; height: 100%"><tr><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></div></td></tr></table></div>++<!-- 14: fieldset with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><fieldset class="m" style="margin: 0; padding: 5px; border: 2px solid"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 100px; height: 20px"></div></td></tr></table></fieldset></td><td class="m"><div style="width: 50px; height: 10px"></div></td></tr></table></div>++<!-- 15: button with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><button class="m" style="padding: 0; border: 0; display: block"><table class="m"><tr><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table></button></td></tr></table></div>++<!-- 16: multicol with a table inside a cell -->+<div class="case"><table class="m" style="width: 400px"><tr><td class="m"><div class="m" style="columns: 2; column-gap: 0"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></div></td></tr></table></div>++<!-- 17: details with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><details class="m" open><summary style="display: block; height: 10px"></summary><table class="m"><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></details></td></tr></table></div>++<!-- 18: display: contents wrapper around a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><div style="display: contents"><table class="m"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div></td><td class="m"><div style="width: 30px; height: 30px"></div></td></tr></table></div>++<!-- 19: flex inside a cell inside a flex inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex; gap: 4px"><table class="m"><tr><td class="m"><div class="m" style="display: flex"><div style="width: 30px; height: 20px"></div><div style="width: 40px; height: 10px"></div></div></td></tr></table><div style="width: 20px; height: 20px"></div></div></td></tr></table></div>++<!-- 20: grid inside a cell inside a grid inside a cell, with stretched row -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: grid; grid-template-columns: 100px 100px"><table class="m" style="height: 100%"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table><div class="m" style="height: 60px"></div></div></td></tr></table></div>++<!-- 21: vertical writing-mode block with a table inside a cell -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="writing-mode: vertical-rl"><table class="m"><tr><td class="m"><div style="width: 30px; height: 60px"></div></td></tr></table></div></td></tr></table></div>++<!-- 22: table inside a flex item, with a flex container in a cell -->+<div class="case"><div class="m" style="display: flex; width: 400px"><table class="m" style="flex: 1"><tr><td class="m"><div class="m" style="display: flex; justify-content: space-between"><div style="width: 30px; height: 20px"></div><div style="width: 30px; height: 30px"></div></div></td></tr></table><div style="width: 100px; height: 10px"></div></div></div>++<!-- 23: table inside a grid area, with a grid in a cell -->+<div class="case"><div class="m" style="display: grid; grid-template-columns: 1fr 100px; width: 400px"><table class="m" style="width: 100%"><tr><td class="m"><div class="m" style="display: grid; grid-template-columns: repeat(3, 1fr)"><div style="width: 10px; height: 20px"></div><div style="width: 10px; height: 20px"></div><div style="width: 10px; height: 30px"></div></div></td></tr></table><div style="width: 10px; height: 10px"></div></div></div>++<!-- 24: table inside a stretched grid area, with a 100% height block in a cell -->+<div class="case"><div class="m" style="display: grid; grid-template-columns: 200px 100px"><table class="m" style="height: 100%"><tr><td class="m"><div class="m" style="height: 100%; width: 50px"></div></td></tr></table><div class="m" style="height: 80px"></div></div></div>++<!-- 25: table inside a float, with a float in a cell -->+<div class="case"><div style="width: 400px"><div class="m" style="float: right"><table class="m"><tr><td class="m"><div class="m" style="float: left; width: 30px; height: 30px"></div><div style="width: 60px; height: 10px"></div></td></tr></table></div><div style="width: 10px; height: 10px"></div></div></div>++<!-- 26: table inside an abspos box, with an abspos box in a relative cell -->+<div class="case"><div style="position: relative; width: 400px; height: 120px"><div class="m" style="position: absolute; left: 50px; top: 10px"><table class="m"><tr><td class="m" style="position: relative"><div style="width: 80px; height: 40px"></div><div class="m" style="position: absolute; right: 0; bottom: 0; width: 20px; height: 10px"></div></td></tr></table></div></div></div>++<!-- 27: table inside an inline-block, with an inline-block in a cell -->+<div class="case"><div style="line-height: 0"><div class="m" style="display: inline-block"><table class="m"><tr><td class="m"><div class="m" style="display: inline-block; width: 40px; height: 20px"></div><div class="m" style="display: inline-block; width: 50px; height: 30px"></div></td></tr></table></div></div></div>++<!-- 28: table inside a flex column with a definite height, with a percentage-height block in a cell -->+<div class="case"><div class="m" style="display: flex; flex-direction: column; height: 200px; width: 300px"><table class="m" style="flex: 1"><tr><td class="m"><div class="m" style="height: 50%; width: 20px"></div></td></tr></table></div></div>++<!-- 29: table inside a multicol, with a flex row in a cell -->+<div class="case"><div class="m" style="columns: 2; column-gap: 20px; width: 420px"><table class="m" style="width: 100%"><tr><td class="m"><div class="m" style="display: flex"><div style="width: 30px; height: 20px"></div><div class="m" style="flex: 1; height: 20px"></div></div></td></tr></table></div></div>++<!-- 30: table inside an aspect-ratio box, with an aspect-ratio box in a cell -->+<div class="case"><div class="m" style="width: 200px; aspect-ratio: 2"><table class="m" style="width: 100%; height: 100%"><tr><td class="m"><div class="m" style="width: 50%; aspect-ratio: 1"></div></td></tr></table></div></div>++<!-- 31: table inside a shrink-to-fit abspos box, with a percentage-width table in a cell -->+<div class="case"><div style="position: relative; height: 80px"><div class="m" style="position: absolute"><table class="m"><tr><td class="m"><div style="width: 100px; height: 20px"></div></td><td class="m"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></td></tr></table></div></div></div>++<!-- 32: table inside an overflow: auto box, with an overflow: auto box in a cell -->+<div class="case"><div class="m" style="overflow: auto; width: 200px"><table class="m" style="width: 100%"><tr><td class="m"><div class="m" style="overflow: auto; width: 100px"><div style="width: 300px; height: 20px"></div></div></td></tr></table></div></div>++<!-- 33: table inside a flex item with min-width: 0, with a wide image in a cell -->+<div class="case"><div class="m" style="display: flex; width: 200px"><div class="m" style="min-width: 0; flex: 1"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 300px; height: 10px"></div></td></tr></table></div></div></div>++<!-- 34: table inside a grid item with min-width: 0 and a fixed layout table -->+<div class="case"><div class="m" style="display: grid; grid-template-columns: minmax(0, 1fr) 50px; width: 300px"><table class="m" style="width: 100%; table-layout: fixed"><tr><td class="m"><div style="width: 400px; height: 10px"></div></td></tr></table><div style="width: 10px; height: 10px"></div></div></div>++<!-- 35: form controls in cells of a table inside a flex item -->+<div class="case"><div class="m" style="display: flex; width: 400px"><table class="m" style="flex: 1"><tr><td class="m"><input class="m" style="width: 100%; height: 20px"></td><td class="m"><select class="m" style="width: 80px; height: 20px"></select></td></tr><tr><td class="m" colspan="2"><textarea class="m" style="width: 100%; height: 40px; resize: none"></textarea></td></tr></table></div></div>++<!-- 36: flex, table, grid, table, flex -->+<div class="case"><div class="m" style="display: flex; width: 500px"><table class="m" style="flex: 1"><tr><td class="m"><div class="m" style="display: grid; grid-template-columns: 1fr 1fr"><table class="m" style="width: 100%"><tr><td class="m"><div class="m" style="display: flex"><div style="width: 20px; height: 20px"></div><div class="m" style="flex: 1; height: 10px"></div></div></td></tr></table><div style="width: 10px; height: 30px"></div></div></td></tr></table></div></div>++<!-- 37: table, flex, table, float, table -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex"><table class="m"><tr><td class="m"><div class="m" style="float: left"><table class="m"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div><div style="width: 70px; height: 10px"></div></td></tr></table><div style="width: 10px; height: 40px"></div></div></td></tr></table></div>++<!-- 38: table, inline-block, table, abspos, table -->+<div class="case"><table class="m"><tr><td class="m" style="line-height: 0"><div class="m" style="display: inline-block; position: relative"><table class="m"><tr><td class="m"><div style="width: 100px; height: 50px"></div><div class="m" style="position: absolute; left: 10px; top: 10px"><table class="m"><tr><td class="m"><div style="width: 30px; height: 15px"></div></td></tr></table></div></td></tr></table></div></td></tr></table></div>++<!-- 39: grid, table with percentage width, flex column, table with percentage height -->+<div class="case"><div class="m" style="display: grid; grid-template-columns: 300px; grid-template-rows: 150px"><table class="m" style="width: 50%; height: 100%"><tr><td class="m"><div class="m" style="display: flex; flex-direction: column; height: 100%"><table class="m" style="flex: 1"><tr><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></div></td></tr></table></div></div>++<!-- 40: nested percentage-width tables inside flex inside a table -->+<div class="case"><table class="m" style="width: 400px"><tr><td class="m"><div class="m" style="display: flex"><table class="m" style="width: 50%"><tr><td class="m"><table class="m" style="width: 50%"><tr><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></td></tr></table><div style="width: 50px; height: 10px"></div></div></td></tr></table></div>++</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-positioning-and-svg-interop.html b/Tests/LibWeb/Text/input/table-positioning-and-svg-interop.htmlnew file mode 100644index 00000000000..0efdcbc4851--- /dev/null+++ b/Tests/LibWeb/Text/input/table-positioning-and-svg-interop.html@@ -0,0 +1,167 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ table {+ border-spacing: 0;+ }+ td {+ padding: 0;+ vertical-align: top;+ }+ .case {+ margin-bottom: 10px;+ width: 600px;+ display: flow-root;+ }+ .b {+ background: lightblue;+ }+ input, select, textarea, button {+ box-sizing: border-box;+ margin: 0;+ padding: 0;+ border: 2px solid black;+ font-size: 0;+ appearance: none;+ }+</style>+<div id="cases">+<!-- 1: abspos table with auto size -->+<div class="case"><div style="position: relative; height: 60px"><table class="m" style="position: absolute; left: 10px; top: 5px"><tr><td class="m"><div style="width: 70px; height: 20px"></div></td></tr></table></div></div>++<!-- 2: abspos table with left and right insets -->+<div class="case"><div style="position: relative; width: 400px; height: 60px"><table class="m" style="position: absolute; left: 50px; right: 50px"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div></div>++<!-- 3: abspos table with insets and a wide cell -->+<div class="case"><div style="position: relative; width: 200px; height: 60px"><table class="m" style="position: absolute; left: 50px; right: 50px"><tr><td class="m"><div style="width: 300px; height: 20px"></div></td></tr></table></div></div>++<!-- 4: abspos table with top and bottom insets -->+<div class="case"><div style="position: relative; width: 400px; height: 100px"><table class="m" style="position: absolute; top: 10px; bottom: 10px"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div></div>++<!-- 5: abspos table with percentage size -->+<div class="case"><div style="position: relative; width: 400px; height: 100px"><table class="m" style="position: absolute; width: 50%; height: 50%; right: 0; bottom: 0"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div></div>++<!-- 6: abspos table with margin: auto centering -->+<div class="case"><div style="position: relative; width: 400px; height: 100px"><table class="m" style="position: absolute; inset: 0; width: 100px; height: 40px; margin: auto"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table></div></div>++<!-- 7: abspos table with a caption -->+<div class="case"><div style="position: relative; width: 400px; height: 100px"><table class="m" style="position: absolute; right: 0; bottom: 0"><caption class="m"><div style="width: 50px; height: 10px"></div></caption><tr><td class="m"><div style="width: 80px; height: 20px"></div></td></tr></table></div></div>++<!-- 8: abspos table with static position after inline content -->+<div class="case"><div style="width: 400px; line-height: 0"><div style="width: 100px; height: 20px"></div><div style="display: inline-block; width: 50px; height: 10px"></div><table class="m" style="position: absolute"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></div>++<!-- 9: abspos inline-table with static position -->+<div class="case"><div style="width: 400px; line-height: 0"><div style="display: inline-block; width: 50px; height: 10px"></div><table class="m" style="display: inline-table; position: absolute"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></div>++<!-- 10: fixed table inside a transformed container -->+<div class="case"><div style="transform: translate(0); width: 400px; height: 100px"><table class="m" style="position: fixed; right: 10px; bottom: 10px"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></div>++<!-- 11: fixed table with insets inside a transformed container -->+<div class="case"><div style="transform: translate(0); width: 400px; height: 100px"><table class="m" style="position: fixed; left: 20px; right: 20px; top: 0"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></div>++<!-- 12: relatively positioned table -->+<div class="case"><table class="m" style="position: relative; left: 20px; top: 5px"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div>++<!-- 13: sticky table in a scroller -->+<div class="case"><div style="overflow: auto; height: 60px; width: 300px"><div style="width: 10px; height: 10px"></div><table class="m" style="position: sticky; top: 0"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table><div style="width: 10px; height: 100px"></div></div></div>++<!-- 14: left float table -->+<div class="case"><div style="width: 400px"><table class="m" style="float: left"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table><div class="m" style="height: 10px"></div></div></div>++<!-- 15: right float table with a percentage width -->+<div class="case"><div style="width: 400px"><table class="m" style="float: right; width: 25%"><tr><td class="m"><div style="width: 30px; height: 20px"></div></td></tr></table><div class="m" style="height: 10px"></div></div></div>++<!-- 16: two floated tables and wrapping -->+<div class="case"><div style="width: 200px"><table class="m" style="float: left"><tr><td class="m"><div style="width: 120px; height: 20px"></div></td></tr></table><table class="m" style="float: left"><tr><td class="m"><div style="width: 120px; height: 20px"></div></td></tr></table></div></div>++<!-- 17: float table with a margin next to a float -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><table class="m" style="float: left; margin-left: 10px"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div></div>++<!-- 18: block formatting context table next to two floats -->+<div class="case"><div style="width: 400px"><div style="float: left; width: 100px; height: 50px"></div><div style="float: right; width: 50px; height: 30px"></div><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div></div>++<!-- 19: float table with a caption-side bottom caption -->+<div class="case"><div style="width: 400px"><table class="m" style="float: right"><caption class="m" style="caption-side: bottom"><div style="width: 30px; height: 10px"></div></caption><tr><td class="m"><div style="width: 60px; height: 20px"></div></td></tr></table></div></div>++<!-- 20: float table that is too wide for the line beside a float -->+<div class="case"><div style="width: 300px"><div style="float: left; width: 200px; height: 30px"></div><table class="m" style="float: left"><tr><td class="m"><div style="width: 150px; height: 20px"></div></td></tr></table></div></div>++<!-- 21: table in a sized foreignObject -->+<div class="case"><svg xmlns="http://www.w3.org/2000/svg" width="300" height="150"><foreignObject width="200" height="100" x="10" y="20"><table class="m" style="width: 100%; height: 100%"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></foreignObject></svg></div>++<!-- 22: table with auto size in a foreignObject -->+<div class="case"><svg xmlns="http://www.w3.org/2000/svg" width="300" height="150"><foreignObject width="200" height="100"><table class="m" style=""><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></foreignObject></svg></div>++<!-- 23: table with a wide cell in a narrow foreignObject -->+<div class="case"><svg xmlns="http://www.w3.org/2000/svg" width="300" height="150"><foreignObject width="100" height="100"><table class="m" style=""><tr><td class="m"><div style="width: 150px; height: 20px"></div></td></tr></table></foreignObject></svg></div>++<!-- 24: svg with width and height attributes in a cell -->+<div class="case"><table class="m"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" width="80" height="40"></svg></td><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 25: block svg with only a viewBox in an auto-width table -->+<div class="case"><table class="m"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 1" style="display: block"></svg></td><td class="m"><div style="width: 20px; height: 20px"></div></td></tr></table></div>++<!-- 26: block svg with only a viewBox in a fixed-width table -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 1" style="display: block"></svg></td><td class="m"><div style="width: 100px; height: 20px"></div></td></tr></table></div>++<!-- 27: block svg with no size and no viewBox in a cell -->+<div class="case"><table class="m"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" style="display: block"></svg></td></tr></table></div>++<!-- 28: block svg with width: 100% and a viewBox in a fixed layout table -->+<div class="case"><table class="m" style="width: 300px; table-layout: fixed"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 1" style="display: block; width: 100%"></svg></td><td class="m"><div style="width: 10px; height: 10px"></div></td></tr></table></div>++<!-- 29: block svg with height: 100% and a viewBox in a fixed-height cell -->+<div class="case"><table class="m"><tr><td class="m" style="height: 100px"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 1" style="display: block; height: 100%"></svg></td></tr></table></div>++<!-- 30: block svg with max-width: 100% in a narrow fixed layout cell -->+<div class="case"><table class="m" style="width: 100px; table-layout: fixed"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" width="200" height="100" style="display: block; max-width: 100%; height: auto"></svg></td></tr></table></div>++<!-- 31: block svg with a percentage width attribute in an auto-width cell -->+<div class="case"><table class="m" style="width: 300px"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" width="50%" height="20" style="display: block"></svg></td><td class="m"><div style="width: 100px; height: 20px"></div></td></tr></table></div>++<!-- 32: block svg with an aspect-ratio and a width in a cell -->+<div class="case"><table class="m"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" style="display: block; width: 90px; aspect-ratio: 3"></svg></td></tr></table></div>++<!-- 33: block svg with an aspect-ratio and no width in a fixed-width table -->+<div class="case"><table class="m" style="width: 200px"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" style="display: block; aspect-ratio: 4"></svg></td></tr></table></div>++<!-- 34: inline svg with a viewBox and a height in a cell -->+<div class="case"><table class="m"><tr><td class="m" style="line-height: 0"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 1" style="height: 20px"></svg></td></tr></table></div>++<!-- 35: svg as a flex item in a cell -->+<div class="case"><table class="m"><tr><td class="m"><div class="m" style="display: flex; width: 200px"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" style="flex: 1"></svg><div style="width: 50px; height: 10px"></div></div></td></tr></table></div>++<!-- 36: table in a foreignObject in an svg in a cell -->+<div class="case"><table class="m"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" width="200" height="80" style="display: block"><foreignObject width="200" height="80"><table class="m" style="width: 100%"><tr><td class="m"><div style="width: 50px; height: 20px"></div></td></tr></table></foreignObject></svg></td></tr></table></div>++<!-- 37: svg in a cell of a table in a foreignObject -->+<div class="case"><svg xmlns="http://www.w3.org/2000/svg" width="300" height="150"><foreignObject width="300" height="150"><table class="m" style="width: 100%"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 1" style="display: block; width: 100%"></svg></td><td class="m"><div style="width: 100px; height: 10px"></div></td></tr></table></foreignObject></svg></div>++<!-- 38: abspos table in a foreignObject -->+<div class="case"><svg xmlns="http://www.w3.org/2000/svg" width="300" height="150"><foreignObject width="300" height="150"><div style="position: relative; height: 150px"><table class="m" style="position: absolute; right: 0; bottom: 0"><tr><td class="m"><div style="width: 40px; height: 20px"></div></td></tr></table></div></foreignObject></svg></div>++<!-- 39: abspos block svg with a viewBox and insets -->+<div class="case"><div style="position: relative; width: 400px; height: 100px"><table class="m" style="position: absolute; left: 0; top: 0; width: 200px"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 1" style="display: block"></svg></td></tr></table></div></div>++<!-- 40: floated table with a block svg with only a viewBox -->+<div class="case"><div style="width: 400px"><table class="m" style="float: left"><tr><td class="m"><svg class="m" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 1" style="display: block"></svg></td><td class="m"><div style="width: 30px; height: 30px"></div></td></tr></table></div></div>++</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect();+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.left - origin.left)},${Math.round(rect.top - origin.top)} ${Math.round(rect.width)}x${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" | ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>diff --git a/Tests/LibWeb/Text/input/table-row-block-size-distribution.html b/Tests/LibWeb/Text/input/table-row-block-size-distribution.htmlnew file mode 100644index 00000000000..d1a9b7e24fb--- /dev/null+++ b/Tests/LibWeb/Text/input/table-row-block-size-distribution.html@@ -0,0 +1,354 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ }+ table {+ border-spacing: 0;+ width: 200px;+ }+ td {+ padding: 0;+ vertical-align: top;+ }+ .table {+ display: table;+ width: 200px;+ }+ .row {+ display: table-row;+ }+ .cell {+ display: table-cell;+ }+ .case {+ margin-bottom: 10px;+ }+</style>+<div id="cases">+<!-- 1: block with content height and a 100% row in a fixed-height table -->+<div class="case"><div class="table m" style="height: 400px">+ <div class="m" style="height: 200px"></div>+ <div class="row m" style="height: 100%"><div style="height: 25px"></div></div>+</div></div>++<!-- 2: two 50% rows with small content -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50%"><td><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 50%"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 3: two 50% rows, one with content taller than its share -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50%"><td><div style="height: 250px"></div></td></tr>+ <tr class="m" style="height: 50%"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 4: two 100% rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 100%"><td><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 5: one 30% row and two auto rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 30%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+ <tr class="m"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 6: px row and % row whose sum exceeds the table height -->+<div class="case"><table class="m" style="height: 200px">+ <tr class="m" style="height: 150px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 80%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 7: px row and auto row in a taller table -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 8: % on cells instead of rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td style="height: 60%"><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 50px"></div></td></tr>+</table></div>++<!-- 9: 100% cell next to an auto row with content -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td><div style="height: 120px"></div></td></tr>+ <tr class="m"><td style="height: 100%"><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 10: % rows split across thead, tbody and tfoot -->+<div class="case"><table class="m" style="height: 300px">+ <thead><tr class="m" style="height: 20%"><td><div style="height: 10px"></div></td></tr></thead>+ <tbody><tr class="m" style="height: 100%"><td><div style="height: 30px"></div></td></tr>+ <tr class="m"><td><div style="height: 40px"></div></td></tr></tbody>+ <tfoot><tr class="m" style="height: 20%"><td><div style="height: 10px"></div></td></tr></tfoot>+</table></div>++<!-- 11: border-spacing with a 100% row -->+<div class="case"><table class="m" style="height: 300px; border-spacing: 10px">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 12: cell padding and borders with a 100% row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td style="padding: 10px; border: 5px solid"><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td style="padding: 10px"><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 13: border-box table with borders and a 100% row -->+<div class="case"><div class="table m" style="height: 300px; box-sizing: border-box; border: 10px solid">+ <div class="row m"><div class="cell"><div style="height: 100px"></div></div></div>+ <div class="row m" style="height: 100%"><div class="cell"><div style="height: 10px"></div></div></div>+</div></div>++<!-- 14: % row next to a row spanned by a rowspan cell -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50%"><td rowspan="2"><div style="height: 200px"></div></td><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 15: % rows in an auto-height table -->+<div class="case"><table class="m">+ <tr class="m" style="height: 100%"><td><div style="height: 30px"></div></td></tr>+ <tr class="m"><td><div style="height: 50px"></div></td></tr>+</table></div>++<!-- 16: table height smaller than its auto rows -->+<div class="case"><table class="m" style="height: 50px">+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+ <tr class="m"><td><div style="height: 60px"></div></td></tr>+</table></div>++<!-- 17: only px rows, smaller than the table height -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 100px"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 18: min-height on the table with a 100% row -->+<div class="case"><table class="m" style="min-height: 300px">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 19: nested anonymous tables with height: inherit, like a card layout -->+<div class="case"><div style="width: 300px; height: 500px">+ <div class="table m" style="height: 100%; width: 100%">+ <div class="m" style="height: 150px"></div>+ <div class="row m" style="height: 100%">+ <div style="height: inherit">+ <div class="table m" style="height: inherit; width: 100%">+ <div class="m" style="margin: 30px 0"><div style="height: 75px"></div></div>+ <div class="row m" style="height: inherit"><div style="height: 50px"></div></div>+ </div>+ </div>+ </div>+ </div>+</div></div>++<!-- 20: 200% row -->+<div class="case"><table class="m" style="height: 200px">+ <tr class="m"><td><div style="height: 50px"></div></td></tr>+ <tr class="m" style="height: 200%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 21: two 25% rows, one with tall content, and an auto row -->+<div class="case"><table class="m" style="height: 400px">+ <tr class="m" style="height: 25%"><td><div style="height: 200px"></div></td></tr>+ <tr class="m" style="height: 25%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 30px"></div></td></tr>+</table></div>++<!-- 22: % rows summing over 100% with an auto row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 70%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 60%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+</table></div>++<!-- 23: rows with height: inherit from a fixed-height table -->+<div class="case"><div class="table m" style="height: 250px">+ <div class="row m" style="height: inherit"><div class="cell"><div style="height: 100px"></div></div></div>+ <div class="row m" style="height: inherit"><div class="cell"><div style="height: 50px"></div></div></div>+</div></div>++<!-- 24: two % rows and a px row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 40%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 40%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 100px"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 25: empty % rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 10%"><td></td></tr>+ <tr class="m" style="height: 100%"><td></td></tr>+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+</table></div>++<!-- 26: px row taller than its content and a 100% row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 120px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 27: px cell and % cell in the same row, plus a 100% row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td style="height: 80px"><div style="height: 10px"></div></td><td style="height: 30%"><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 100%"><td colspan="2"><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 28: border-collapse with a 100% row -->+<div class="case"><table class="m" style="height: 300px; border-collapse: collapse">+ <tr class="m"><td style="border: 4px solid"><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td style="border: 4px solid"><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 29: % row in a table with max-height lower than its height -->+<div class="case"><table class="m" style="height: 400px; max-height: 200px">+ <tr class="m"><td><div style="height: 50px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 30: % row with tall content and an auto row with tall content, table too small -->+<div class="case"><table class="m" style="height: 200px">+ <tr class="m" style="height: 50%"><td><div style="height: 150px"></div></td></tr>+ <tr class="m"><td><div style="height: 150px"></div></td></tr>+</table></div>++<!-- 31: 100% row with tall content followed by a 50% row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 100%"><td><div style="height: 200px"></div></td></tr>+ <tr class="m" style="height: 50%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 32: two auto rows with different content -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+ <tr class="m"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 33: an empty auto row and an auto row with content -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m"><td></td></tr>+ <tr class="m"><td><div style="height: 40px"></div></td></tr>+</table></div>++<!-- 34: px row and small % row, without auto rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 10%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 35: auto thead row and % tbody row -->+<div class="case"><table class="m" style="height: 300px">+ <thead><tr class="m"><td><div style="height: 30px"></div></td></tr></thead>+ <tbody><tr class="m" style="height: 50%"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr></tbody>+</table></div>++<!-- 36: rowspan cell across three auto rows -->+<div class="case"><table class="m" style="height: 250px">+ <tr class="m"><td rowspan="3"><div style="height: 200px"></div></td><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 37: two px rows with an auto row -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 100px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 38: rowspan cell across a % row and an auto row, in a taller table -->+<div class="case"><table class="m" style="height: 400px">+ <tr class="m"><td rowspan="2"><div style="height: 200px"></div></td><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 25%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 39: 100% block in an auto row -->+<div class="case"><table class="m" style="height: 400px">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m"><td><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 40: 100% block in a 100% row -->+<div class="case"><table class="m" style="height: 400px">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m" style="height: 100%"><td><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 41: 100% block in a 100% cell -->+<div class="case"><table class="m" style="height: 400px">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m"><td style="height: 100%"><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 42: 100% block in an auto-height table -->+<div class="case"><table class="m">+ <tr class="m"><td><div style="height: 100px"></div></td></tr>+ <tr class="m"><td><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 43: 50% block in a 100% row of a table in a fixed-height block -->+<div class="case"><div style="height: 300px"><div class="table m" style="height: 100%; width: 200px">+ <div class="row m" style="height: 100%"><div class="cell"><div class="m" style="height: 50%"><div style="height: 20px"></div></div></div></div>+ <div class="row m"><div class="cell"><div style="height: 50px"></div></div></div>+</div></div></div>++<!-- 44: px row and 50% row, without auto rows -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 50px"><td><div style="height: 10px"></div></td></tr>+ <tr class="m" style="height: 50%"><td><div style="height: 10px"></div></td></tr>+</table></div>++<!-- 45: 100% block in a px row -->+<div class="case"><table class="m">+ <tr class="m" style="height: 100px"><td><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 46: 100% inline-block in a px row -->+<div class="case"><table class="m">+ <tr class="m" style="height: 100px"><td><div class="m" style="display: inline-block; vertical-align: top; width: 20px; height: 100%"></div></td></tr>+</table></div>++<!-- 47: 100% block in a px cell -->+<div class="case"><table class="m">+ <tr class="m"><td style="height: 100px"><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+</table></div>++<!-- 48: 100% block in a px row of a fixed-height table -->+<div class="case"><table class="m" style="height: 300px">+ <tr class="m" style="height: 100px"><td><div class="m" style="height: 100%"><div style="height: 20px"></div></div></td></tr>+ <tr class="m"><td><div style="height: 20px"></div></td></tr>+</table></div>++<!-- 49: 50% block in a 100% cell of an auto-height table -->+<div class="case"><table class="m">+ <tr class="m"><td style="height: 100%"><div class="m" style="height: 50%"><div style="height: 20px"></div></div></td></tr>+</table></div>+</div>+<script src="include.js"></script>+<script>+ test(() => {+ const cases = document.querySelectorAll(".case");+ cases.forEach((c, index) => {+ const origin = c.getBoundingClientRect().top;+ const parts = [];+ for (const element of c.querySelectorAll(".m")) {+ const rect = element.getBoundingClientRect();+ parts.push(`${Math.round(rect.top - origin)}+${Math.round(rect.height)}`);+ }+ println(`${index + 1}: ${parts.join(" ")}`);+ });+ document.getElementById("cases").remove();+ });+</script>