xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

Hide canvas in shadow tree #167

Open ksons opened 8 years ago

ksons commented 8 years ago

Currently we create a <canvas> element and place it at the <xml3d> element's DOM position. This implicit mutation of the DOM is not very elegant and might confuse an application.

With Shadow DOM functionality we can hide the canvas inside the <xml3d> element's shadow tree. Hence we would not have to modify the (exposed) DOM.

Unfortinately, only a small subset of browsers support Shadow DOM. One could use the Shadow DOM where available and, at the same time, provide a unified access to the <canvas> element (e.g. as a property of the <xml3d> element).