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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/tabular-data/html-table-section-element.js

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // https://html.spec.whatwg.org/multipage/#dom-tbody-rows 1 // https://html.spec.whatwg.org/multipage/#dom-tbody-rows
2 function testRowsAttribute(localName) { 2 function testRowsAttribute(localName) {
3 var elem = document.createElement(localName); 3 var elem = document.createElement(localName);
4 assert_equals(elem.rows.length, 0); 4 assert_equals(elem.rows.length, 0);
5 5
6 // Child <p> should *not* count as a row 6 // Child <p> should *not* count as a row
7 elem.appendChild(document.createElement("p")); 7 elem.appendChild(document.createElement("p"));
8 assert_equals(elem.rows.length, 0); 8 assert_equals(elem.rows.length, 0);
9 9
10 // Child <tr> should count as a row 10 // Child <tr> should count as a row
11 var childTr = document.createElement("tr"); 11 var childTr = document.createElement("tr");
12 elem.appendChild(childTr); 12 elem.appendChild(childTr);
13 assert_equals(elem.rows.length, 1); 13 assert_equals(elem.rows.length, 1);
14 14
15 // Nested table with child <tr> should *not* count as a row 15 // Nested table with child <tr> should *not* count as a row
16 var nested = document.createElement(localName); 16 var nested = document.createElement(localName);
17 nested.appendChild(document.createElement("tr")); 17 nested.appendChild(document.createElement("tr"));
18 var nestedTable = document.createElement("table"); 18 var nestedTable = document.createElement("table");
19 nestedTable.appendChild(nested); 19 nestedTable.appendChild(nested);
20 childTr.appendChild(nestedTable); 20 childTr.appendChild(nestedTable);
21 assert_equals(elem.rows.length, 1); 21 assert_equals(elem.rows.length, 1);
22 } 22 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698