create3000 / x_ite

X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.
https://create3000.github.io/x_ite/
Other
66 stars 13 forks source link

x3d-canvas xmlns attribute handling #130

Closed andreasplesch closed 1 year ago

andreasplesch commented 1 year ago

Having two x3d-canvas elements works:

https://raw.githack.com/andreasplesch/Library/f4ee4947aceb3ea3f5477c40fd829a9feeff128c/Tests/Browser/DOMIntegration/in_reflection/dom_inlineReflection.xhtml

But after adding a xmlns attribute to the second canvas, there is an exception: https://raw.githack.com/andreasplesch/Library/ed9960333fdb60dad2fa7cf2187739f2b57cde27/Tests/Browser/DOMIntegration/in_reflection/dom_inlineReflection.xhtml

Not sure what the correct behavior actually should be but probably the first x3d-canvas should be rendered, and the second one may or may not be properly parsed.

create3000 commented 1 year ago
  1. It is not possible to add a xmlns attribute to the x3d-canvas element, because it uses the custom-element API from JavaScript. When adding the attribute the API does not recognize the element anymore.
  2. I think, the right place for the xmlns attribute is the X3D element inside. Because the x3d-canvas element is still HTML and not part of the namespace, and X3D, what the namespace includes, starts with X3D root element.
andreasplesch commented 1 year ago

It is ok to not recognize and ignore the xmlns namespaced x3d-canvas element. And this is what happens if this is the only x3d-canvas element on the page.

But I believe, it should not have effects on other x3d-canvas elements on the same page if there are multiple. It is not a critical issue since it would be very rare that somebody would try do that.

create3000 commented 1 year ago

That's right, there must not be an exception. Now, X_ITE silently ignores such elements.