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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.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 <meta charset=utf-8>
3 <title>HTMLTableCellElement.cellIndex</title>
4 <script src="../../../../../../resources/testharness.js"></script>
5 <script src="../../../../../../resources/testharnessreport.js"></script>
6 <div id="log"></div>
7 <script>
8 test(function() {
9 var th = document.createElement("th");
10 assert_true("cellIndex" in th, '"cellIndex" in th');
11 var td = document.createElement("td");
12 assert_true("cellIndex" in td, '"cellIndex" in td');
13 }, "cellIndex should exist.")
14 test(function() {
15 var th = document.createElement("th");
16 assert_equals(th.cellIndex, -1);
17 var td = document.createElement("td");
18 assert_equals(td.cellIndex, -1);
19 }, "For cells without a parent, cellIndex should be -1.")
20 test(function() {
21 var table = document.createElement("table");
22 var th = table.appendChild(document.createElement("th"));
23 assert_equals(th.cellIndex, -1);
24 var td = table.appendChild(document.createElement("td"));
25 assert_equals(td.cellIndex, -1);
26 }, "For cells whose parent is not a tr, cellIndex should be -1.")
27 test(function() {
28 var tr = document.createElementNS("", "tr");
29 var th = tr.appendChild(document.createElement("th"));
30 assert_equals(th.cellIndex, -1);
31 var td = tr.appendChild(document.createElement("td"));
32 assert_equals(td.cellIndex, -1);
33 }, "For cells whose parent is not a HTML tr, cellIndex should be -1.")
34 test(function() {
35 var tr = document.createElement("tr");
36 var th = tr.appendChild(document.createElement("th"));
37 assert_equals(th.cellIndex, 0);
38 var td = tr.appendChild(document.createElement("td"));
39 assert_equals(td.cellIndex, 1);
40 }, "For cells whose parent is a tr, cellIndex should be the index.")
41 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698