Re: [webcomponents] Interaction of shadow DOM, imports, base URIs

On 5/28/13 2:28 PM, Dimitri Glazkov wrote:
> This is a really good question. Web developers expressed the need for
> properly resolving URLs pretty much as soon as they heard of HTML
> Imports:

Right, not surprising.

> What they want is for this to Just Work Like Stylesheets (tm). In
> other words, when they define an import "300.html", then in that file,
> they want to use relative URLs to refer to resources:


> Since custom elements are currently completely decoupled from HTML
> Templates and Shadow DOM, instantiating a shadow tree from a template
> that came from an import is the responsibility of the custom element
> author.

Hmm.  So we have no declarative way to do a shadow tree coming from some 
URI different from the document URI?

> 2) we provide some explicit APIs for resolving relative hyperlinks on
> elements coming from one document to another

Well, authors can always set xml:base if they're stuck with being 
explicit.   To the extent that UAs support xml:base, of course...

> 4) <your idea here>

Have some hidden state that sets the base URI on nodes coming from 
imports and have cloning copy that state?  Like xml:base but without the 
mutability headaches, kinda, so maybe easier to get UAs to support.


Received on Thursday, 30 May 2013 17:57:47 UTC