[Bug 24564] [Imports]: Blocking circular reference in the import tree/list

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24564

--- Comment #4 from Morrita Hajime <morrita@google.com> ---
(In reply to Gabor Krizsanits from comment #3)
> I understand that many programming languages disallow cycles, as it
> simplifies things. But imports are a bit special... 
> 

> This list idea is still not clear. First it does not scale compared to a map
> I'm afraid. I don't understand how will a de-dup mechanism prevent a circle.
> An edge that causes a circle does not add any new element to the list, the
> element is already there, it just trying to use it as a second referring
> link element would. 

Sorry for unclear my explanation.
First let me clarify what cycle prevention that I meant.
I think I used that word in wrong sense.

Think a about this case:

* index.html
  <link id=li rel=import href="a.html">
* a.html
  <link id=la rel=import href="b.html">
* b.html
  <link id=lb rel=import href="a.html">

In this case,

- li triggers loading of a.html. 
- la triggers loading of b.html.
- lb reuses shares(de-dups) a.html that is previously loaded

Now la.import points b.html and lb.import points a.html.
Here is a cycle. But this is fine because a.html document is shared
and there are no infinity loading loop happening.
this endless loading is what I meant cycle.

IMO, circular reference itself is totally fine,
and it seems your point is same (isn't it?)


> I don't understand the ordering either, why is it important? And what
> happens if I start moving import links around in the DOM (not to mention
> adopt children among imports)? Or do you want the list to represent a
> topological order to prevent directed circles? For that I think we would
> need a list of the link elements not the imports/import loaders.

On ordering, current spec doesn't depend on that.
I have a vague plan to use it to resolve some racy cases.

Let me try it in coming changes. If it turns out order doesn't matter.
I'm happy to go back to the map. But I think it matters
because Blink implementation actually relies on it.
Well, I admit that writing spec sometimes leads better way to do it :-)

On relationship between DOM mutation and import list,
my intention to have the "import list" concept explicitly is that
DOM mutation doesn't affect the list order once the import is inserted
into the list by the loading algorithm.

I want it rather static because it changing it dynamically will cause
the nightmare in dependency management perspective. 
Static order can avoid such complexity.

> 
> Sorry, for the many questions but I'm confused, and I think this is a very
> important problem to address before the release.

I really appreciate that you take time to clarify the points and help it
polished.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 7 February 2014 18:50:38 UTC