[webcomponents] Proposal: Add namespace property to ElementRegistrationOptions parameter of Document.registerElement (#328)

This namespace property is only applicable to XHTML documents and contains the namespace of the new custom element. In the current specification all new custom elements are put in the HTML namespace http://www.w3.org/1999/xhtml.

If the namespace isn't used by the browser for rendering (e.g. http://www.w3.org/1999/xhtml or http://www.w3.org/2000/svg) the dash requirement for new custom element tag names can be removed. This way it is possible to create polyfill XHTML extensions such as XForms, MathML or X3D using custom elements.

I have forked webcomponents.js to demonstrate this enhancement: https://github.com/hfmanson/webcomponentsjs/tree/xml-namespace/ and a live demo can be seen at http://mansoft.nl/webcomponents/xmltests/brb-test-polyfill-ce.xhtml. Look at that page's source code. This projects runs on Firefox (which doesn't natively support document.registerElement). An important restriction on non-HTML custom elements is to no longer use the HTML-specific onclick functions but the generic DOM AddEventListener pattern. The README.md contains further information

The example component 'Big Red Button' is based on a webcomponent sample from Robin Berjon's presentation 'Distributed Extensibility: Finally Done Right?' on XML Prague 2014.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/328

Received on Thursday, 24 September 2015 09:38:04 UTC