[Bug 22305] [imports]: Imports should be represented as Documents, not DocumentFragments.

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

--- Comment #10 from Gabor Krizsanits <gkrizsanits@mozilla.com> ---
(In reply to Dimitri Glazkov from comment #8)
> morrita@, adamk@, esprehn@ and myself chatted a while yesterday on whether
> imports should return to being document fragments.

I think imports are just a new concept, neither document fragment nor actual
document. For me it feels more closer to document right now because of it's
capabilities. But the real question is then what are the capabilities we
certainly want to support? If they can execute scripts and have their own
parser and load their own resources, then I think we shouldn't try to stretch
the concept of document fragment (which is designed to be minimalistic), but
start from the document and limit it in a sane way. 

> 
> One of the key issues that we've encountered with pursuing imports as
> documents is that we seem to have simply kicked the can of worms down the
> road. We'll still have to open it.
> 
> Imports as documents make it easy to reason about loading and parsing of
> imports, but they bring a whole new level problems, like existence of
> documents that have a defaultView but no active browsing context (no
> browsing context at all, for that matter!), as well as answering questions
> like what the DOCTYPE and charset do in import in relation to master
> document, and what is the value of document.currentScript.
> 
> Documents also have lots of baggage like APIs for dealing with focus or
> fullscreen that aren't even applicable in imports.

While there are plenty of document API that does not make a lot of sense for
imports, I feel like if we don't answer them we just kick that can further down
the road.

> 
> This led to another interesting conversation about the fact that there's
> really one ordered list of imports that is populated when <link
> rel="import"> is inserted, and not actually a tree of imports. I believe
> Gabor mentioned that at our previous discussion.
> 
> Elliott sketched out something like document.imports, which acts like an
> array.
> 

I think it was not my idea. In fact in my mind it's still a tree and that list
is just a flattened walk of the tree. And let me explain why I stick to this
mental image: script execution order. When you add a new link import to the
list it does not end up at the end of the list... So I would be careful with
this array approach unless we want to stop caring about script execution order
or want to disallow imports to run their own scripts.

> This is about it. No conclusions, but lots of new thoughts. Comments,
> reactions, ideas, are appreciated.

My two cent is, if we want to alter the current version of spec. drastically
like this, first we have to redefine what are our expectations from imports.

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

Received on Friday, 14 February 2014 18:27:00 UTC