4 <title>New document without browsing context must not have a registry</title>
5 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
6 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
7 <meta name="assert" content="In all other cases, new documents must not have a registry.">
8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#creating-and-passing-registries">
9 <script src="../../../../resources/testharness.js"></script>
10 <script src="../../../../resources/testharnessreport.js"></script>
11 <script src="../testcommon.js"></script>
12 <link rel="stylesheet" href="../../../../resources/testharness.css">
18 var doc = document.implementation.createDocument(null, 'test', null);
21 function() { doc.registerElement('x-element'); },
22 'Registering valid custom element in a document ' +
23 'without registry should fail');
24 }, 'Document of type other than HTML, not loaded into browsing context, must not have a registry');
26 async_test(function(t) {
27 var request = new XMLHttpRequest();
28 request.onreadystatechange = t.step_func(function() {
29 if (request.readyState == 4){
30 assert_equals(200, request.status, 'Test document is not loaded correctly');
31 var doc = request.response;
32 assert_true(doc instanceof HTMLDocument,
33 'XMLHttpRequest\'s asynchronous response should be HTML document');
36 function() { doc.registerElement('x-element'); },
37 'Registering valid custom element in ' +
38 'an XMLHttpRequest\'s response document should fail');
43 request.open('GET', '../resources/blank.html', true);
44 request.responseType = 'document';
46 }, 'XMLHttpRequest\'s asynchronous response HTML document must not have a registry');