Bug 21229 - [Imports]: Imports should fetch and process some external resources
[Imports]: Imports should fetch and process some external resources
Status: RESOLVED DUPLICATE of bug 23170
Product: WebAppsWG
Classification: Unclassified
Component: Component Model
unspecified
PC Windows NT
: P2 normal
: ---
Assigned To: Dimitri Glazkov
public-webapps-bugzilla
:
Depends on:
Blocks: 20683
  Show dependency treegraph
 
Reported: 2013-03-09 00:16 UTC by Scott Miles
Modified: 2013-09-18 19:47 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Miles 2013-03-09 00:16:02 UTC
We have straw version of this loader that allows construction like this:

web-component.html:

  <script src="one.js"></script>
  <link rel="component" href="two.html">
  <element name="three">
  ...
  </element>
  <link rel="component" href="four.html">
  <script src="five.js"></script>
  <element name="six">
  ... 
  </element>

Ideally the contract is that the script tags are live (executed in main window context), and that each of these things is processed in order.

As in the example, 'one.js' must be processed before 'two.html', and so on.
Comment 1 Scott Miles 2013-03-09 00:17:40 UTC
I forgot to mention that all paths are intended to be relative to the url of the linked component document itself, but I believe that's already in the spec.
Comment 2 Dominic Cooney 2013-03-28 05:06:08 UTC
It seems odd to permit external scripts but not inline scripts.
Comment 3 Scott Miles 2013-03-28 07:50:03 UTC
I agree. I didn't include it my example, but fwiw our polyfill evaluates inline scripts also.
Comment 4 Dimitri Glazkov 2013-07-19 17:31:02 UTC
What about other resources?

I guess this depends on understanding what exactly does including a <link rel=stylesheet> or <img src> (or <frame srd>) in an import mean.
Comment 5 Scott Miles 2013-07-19 22:36:10 UTC
We use the following rules:

>> <link rel=stylesheet> 

applied as if it was in the main document

>> <img src> 

inert

>> <iframe src>)

inert
Comment 6 Dimitri Glazkov 2013-07-19 22:47:46 UTC
Do you need to keep things that are inert in the document? Ian had an idea today that we introduce a new insertion mode in HTML parser that simply throws away everything that isn't relevant in an import document.
Comment 7 Scott Miles 2013-07-19 22:49:59 UTC
IMO, the expectation is that those nodes are available for manual transplantation into the main document.
Comment 8 Dimitri Glazkov 2013-07-19 22:56:44 UTC
(In reply to comment #7)
> IMO, the expectation is that those nodes are available for manual
> transplantation into the main document.

So it's okay if the relative URLs in these elements will be messed up when you move them into main documents? This is the way it works now when you move an element from one doc to another.
Comment 9 Dimitri Glazkov 2013-07-19 23:04:30 UTC
(In reply to comment #7)
> IMO, the expectation is that those nodes are available for manual
> transplantation into the main document.

Another thought: can we not just let the authors put these into a template on the imported document?
Comment 10 Dimitri Glazkov 2013-09-18 19:47:03 UTC

*** This bug has been marked as a duplicate of bug 23170 ***