<div dir="ltr"><div>in order to test my mutation observer based cobweb-dom bridge a bit more robustly, I used D3 to control element attributes for some animation in my example scene. It seems to works well:<br><br><a href="https://andreasplesch.github.io/cobweb_dom/tests/cobweb_d3.xhtml">https://andreasplesch.github.io/cobweb_dom/tests/cobweb_d3.xhtml</a><br><br></div>The d3 animation should work in the same way with x3dom. x3dom does not use mutation observers but directly redefines the DOM .setAttribute function for its custom DOM elements to invoke the appropriate action on the x3d node, as far as I can see.<br><div><div><div><div><br></div><div>-Andreas<br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 20, 2016 at 7:28 PM, Andreas Plesch <span dir="ltr"><<a target="_blank" href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr"><div>Hi Don, Holger, list,<br><br></div><div>I worked more on exposing x3d events to the web page DOM, so that DOM event listeners can pick up those events and take action.<br><br></div><div>Here is an updated example:<br><br><a target="_blank" href="https://andreasplesch.github.io/cobweb_dom/perf.xhtml">https://andreasplesch.github.<wbr>io/cobweb_dom/perf.xhtml</a><br><br></div><div>Some design changes were necessary. First, while I had used the Event() constructor to generate the DOM event to be dispatched, it seems more appropriate to use the CustomEvent() constructor which comes with a recognized mechanism to provide an event related value.<br><br><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent">https://developer.mozilla.org/<wbr>en-US/docs/Web/API/<wbr>CustomEvent/CustomEvent</a><br><br></div><div>As a consequence, the DOM event handler has to use a evt.detail property object to access delivered values, eg.evt.detail.value (instead of evt.value).<br></div><div><br></div><div>Second, the UI Event working draft suggests to use a prefix for new DOM event type names<br><br><a target="_blank" href="https://www.w3.org/TR/DOM-Level-3-Events/#extending-events">https://www.w3.org/TR/DOM-<wbr>Level-3-Events/#extending-<wbr>events</a><br><br></div><div>I used 'x3d' as prefix in the example.<br><br></div><div>Third, I think it is necessary that the generated event type uniquely identifies the generating node and field name. Otherwise, event listeners have to reconstruct the source and check if it is the kind of event they expect to listen to.<br><br></div><div>In the example and bridge code I construct the event type as a concatenation of 'x3d', source node type, source node x3d name (DEF) and field name which leads to long, unwieldy event names. Perhaps x3d+DEF+field suffices.<br><br></div><div>Any feedback or ideas welcome,<br><br></div><div>Andreas<br></div><div><br><br><br></div><div><br><br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 19, 2016 at 7:33 PM, Don Brutzman <span dir="ltr"><<a target="_blank" href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Thanks for these thoughtful efforts.  In many ways, doing DOM well is the essence of how X3D might integrate deeply with HTML5 and the Open Web Platform (OWP).  Experimenting, testing, comparing, improving etc. is of course expected.  Event exchange between systems is where the "rubber hits the road" and also where implementation innovation will continue in future browsers.<br>
<br>
When we align specifications for content stability, it becomes hard to go too far wrong...  we are designing for the long term.<br>
<br>
*Having 2 open-source implementations in X3DOM and Cobweb is really powerful.*  Lots of opportunity here!  Looking forward to further progress together, for everyone's benefit.<br>
<br>
v/r Don<br>
<br>
<br>
On 9/17/2016 11:01 AM, Andreas Plesch wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
Hi Holger,<br>
<br>
I am open to integrating the DOM code with the official cobweb release. For now it may make most sense to keep it in a separate file so it remains optional. Let's discuss further details off-list.<br>
<br>
If you have ideas or just thoughts how or if the standard should reflect and specify such a X3D-web page DOM integration, please do not hesitate to mention them here in on the list. Any input would be greatly appreciated by all, I am sure.<br>
<br>
-Andreas<br>
<br>
    Message: 1<br>
    Date: Fri, 16 Sep 2016 22:41:24 +0200<br>
    From: Holger Seelig <<a target="_blank" href="mailto:holger.seelig@yahoo.de">holger.seelig@yahoo.de</a> <mailto:<a target="_blank" href="mailto:holger.seelig@yahoo.de">holger.seelig@yahoo.de</a><wbr>>><br>
    To: <a target="_blank" href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a> <mailto:<a target="_blank" href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>
    Subject: Re: [x3d-public] DOM integration with cobweb<br>
    Message-ID: <<a target="_blank" href="mailto:dcdf2e55-defb-79b5-8437-ebecb15fc5eb@yahoo.de">dcdf2e55-defb-79b5-8437-ebecb<wbr>15fc5eb@yahoo.de</a> <mailto:<a target="_blank" href="mailto:dcdf2e55-defb-79b5-8437-ebecb15fc5eb@yahoo.de">dcdf2e55-defb-79b5-843<wbr>7-ebecb15fc5eb@yahoo.de</a>>><br>
    Content-Type: text/plain; charset=UTF-8; format=flowed<br>
<br>
    Would like to include your fantastic work in the next official release,<br>
    with some documentation added.<br>
<br>
    Cheers,<br>
    Holger<br>
<br>
<br>
    Am 16.09.2016 um 21:54 schrieb Andreas Plesch:<br>
    > Holger was kind enough to amend cobweb in its latest release to allow<br>
    > convenient access to its x3d nodes from a custom property added to DOM<br>
    > nodes within the x3d scene. This means that the (experimental) dom<br>
    > bridge code now works with the regular cobweb release.<br>
    ><br>
    > Since there is enough functionality, I put the code in a release folder<br>
    > to make it available from:<br>
    ><br>
    > <a target="_blank" rel="noreferrer" href="https://raw.githubusercontent.com/andreasplesch/cobweb_dom/master/release/cobweb_dom.0.1.js">https://raw.githubusercontent.<wbr>com/andreasplesch/cobweb_dom/m<wbr>aster/release/cobweb_dom.0.1.j<wbr>s</a> <<a target="_blank" rel="noreferrer" href="https://raw.githubusercontent.com/andreasplesch/cobweb_dom/master/release/cobweb_dom.0.1.js">https://raw.githubusercontent<wbr>.com/andreasplesch/cobweb_dom/<wbr>master/release/cobweb_dom.0.1.<wbr>js</a>><br>
    > or<br>
    > <a target="_blank" rel="noreferrer" href="https://rawgit.com/andreasplesch/cobweb_dom/master/release/cobweb_dom.0.1.js">https://rawgit.com/andreasples<wbr>ch/cobweb_dom/master/release/c<wbr>obweb_dom.0.1.js</a> <<a target="_blank" rel="noreferrer" href="https://rawgit.com/andreasplesch/cobweb_dom/master/release/cobweb_dom.0.1.js">https://rawgit.com/andreasple<wbr>sch/cobweb_dom/master/release/<wbr>cobweb_dom.0.1.js</a>><br>
    ><br>
    > Just load it after loading cobweb.[min].js.<br>
    > There is a chance the code could work with D3 as a DOM manipulation<br>
    > library but I did not test this.<br>
    ><br>
    > Holger also implemented the .dispose() SAI function and other<br>
    > functionality which should make the bridge code much cleaner.<br>
    ><br>
    > Also, it turns out that my performance issues were not due to the event<br>
    > handling but just a very busy PC with its 32GB memory completely filled<br>
    > up. But I do suspect that cobweb is more memory demanding and prone to<br>
    > more frequent GC stuttering than x3dom is.<br>
    ><br>
    > -Andreas<br>
    ><br>
<br>
<br>
--<br>
Andreas Plesch<br>
39 Barbara Rd.<br>
Waltham, MA 02453<br>
<br>
<br>
______________________________<wbr>_________________<br>
x3d-public mailing list<br>
<a target="_blank" href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br>
<a target="_blank" rel="noreferrer" href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org">http://web3d.org/mailman/listi<wbr>nfo/x3d-public_web3d.org</a><br>
<br>
</blockquote>
<br>
<br>
all the best, Don<span class="gmail-HOEnZb"><font color="#888888"><span><font color="#888888"><br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a target="_blank" href="mailto:brutzman@nps.edu">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a target="_blank" value="+18316562149" href="tel:%2B1.831.656.2149">+1.831.656.2149</a><br>
X3D graphics, virtual worlds, navy robotics <a target="_blank" rel="noreferrer" href="http://faculty.nps.edu/brutzman">http://faculty.nps.edu/brutzma<wbr>n</a><br>
</font></span></font></span></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div>Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div></div></div></div></div>