[x3d-public] custom elements in HTML5

Andreas Plesch andreasplesch at gmail.com
Thu Aug 1 12:59:07 PDT 2019


As I had mentioned  at Web3D 2019, the use of dashes is a name space
mechanism in HTML5,. Let me follow up with background and references:

A) What is HTML5 ?

I believe the W3C and WHATWG spec. divergence was resolved:

WHATWG:
https://html.spec.whatwg.org/multipage/introduction.html#is-this-html5?

W3C:
latest recommendation:
https://www.w3.org/TR/2017/REC-html52-20171214/
latest working draft:
https://www.w3.org/TR/2018/WD-html53-20181018/

B) Why custom elements ?

Custom elements are the recommended, standardized method to extend HTML5 to
other domains. However, both x3dom and x-cite use other mechanisms.
Currently, x3dom uses Unknown Elements and x-cite uses DOM provided XML
parsing.

Unless W3C/WHATWG adopts X3D as native elements (such as SVG) which is
unlikely in the near to medium term, the custom element specification would
be the best fit to strongly couple X3D to HTML.

C) Dashes in custom element names

A valid custom element must contain a dash ("-") character. See the
production here:

WHATWG:
https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name

W3C:
https://www.w3.org/TR/2018/WD-html53-20181018/semantics-scripting.html#valid-custom-element-name
https://www.w3.org/TR/2017/REC-html52-20171214/dom.html#elements links to
https://www.w3.org/TR/custom-elements/#valid-custom-element-name
which points back to HTML5.3 draft

The suggestion would be to add a "x3d-" prefix to all X3D nodes and
keywords. "x-" is already used by multiple custom element collections.

-Andreas

-- 
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190801/f02fccef/attachment.html>


More information about the x3d-public mailing list