This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
If the author does this: document.register('x-foo', {prototype: HTMLElement.prototype}) I think the current spec says implementations should throw a namespace error per step 5.4 (because HTMLElement does not inherit from HTMLElement.) However that is really a coincidence; that step is designed to stop you extending elements outside the SVG and HTML namespaces. I think defining multiple custom elements with the same prototype object should be an error (because the constructor property will be updated!) and extending HTMLElement.prototype directly sucks particularly because it is a widely shared object. However if the decision is that a given prototype object can be used for multiple definitions, I think HTMLElement.prototype should be allowed to be (ab)used multiple times too. Perhaps you could make document.register('x-foo', {prototype: HTMLElement.prototype}) to be sugar for Object.create(HTMLElement.prototype, {}) just like document.register('x-foo') is. The same could go for using any built-in interface prototype object directly like this.
I'm confused what you mean about overwriting the 'constructor' property. Normally, the constructor of a prototype is the thing that constructed the prototype, not any constructor it is attached to. IOW, P = {}; c = P.constructor; Foo = function() {}; Foo.prototype = P; assert(P.constructor === c); // true Bar = function() {}; Bar.prototype = P; assert(P.constructor === c); // true Are these prototypes handled differently somehow?
Sorry, I misread the spec. The constructor generation algorithm says: If PROTOTYPE is already an interface prototype object for any interface object or PROTOTYPE has a non-configurable property named constructor, throw a NotSupportedError and stop. This is clear and obviates these issues. Sorry for the spam.