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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-table-element/tBodies.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 <title>HTMLTableElement.tBodies</title>
3 <script src="../../../../../../resources/testharness.js"></script>
4 <script src="../../../../../../resources/testharnessreport.js"></script>
5 <div id="log"></div>
6 <script>
7 test(function() {
8 var text =
9 '<html xmlns="http://www.w3.org/1999/xhtml">' +
10 ' <head>' +
11 ' <title>Virtual Library</title>' +
12 ' </head>' +
13 ' <body>' +
14 ' <table id="mytable" border="1">' +
15 ' <tbody>' +
16 ' <tr><td>Cell 1</td><td>Cell 2</td></tr>' +
17 ' <tr><td>Cell 3</td><td>Cell 4</td></tr>' +
18 ' </tbody>' +
19 ' </table>' +
20 ' </body>' +
21 '</html>';
22
23 var parser = new DOMParser();
24 var doc = parser.parseFromString(text, "text/xml");
25
26 // import <table>
27 var table = doc.documentElement.getElementsByTagName('table')[0];
28 var mytable = document.body.appendChild(document.importNode(table, true));
29
30 assert_equals(mytable.tBodies.length, 1);
31 var tbody = document.createElement('tbody');
32 mytable.appendChild(tbody);
33 var tr = tbody.insertRow(-1);
34 tr.insertCell(-1).appendChild(document.createTextNode('Cell 5'));
35 tr.insertCell(-1).appendChild(document.createTextNode('Cell 6'));
36 assert_equals(mytable.tBodies.length, 2);
37 assert_equals(mytable.rows.length, 3);
38 assert_equals(tr.rowIndex, 2);
39 });
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698