<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 16, 2017 at 11:33 PM,  <span dir="ltr"><<a href="mailto:x3d-public-request@web3d.org" target="_blank">x3d-public-request@web3d.org</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">Date: Sun, 16 Jul 2017 20:32:59 -0700<br>
From: Leonard Daly <<a href="mailto:Leonard.Daly@realism.com" target="_blank">Leonard.Daly@realism.com</a>><br>
To: <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br></blockquote><div><br></div><div>... </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>     This loose coupling may be a variation on your approach (C) below?<br>
>     - not sure.  Reconciling Inline/IMPORT/EXPORT names is the same<br>
>     for for event passing to/from any node. If IMPORT/EXPORT only<br>
>     refer to a DEF name within scoped X3D scene graphs, no collisions<br>
>     occur (as already shown in other X3D encodings).<br>
><br>
><br>
> ShadowDOM may be the only way to implement strict X3D Inline in a HTML<br>
> browser as a subtree. However, I am not sure if X3D Inline would be an<br>
> intended use of ShadowDOM. Since ShadowDOM was not available when<br>
> x3dom was developed, x3dom just appends the Inline's nodes to the main<br>
> X3D scene. Also, I am not sure if ShadowDOM is intended to completely<br>
> prevent access to the added subtree.<br>
<br>
X3DOM uses the namespacename attribute to determine what to do with an<br>
Inline. If it is blank, then the X3D nodes are not put into the DOM and<br>
only appear in the scene graph. If it is defined, the DEF and ID<br>
(depending on other attributes) are modified and the nodes are entered<br>
into the DOM with the modified values. Note that there are still issues<br>
if an Inlined file Inlines a second file. If the first file is Inlined<br>
more than once and supplies a value for namespacename, then there will<br>
still be name conflicts.<br>
<br>
X3DOM does not use Shadow DOM.<br>
<br>
My issue with IMPORT/EXPORT is for the case where there is a single<br>
namescope. What is the use/value of such statements when all they can do<br>
is alias names, since everything is imported/exported anyway.<br></blockquote><div><br></div><div>Let's say a strict X3D interpreter would keep the inline only in the internal parallel X3D scenegraph, and not in the DOM.<br><br></div><div>Hm, even in that case it would be possible to access the Inline content from javascript.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>><br>
><br>
> Keep in mind there is also the need to define the interfaces between<br>
> these parts of the DOM tree.<br></blockquote><div><br></div><div>I believe this is the difficult part.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
>     Thanks for considering these valuable possibilities.<br>
><br>
><br>
>     > 1) All nodes are available to all other nodes at all times<br>
>     > 2) IMPORT does not have any meaning<br>
>     > 3) EXPORT does not have any meaning<br>
>     > 4) Uncertain how to handle a file that gets Inlined more than<br>
>     once since all DEF and ID from the Inline will be duplicated<br>
>     ><br>
><br>
><br>
>     > Possible solutions are:<br>
>     > A) Do not put the contents of any Inline into the DOM<br>
><br>
><br>
> I think this is what Don suggests.<br>
><br>
>     > B) Do not put the contents of any X3D file into the DOM<br>
>     > C) Modify the DEF & ID values on each Inline so they are unique<br>
>     ><br>
>     > (A) has the potential problem of completely hiding all of the<br>
>     interior nodes and making it unavailable. In this case IMPORT and<br>
>     EXPORT can be defined to make sense by providing access to those<br>
>     fields. Unfortunately this breaks a different goal of full DOM<br>
>     integration.<br>
><br>
><br>
> Agreed, that the developer expectation probably would be that Inlined<br>
> content would be accessible (and I tried to do that for cobweb-dom).<br>
> On the other hand, a web compatible inline would be probably defined<br>
> or implemented outside of X3D anyways, in addition to the x3d inline.<br>
> For example, the webcomponents import functionality<br>
> (<a href="https://www.webcomponents.org/introduction#html-imports" rel="noreferrer" target="_blank">https://www.webcomponents.org<wbr>/introduction#html-imports</a>) or html5<br>
> template<br>
> (<a href="https://www.w3.org/TR/html5/scripting-1.html#the-template-element" rel="noreferrer" target="_blank">https://www.w3.org/TR/html5/s<wbr>cripting-1.html#the-template-e<wbr>lement</a>)<br>
> comes to mind.<br>
<br>
Web Components are (or will be) part of the browser, though there are<br>
poly-fill libraries for these right now. Simple intro to Web Components<br>
-- <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components" rel="noreferrer" target="_blank">https://developer.mozilla.org/<wbr>en-US/docs/Web/Web_Components</a><br>
<br></blockquote><div><br> >> Here is a (thought) experiment with x3dom and import:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> 1) Use import to import a x3dom inline document.<br>
> 2) write a short script to get the imported scene, clone it, and<br>
> insert it somewhere into a x3dom main scene, perhaps as a group.<br>
> 3) see if it works.<br>
> 4) bonus: write a short custom element 'x3dimport' which does 2)<br>
> 5) bonus: add an attribute which identifies which import to clone and<br>
> insert.<br>
<br>
I presume that (1) is 'Use Inline..."<br></blockquote><div><br></div><div>It would be use inline without using the Inline X3D node.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The contents of external X3D files can be stored as elements, not in the<br>
DOM (but in variables stored in the DOM). Since it is not in the DOM, it<br>
would not need to be cloned.<br>
<br>
Are you talking about something like:<br>
<br>
var externalX3d = readExternal (externalUrl);<br>
var copyOfExternalX3d = deepClone (externalX3D);<br>
var ele = document.getElementById('Appro<wbr>priateX3dNodeElementId');<br>
ele.addChildren (copyOfExternalX3d);<br>
<br></blockquote><div><br></div><div>Yes, in effect but using imports.<br><pre class="gmail-line-numbers gmail-language-html"><code class="gmail-language-html"><span class="gmail-token gmail-tag"><span class="gmail-token gmail-tag"><span class="gmail-token gmail-punctuation"><</span>link</span> <span class="gmail-token gmail-attr-name">rel</span><span class="gmail-token gmail-attr-value"><span class="gmail-token gmail-punctuation">=</span><span class="gmail-token gmail-punctuation">"</span>import<span class="gmail-token gmail-punctuation">"</span></span> <span class="gmail-token gmail-attr-name">href</span><span class="gmail-token gmail-attr-value"><span class="gmail-token gmail-punctuation">=</span><span class="gmail-token gmail-punctuation">"</span>myInline.html<span class="gmail-token gmail-punctuation">"</span></span><span class="gmail-token gmail-punctuation">><br>var externalX3D = document.querySelector("link [rel='import'][href='myInline.html']");// or so<br></span></span></code>var copyOfExternalX3d = externalX3D.clone(true);<br>var ele = document.getElementById('Appro<wbr>priateX3dNodeElementId');
ele.addChildren (copyOfExternalX3d);<br><br></pre><pre class="gmail-line-numbers gmail-language-html">Cloning is only necessary in case the same import needs to be used multiple times.<br>
</pre></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
// (4): package up the above to meet the requirements<br></blockquote><div><br></div><div>4) would be <my-Inline /><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
// Not sure what you mean by (5)<br></blockquote><div><br></div><div>5) would be <x3d-Inline src='myInline.html' /><br></div><div>and using the src attribute in the querySelector.<br><br></div><div>Andreas<br clear="all"></div></div><div><br></div>-- <br><div class="gmail-m_58853057402230551gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div>