Setting table layout to fixed causes incorrect cell width calculations
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 22:23:24 +0000 (22:23 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 22:23:24 +0000 (22:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90068

Reviewed by Simon Fraser.

Derived from the test case written by Pravin D.

Add a test case to ensure we do not regress cell width computation in fixed table layout
when colspan is greater than the number of columns in the table.

* fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns-expected.html: Added.
* fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234630 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns-expected.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns.html [new file with mode: 0644]

index 341ebc1..d06537c 100644 (file)
@@ -1,5 +1,20 @@
 2018-08-06  Daniel Bates  <dabates@apple.com>
 
+        Setting table layout to fixed causes incorrect cell width calculations
+        https://bugs.webkit.org/show_bug.cgi?id=90068
+
+        Reviewed by Simon Fraser.
+
+        Derived from the test case written by Pravin D.
+
+        Add a test case to ensure we do not regress cell width computation in fixed table layout
+        when colspan is greater than the number of columns in the table.
+
+        * fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns-expected.html: Added.
+        * fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns.html: Added.
+
+2018-08-06  Daniel Bates  <dabates@apple.com>
+
         Add tests to ensure that Same-Site cookies are stored when set as the first party
         https://bugs.webkit.org/show_bug.cgi?id=188080
 
diff --git a/LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns-expected.html b/LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns-expected.html
new file mode 100644 (file)
index 0000000..6ff7de2
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+table, tr, td {
+    border: 1px solid black;
+}
+
+td {
+    width: 1%;
+}
+table {
+    background: red;
+}
+tr {
+    background: green;
+    height: 35px;
+}
+</style>
+</head>
+<body>
+<p>This test verifies that the width of table cells are computed correctly in fixed table layout regardless of whether colspan &gt; than the number of columns.</p>
+<table cellspacing="0" cellspacing="0" width="100%" style="table-layout: fixed;">
+    <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td style="width:94%;"></td>
+    </tr>
+    <tr>
+        <td colspan="7" style="height:24px;width:100%"></td>
+    </tr>
+</table>
+</body>
+</html>
diff --git a/LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns.html b/LayoutTests/fast/table/fixed-table-layout/width-distribution-when-colspan-greater-than-table-columns.html
new file mode 100644 (file)
index 0000000..ea61a6a
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+table, tr, td {
+    border: 1px solid black;
+}
+
+td {
+    width: 1%;
+}
+table {
+    background: red;
+}
+tr {
+    background: green;
+    height: 35px;
+}
+</style>
+</head>
+<body>
+<p>This test verifies that the width of table cells are computed correctly in fixed table layout regardless of whether colspan &gt; than the number of columns.</p>
+<table cellspacing="0" cellspacing="0" width="100%" style="table-layout: fixed;">
+    <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td style="width:94%;"></td>
+    </tr>
+    <tr>
+        <td colspan="10" style="height:24px;width:100%"></td>
+    </tr>
+</table>
+</body>
+</html>