This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Currently dynamically added imports behaves as if it is @async applied. This should change. It should block following imports, in terms of script execution. For example: ---- <link rel=import href=a.html> <script> var currentDocument = document.currentScript.ownerDocument; var b = currentDocument.createElement("link"); b.rel = "import"; b.href = "b.html"; currentDocument.appendChild(b); var c = currentDocument.createElement("link"); c.rel = "import"; c.href = "c.html"; currentDocument.appendChild(c); </script> <link rel=import href=d.html> ---- In this case, scripts in imports should be executed in order of [a.html, b.html, c.html, d.html] instead of current [a.html, (probably)d.html, (b or c).html, (b or c).html]. What's the motivation? We need this because in some case we want to dynamically load a set of imports has dependency in it. For example we might want to lazily load plugin-base.html and plugin-hmm.html, where plugin-hmm.html depends on plugin-base.html.
Hmm. Actually, the spec doesn't say anything about dynamically-added node. This is probably what is already written. Will keep this open for a while so that people can share their opinions if there are, then close.
Note that this makes sense as we now have explicit @async and we can use it anytime we want. There is no need for this ugly workaround.
This is how spec is written. Blink implementation is just wrong and have to be fixed.