This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 490
Scripts cloned from HTML Imported template does not execute on polyfilled browsers #872
Closed
3 of 5 tasks
Comments
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Dec 2, 2017
WIP: support WebComponents.js polyfill >=1.x - per-template script execution is missing. webcomponents/webcomponentsjs#872 Implements #29
tomalec
added a commit
to tomalec/html-imports
that referenced
this issue
Dec 4, 2017
This was referenced Dec 4, 2017
Looks like we'll have to clone scripts inside templates in order to execute them :[ <pre id="out"></pre>
<script>
const template = document.createElement('template');
template.innerHTML = '<script>window.executedTemplateScript=true<\/script>';
// we have to clone scripts inside templates :[
// const script = template.content.querySelector('script');
// const clone = document.createElement('script');
// clone.textContent = script.textContent;
// template.content.insertBefore(clone, script);
// template.content.removeChild(script);
document.body.appendChild(document.importNode(template.content, true));
out.textContent = 'executed? ' + window.executedTemplateScript;
</script> |
tomalec
added a commit
to tomalec/html-imports
that referenced
this issue
Dec 5, 2017
tomalec
added a commit
to tomalec/html-imports
that referenced
this issue
Dec 5, 2017
valdrinkoshi
pushed a commit
to webcomponents/html-imports
that referenced
this issue
Dec 5, 2017
valdrinkoshi
pushed a commit
to webcomponents/html-imports
that referenced
this issue
Dec 11, 2017
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Dec 12, 2017
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Dec 12, 2017
webcomponents/webcomponentsjs#872 Start testing in Safari 10
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Dec 12, 2017
webcomponents/webcomponentsjs#872 Start testing in Safari 10
valdrinkoshi
pushed a commit
to webcomponents/html-imports
that referenced
this issue
Dec 16, 2017
valdrinkoshi
added a commit
to webcomponents/html-imports
that referenced
this issue
Dec 18, 2017
* clone scripts inside templates * skip test if template is not supported * Clone scripts also in nested templates #77 webcomponents/webcomponentsjs#872 * test with template polyfill * expand tests for cloned templates * chai.assert -> assert * test with fix-template-scripts branch * cannot exec w/o cloning, remove wrong test * use template v1.2.1
tomalec
added a commit
to Juicy/imported-template
that referenced
this issue
Feb 20, 2018
webcomponents/html-imports#77 is merged to wcjs polyfill #41
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have an
externalDoc.html
:Then, I:
<link rel="import" href="externalDoc.html">
template
s content:script
gets stamped/appended to the main document - ✓jsbin: http://output.jsbin.com/yijokor/6/quiet
Expected behavior
Cloned script is executed
Actual behavior
It's not
Affected browsers
Unfortunately, it's a blocking issue for us to migrate to V1 polyfill, as we are developing an application platform based on modular views made with HTML Imports based client-side includes. (https://starcounter.io/html-partialsincludes-webcomponents-way/)
So our customers have hundreds of nested imports with every kind of HTML markup in their templates.
//cc @valdrinkoshi
The text was updated successfully, but these errors were encountered: