| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <meta charset=windows-1252> | 2 <meta charset=windows-1252> |
| 3 <!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8 | 3 <!-- Using windows-1252 to ensure that new Document() doesn't inherit utf-8 |
| 4 from the parent document. --> | 4 from the parent document. --> |
| 5 <title>Document constructor</title> | 5 <title>Document constructor</title> |
| 6 <link rel=help href="https://dom.spec.whatwg.org/#dom-document"> | 6 <link rel=help href="https://dom.spec.whatwg.org/#dom-document"> |
| 7 <script src="../../../../resources/testharness.js"></script> | 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="../../../../resources/testharnessreport.js"></script> | 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <div id="log"></div> | 9 <div id="log"></div> |
| 10 <script> | 10 <script> |
| 11 test(function() { | 11 test(function() { |
| 12 var doc = new Document(); | 12 var doc = new Document(); |
| 13 assert_true(doc instanceof Node, "Should be a Node"); | 13 assert_true(doc instanceof Node, "Should be a Node"); |
| 14 assert_true(doc instanceof Document, "Should be a Document"); | 14 assert_true(doc instanceof Document, "Should be a Document"); |
| 15 assert_false(doc instanceof XMLDocument, "Should not be an XMLDocument"); | 15 assert_false(doc instanceof XMLDocument, "Should not be an XMLDocument"); |
| 16 assert_equals(Object.getPrototypeOf(doc), Document.prototype, | 16 assert_equals(Object.getPrototypeOf(doc), Document.prototype, |
| 17 "Document should be the primary interface"); | 17 "Document should be the primary interface"); |
| 18 }, "new Document(): interfaces") | 18 }, "new Document(): interfaces") |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 }, "new Document(): characterSet aliases") | 44 }, "new Document(): characterSet aliases") |
| 45 | 45 |
| 46 test(function() { | 46 test(function() { |
| 47 var doc = new Document(); | 47 var doc = new Document(); |
| 48 var a = doc.createElement("a"); | 48 var a = doc.createElement("a"); |
| 49 // In UTF-8: 0xC3 0xA4 | 49 // In UTF-8: 0xC3 0xA4 |
| 50 a.href = "http://example.org/?\u00E4"; | 50 a.href = "http://example.org/?\u00E4"; |
| 51 assert_equals(a.href, "http://example.org/?%C3%A4"); | 51 assert_equals(a.href, "http://example.org/?%C3%A4"); |
| 52 }, "new Document(): URL parsing") | 52 }, "new Document(): URL parsing") |
| 53 </script> | 53 </script> |
| OLD | NEW |