This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25467 - [imports]: Dynanically added imports should block following imports.
Summary: [imports]: Dynanically added imports should block following imports.
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 25470
  Show dependency treegraph
 
Reported: 2014-04-25 22:30 UTC by Morrita Hajime
Modified: 2014-04-29 23:38 UTC (History)
3 users (show)

See Also:


Attachments

Description Morrita Hajime 2014-04-25 22:30:58 UTC
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.
Comment 1 Morrita Hajime 2014-04-25 23:00:11 UTC
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.
Comment 2 Morrita Hajime 2014-04-25 23:01:33 UTC
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.
Comment 3 Morrita Hajime 2014-04-29 23:38:35 UTC
This is how spec is written.
Blink implementation is just wrong and have to be fixed.