summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/semantics/tabular-data/the-caption-element
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/semantics/tabular-data/the-caption-element')
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep0
-rw-r--r--testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html70
2 files changed, 70 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/.gitkeep
diff --git a/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html
new file mode 100644
index 000000000..ecb1bef85
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/tabular-data/the-caption-element/caption_001.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTML5 Table API Tests</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-caption-element" />
+ </head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <body>
+ <div id="log"></div>
+ <table id="table1" style="display:none">
+ <tr><td></td></tr>
+ <caption>first caption</caption>
+ <caption>second caption</caption>
+ </table>
+ <table id="table2" style="display:none">
+ <tr><td></td></tr>
+ </table>
+ <table id="table3" style="display:none">
+ <tr><td></td></tr>
+ </table>
+ <table id="table4" style="display:none">
+ <tr><td></td></tr>
+ <caption>first caption</caption>
+ </table>
+ <script>
+ test(function () {
+ assert_equals(document.getElementById('table1').caption.innerHTML, "first caption");
+ }, "first caption element child of the first table element");
+
+ test(function () {
+ var caption = document.createElement("caption");
+ caption.innerHTML = "new caption";
+ var table = document.getElementById('table1');
+ table.caption = caption;
+
+ assert_equals(caption.parentNode, table);
+ assert_equals(table.firstChild, caption);
+ assert_equals(table.caption.innerHTML, "new caption");
+
+ captions = table.getElementsByTagName('caption');
+ assert_equals(captions.length, 2);
+ assert_equals(captions[0].innerHTML, "new caption");
+ assert_equals(captions[1].innerHTML, "second caption");
+ }, "setting caption on a table");
+
+ test(function () {
+ assert_equals(document.getElementById('table2').caption, null);
+ }, "caption IDL attribute is null");
+
+ test(function () {
+ var table = document.getElementById('table3');
+ var caption = document.createElement("caption")
+ table.rows[0].appendChild(caption);
+ assert_equals(table.caption, null);
+ }, "caption of the third table element should be null");
+
+ test(function () {
+ assert_not_equals(document.getElementById('table4').caption, null);
+
+ var parent = document.getElementById('table4').caption.parentNode;
+ parent.removeChild(document.getElementById('table4').caption);
+
+ assert_equals(document.getElementById('table4').caption, null);
+ }, "dynamically removing caption on a table");
+ </script>
+ </body>
+</html>