mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
46
tests/content/test_document_head.html
Normal file
46
tests/content/test_document_head.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="harness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// test1: existing document's head
|
||||
{
|
||||
is_not(document.head, null, "test1-0, existing document's head");
|
||||
is_a(document.head, HTMLHeadElement, "test1-1, exising document's head");
|
||||
is(document.head && document.head.tagName, "HEAD", "test1-2, existing document's head");
|
||||
}
|
||||
|
||||
// test2: append head to a new document
|
||||
{
|
||||
let new_document = new Document();
|
||||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_head = new_document.createElement("head");
|
||||
|
||||
is_not(new_head, null, "test2-0, append head to a new document");
|
||||
is_a(new_head, HTMLHeadElement, "test2-1, append head to a new document");
|
||||
is(new_head && new_head.tagName, "head", "test2-2, append head to a new document");
|
||||
|
||||
// Document::head is read-only.
|
||||
new_document.head = new_head;
|
||||
is(new_document.head, null, "test2-3, append head to a new document");
|
||||
|
||||
new_document.documentElement.appendChild(new_head);
|
||||
is(new_document.head, new_head, "test2-4, append head to a new document");
|
||||
}
|
||||
|
||||
// test3: head's parent should be document element
|
||||
{
|
||||
let new_document = new Document();
|
||||
let html = new_document.createElement("html");
|
||||
let foo = new_document.createElement("foo");
|
||||
let head = new_document.createElement("head");
|
||||
new_document.appendChild(html);
|
||||
html.appendChild(foo);
|
||||
foo.appendChild(head);
|
||||
is(new_document.head, null, "test3-0, head's parent should be document element");
|
||||
}
|
||||
finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue