| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| |
| description("This test checks the implementation of the element traversal APIs on CharacterData as part of the NonDocumentTypeChildNode interface."); |
| |
| var children = document.createElement('div'); |
| var firstTextNode = document.createTextNode('first text node'); |
| children.appendChild(firstTextNode); |
| var element = document.createElement('p'); |
| children.appendChild(element); |
| children.appendChild(document.createComment("a comment")); |
| var lastTextNode = document.createTextNode('last text node'); |
| children.appendChild(lastTextNode); |
| children.appendChild(document.createComment("last comment")); |
| |
| shouldBe("firstTextNode.previousElementSibling", "null"); |
| shouldBe("firstTextNode.nextElementSibling", "element"); |
| shouldBe("firstTextNode.nextElementSibling.nextElementSibling", "null"); |
| shouldBe("lastTextNode.previousElementSibling", "element"); |
| shouldBe("lastTextNode.previousElementSibling.previousElementSibling", "null"); |
| shouldBe("lastTextNode.nextElementSibling", "null"); |
| |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |