Re: Relative URLs in Web Components

On Sun, Oct 5, 2014 at 11:19 AM, Scott Miles <sjmiles@google.com> wrote:
>> The URL is parsed again? That seems like something that should not
>> happen. Are you copying the node perhaps?
>
> There is no explicit copying, but I don't know if there is something
> implicit happening when the element goes trans-document.

>From https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element
it says that whenever an img element is adopted, its URL would be
parsed again. That is what causes this. You can see this more clearly
in:

  https://dump.testsuite.org/dom/baseurl.html

I've no idea why it is that way. I assume there are some compatibility
issues with not doing it.


>> The lack of encapsulation is major hassle.
>
> I'm not sure what you mean, can you elaborate? If this is the root cause,
> maybe we attack it there.

If components had their own global environment to execute scripts in,
that global environment would have also had its own base URL that
would match that of the component. What we have instead is something
that is a mix between <iframe> and <script>. Parsing abilities of the
former, global environment of the latter.

Doesn't really feel like it deserves to be called components. It's
more like assets.


-- 
https://annevankesteren.nl/

Received on Sunday, 5 October 2014 10:09:30 UTC