googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

<x-foo> syntax fails while <button is="x-foo"> succeeds #90

Closed dave closed 11 years ago

dave commented 11 years ago

When I define a custom element that inherits from button with the document.register syntax, it can't be created using the syntax. Creating from code with new XFoo(); works, as does

dave commented 11 years ago

We should see three buttons. What we see is:

screen shot 2013-05-31 at 11 41 46

sjmiles commented 11 years ago

As per spec, custom elements that are derivations of existing DOM elements (other than HTMLElement) must use the is syntax.

This is necessary because various browsers have legacy code that expects the localName (e.g.) of a <button> to always be button. This is why the is syntax was invented.

dave commented 11 years ago

Excellent, thanks. Perhaps the Custom Elements intro page (http://www.polymer-project.org/platform/custom-elements.html) could do with mentioning that... It doesn't really make it clear:

screen shot 2013-06-01 at 00 14 45

sjmiles commented 11 years ago

Eek, yes, that's a problem. Thanks for pointing that out.

rafaelw commented 11 years ago

Closing this since it's not an MDV bug.

ebidel commented 11 years ago

Updated the docs to be more clear on type extension custom elements.

https://github.com/Polymer/CustomElements/commit/bf36b5a9c85d3e1cd837faab23a586aca7ee6a7c