aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoungsoo Son <ysoo.son@samsung.com>2014-01-24 16:24:15 +0900
committerJunyoung Cho <june0.cho@samsung.com>2014-03-24 15:49:12 +0900
commite5333fca2da8b86ea11d43f04280187fd12b09f5 (patch)
tree8b4d67289f2748d89c72bac83cb3387b910171f6 /src
parent8dbec501781aa44256cce786e90f0704e06dbac1 (diff)
downloadservo-e5333fca2da8b86ea11d43f04280187fd12b09f5.tar.gz
servo-e5333fca2da8b86ea11d43f04280187fd12b09f5.zip
Add fixed table test cases
Diffstat (limited to 'src')
-rw-r--r--src/test/html/fixed_table.html36
-rw-r--r--src/test/html/fixed_table_2.html36
-rw-r--r--src/test/html/fixed_table_additional_cols.html39
-rw-r--r--src/test/html/fixed_table_basic_height.html40
-rw-r--r--src/test/html/fixed_table_simple.html30
-rw-r--r--src/test/html/fixed_table_with_margin_padding.html50
6 files changed, 231 insertions, 0 deletions
diff --git a/src/test/html/fixed_table.html b/src/test/html/fixed_table.html
new file mode 100644
index 00000000000..d6b7e678a9b
--- /dev/null
+++ b/src/test/html/fixed_table.html
@@ -0,0 +1,36 @@
+<!-- This test creates one table, one caption, three rows, three header cells, and five data cells.
+ The table uses the fixed table layout algorithm and the table's width specified to 600px.
+ Each column's width will be assigned as follows:
+ - 1st column: 200px (because it is defined in col element)
+ - 2nd column: 100px (because it is defined in first row)
+ - 3rd column: remaining width (becuase it is not defined so the remaining width is assigned)
+ And table, caption, td, th elements have border. -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Fixed Table</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ }
+ caption { border: solid blue 1px; }
+ td { border: solid red 1px; }
+ th { border: solid red 1px; }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This is a 3x3 fixed table</caption>
+ <colgroup>
+ <col style="width: 200px" />
+ </colgroup>
+ <tbody>
+ <tr><th style="width: 100px">Header 1</th><td style="width: 100px">Cell 1</td><td>Cell 2</td></tr>
+ <tr><th style="width: 300px">Header 2</th><td style="width: 300px">Cell 3</th><td>Cell 4</td></tr>
+ <tr><th>Header 3</th><td>Cell 5</th></tr>
+ </tbody>
+ </table>
+ </body>
+<html>
diff --git a/src/test/html/fixed_table_2.html b/src/test/html/fixed_table_2.html
new file mode 100644
index 00000000000..0a5d28d6ad6
--- /dev/null
+++ b/src/test/html/fixed_table_2.html
@@ -0,0 +1,36 @@
+<!-- This test creates one table, one caption, three rows, three header cells, and five data cells.
+ The table uses the fixed table layout algorithm and the table's width specified to 600px.
+ Each column's width will be assigned according to their ratio of column's widths
+ which are defined in col elements.
+ And table, caption, td, th elements have border. -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Fixed Table</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ }
+ caption { border: solid blue 1px; }
+ td { border: solid red 1px; }
+ th { border: solid red 1px; }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This is a 3x3 fixed table</caption>
+ <colgroup>
+ <col style="width: 10px" />
+ <col style="width: 20px" />
+ <col style="width: 30px" />
+ </colgroup>
+ <tbody>
+ <tr><th style="width: 100px">Header 1</th><td style="width: 100px">Cell 1</td><td>Cell 2</td></tr>
+ <tr><th style="width: 300px">Header 2</th><td style="width: 300px">Cell 3</th><td>Cell 4</td></tr>
+ <tr><th>Header 3</th><td>Cell 5</th></tr>
+ </tbody>
+ </table>
+ </body>
+<html>
diff --git a/src/test/html/fixed_table_additional_cols.html b/src/test/html/fixed_table_additional_cols.html
new file mode 100644
index 00000000000..cca70af353f
--- /dev/null
+++ b/src/test/html/fixed_table_additional_cols.html
@@ -0,0 +1,39 @@
+<!-- This test creates one table, one caption, three rows, three header cells, and five data cells.
+ The table uses the fixed table layout algorithm and the table's width specified to 600px.
+ Each column's width will be assigned as follows:
+ - 1st & 2nd column: 200px (because it is defined in col element)
+ - 3rd & 4th column: remaining width / 2
+ (becuase it is not defined so the remaining width is equally divided)
+ And table, caption, td, th elements have border. -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Fixed Table</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ }
+ caption { border: solid blue 1px; }
+ td { border: solid red 1px; }
+ th { border: solid red 1px; }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This is a 3x4 fixed table</caption>
+ <colgroup>
+ <col style="width: 200px" />
+ <col style="width: 200px" />
+ <col />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr><th>Header 1</th><td>Cell 1</td><td>Cell 2</td></tr>
+ <tr><th>Header 2</th><td>Cell 3</th><td>Cell 4</td></tr>
+ <tr><th>Header 3</th><td>Cell 5</th></tr>
+ </tbody>
+ </table>
+ </body>
+<html>
diff --git a/src/test/html/fixed_table_basic_height.html b/src/test/html/fixed_table_basic_height.html
new file mode 100644
index 00000000000..2e2712b01c5
--- /dev/null
+++ b/src/test/html/fixed_table_basic_height.html
@@ -0,0 +1,40 @@
+<!-- This test creates one table, three rows, three header cells, and six data cells.
+ The table uses the fixed table layout algorithm and the table's width specified to 600px.
+ Each column's width will be assigned as 200px.
+ Each table row height is decided as max(specified row height, specified cells' heights, cells' minimum content heights).
+ As a result, each table row height will be assigned as followings:
+ - 1st row: 30px (specified cell height)
+ - 2nd row: 50px (specified row height)
+ - 3rd row: minimum content height
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Table Height Test</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ }
+ caption {
+ border: solid blue 1px;
+ }
+ td, th {
+ border: solid red 1px;
+ padding: 0px;
+ }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This test checks table height algorithm (CSS 2.1, Section 17.5.3),
+ excluding `vertical-align` and percentage height</caption>
+ <tbody>
+ <tr style="height:10px"><th>Header 1</th><td style="height: 30px">Cell 1</td><td>Cell 2</td></tr>
+ <tr style="height:50px"><th>Header 2</th><td>Cell 3</td><td style="height:10px">Cell 4</td></tr>
+ <tr style="height:20px"><th>Header 3</th><td style="height:10px">Cell 5</td><td><div>Cell6</div><p>Cell6</td></tr>
+ </tbody>
+ </table>
+ </body>
+<html>
diff --git a/src/test/html/fixed_table_simple.html b/src/test/html/fixed_table_simple.html
new file mode 100644
index 00000000000..811d6a0bb75
--- /dev/null
+++ b/src/test/html/fixed_table_simple.html
@@ -0,0 +1,30 @@
+<!-- This test creates one table, one caption, three rows, three header cells, and six data cells.
+ The table uses fixed table layout algorithm and the table's width specified to 600px.
+ Each column should have same width because the column's widths are not defined here.
+ And table, caption, td, th elements have border. -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Simple Fixed Table</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ }
+ caption { border: solid blue 1px; }
+ td { border: solid red 1px; }
+ th { border: solid red 1px; }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This is a 3x3 fixed table</caption>
+ <tbody>
+ <tr><th>Header 1</th><td>Cell 1</td><td>Cell 2</td></tr>
+ <tr><th>Header 2</th><td>Cell 3</td><td>Cell 4</td></tr>
+ <tr><th>Header 3</th><td>Cell 5</td><td>Cell 6</td></tr>
+ </tbody>
+ </table>
+ </body>
+<html>
diff --git a/src/test/html/fixed_table_with_margin_padding.html b/src/test/html/fixed_table_with_margin_padding.html
new file mode 100644
index 00000000000..8dff2cc96bf
--- /dev/null
+++ b/src/test/html/fixed_table_with_margin_padding.html
@@ -0,0 +1,50 @@
+<!-- This test creates one table, one caption, three rows, three header cells, and five data cells.
+ The table uses the fixed table layout algorithm and the table's width specified to 600px.
+ Each column's width will be assigned as follows:
+ - 1st column: 200px (because it is defined in col element)
+ - 2nd column: 100px (because it is defined in first row)
+ - 3rd column: remaining width (becuase it is not defined so the remaining width is assigned)
+ The table and caption elements have border, margin, and padding.
+ The td and th elements have border and padding. -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Fixed Table with margin, border, and padding</title>
+ <style>
+ table {
+ table-layout: fixed;
+ width: 600px;
+ border: solid black 2px;
+ margin: 10px;
+ padding: 10px;
+ }
+ caption {
+ border: solid blue 1px;
+ margin: 5px;
+ padding: 5px;
+ }
+ td {
+ border: solid red 1px;
+ padding: 5px;
+ }
+ th {
+ border: solid red 1px;
+ padding: 5px;
+ }
+ </style>
+ </head>
+ <body>
+ <table>
+ <caption>This is a 3x3 fixed table with margin, border, and padding</caption>
+ <colgroup>
+ <col style="width: 200px" />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr><th style="width: 100px">Header 1</th><td style="width: 100px">Cell 1</td><td>Cell 2</td></tr>
+ <tr><th>Header 2</th><td>Cell 3</td><td>Cell 4</td></tr>
+ <tr><th>Header 3</th><td>Cell 5</td></tr>
+ </tbody>
+ </table>
+ </body>
+<html>