4 <title>The import attribute</title>
5 <link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import">
6 <script src="../../../../resources/testharness.js"></script>
7 <script src="../../../../resources/testharnessreport.js"></script>
8 <link rel="stylesheet" href="../../../../resources/testharness.css">
10 <link id="nonImportLink" rel="stylesheet" href="resources/hello.css">
11 <link id="goOutFromDocument" rel="import" href="resources/body-only-0.html">
12 <link id="importLink" rel="import" href="resources/body-only-1.html">
13 <link id="anotherImportLink" rel="import" href="resources/body-only-2.html">
20 assert_equals(nonImportLink.import, null);
21 }, 'The import attribute must return null if the link does not represent an import.');
24 var link = goOutFromDocument;
25 assert_true(link.import != null);
26 document.head.removeChild(link);
27 assert_equals(link.import, null);
28 }, 'The import attribute must return null if the link element is not in a Document.');
31 assert_equals(importLink.import.body.id, 'body-only-1');
32 }, 'The attribute must return the imported document for the import.');
35 var importA = importLink.import;
36 var importB = document.querySelector('#importLink').import;
37 var anotherImport = document.querySelector('#anotherImportLink').import;
38 assert_true(importA === importB);
39 assert_true(importA !== anotherImport);
40 }, 'The same object must be returned each time.');