Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-caption-element/caption_001.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>HTML5 Table API Tests</title>
5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-caption-e lement" />
8 </head>
9 <script src="../../../../../../resources/testharness.js"></script>
10 <script src="../../../../../../resources/testharnessreport.js"></script>
11 <body>
12 <div id="log"></div>
13 <table id="table1" style="display:none">
14 <tr><td></td></tr>
15 <caption>first caption</caption>
16 <caption>second caption</caption>
17 </table>
18 <table id="table2" style="display:none">
19 <tr><td></td></tr>
20 </table>
21 <table id="table3" style="display:none">
22 <tr><td></td></tr>
23 </table>
24 <table id="table4" style="display:none">
25 <tr><td></td></tr>
26 <caption>first caption</caption>
27 </table>
28 <script>
29 test(function () {
30 assert_equals(document.getElementById('table1').caption.innerHTML, "firs t caption");
31 }, "first caption element child of the first table element");
32
33 test(function () {
34 var caption = document.createElement("caption");
35 caption.innerHTML = "new caption";
36 var table = document.getElementById('table1');
37 table.caption = caption;
38
39 assert_equals(caption.parentNode, table);
40 assert_equals(table.caption.innerHTML, "new caption");
41
42 captions = table.getElementsByTagName('caption');
43 assert_equals(captions.length, 2);
44 assert_equals(captions[0].innerHTML, "new caption");
45 assert_equals(captions[1].innerHTML, "second caption");
46 }, "setting caption on a table");
47
48 test(function () {
49 assert_equals(document.getElementById('table2').caption, null);
50 }, "caption IDL attribute is null");
51
52 test(function () {
53 var table = document.getElementById('table3');
54 var caption = document.createElement("caption")
55 table.rows[0].appendChild(caption);
56 assert_equals(table.caption, null);
57 }, "caption of the third table element should be null");
58
59 test(function () {
60 assert_not_equals(document.getElementById('table4').caption, null);
61
62 var parent = document.getElementById('table4').caption.parentNode;
63 parent.removeChild(document.getElementById('table4').caption);
64
65 assert_equals(document.getElementById('table4').caption, null);
66 }, "dynamically removing caption on a table");
67 </script>
68 </body>
69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698