Juicy/juicy-html

document._currentScript not needed

Closed this issue · 5 comments

This custom element has a variant of the following line:

var script = document._currentScript || document.currentScript;
var template = script.previousElementSibling;

document._currentScript was only needed in IE11, but Starcounter does not support that browser anymore.

Therefore, this code can be simplified to:

var template = document.currentScript.previousElementSibling;

If we want to drop support for IE11.

This is needed to point to correct <script> when HTML Imports polyfill is used.

For V1 version of webcomponentsjs polyfill, where HTML Imports are not 100% standard compatible, this may not be needed.
There will be no imported document, the entire fragment will be stamped into <link> in the main document.

As checked in HTML Imports polyfill that is part of WC.js V1, document._currentScript is not needed. I will add a PR to remove that.

@kegor could you please do that? I can help you set up the environment for developing custom elements if needed.

kegor commented

Closed, because it was merged into #42.