<div dir="ltr">It turned out that the previous experiment only worked in chrome since it has the most complete native web components support. Here is an adjusted version which also works with firefox and IE11(!), and exercises web-animation.<br><div><br><a href="https://glitch.com/edit/#!/maddening-agenda?path=index.html:54:30" target="_blank">https://glitch.com/edit/#!/<wbr>maddening-agenda?path=index.<wbr>html:54:30</a><br><br></div><div>Some more observations:<br><br></div><div>The required polyfill changes the sequencing of script execution. As a consequence, the imported DEF node is not available when x3dom is looking for it when it encounters the USE node. It uses defaults instead. It possible to insert the USE node explicitly after inserting the imported DEF node which then does allow x3dom to reference the expected node. <br><br></div><div>The polyfill also does not prevent selection of nodes in an attached shadow tree. Probably, this level of encapsulation is only available with a native implementation.<br><br></div><div>web-animation is for css properties, eg. styling. x3dom has some support for animation via the css transform property and web-animation works with it. But at this point, styling capability for all x3d fields and then having animation support is not feasible. It would be a longer term target.</div><div><br></div><div><div class="gmail_extra">-Andreas</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 21, 2017 at 10:24 AM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><a href="https://glitch.com/edit/#%21/juniper-wool?path=index.html:40:7" target="_blank">https://glitch.com/edit/#!/jun<wbr>iper-wool?path=index.html:40:7</a><br></div><div><br></div><div>is an investigation of how HTML Imports and ShadowDOM may be used to substitute for X3D Inline nodes. HTML Imports makes it straightforward to load an external fragment of HTML into a document: <a href="https://www.webcomponents.org/community/articles/introduction-to-html-imports" target="_blank">https://www.webcomponents.org/<wbr>community/articles/introductio<wbr>n-to-html-imports</a>. And the stated purpose of ShadowDOM is encapsulation. </div><div><br></div><div>Here are some observations:</div><div><br></div><div>HTML imports work as intended with x3dom.</div><div>It is likely one could use a generic 'include' webcomponent.</div><div>DEF nodes in the imported x3d are exported/imported, so they can be USEd. There is no separate namescope.</div><div>HTML imports can also be attached as shadow tree to a host node. But x3dom does not recognize the shadow tree and it is not rendered. Native X3D in HTML or an improved x3dom would likely render those.</div><div>Attached shadow tree content cannot be selected/found with regular DOM methods. However, shadow trees still can be selected with the host.shadowroot property. </div><div><br></div><div>It is likely that one could use en existing webcomponent such as</div><div><a href="https://www.webcomponents.org/element/github/include-fragment-element" target="_blank">https://www.webcomponents.org/<wbr>element/github/include-fragmen<wbr>t-element</a></div><div>for inline purposes as well.</div><div><br></div><div>Overall, it looks like that Inline would duplicate native webcomponent capability.</div><div><br></div><div>It could also be fruitful to investigate how custom elements with templates compare with protos in detail. There seems to be match in purpose and ability.</div><div><br></div><div>-Andreas</div><div><br></div><br clear="all"><div><br></div>--  <span class="m_1447592309658620002gmail-HOEnZb"><font color="#888888"><br><div class="m_1447592309658620002gmail-m_-1417533768917205727gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="m_1447592309658620002gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div></div>