Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add namespace property to ElementRegistrationOptions parameter of Document.registerElement #328

Closed
hfmanson opened this issue Sep 24, 2015 · 3 comments

Comments

@hfmanson
Copy link

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.

@travisleithead
Copy link
Member

We may need the hyphen to signal other processes as part of the lifecycle of a custom element, for example, to pre-create a constructor for the element. So, I'm not sure that we can remove the hyphen requirement based solely on your rationale above...

@rniwa
Copy link
Collaborator

rniwa commented Sep 24, 2015

I'm sure we can add some flag associated with each element name if needed instead.

@annevk
Copy link
Collaborator

annevk commented Mar 11, 2016

This seems like a duplicate of #154. I don't think any browser nor many web developers would be interested in solutions that do not work inside text/html, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants