andreasplesch / x_ite_dom

link x_ite to the DOM
http://andreasplesch.github.io/x_ite_dom/index.xhtml
MIT License
6 stars 0 forks source link

inline #3

Closed andreasplesch closed 8 years ago

andreasplesch commented 8 years ago

How to make inlined nodes DOM nodes in the main document so they can be manipulated ?

http://examples.x3dom.org/example/x3dom_inlineReflection.xhtml http://doc.x3dom.org/tutorials/models/inline/index.html

inline elements are directly added as children to and the ids are prefixed with a namespacename.

cobweb may ignore any xml children in inline. So with some changes it may be possible to do the same. Then cobweb_dom could check for mutations in inlines, find the corresponding x3dnode and do the same as for the regular nodes.

Use a shadow root below inline ? Advantage would be scoping of IDs . But the EXPORT/IMPORT rules are for this.

Or simply not allow any inline mods and advocate use HTML DOM way of inlining ?

andreasplesch commented 8 years ago

Follow IMPORT

andreasplesch commented 8 years ago

Adding inline scene dom to inline element works. Then manipulation of inline scene dom elements works because their x3dnode property still refers to the correct node.

However, inlines are loaded asynchronous and there is no built in event to signal when they are available.

The browser has a loadsensor. Add inlines to watchlist, then use is loaded field.

andreasplesch commented 8 years ago

Solved stacked inlines by adjusting watchList dynamically as inlines get added.