OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <script src="resources/import-helpers.js"></script> | 4 <script src="resources/import-helpers.js"></script> |
5 <head> | 5 <head> |
6 <link id="target", rel="import" href="resources/hello.html"> | 6 <link id="target", rel="import" href="resources/hello.html"> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <script> | 9 <script> |
10 waitAndTest([ | 10 window.jsTestIsAsync = true; |
11 { | 11 description('Updating attribute value shouldn\'t invalidate loaded import.'); |
12 description: "Updating attribute value shouldn't invalidate loaded impor
t.", | 12 (function() { |
13 setup: function() | 13 debug('Before update:'); |
14 { | 14 shouldBeNull('target.sheet'); |
15 debug("Before update:"); | 15 shouldBeNonNull('target.import'); |
16 shouldBeNull("target.sheet"); | 16 target.setAttribute('href', 'resources/hello.css'); |
17 shouldBeNonNull("target.import"); | 17 target.setAttribute('rel', 'stylesheet'); |
18 target.setAttribute("href", "resources/hello.css"); | 18 window.placeholder = createPlaceholder(); |
19 target.setAttribute("rel", "stylesheet"); | 19 window.placeholder.onload = function() { |
20 window.placeholder = createPlaceholder(); | 20 debug('After update:'); |
21 }, | 21 shouldBeNull('target.sheet'); |
22 ready: function() { return window.placeholder.import; }, | 22 shouldBeNonNull('target.import'); |
23 test: function() | 23 window.addEventListener('load', function() { requestAnimationFrame(fini
shJSTest); }); |
24 { | |
25 debug("After update:"); | |
26 shouldBeNull("target.sheet"); | |
27 shouldBeNonNull("target.import"); | |
28 } | |
29 } | 24 } |
30 ]); | 25 })(); |
31 </script> | 26 </script> |
32 </body> | 27 </body> |
33 </html> | 28 </html> |
OLD | NEW |