OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Node.parentElement</title> | 2 <title>Node.parentElement</title> |
3 <link rel="stylesheet" href="../../../../resources/testharness.css"> | |
4 <script src="../../../../resources/testharness.js"></script> | 3 <script src="../../../../resources/testharness.js"></script> |
5 <script src="../../../../resources/testharnessreport.js"></script> | 4 <script src="../../../../resources/testharnessreport.js"></script> |
6 <div id="log"></div> | 5 <div id="log"></div> |
7 <script> | 6 <script> |
8 test(function() { | 7 test(function() { |
9 assert_equals(document.parentElement, null) | 8 assert_equals(document.parentElement, null) |
10 }, "When the parent is null, parentElement should be null") | 9 }, "When the parent is null, parentElement should be null") |
11 test(function() { | 10 test(function() { |
12 assert_equals(document.doctype.parentElement, null) | 11 assert_equals(document.doctype.parentElement, null) |
13 }, "When the parent is a document, parentElement should be null (doctype)") | 12 }, "When the parent is a document, parentElement should be null (doctype)") |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 document.body.appendChild(el) | 73 document.body.appendChild(el) |
75 assert_equals(el.parentElement, document.body) | 74 assert_equals(el.parentElement, document.body) |
76 }, "parentElement should work correctly in a document (element)") | 75 }, "parentElement should work correctly in a document (element)") |
77 test(function() { | 76 test(function() { |
78 var text = document.createElement("div") | 77 var text = document.createElement("div") |
79 assert_equals(text.parentElement, null) | 78 assert_equals(text.parentElement, null) |
80 document.body.appendChild(text) | 79 document.body.appendChild(text) |
81 assert_equals(text.parentElement, document.body) | 80 assert_equals(text.parentElement, document.body) |
82 }, "parentElement should work correctly in a document (text)") | 81 }, "parentElement should work correctly in a document (text)") |
83 </script> | 82 </script> |
OLD | NEW |