diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html')
-rw-r--r-- | testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html b/testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html new file mode 100644 index 0000000000..f0c96dd707 --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/html5-table-formatting-1.html @@ -0,0 +1,98 @@ +<!doctype html> +<script src='/resources/testharness.js'></script> +<script src='/resources/testharnessreport.js'></script> +<link rel='stylesheet' href='./support/base.css' /> +<link rel="help" href="https://drafts.csswg.org/css-tables-3/#table-layout-algorithm"> +<main> + + <h1>HTML5 Table Formatting algorithm (row/column grid computation)</h1> + <p>Verifies how browser define and act on empty tables</p> + + <hr/> + <p>This should be a 50px by 50px blue square:</p> + <p>The table grid is 0x0, so the table is empty and follows step 3B of the table layout algorithm</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"></x-table> + + <hr/> + <p>This should be a 50px by 50px blue square:</p> + <p>The table grid is 2x0, so the table is empty and follows step 3B of the table layout algorithm</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"> + <x-col style="width: 100px"></x-col> + <x-col style="width: 100px"></x-col> + </x-table> + + <hr/> + <p>This should be a 50px by 50px blue square:</p> + <p>The table grid is 0x1, so the table is empty and follows step 3B of the table layout algorithm</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"> + <x-tr style="height: 100px; background: orange;"></x-tr> + </x-table> + + <hr/> + <p>This should be a 200px by 100px blue rectangle:</p> + <p>The table grid is 2x1, so the table is not empty and follows step 3A of the table layout algorithm (which adds anonymous cell boxes)</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"> + <x-col style="width: 100px"></x-col> + <x-col style="width: 100px"></x-col> + <x-tr style="height: 100px; background: orange;"></x-tr> + </x-table> + + <hr/> + <p>This should be a 200px by 100px half-blue half-orange rectangle:</p> + <p>The table grid is 2x1, so the table is not empty and follows step 3A of the table layout algorithm (which adds anonymous cell boxes)</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"> + <x-col style="width: 100px"></x-col> + <x-col style="width: 100px"></x-col> + <x-tr style="height: 100px; background: orange;"><x-td></x-td></x-tr> + </x-table> + + <hr/> + <p>This should be a 200px by 100px orange rectangle:</p> + <p>The table grid is 2x1, so the table is not empty and follows step 3A of the table layout algorithm (which adds anonymous cell boxes)</p> + <x-table style="min-width: 50px; height: 50px; background: blue;"> + <x-col style="width: 100px"></x-col> + <x-col style="width: 100px"></x-col> + <x-tr style="height: 100px; background: orange;"><x-td></x-td><x-td></x-td></x-tr> + </x-table> + +</main> + +<script> + + generate_tests(assert_equals, [ + [ + "Empty tables can still get a lsyout", + document.querySelector("x-table:nth-of-type(1)").offsetWidth, + 50 + ], + [ + "Empty tables do not take table-columns into account", + document.querySelector("x-table:nth-of-type(2)").offsetWidth, + 50 + ], + [ + "Empty tables do not take table-rows into account", + document.querySelector("x-table:nth-of-type(3)").offsetHeight, + 50 + ], + ]) + + generate_tests(assert_equals, [ + [ + "Table-columns are taken into account after missing cells are generated (empty line)", + document.querySelector("x-table:nth-of-type(4)").offsetWidth, + 200 + ], + [ + "Table-columns are taken into account after missing cells are generated (partially empty line)", + document.querySelector("x-table:nth-of-type(5)").offsetWidth, + 200 + ], + [ + "Table-columns are taken into account after missing cells are generated (non-empty line)", + document.querySelector("x-table:nth-of-type(6)").offsetWidth, + 200 + ], + ]) + +</script> |